All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: unpin pushbuffer bo before destroying it
@ 2012-11-25 22:02 Marcin Slusarz
       [not found] ` <20121125220228.GD13248-OI9uyE9O0yo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Slusarz @ 2012-11-25 22:02 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---

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(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c
index 1363578..174300b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_chan.c
+++ b/drivers/gpu/drm/nouveau/nouveau_chan.c
@@ -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);
 	}
-- 
1.7.12

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/nouveau: unpin pushbuffer bo before destroying it
       [not found] ` <20121125220228.GD13248-OI9uyE9O0yo@public.gmane.org>
@ 2012-12-02 11:30   ` Marcin Slusarz
  0 siblings, 0 replies; 2+ messages in thread
From: Marcin Slusarz @ 2012-12-02 11:30 UTC (permalink / raw)
  To: Ben Skeggs, Dave Airlie; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Sun, Nov 25, 2012 at 11:02:28PM +0100, Marcin Slusarz wrote:
> Fixes GART leak (as accounted by nouveau_drm.gem.gart_available).
> 
> Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> 
> 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).

>  drivers/gpu/drm/nouveau/nouveau_chan.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c
> index 1363578..174300b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_chan.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c
> @@ -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);
>  	}
> -- 
> 1.7.12
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-02 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-25 22:02 [PATCH] drm/nouveau: unpin pushbuffer bo before destroying it Marcin Slusarz
     [not found] ` <20121125220228.GD13248-OI9uyE9O0yo@public.gmane.org>
2012-12-02 11:30   ` Marcin Slusarz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.