drm/amd/display: Visual Confirm Bar Height Adjust
authorhvanzyll <hvanzyll@amd.com>
Fri, 5 Nov 2021 14:08:25 +0000 (10:08 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Nov 2021 19:45:01 +0000 (14:45 -0500)
[What]
This change allows adjustment to the Visual Confirm
height border.

[Why]
Aids debugging and testing

[How]
Use the existing infrastructure to implement logic to
draw borders

Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Harry VanZyllDeJong <hvanzyll@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/dc.h
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c

index 764663df78874aca694c037b21e475041c9a3448..6b4c9e9705c0c92efd59e4c1ac568dfe94dbee0d 100644 (file)
@@ -574,6 +574,8 @@ struct dc_debug_options {
        bool native422_support;
        bool disable_dsc;
        enum visual_confirm visual_confirm;
+       int visual_confirm_rect_height;
+
        bool sanity_checks;
        bool max_disp_clk;
        bool surface_trace;
index 44293d66b46bd66d7e28290da78a23996f7203f4..e31a6f1516bb50462d490041a72b8b0cd6294578 100644 (file)
 #define BLACK_OFFSET_RGB_Y 0x0
 #define BLACK_OFFSET_CBCR  0x8000
 
+#define VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT 3
+#define VISUAL_CONFIRM_RECT_HEIGHT_MIN 1
+#define VISUAL_CONFIRM_RECT_HEIGHT_MAX 10
+
 #define REG(reg)\
        dpp->tf_regs->reg
 
@@ -685,9 +689,17 @@ static void dpp1_dscl_set_recout(struct dcn10_dpp *dpp,
                                 const struct rect *recout)
 {
        int visual_confirm_on = 0;
+       unsigned short visual_confirm_rect_height = VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT;
+
        if (dpp->base.ctx->dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE)
                visual_confirm_on = 1;
 
+       /* Check bounds to ensure the VC bar height was set to a sane value */
+       if ((dpp->base.ctx->dc->debug.visual_confirm_rect_height >= VISUAL_CONFIRM_RECT_HEIGHT_MIN) &&
+                       (dpp->base.ctx->dc->debug.visual_confirm_rect_height <= VISUAL_CONFIRM_RECT_HEIGHT_MAX)) {
+               visual_confirm_rect_height = dpp->base.ctx->dc->debug.visual_confirm_rect_height;
+       }
+
        REG_SET_2(RECOUT_START, 0,
                  /* First pixel of RECOUT in the active OTG area */
                  RECOUT_START_X, recout->x,
@@ -699,7 +711,7 @@ static void dpp1_dscl_set_recout(struct dcn10_dpp *dpp,
                  RECOUT_WIDTH, recout->width,
                  /* Number of RECOUT vertical lines */
                  RECOUT_HEIGHT, recout->height
-                        - visual_confirm_on * 2 * (dpp->base.inst + 1));
+                        - visual_confirm_on * 2 * (dpp->base.inst + visual_confirm_rect_height));
 }
 
 /**