[Nouveau] [PATCH 6/6] drm/nouveau: give pgraph a chance to idle before spinlock

Maarten Maathuis madman2003 at gmail.com
Wed Feb 3 10:02:22 PST 2010


Patches 4-6 will be pushed tomorrow if there are no objections.

Acks or comments appreciated as usual.

Maarten.

On Tue, Feb 2, 2010 at 10:36 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:
> - 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
> --- a/drivers/gpu/drm/nouveau/nouveau_channel.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
> @@ -280,11 +280,18 @@ nouveau_channel_free(struct nouveau_channel *chan)
>         */
>        nouveau_fence_fini(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. */
>        pfifo->reassign(dev, false);
>
> +       /* 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)
> +               nouveau_wait_for_idle(dev);
> +
> +       spin_lock_irqsave(&dev_priv->engine.lock, flags);
> +
>        pgraph->fifo_access(dev, false);
>        if (pgraph->channel(dev) == chan)
>                pgraph->unload_context(dev);
> --
> 1.6.6.1
>
>


More information about the Nouveau mailing list