dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nv84+: fix fence context seqno's
@ 2014-09-22  9:08 Maarten Lankhorst
       [not found] ` <541FE720.50504-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Maarten Lankhorst @ 2014-09-22  9:08 UTC (permalink / raw)
  To: Ben Skeggs
  Cc: nouveau@lists.freedesktop.org, Ted Percival,
	dri-devel@lists.freedesktop.org

This fixes a regression introduced by "drm/nouveau: rework to new fence interface"
(commit 29ba89b2371d466).

The fence sequence should not be reset after creation, the old value is used instead.
On destruction the final value is written, to prevent another source of accidental
wraparound in case of a channel being destroyed after a hang, and unblocking any other
channel that may wait on the about-to-be-deleted channel to signal.

I'm nothing if not optimistic about any hope of recovery from that. ;-)

Reported-by: Ted Percival <ted@tedp.id.au>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
---
diff --git a/drivers/gpu/drm/nouveau/nv84_fence.c b/drivers/gpu/drm/nouveau/nv84_fence.c
index 7b372a68aa4e..4138db4d8291 100644
--- a/drivers/gpu/drm/nouveau/nv84_fence.c
+++ b/drivers/gpu/drm/nouveau/nv84_fence.c
@@ -120,6 +120,7 @@ nv84_fence_context_del(struct nouveau_channel *chan)
 		nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]);
 	}
 
+	nouveau_bo_wr32(priv->bo, chan->chid * 16 / 4, fctx->base.sequence);
 	nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
 	nouveau_bo_vma_del(priv->bo, &fctx->vma);
 	nouveau_fence_context_del(&fctx->base);
@@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
 		ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
 	}
 
-	nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
-
 	if (ret)
 		nv84_fence_context_del(chan);
 	return ret;

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

end of thread, other threads:[~2014-09-25 22:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22  9:08 [PATCH] drm/nv84+: fix fence context seqno's Maarten Lankhorst
     [not found] ` <541FE720.50504-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2014-09-22 16:23   ` Ted Percival
     [not found]     ` <54204CE7.2010502-QSfhGDxlWt8QrrorzV6ljw@public.gmane.org>
2014-09-23  5:35       ` Ben Skeggs
     [not found]         ` <CACAvsv4gmpN62-FZifbwcFb=dTr7mMtu7K5Ga793i6rUohs=tg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-23 14:24           ` Maarten Lankhorst
     [not found]             ` <542182AD.9020808-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2014-09-25 22:28               ` Ted Percival

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).