Skip to contentSkip to conversation

drm: Only take cursor locks when the cursor plane exists

PATCH Applied Daniel Vetter 4 participants 4 messages Apr 7, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
Fixes b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc")
Cc Harry Wentland <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
---
 drivers/gpu/drm/drm_plane.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_plane.c +4 -4
index 838ca742a28b..fedd4d60d9cd 100644
@@ -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;
 	}
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tested-by on v1 1/1
#1 lore raw
Quoted 14 lines · Daniel Vetter

I thought I've fixed this, but maybe not. Anyway, clearly broken, and easy fix.

Cc Tony Lindgren <[email protected]>
Fixes b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc")
Cc Harry Wentland <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>

Thanks this fixes the issue with starting X with Linux next for me:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Vetter

[mobile email formatting apology here]

Quoted 45 lines · Daniel Vetter

I thought I've fixed this, but maybe not. Anyway, clearly broken, and easy fix.

Cc Tony Lindgren <[email protected]>
Fixes b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc")
Cc Harry Wentland <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
---
 drivers/gpu/drm/drm_plane.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_plane.c +0 -4
index 838ca742a28b..fedd4d60d9cd 100644
@@ -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) {
drivers/gpu/drm/drm_plane.c +4 -0
+               ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
+               if (ret)
+                       goto out;
+
                ret = drm_mode_cursor_universal(crtc, req, file_priv,
&ctx);
                goto out;
        }
Quoted 8 lines

--
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#3 lore raw
In reply to Daniel Vetter
Quoted 14 lines · Daniel Vetter

I thought I've fixed this, but maybe not. Anyway, clearly broken, and easy fix.

Cc Tony Lindgren <[email protected]>
Fixes b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc")
Cc Harry Wentland <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Quoted 1 line

---

Applied to drm-misc

Thanks,

Sean

Quoted 29 lines
 drivers/gpu/drm/drm_plane.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_plane.c +4 -4
index 838ca742a28b..fedd4d60d9cd 100644
@@ -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;
 	}
Signature · 1 line
2.11.0
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx