diff options
author | Simon Ser <contact@emersion.fr> | 2020-11-20 20:18:57 +0000 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-11-24 12:09:52 -0500 |
commit | 5f581248159a005f194ef27aa44ad82d00ba7622 (patch) | |
tree | c8b909dc5723549cbaa455b5d9d971db9840fb1f /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |
parent | 24f99d2b21db3be1da2800470fecfa583a181929 (diff) |
drm/amd/display: disallow cropping for cursor plane
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.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 c7322d3e0b0a..a886761b3280 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8982,6 +8982,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) { @@ -8990,6 +8995,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: |