summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAusef Yousof <auyousof@amd.com>2025-12-01 15:03:10 -0500
committerAlex Deucher <alexander.deucher@amd.com>2026-01-10 14:21:53 -0500
commite7b09b766ae2c2d0cb8e9a2d81b7b9dfca04a9b1 (patch)
treec13256f7fa39ef31366a1d2d91d29d924dfc72b0 /drivers/gpu
parent1883b2578df3e3577b429fd46776e788b2107ec0 (diff)
drm/amd/display: correct clip x assignment in cursor programming
[why&how] primary planes for external displays getting incorrect clip values, detect such a scenario and pass correct parameters Reviewed-by: Ovidiu (Ovi) Bunea <ovidiu.bunea@amd.com> Signed-off-by: Ausef Yousof <auyousof@amd.com> Signed-off-by: Matthew Stewart <matthew.stewart2@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_hw_types.h6
-rw-r--r--drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
index 667852517246..cfa569a7bff1 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
@@ -491,6 +491,12 @@ struct dc_cursor_position {
* for each plane.
*/
bool translate_by_source;
+
+ /**
+ * @use_viewport_for_clip: Use viewport position for clip_x calculation
+ * instead of clip_rect. Required to protect against clip being overwritten
+ */
+ bool use_viewport_for_clip;
};
struct dc_cursor_mi_param {
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
index fa62e40a9858..8a23763ca98e 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
@@ -3666,7 +3666,11 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
int y_plane = pipe_ctx->plane_state->dst_rect.y;
int x_pos = pos_cpy.x;
int y_pos = pos_cpy.y;
- int clip_x = pipe_ctx->plane_state->clip_rect.x;
+ bool is_primary_plane = (pipe_ctx->plane_state->layer_index == 0);
+
+ int clip_x = (pos_cpy.use_viewport_for_clip && is_primary_plane &&
+ !odm_combine_on && !pipe_split_on && param.viewport.x != 0)
+ ? param.viewport.x : pipe_ctx->plane_state->clip_rect.x;
int clip_width = pipe_ctx->plane_state->clip_rect.width;
if ((pipe_ctx->top_pipe != NULL) || (pipe_ctx->bottom_pipe != NULL)) {