[Intel-gfx] [PATCH] drm: Only take cursor locks when the cursor plane exists

Daniel Stone daniel at fooishbar.org
Fri Apr 7 17:05:24 UTC 2017


Reviewed-by: Daniel Stone <daniels at collabora.com>

[mobile email formatting apology here]

On Fri, 7 Apr 2017 at 5:48 pm, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:

> I thought I've fixed this, but maybe not. Anyway, clearly broken, and
> easy fix.
>
> Cc: Tony Lindgren <tony at atomide.com>
> Reported-by: Tony Lindgren <tony at atomide.com>
> Fixes: b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc")
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Jani Nikula <jani.nikula at linux.intel.com>
> Cc: Sean Paul <seanpaul at chromium.org>
> Cc: David Airlie <airlied at linux.ie>
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  drivers/gpu/drm/drm_plane.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 838ca742a28b..fedd4d60d9cd 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -720,15 +720,15 @@ static int drm_mode_cursor_common(struct drm_device
> *dev,
>         ret = drm_modeset_lock(&crtc->mutex, &ctx);
>         if (ret)
>                 goto out;
> -       ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
> -       if (ret)
> -               goto out;
> -
>         /*
>          * If this crtc has a universal cursor plane, call that plane's
> update
>          * handler rather than using legacy cursor handlers.
>          */
>         if (crtc->cursor) {
> +               ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
> +               if (ret)
> +                       goto out;
> +
>                 ret = drm_mode_cursor_universal(crtc, req, file_priv,
> &ctx);
>                 goto out;
>         }
> --
> 2.11.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170407/75885584/attachment.html>


More information about the dri-devel mailing list