aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvin Lee <[email protected]>2024-05-10 15:44:57 -0400
committerAlex Deucher <[email protected]>2024-05-20 16:20:25 -0400
commit44b9a7cfc035166f23b9fddecac3219133a8a15f (patch)
treead974221ecaedc253ef9783ad26d711fb5de429b
parent6b7fd8306efbd406fca9e8d27b2c103f951760c8 (diff)
drm/amd/display: Fix ODM + underscan case with cursor
[Description] There is a corner case where we're in an ODM config that has recout.x != 0. In these scenarios we have to take into account the extra offset in the ODM adjustment for cursor. Reviewed-by: Aric Cyr <[email protected]> Acked-by: Roman Li <[email protected]> Signed-off-by: Alvin Lee <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
index a619da7716ed..f5333a095adb 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
@@ -1089,7 +1089,9 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
(pipe_ctx->prev_odm_pipe != NULL);
int prev_odm_width = 0;
+ int prev_odm_offset = 0;
int next_odm_width = 0;
+ int next_odm_offset = 0;
int x_pos = pos_cpy.x;
int y_pos = pos_cpy.y;
@@ -1152,22 +1154,26 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
y_pos += pipe_ctx->plane_state->src_rect.y;
}
- /* Adjust for ODM Combine */
+ /* Adjust for ODM Combine
+ * next/prev_odm_offset is to account for scaled modes that have underscan
+ */
if (odm_combine_on) {
struct pipe_ctx *next_odm_pipe = pipe_ctx->next_odm_pipe;
struct pipe_ctx *prev_odm_pipe = pipe_ctx->prev_odm_pipe;
while (next_odm_pipe != NULL) {
next_odm_width += next_odm_pipe->plane_res.scl_data.recout.width;
+ next_odm_offset += next_odm_pipe->plane_res.scl_data.recout.x;
next_odm_pipe = next_odm_pipe->next_odm_pipe;
}
while (prev_odm_pipe != NULL) {
prev_odm_width += prev_odm_pipe->plane_res.scl_data.recout.width;
+ prev_odm_offset += prev_odm_pipe->plane_res.scl_data.recout.x;
prev_odm_pipe = prev_odm_pipe->prev_odm_pipe;
}
if (param.rotation == ROTATION_ANGLE_0) {
- x_pos -= prev_odm_width;
+ x_pos -= (prev_odm_width + prev_odm_offset);
}
}
@@ -1269,7 +1275,7 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
pos_cpy.y += pos_cpy_x_offset;
} else {
- pos_cpy.x = pipe_ctx->plane_res.scl_data.recout.width + next_odm_width - pos_cpy.y;
+ pos_cpy.x = pipe_ctx->plane_res.scl_data.recout.width + next_odm_width + next_odm_offset - pos_cpy.y;
pos_cpy.y = temp_x;
}
} else {