[PATCH v2 3/5] amd/display: add cursor check for YUV underlying pipe
Simon Ser
contact at emersion.fr
Wed Mar 10 14:50:17 UTC 2021
The cursor plane can't be displayed if the underlying pipe isn't
using an RGB format. Reject such atomic commits so that user-space
can have a fallback instead of an invisible cursor.
In theory we could support YUV if the cursor is also YUV, but at the
moment only ARGB8888 cursors are supported.
Signed-off-by: Simon Ser <contact at emersion.fr>
Cc: Alex Deucher <alexander.deucher at amd.com>
Cc: Harry Wentland <hwentlan at amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b54ed708e114..98df550c3979 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9494,6 +9494,13 @@ static int dm_check_crtc_cursor(struct drm_atomic_state *state,
return -EINVAL;
}
+ /* In theory we could probably support YUV cursors when the underlying
+ * plane uses a YUV format, but there's no use-case for it yet. */
+ if (new_underlying_state->fb->format->is_yuv) {
+ drm_dbg_atomic(crtc->dev, "Cursor plane can't be used with YUV underlying plane\n");
+ return -EINVAL;
+ }
+
return 0;
}
--
2.30.2
More information about the amd-gfx
mailing list