From: Alvin Lee <[email protected]>

The visual confirm overlay shrinks the recout height by a base/dpp offset.
Prior to visual_confirm_full_viewport, this shrink ran only inside the
overlap > 0 branch of calculate_recout; a pipe with no overlap on its ODM
slice (e.g. an MPO window entirely on a single slice) had its recout zeroed
and was left untouched, so both RECOUT_WIDTH and RECOUT_HEIGHT programmed 0.

The full viewport path moved the shrink to a common tail that runs
unconditionally for every pipe. For a disabled pipe the recout is {0,0,0,0},
so subtracting the height offset drove RECOUT_HEIGHT negative (non-zero)
while RECOUT_WIDTH stayed 0.

Only apply the visual confirm shrink when the recout has real area
(width > 0 && height > 0), for both scl_data.recout and the SPL
dscl_prog_data.recout, preserving the zeroed disabled-pipe behavior.

Cc: Samson Tam <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 832286f0c0b1..3e87ec8ad6a5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -1747,11 +1747,19 @@ bool resource_build_scaling_params(struct pipe_ctx 
*pipe_ctx)
         * recout before the viewport was computed.
         */
        if (pipe_ctx->stream->ctx->dc->debug.visual_confirm_full_viewport) {
-               adjust_recout_for_visual_confirm(
-                               &pipe_ctx->plane_res.scl_data.recout, pipe_ctx);
+               /* A zero-area recout is the disabled-pipe sentinel (no overlap 
with this
+                * ODM slice); only shrink a recout that actually draws, else 
the height
+                * offset drives it negative and the pipe no longer reads as 
disabled.
+                */
+               if (pipe_ctx->plane_res.scl_data.recout.width > 0 &&
+                               pipe_ctx->plane_res.scl_data.recout.height > 0)
+                       adjust_recout_for_visual_confirm(
+                                       &pipe_ctx->plane_res.scl_data.recout, 
pipe_ctx);
                /* SPL programs the HW recout from dscl_prog_data, not 
scl_data.recout */
                if (pipe_ctx->stream->ctx->dc->config.use_spl &&
-                               !pipe_ctx->stream->ctx->dc->debug.disable_spl)
+                               !pipe_ctx->stream->ctx->dc->debug.disable_spl &&
+                               
pipe_ctx->plane_res.scl_data.dscl_prog_data.recout.width > 0 &&
+                               
pipe_ctx->plane_res.scl_data.dscl_prog_data.recout.height > 0)
                        adjust_recout_for_visual_confirm((struct rect *)
                                        
&pipe_ctx->plane_res.scl_data.dscl_prog_data.recout,
                                        pipe_ctx);
-- 
2.43.0

Reply via email to