Skip to contentSkip to conversation

libdrm: Unreference pushbuf objects on channel destruction

PATCH In review Krzysztof Smiechowicz 2 participants 2 messages Dec 27, 2009 – Dec 28, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 libdrm: Unreference pushbuf objects on channel destruction

(resending as git patch)

- unreference pushbuf objects on channel destruction

nouveau/nouveau_channel.c +2 -0
index 674c5c3..6f71f89 100644
@@ -111,6 +111,8 @@ nouveau_channel_free(struct nouveau_channel **chan)
 
  	FIRE_RING(&nvchan->base);
 
+	nouveau_pushbuf_fini(&nvchan->base);
+
  	nouveau_bo_unmap(nvchan->notifier_bo);
  	nouveau_bo_ref(NULL, &nvchan->notifier_bo);
 
nouveau/nouveau_private.h +3 -0
index 784afc9..de21a6b 100644
@@ -65,6 +65,9 @@ struct nouveau_pushbuf_priv {
  int
  nouveau_pushbuf_init(struct nouveau_channel *);
 
+void
+nouveau_pushbuf_fini(struct nouveau_channel *);
+
  struct nouveau_channel_priv {
  	struct nouveau_channel base;
 
nouveau/nouveau_pushbuf.c +6 -0
index b90e923..c4053ed 100644
@@ -170,6 +170,12 @@ nouveau_pushbuf_init(struct nouveau_channel *chan)
  	return 0;
  }
 
+void
+nouveau_pushbuf_fini(struct nouveau_channel *chan)
+{
+	nouveau_pushbuf_fini_call(chan);
+}
+
  int
  nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
  {
#2 lore raw
In reply to a message not in the archive
Quoted 46 lines · Krzysztof Smiechowicz

(resending as git patch)

- unreference pushbuf objects on channel destruction

nouveau/nouveau_channel.c +2 -0
index 674c5c3..6f71f89 100644
@@ -111,6 +111,8 @@ nouveau_channel_free(struct nouveau_channel **chan)
 
        FIRE_RING(&nvchan->base);
 
+       nouveau_pushbuf_fini(&nvchan->base);
+
        nouveau_bo_unmap(nvchan->notifier_bo);
        nouveau_bo_ref(NULL, &nvchan->notifier_bo);
 
nouveau/nouveau_private.h +0 -0
index 784afc9..de21a6b 100644
@@ -65,6 +65,9 @@ struct nouveau_pushbuf_priv {

 int
 nouveau_pushbuf_init(struct nouveau_channel *);

nouveau/nouveau_private.h +3 -0
+void
+nouveau_pushbuf_fini(struct nouveau_channel *);
+

 struct nouveau_channel_priv {
       struct nouveau_channel base;

nouveau/nouveau_pushbuf.c +6 -0
index b90e923..c4053ed 100644
@@ -170,6 +170,12 @@ nouveau_pushbuf_init(struct nouveau_channel *chan)
        return 0;
  }
 
+void
+nouveau_pushbuf_fini(struct nouveau_channel *chan)
+{
+       nouveau_pushbuf_fini_call(chan);
+}
+
Quoted 3 lines

 int
 nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min) {

Pushed both. I had to apply them by hand along with a few minor additions since they would still not apply cleanly. They probably needed a rebase. Thanks.