Commit e6d24213 authored by Murton Liu's avatar Murton Liu Committed by Alex Deucher

drm/amd/display: PIP overlay corruption

[Why]
When moving mouse onto or off of pip plane,
screen would flash briefly due to garbage negative
pos values being programmed for cursor.
Also, text flashes due to PIP flips taking too long.

[How]
When negative pos value seen, default to 0 and adjust by modifying cursor hotspot.
For flip issue, only do post update when optimize required vs all the time.
Signed-off-by: default avatarMurton Liu <murton.liu@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: default avatarSivapiriyan Kumarasamy <Sivapiriyan.Kumarasamy@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent de00d253
...@@ -1125,6 +1125,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc) ...@@ -1125,6 +1125,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
int i; int i;
struct dc_state *context = dc->current_state; struct dc_state *context = dc->current_state;
if (dc->optimized_required == false)
return true;
post_surface_trace(dc); post_surface_trace(dc);
for (i = 0; i < dc->res_pool->pipe_count; i++) for (i = 0; i < dc->res_pool->pipe_count; i++)
......
...@@ -1150,9 +1150,28 @@ void hubp1_cursor_set_position( ...@@ -1150,9 +1150,28 @@ void hubp1_cursor_set_position(
REG_UPDATE(CURSOR_CONTROL, REG_UPDATE(CURSOR_CONTROL,
CURSOR_ENABLE, cur_en); CURSOR_ENABLE, cur_en);
REG_SET_2(CURSOR_POSITION, 0, //account for cases where we see negative offset relative to overlay plane
CURSOR_X_POSITION, pos->x, if (src_x_offset < 0 && src_y_offset < 0) {
REG_SET_2(CURSOR_POSITION, 0,
CURSOR_X_POSITION, 0,
CURSOR_Y_POSITION, 0);
x_hotspot -= src_x_offset;
y_hotspot -= src_y_offset;
} else if (src_x_offset < 0) {
REG_SET_2(CURSOR_POSITION, 0,
CURSOR_X_POSITION, 0,
CURSOR_Y_POSITION, pos->y); CURSOR_Y_POSITION, pos->y);
x_hotspot -= src_x_offset;
} else if (src_y_offset < 0) {
REG_SET_2(CURSOR_POSITION, 0,
CURSOR_X_POSITION, pos->x,
CURSOR_Y_POSITION, 0);
y_hotspot -= src_y_offset;
} else {
REG_SET_2(CURSOR_POSITION, 0,
CURSOR_X_POSITION, pos->x,
CURSOR_Y_POSITION, pos->y);
}
REG_SET_2(CURSOR_HOT_SPOT, 0, REG_SET_2(CURSOR_HOT_SPOT, 0,
CURSOR_HOT_SPOT_X, x_hotspot, CURSOR_HOT_SPOT_X, x_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