]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Program triplebuffer on all pipes
authorSung Lee <Sung.Lee@amd.com>
Fri, 2 May 2025 20:07:44 +0000 (16:07 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 May 2025 13:31:15 +0000 (09:31 -0400)
[WHY]
Triplebuffer should be programmed on all pipes.
Some code assumed it only needed to be called on top
pipe, but as the HWSS function does not account
for that, it must be called on every pipe.

[HOW]
Remove condition to not program triplebuffer
on non-top/next pipe. Call the function
unconditionally on all pipes.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Sung Lee <Sung.Lee@amd.com>
Signed-off-by: Ray Wu <ray.wu@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/hwss/dcn20/dcn20_hwseq.c
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c

index ea06f23a1812ff59c764758583ef506f2a58a401..608aa2d7d0861583a4b7a0dcaa996f1fd48c16d3 100644 (file)
@@ -4246,12 +4246,6 @@ static void commit_planes_for_stream(struct dc *dc,
                        if (update_type == UPDATE_TYPE_FAST)
                                continue;
 
-                       ASSERT(!pipe_ctx->plane_state->triplebuffer_flips);
-                       if (dc->hwss.program_triplebuffer != NULL && dc->debug.enable_tri_buf) {
-                               /*turn off triple buffer for full update*/
-                               dc->hwss.program_triplebuffer(
-                                       dc, pipe_ctx, pipe_ctx->plane_state->triplebuffer_flips);
-                       }
                        stream_status =
                                stream_get_status(context, pipe_ctx->stream);
 
@@ -4260,6 +4254,25 @@ static void commit_planes_for_stream(struct dc *dc,
                                        dc, pipe_ctx->stream, stream_status->plane_count, context);
                }
        }
+
+       for (j = 0; j < dc->res_pool->pipe_count; j++) {
+               struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
+
+               if (!pipe_ctx->plane_state)
+                       continue;
+
+               /* Full fe update*/
+               if (update_type == UPDATE_TYPE_FAST)
+                       continue;
+
+               ASSERT(!pipe_ctx->plane_state->triplebuffer_flips);
+               if (dc->hwss.program_triplebuffer != NULL && dc->debug.enable_tri_buf) {
+                       /*turn off triple buffer for full update*/
+                       dc->hwss.program_triplebuffer(
+                               dc, pipe_ctx, pipe_ctx->plane_state->triplebuffer_flips);
+               }
+       }
+
        if (dc->hwss.program_front_end_for_ctx && update_type != UPDATE_TYPE_FAST) {
                dc->hwss.program_front_end_for_ctx(dc, context);
 
index 5e78b553adbd33e3cabfead4593d82cbe3d66dcc..858288c3b1acb3ce9964b59d62dbf41b07613675 100644 (file)
@@ -2053,7 +2053,7 @@ void dcn20_program_front_end_for_ctx(
                for (i = 0; i < dc->res_pool->pipe_count; i++) {
                        pipe = &context->res_ctx.pipe_ctx[i];
 
-                       if (!pipe->top_pipe && !pipe->prev_odm_pipe && pipe->plane_state) {
+                       if (pipe->plane_state) {
                                ASSERT(!pipe->plane_state->triplebuffer_flips);
                                /*turn off triple buffer for full update*/
                                dc->hwss.program_triplebuffer(
index ae7194da59878deb403a3df8abbe4f0c6b8cdf7b..e61ed07fdc62b5661c0cdef2a2fe33b865ef2abe 100644 (file)
@@ -2361,7 +2361,7 @@ void dcn401_program_front_end_for_ctx(
                for (i = 0; i < dc->res_pool->pipe_count; i++) {
                        pipe = &context->res_ctx.pipe_ctx[i];
 
-                       if (!pipe->top_pipe && !pipe->prev_odm_pipe && pipe->plane_state) {
+                       if (pipe->plane_state) {
                                if (pipe->plane_state->triplebuffer_flips)
                                        BREAK_TO_DEBUGGER();