Skip to contentSkip to conversation

drm: warn if cursor plane is set with legacy funcs

PATCH In review Simon Ser 2 participants 2 messages Dec 22, 2020

Subsystems (2)
lore
Share & tools
lore

Simon Ser

author
#0 lore raw

PATCH 1/1 drm: warn if cursor plane is set with legacy funcs

A driver must not set drm_crtc.cursor and any of the legacy funcs at the same time, otherwise it's not clear which one DRM core should use for legacy cursor updates.

Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_mode_config.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/drm_mode_config.c +10 -0
index 9611f21bca00..92e56baf04ad 100644
@@ -645,6 +645,16 @@ void drm_mode_config_validate(struct drm_device *dev)
 		WARN(!crtc->primary, "Missing primary plane on [CRTC:%d:%s]\n",
 		     crtc->base.id, crtc->name);
 
+		WARN(crtc->cursor && crtc->funcs->cursor_set,
+		     "[CRTC:%d:%s] must not have both a cursor plane and a cursor_set func",
+		     crtc->base.id, crtc->name);
+		WARN(crtc->cursor && crtc->funcs->cursor_set2,
+		     "[CRTC:%d:%s] must not have both a cursor plane and a cursor_set2 func",
+		     crtc->base.id, crtc->name);
+		WARN(crtc->cursor && crtc->funcs->cursor_move,
+		     "[CRTC:%d:%s] must not have both a cursor plane and a cursor_move func",
+		     crtc->base.id, crtc->name);
+
 		if (crtc->primary) {
 			WARN(!(crtc->primary->possible_crtcs & drm_crtc_mask(crtc)),
 			     "Bogus primary plane possible_crtcs: [PLANE:%d:%s] must be compatible with [CRTC:%d:%s]\n",
Signature · 6 lines
2.29.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Simon Ser

A driver must not set drm_crtc.cursor and any of the legacy funcs at the same time, otherwise it's not clear which one DRM core should use for legacy cursor updates.

Cc Daniel Vetter <[email protected]>
Quoted 28 lines
---
 drivers/gpu/drm/drm_mode_config.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/drm_mode_config.c +10 -0
index 9611f21bca00..92e56baf04ad 100644
@@ -645,6 +645,16 @@ void drm_mode_config_validate(struct drm_device *dev)
 		WARN(!crtc->primary, "Missing primary plane on [CRTC:%d:%s]\n",
 		     crtc->base.id, crtc->name);
 
+		WARN(crtc->cursor && crtc->funcs->cursor_set,
+		     "[CRTC:%d:%s] must not have both a cursor plane and a cursor_set func",
+		     crtc->base.id, crtc->name);
+		WARN(crtc->cursor && crtc->funcs->cursor_set2,
+		     "[CRTC:%d:%s] must not have both a cursor plane and a cursor_set2 func",
+		     crtc->base.id, crtc->name);
+		WARN(crtc->cursor && crtc->funcs->cursor_move,
+		     "[CRTC:%d:%s] must not have both a cursor plane and a cursor_move func",
+		     crtc->base.id, crtc->name);
+
 		if (crtc->primary) {
 			WARN(!(crtc->primary->possible_crtcs & drm_crtc_mask(crtc)),
 			     "Bogus primary plane possible_crtcs: [PLANE:%d:%s] must be compatible with [CRTC:%d:%s]\n",
Signature · 1 line
2.29.2
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel