Skip to contentSkip to conversation

drm/nouveau: unpin pushbuffer bo before destroying it

PATCH In review Marcin Slusarz 1 participant 2 messages Nov 25, 2012 – Dec 2, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: unpin pushbuffer bo before destroying it

Fixes GART leak (as accounted by nouveau_drm.gem.gart_available).

---

Running glxinfo in a loop is enough to trigger it - after several thousand runs (depending on GART size), X server crashes and does not come back in a correct state (corruptions and crashes).

With this patch applied, it's possible again to do full piglit run (with concurrency disabled) without crashes or lockups.

---
 drivers/gpu/drm/nouveau/nouveau_chan.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/nouveau/nouveau_chan.c +2 -0
index 1363578..174300b 100644
@@ -76,6 +76,8 @@ nouveau_channel_del(struct nouveau_channel **pchan)
 		nouveau_object_del(client, NVDRM_DEVICE, chan->push.handle);
 		nouveau_bo_vma_del(chan->push.buffer, &chan->push.vma);
 		nouveau_bo_unmap(chan->push.buffer);
+		if (chan->push.buffer && chan->push.buffer->pin_refcnt)
+			nouveau_bo_unpin(chan->push.buffer);
 		nouveau_bo_ref(NULL, &chan->push.buffer);
 		kfree(chan);
 	}
Signature · 1 line
1.7.12

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 5 lines · Marcin Slusarz

Fixes GART leak (as accounted by nouveau_drm.gem.gart_available).

---

Quoted 8 lines

Running glxinfo in a loop is enough to trigger it - after several thousand runs (depending on GART size), X server crashes and does not come back in a correct state (corruptions and crashes).

With this patch applied, it's possible again to do full piglit run (with concurrency disabled) without crashes or lockups.

---

Please consider applying this patch for 3.7/3.7.x. This bug is easily reproducible and has fatal consequences (gpu is unusuable after 1st crash).

Quoted 19 lines
 drivers/gpu/drm/nouveau/nouveau_chan.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/nouveau/nouveau_chan.c +2 -0
index 1363578..174300b 100644
@@ -76,6 +76,8 @@ nouveau_channel_del(struct nouveau_channel **pchan)
 		nouveau_object_del(client, NVDRM_DEVICE, chan->push.handle);
 		nouveau_bo_vma_del(chan->push.buffer, &chan->push.vma);
 		nouveau_bo_unmap(chan->push.buffer);
+		if (chan->push.buffer && chan->push.buffer->pin_refcnt)
+			nouveau_bo_unpin(chan->push.buffer);
 		nouveau_bo_ref(NULL, &chan->push.buffer);
 		kfree(chan);
 	}
Signature · 1 line
1.7.12