Skip to content

Commit 3295348

Browse files
AMD-aricalexdeucher
authored andcommitted
drm/amd/display: Do not update DRR while BW optimizations pending
[why] While bandwidth optimizations are pending, it's possible a pstate change will occur. During this time, VSYNC handler should not also try to update DRR parameters causing pstate hang [how] Do not adjust DRR if optimize bandwidth is set. Reviewed-by: Aric Cyr <[email protected]> Acked-by: Qingqing Zhuo <[email protected]> Signed-off-by: Aric Cyr <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 82a10af commit 3295348

File tree

1 file changed

+29
-19
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+29
-19
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,13 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
400400
{
401401
int i;
402402

403+
/*
404+
* Don't adjust DRR while there's bandwidth optimizations pending to
405+
* avoid conflicting with firmware updates.
406+
*/
407+
if (dc->optimized_required || dc->wm_optimized_required)
408+
return false;
409+
403410
stream->adjust.v_total_max = adjust->v_total_max;
404411
stream->adjust.v_total_mid = adjust->v_total_mid;
405412
stream->adjust.v_total_mid_frame_num = adjust->v_total_mid_frame_num;
@@ -2180,27 +2187,33 @@ void dc_post_update_surfaces_to_stream(struct dc *dc)
21802187

21812188
post_surface_trace(dc);
21822189

2183-
if (dc->ctx->dce_version >= DCE_VERSION_MAX)
2184-
TRACE_DCN_CLOCK_STATE(&context->bw_ctx.bw.dcn.clk);
2185-
else
2190+
/*
2191+
* Only relevant for DCN behavior where we can guarantee the optimization
2192+
* is safe to apply - retain the legacy behavior for DCE.
2193+
*/
2194+
2195+
if (dc->ctx->dce_version < DCE_VERSION_MAX)
21862196
TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
2197+
else {
2198+
TRACE_DCN_CLOCK_STATE(&context->bw_ctx.bw.dcn.clk);
21872199

2188-
if (is_flip_pending_in_pipes(dc, context))
2189-
return;
2200+
if (is_flip_pending_in_pipes(dc, context))
2201+
return;
21902202

2191-
for (i = 0; i < dc->res_pool->pipe_count; i++)
2192-
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
2193-
context->res_ctx.pipe_ctx[i].plane_state == NULL) {
2194-
context->res_ctx.pipe_ctx[i].pipe_idx = i;
2195-
dc->hwss.disable_plane(dc, &context->res_ctx.pipe_ctx[i]);
2196-
}
2203+
for (i = 0; i < dc->res_pool->pipe_count; i++)
2204+
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
2205+
context->res_ctx.pipe_ctx[i].plane_state == NULL) {
2206+
context->res_ctx.pipe_ctx[i].pipe_idx = i;
2207+
dc->hwss.disable_plane(dc, &context->res_ctx.pipe_ctx[i]);
2208+
}
21972209

2198-
process_deferred_updates(dc);
2210+
process_deferred_updates(dc);
21992211

2200-
dc->hwss.optimize_bandwidth(dc, context);
2212+
dc->hwss.optimize_bandwidth(dc, context);
22012213

2202-
if (dc->debug.enable_double_buffered_dsc_pg_support)
2203-
dc->hwss.update_dsc_pg(dc, context, true);
2214+
if (dc->debug.enable_double_buffered_dsc_pg_support)
2215+
dc->hwss.update_dsc_pg(dc, context, true);
2216+
}
22042217

22052218
dc->optimized_required = false;
22062219
dc->wm_optimized_required = false;
@@ -4169,12 +4182,9 @@ void dc_commit_updates_for_stream(struct dc *dc,
41694182
if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
41704183
new_pipe->plane_state->force_full_update = true;
41714184
}
4172-
} else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
4185+
} else if (update_type == UPDATE_TYPE_FAST) {
41734186
/*
41744187
* Previous frame finished and HW is ready for optimization.
4175-
*
4176-
* Only relevant for DCN behavior where we can guarantee the optimization
4177-
* is safe to apply - retain the legacy behavior for DCE.
41784188
*/
41794189
dc_post_update_surfaces_to_stream(dc);
41804190
}

0 commit comments

Comments
 (0)