Commit 44b9a7cf authored by Alvin Lee's avatar Alvin Lee Committed by Alex Deucher

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: default avatarAric Cyr <aric.cyr@amd.com>
Acked-by: default avatarRoman Li <roman.li@amd.com>
Signed-off-by: default avatarAlvin Lee <alvin.lee2@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6b7fd830
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment