From: Daniel Vetter Date: Fri, 7 Apr 2017 16:48:17 +0000 (+0200) Subject: drm: Only take cursor locks when the cursor plane exists X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2e0641631f233b5af09f0bfeaa6220d10cad75e7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Only take cursor locks when the cursor plane exists I thought I've fixed this, but maybe not. Anyway, clearly broken, and easy fix. Cc: Tony Lindgren Reported-by: Tony Lindgren Fixes: b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc") Cc: Harry Wentland Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jani Nikula Cc: Sean Paul Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Signed-off-by: Daniel Vetter Tested-by: Tony Lindgren Reviewed-by: Daniel Stone Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/20170407164817.28272-1-daniel.vetter@ffwll.ch --- 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 @@ retry: 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; }