Commit 4e8eac98 authored by Alvin Lee's avatar Alvin Lee Committed by Alex Deucher

drm/amd/display: Calculate ODM width using odm slice rect, not recout

[Description]
There are scenarios where ODM4:1 is used but the
surface is entirely outside of the first and last
ODM slice. In this case the recout.width for the
first and last slice is 0 because there's no overlap
with the surface and that ODM slice, but this causes
the x_pos for the cursor in this scenario to be
calculated incorrectly. Instead we should use the
ODM slice width instead of the recout width.
Reviewed-by: default avatarNevenko Stupar <nevenko.stupar@amd.com>
Signed-off-by: default avatarJerry Zuo <jerry.zuo@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 39d496d4
...@@ -1115,10 +1115,10 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) ...@@ -1115,10 +1115,10 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
.mirror = pipe_ctx->plane_state->horizontal_mirror, .mirror = pipe_ctx->plane_state->horizontal_mirror,
.stream = pipe_ctx->stream .stream = pipe_ctx->stream
}; };
struct rect odm_slice_src = { 0 };
bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) || bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
(pipe_ctx->prev_odm_pipe != NULL); (pipe_ctx->prev_odm_pipe != NULL);
int prev_odm_width = 0; int prev_odm_width = 0;
int prev_odm_offset = 0;
struct pipe_ctx *prev_odm_pipe = NULL; struct pipe_ctx *prev_odm_pipe = NULL;
bool mpc_combine_on = false; bool mpc_combine_on = false;
int bottom_pipe_x_pos = 0; int bottom_pipe_x_pos = 0;
...@@ -1183,12 +1183,12 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) ...@@ -1183,12 +1183,12 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
prev_odm_pipe = pipe_ctx->prev_odm_pipe; prev_odm_pipe = pipe_ctx->prev_odm_pipe;
while (prev_odm_pipe != NULL) { while (prev_odm_pipe != NULL) {
prev_odm_width += prev_odm_pipe->plane_res.scl_data.recout.width; odm_slice_src = resource_get_odm_slice_src_rect(prev_odm_pipe);
prev_odm_offset += prev_odm_pipe->plane_res.scl_data.recout.x; prev_odm_width += odm_slice_src.width;
prev_odm_pipe = prev_odm_pipe->prev_odm_pipe; prev_odm_pipe = prev_odm_pipe->prev_odm_pipe;
} }
x_pos -= (prev_odm_width + prev_odm_offset); x_pos -= (prev_odm_width);
} }
/* If the position is negative then we need to add to the hotspot /* If the position is negative then we need to add to the hotspot
......
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