drm/amd/display: Fix cursor visual confirm update
[Why/How] Certain transitions from HW to SW cursor can be missed, which will result in black visual confirm instead of expected blue/red. Need to add handling for cursor visual confirm to dc_update_visual_confirm_color. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
b8d046985c
commit
e4dc767f1f
@@ -1157,6 +1157,8 @@ static void dc_update_visual_confirm_color(struct dc *dc, struct dc_state *conte
|
||||
get_surface_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color));
|
||||
else if (dc->debug.visual_confirm == VISUAL_CONFIRM_SWIZZLE)
|
||||
get_surface_tile_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color));
|
||||
else if (dc->debug.visual_confirm == VISUAL_CONFIRM_HW_CURSOR)
|
||||
get_cursor_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color));
|
||||
else {
|
||||
if (dc->ctx->dce_version < DCN_VERSION_2_0)
|
||||
color_space_to_black_color(
|
||||
|
||||
@@ -497,6 +497,23 @@ void get_mclk_switch_visual_confirm_color(
|
||||
}
|
||||
}
|
||||
|
||||
void get_cursor_visual_confirm_color(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct tg_color *color)
|
||||
{
|
||||
uint32_t color_value = MAX_TG_COLOR_VALUE;
|
||||
|
||||
if (pipe_ctx->stream && pipe_ctx->stream->cursor_position.enable) {
|
||||
color->color_r_cr = color_value;
|
||||
color->color_g_y = 0;
|
||||
color->color_b_cb = 0;
|
||||
} else {
|
||||
color->color_r_cr = 0;
|
||||
color->color_g_y = 0;
|
||||
color->color_b_cb = color_value;
|
||||
}
|
||||
}
|
||||
|
||||
void set_p_state_switch_method(
|
||||
struct dc *dc,
|
||||
struct dc_state *context,
|
||||
|
||||
@@ -421,7 +421,6 @@ bool dc_stream_program_cursor_position(
|
||||
/* apply/update visual confirm */
|
||||
if (dc->debug.visual_confirm == VISUAL_CONFIRM_HW_CURSOR) {
|
||||
/* update software state */
|
||||
uint32_t color_value = MAX_TG_COLOR_VALUE;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||
@@ -429,15 +428,7 @@ bool dc_stream_program_cursor_position(
|
||||
|
||||
/* adjust visual confirm color for all pipes with current stream */
|
||||
if (stream == pipe_ctx->stream) {
|
||||
if (stream->cursor_position.enable) {
|
||||
pipe_ctx->visual_confirm_color.color_r_cr = color_value;
|
||||
pipe_ctx->visual_confirm_color.color_g_y = 0;
|
||||
pipe_ctx->visual_confirm_color.color_b_cb = 0;
|
||||
} else {
|
||||
pipe_ctx->visual_confirm_color.color_r_cr = 0;
|
||||
pipe_ctx->visual_confirm_color.color_g_y = 0;
|
||||
pipe_ctx->visual_confirm_color.color_b_cb = color_value;
|
||||
}
|
||||
get_cursor_visual_confirm_color(pipe_ctx, &(pipe_ctx->visual_confirm_color));
|
||||
|
||||
/* programming hardware */
|
||||
if (pipe_ctx->plane_state)
|
||||
|
||||
@@ -505,6 +505,10 @@ void get_mclk_switch_visual_confirm_color(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct tg_color *color);
|
||||
|
||||
void get_cursor_visual_confirm_color(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
struct tg_color *color);
|
||||
|
||||
void set_p_state_switch_method(
|
||||
struct dc *dc,
|
||||
struct dc_state *context,
|
||||
|
||||
Reference in New Issue
Block a user