]> www.infradead.org Git - linux.git/commitdiff
drm/amd/display: Fix overlay with pre-blend color processing
authorMichael Strauss <michael.strauss@amd.com>
Tue, 30 Jul 2019 20:27:24 +0000 (16:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Aug 2024 15:11:01 +0000 (11:11 -0400)
[WHY]
Overlay works similarly to MPO, but uses global alpha on both planes and
sets the desktop as the rear plane instead of the front plane

[HOW]
Ensure that top plane isn't overlay by checking global alpha before
applying the previously added MPO fix

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Michael Strauss <michael.strauss@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@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

index 3cd584419b88e7af2d1d3ef4b517361aa8fc8daf..a7b5b25e3f345e17dc63cd6046d75113c5dc9ae5 100644 (file)
@@ -2586,8 +2586,11 @@ static bool dcn10_is_rear_mpo_fix_required(struct pipe_ctx *pipe_ctx, enum dc_co
 
                        while (top->top_pipe)
                                top = top->top_pipe; // Traverse to top pipe_ctx
-                       if (top->plane_state && top->plane_state->layer_index == 0)
-                               return true; // Front MPO plane not hidden
+                       if (top->plane_state && top->plane_state->layer_index == 0 && !top->plane_state->global_alpha)
+                               // Global alpha used by top plane for PIP overlay
+                               // Pre-multiplied/per-pixel alpha used by MPO
+                               // Check top plane's global alpha to ensure layer_index > 0 not caused by PIP
+                               return true; // MPO in use and front plane not hidden
                }
        }
        return false;