summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
diff options
context:
space:
mode:
authorLeo Ma <hanghong.ma@amd.com>2023-03-28 16:26:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2023-07-18 11:14:02 -0400
commitbf27f5defe92d310099d2f621a5276104d7db093 (patch)
tree7451f93ba54852b800d395b36002bf83cd860811 /drivers/gpu/drm/amd/display/dc/core/dc_resource.c
parentab02d4ae4a4313568761b4877a2eee3e7579ef34 (diff)
drm/amd/display: Update scaler recout data for visual confirm
[Why] Visual confirm color is not as expected for Autoa Color Management feature test. [How] Calculate scaler recout data when visual confirm enabled to update the visual confirm bar on the display. Reviewed-by: Aric Cyr <aric.cyr@amd.com> Acked-by: Alan Liu <haoping.liu@amd.com> Signed-off-by: Leo Ma <hanghong.ma@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc_resource.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_resource.c22
1 files changed, 22 insertions, 0 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 2f3d9a698486..1859350dffc6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -69,6 +69,9 @@
#include "../dcn32/dcn32_resource.h"
#include "../dcn321/dcn321_resource.h"
+#define VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT 3
+#define VISUAL_CONFIRM_RECT_HEIGHT_MIN 1
+#define VISUAL_CONFIRM_RECT_HEIGHT_MAX 10
#define DC_LOGGER_INIT(logger)
@@ -808,6 +811,8 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)
struct rect surf_clip = plane_state->clip_rect;
bool split_tb = stream->view_format == VIEW_3D_FORMAT_TOP_AND_BOTTOM;
int split_count, split_idx;
+ struct dpp *dpp = pipe_ctx->plane_res.dpp;
+ unsigned short visual_confirm_rect_height = VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT;
calculate_split_count_and_index(pipe_ctx, &split_count, &split_idx);
if (stream->view_format == VIEW_3D_FORMAT_SIDE_BY_SIDE)
@@ -876,6 +881,23 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)
data->recout.width = data->h_active - data->recout.x;
}
}
+
+ /* Check bounds to ensure the VC bar height was set to a sane value */
+ if (dpp != NULL) {
+ if ((dpp->ctx->dc->debug.visual_confirm_rect_height >= VISUAL_CONFIRM_RECT_HEIGHT_MIN) &&
+ (dpp->ctx->dc->debug.visual_confirm_rect_height <= VISUAL_CONFIRM_RECT_HEIGHT_MAX)) {
+ visual_confirm_rect_height = dpp->ctx->dc->debug.visual_confirm_rect_height;
+ }
+
+ if (dpp->ctx->dc->debug.visual_confirm !=
+ VISUAL_CONFIRM_DISABLE)
+ data->recout.height = data->recout.height -
+ 2 * ((pipe_ctx->prev_odm_pipe ||
+ (pipe_ctx->top_pipe &&
+ pipe_ctx->top_pipe->plane_state ==
+ pipe_ctx->plane_state)) +
+ visual_confirm_rect_height);
+ }
}
static void calculate_scaling_ratios(struct pipe_ctx *pipe_ctx)