[Nouveau] [PATCH 6/6] drm/nouveau: give pgraph a chance to idle before spinlock
madman2003 at gmail.com
Tue Feb 2 13:36:05 PST 2010
- Under some rare conditions i've managed to get pgraph errors after the
channel is closed, which has very undesirable effects.
- This is the only reason i can think off.
Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
drivers/gpu/drm/nouveau/nouveau_channel.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
index 86399f6..d25ed61 100644
@@ -280,11 +280,18 @@ nouveau_channel_free(struct nouveau_channel *chan)
- spin_lock_irqsave(&dev_priv->engine.lock, flags);
- /* Ensure the channel is no longer active on the GPU */
+ /* This will prevent pfifo from switching channels. */
+ /* We want to give pgraph a chance to idle and get rid of all potential
+ * errors. We need to do this before the lock, otherwise the irq handler
+ * is unable to process them.
+ if (pgraph->channel(dev) == chan)
+ spin_lock_irqsave(&dev_priv->engine.lock, flags);
if (pgraph->channel(dev) == chan)
More information about the Nouveau