]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Fix cursor visual confirm update
authorIlya Bakoulin <Ilya.Bakoulin@amd.com>
Thu, 12 Sep 2024 18:31:13 +0000 (14:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Oct 2024 21:33:09 +0000 (17:33 -0400)
[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>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/core/dc_stream.c
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h

index c271fbaaf896ca8dfb302e343016c723eea9a7ab..4c33e3b14c4f5f3d2fc3fb15cf98a78a66aa6fec 100644 (file)
@@ -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(
index 2cb9253c9bdecbf5a0c9a638d066227dfe45e59e..2fdcf8d59b9f534d65086fc89a0179efdd96d38e 100644 (file)
@@ -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,
index 9a406d74c0dd7617948782ab12ef8de3e003ab7a..5d233c09d23989a10cea766c5a86056951e9f1cc 100644 (file)
@@ -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)
index b8c47e4c51c153c73968e822662fb6536dca1679..2f56c36e425103626243342d14420ecc38f48ce9 100644 (file)
@@ -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,