Commit e4dc767f authored by Ilya Bakoulin's avatar Ilya Bakoulin Committed by Alex Deucher
Browse files

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: default avatarAlvin Lee <alvin.lee2@amd.com>
Signed-off-by: default avatarIlya Bakoulin <Ilya.Bakoulin@amd.com>
Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b8d04698
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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(
+17 −0
Original line number Diff line number Diff line
@@ -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,
+1 −10
Original line number Diff line number Diff line
@@ -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)
+4 −0
Original line number Diff line number Diff line
@@ -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,