]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Calculate ODM width using odm slice rect, not recout
authorAlvin Lee <alvin.lee2@amd.com>
Wed, 3 Jul 2024 15:36:34 +0000 (11:36 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:07:12 +0000 (17:07 -0400)
[Description]
There are scenarios where ODM4:1 is used but the
surface is entirely outside of the first and last
ODM slice. In this case the recout.width for the
first and last slice is 0 because there's no overlap
with the surface and that ODM slice, but this causes
the x_pos for the cursor in this scenario to be
calculated incorrectly. Instead we should use the
ODM slice width instead of the recout width.

Reviewed-by: Nevenko Stupar <nevenko.stupar@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@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/dcn401/dcn401_hwseq.c

index b9378f18c020e434cdcf88a7b9f208c312f8a9af..31e0e9210dd7e769c53de4e987f0660b8acf4547 100644 (file)
@@ -1115,10 +1115,10 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
                .mirror = pipe_ctx->plane_state->horizontal_mirror,
                .stream = pipe_ctx->stream
        };
+       struct rect odm_slice_src = { 0 };
        bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) ||
                (pipe_ctx->prev_odm_pipe != NULL);
        int prev_odm_width = 0;
-       int prev_odm_offset = 0;
        struct pipe_ctx *prev_odm_pipe = NULL;
        bool mpc_combine_on = false;
        int  bottom_pipe_x_pos = 0;
@@ -1183,12 +1183,12 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
                prev_odm_pipe = pipe_ctx->prev_odm_pipe;
 
                while (prev_odm_pipe != NULL) {
-                       prev_odm_width += prev_odm_pipe->plane_res.scl_data.recout.width;
-                       prev_odm_offset += prev_odm_pipe->plane_res.scl_data.recout.x;
+                       odm_slice_src = resource_get_odm_slice_src_rect(prev_odm_pipe);
+                       prev_odm_width += odm_slice_src.width;
                        prev_odm_pipe = prev_odm_pipe->prev_odm_pipe;
                }
 
-               x_pos -= (prev_odm_width + prev_odm_offset);
+               x_pos -= (prev_odm_width);
        }
 
        /* If the position is negative then we need to add to the hotspot