[PATCH 5/6] amd/display: add cursor alpha and blend mode checks
Simon Ser
contact at emersion.fr
Fri Feb 19 18:58:22 UTC 2021
We don't want a semi-transparent overlay to make the cursor plane
semi-transparent as well. Same for the pixel blend mode.
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 | 10 ++++++++++
1 file changed, 10 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 6e7f4a182e89..d6ecc5826be9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9257,6 +9257,16 @@ static int dm_check_crtc_cursor(struct drm_atomic_state *state,
return -EINVAL;
}
+ if (new_underlying_state->alpha != DRM_BLEND_ALPHA_OPAQUE) {
+ drm_dbg_atomic(crtc->dev, "Cursor plane can't be used with non-opaque underlying plane\n");
+ return -EINVAL;
+ }
+
+ if (new_underlying_state->pixel_blend_mode != DRM_MODE_BLEND_PREMULTI) {
+ drm_dbg_atomic(crtc->dev, "Cursor plane can't be used with non-premultiplied underlying plane\n");
+ return -EINVAL;
+ }
+
return 0;
}
--
2.30.1
More information about the amd-gfx
mailing list