aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamson Tam <[email protected]>2024-04-24 08:37:04 -0400
committerAlex Deucher <[email protected]>2024-05-08 15:17:03 -0400
commitd1ae412d74a63615f89f195afb950223174e6e43 (patch)
tree98e77976b7110240d0fdd2b6f5dca63b003d65c3
parentb9b5a82c532109a09f4340ef5cabdfdbb0691a9d (diff)
drm/amd/display: Clean-up recout calculation for visual confirm
[Why & How] Split into a separate adjust and calculate call so we can let the caller adjust recout Reviewed-by: Jun Lei <[email protected]> Acked-by: Tom Chung <[email protected]> Signed-off-by: Samson Tam <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_resource.c23
1 files changed, 16 insertions, 7 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 a48afc307a4e..532882ee7b2b 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -973,24 +973,33 @@ static struct rect calculate_mpc_slice_in_timing_active(
return mpc_rec;
}
-static void adjust_recout_for_visual_confirm(struct rect *recout,
- struct pipe_ctx *pipe_ctx)
+static void calculate_adjust_recout_for_visual_confirm(struct pipe_ctx *pipe_ctx,
+ int *base_offset, int *dpp_offset)
{
struct dc *dc = pipe_ctx->stream->ctx->dc;
- int dpp_offset, base_offset;
+ *base_offset = 0;
+ *dpp_offset = 0;
if (dc->debug.visual_confirm == VISUAL_CONFIRM_DISABLE || !pipe_ctx->plane_res.dpp)
return;
- dpp_offset = pipe_ctx->stream->timing.v_addressable / VISUAL_CONFIRM_DPP_OFFSET_DENO;
- dpp_offset *= pipe_ctx->plane_res.dpp->inst;
+ *dpp_offset = pipe_ctx->stream->timing.v_addressable / VISUAL_CONFIRM_DPP_OFFSET_DENO;
+ *dpp_offset *= pipe_ctx->plane_res.dpp->inst;
if ((dc->debug.visual_confirm_rect_height >= VISUAL_CONFIRM_BASE_MIN) &&
dc->debug.visual_confirm_rect_height <= VISUAL_CONFIRM_BASE_MAX)
- base_offset = dc->debug.visual_confirm_rect_height;
+ *base_offset = dc->debug.visual_confirm_rect_height;
else
- base_offset = VISUAL_CONFIRM_BASE_DEFAULT;
+ *base_offset = VISUAL_CONFIRM_BASE_DEFAULT;
+}
+
+static void adjust_recout_for_visual_confirm(struct rect *recout,
+ struct pipe_ctx *pipe_ctx)
+{
+ int dpp_offset, base_offset;
+ calculate_adjust_recout_for_visual_confirm(pipe_ctx, &base_offset,
+ &dpp_offset);
recout->height -= base_offset;
recout->height -= dpp_offset;
}