summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/hwss/dcn20
diff options
context:
space:
mode:
authorAlvin Lee <alvin.lee2@amd.com>2023-12-12 20:17:31 +0300
committerAlex Deucher <alexander.deucher@amd.com>2024-01-03 18:47:20 +0300
commit6b2b782ad6a25734ae847d1659bea3f613dbb563 (patch)
tree87cee0658800cfada33c039210698ab7b2e2b2eb /drivers/gpu/drm/amd/display/dc/hwss/dcn20
parent59f1622a5f05d948a7c665a458a3dd76ba73015e (diff)
downloadlinux-6b2b782ad6a25734ae847d1659bea3f613dbb563.tar.xz
drm/amd/display: For FPO and SubVP/DRR configs program vmin/max sel
For FPO and SubVP/DRR cases we need to ensure to program OTG_V_TOTAL_MIN/MAX_SEL, otherwise stretching the vblank in FPO / SubVP / DRR cases will not have any effect and we could hit underflow / corruption. Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Reviewed-by: Aric Cyr <aric.cyr@amd.com> Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/hwss/dcn20')
-rw-r--r--drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
index 0dfcb3cdcd20..bc71a9b058fe 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
@@ -1882,6 +1882,42 @@ static void dcn20_program_pipe(
}
}
+static void update_vmin_vmax_fams(struct dc *dc,
+ struct dc_state *context)
+{
+ uint32_t i;
+ struct drr_params params = {0};
+ bool subvp_in_use = resource_subvp_in_use(dc, context);
+
+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
+ struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
+
+ if (resource_is_pipe_type(pipe, OTG_MASTER) &&
+ ((subvp_in_use && dc_state_get_pipe_subvp_type(context, pipe) != SUBVP_PHANTOM &&
+ pipe->stream->allow_freesync) || (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && pipe->stream->fpo_in_use))) {
+ if (!pipe->stream->vrr_active_variable && !pipe->stream->vrr_active_fixed) {
+ struct timing_generator *tg = context->res_ctx.pipe_ctx[i].stream_res.tg;
+
+ /* DRR should be configured already if we're in active variable
+ * or active fixed, so only program if we're not in this state
+ */
+ params.vertical_total_min = pipe->stream->timing.v_total;
+ params.vertical_total_max = pipe->stream->timing.v_total;
+ tg->funcs->set_drr(tg, &params);
+ }
+ } else {
+ if (resource_is_pipe_type(pipe, OTG_MASTER) &&
+ !pipe->stream->vrr_active_variable &&
+ !pipe->stream->vrr_active_fixed) {
+ struct timing_generator *tg = context->res_ctx.pipe_ctx[i].stream_res.tg;
+ params.vertical_total_min = 0;
+ params.vertical_total_max = 0;
+ tg->funcs->set_drr(tg, &params);
+ }
+ }
+ }
+}
+
void dcn20_program_front_end_for_ctx(
struct dc *dc,
struct dc_state *context)
@@ -1958,6 +1994,7 @@ void dcn20_program_front_end_for_ctx(
&& context->res_ctx.pipe_ctx[i].stream)
hws->funcs.blank_pixel_data(dc, &context->res_ctx.pipe_ctx[i], true);
+ update_vmin_vmax_fams(dc, context);
/* Disconnect mpcc */
for (i = 0; i < dc->res_pool->pipe_count; i++)