[PATCH 2/4] drm/amd/display: disallow cropping for cursor plane

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looking at handle_cursor_update, it doesn't seem like src_{x,y,w,h}
are picked up by DC. I also tried to change these parameters via a
test KMS client, and amdgpu ignored them. Instead of displaying the
wrong result, reject the atomic commit.

Signed-off-by: Simon Ser <contact@xxxxxxxxxxx>
Cc: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: Harry Wentland <hwentlan@xxxxxxx>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx>
---
 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 bd63f1c4ae79..a7e1af7081cb 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8902,6 +8902,11 @@ static int dm_update_plane_state(struct dc *dc,
 			return -EINVAL;
 		}
 
+		if (new_plane_state->src_x != 0 || new_plane_state->src_y != 0) {
+			DRM_DEBUG_ATOMIC("Cropping not supported for cursor plane\n");
+			return -EINVAL;
+		}
+
 		if (new_plane_state->fb) {
 			if (new_plane_state->fb->width > new_acrtc->max_cursor_width ||
 			    new_plane_state->fb->height > new_acrtc->max_cursor_height) {
@@ -8910,6 +8915,11 @@ static int dm_update_plane_state(struct dc *dc,
 						 new_plane_state->fb->height);
 				return -EINVAL;
 			}
+			if (new_plane_state->src_w != new_plane_state->fb->width << 16 ||
+			    new_plane_state->src_h != new_plane_state->fb->height << 16) {
+				DRM_DEBUG_ATOMIC("Cropping not supported for cursor plane\n");
+				return -EINVAL;
+			}
 
 			switch (new_plane_state->fb->width) {
 			case 64:
-- 
2.29.2


_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux