[Intel-gfx] [-PATCH v5 1/5] drm/i915: update cursors asynchronously through atomic

Chris Wilson chris at chris-wilson.co.uk
Fri Sep 8 19:48:56 UTC 2017


Quoting Gustavo Padovan (2017-09-08 20:24:15)
> @@ -13167,6 +13170,26 @@ static int intel_atomic_commit(struct drm_device *dev,
>         struct drm_i915_private *dev_priv = to_i915(dev);
>         int ret = 0;
>  
> +       /*
> +        * The atomic async update fast path takes care
> +        * of avoiding the vblank waits for simple cursor
> +        * movement and flips. For cursor on/off and size changes,
> +        * we want to perform the vblank waits so that watermark
> +        * updates happen during the correct frames. Gen9+ have
> +        * double buffered watermarks and so shouldn't need this.
> +        */
> +       if (state->async_update) {
> +               ret = mutex_lock_interruptible(&dev->struct_mutex);
> +               if (ret)
> +                       return ret;

This deadlock should be found by the test suite, or else we are missing
tests!

> +
> +               ret = drm_atomic_helper_prepare_planes(dev, state);

And that will make adding the missing if (ret) return ret; easier.

> +               mutex_unlock(&dev->struct_mutex);
> +
> +               drm_atomic_helper_async_commit(dev, state);
> +               return 0;
> +       }
> +
>         ret = drm_atomic_helper_setup_commit(state, nonblock);
>         if (ret)
>                 return ret;


More information about the Intel-gfx mailing list