drm/amd/display: Set cursor attributes before position
authorHarry Wentland <harry.wentland@amd.com>
Thu, 4 Apr 2024 15:54:40 +0000 (11:54 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:48:49 +0000 (09:48 -0400)
HWSS set_cursor_attributes copies the stream's cursor attributes
to the hubp cursor attributes. set_cursor_position might attempt
to program the cursor attributes but will program them wrong if
they're not set correctly. We need to call HWSS set_cursor_attributes
first to ensure hubp has the right attributes to be programmed.

Reviewed-by: Agustin Gutierrez <agustin.gutierrez@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@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/hwss/dcn10/dcn10_hwseq.c
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c

index 55fb69fb7777bcdc4aa81c8fb63e529c6db527b5..ff2951c88d559c247bca3038766b864c5a2f5cfb 100644 (file)
@@ -2886,8 +2886,8 @@ static void dcn10_update_dchubp_dpp(
        }
 
        if (pipe_ctx->stream->cursor_attributes.address.quad_part != 0) {
-               dc->hwss.set_cursor_position(pipe_ctx);
                dc->hwss.set_cursor_attribute(pipe_ctx);
+               dc->hwss.set_cursor_position(pipe_ctx);
 
                if (dc->hwss.set_cursor_sdr_white_level)
                        dc->hwss.set_cursor_sdr_white_level(pipe_ctx);
index 651162a5043c95060dd3f0a9ea9bb22842c66bb2..429d3b6620501dcb582322aa3d520e971eccbfa7 100644 (file)
@@ -1759,8 +1759,8 @@ static void dcn20_update_dchubp_dpp(
        if ((pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed ||
                        pipe_ctx->update_flags.bits.scaler || viewport_changed == true) &&
                        pipe_ctx->stream->cursor_attributes.address.quad_part != 0) {
-               dc->hwss.set_cursor_position(pipe_ctx);
                dc->hwss.set_cursor_attribute(pipe_ctx);
+               dc->hwss.set_cursor_position(pipe_ctx);
 
                if (dc->hwss.set_cursor_sdr_white_level)
                        dc->hwss.set_cursor_sdr_white_level(pipe_ctx);