mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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 <aric.cyr@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Aric Cyr <aric.cyr@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
82a10aff94
commit
32953485c5
@ -400,6 +400,13 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't adjust DRR while there's bandwidth optimizations pending to
|
||||||
|
* avoid conflicting with firmware updates.
|
||||||
|
*/
|
||||||
|
if (dc->optimized_required || dc->wm_optimized_required)
|
||||||
|
return false;
|
||||||
|
|
||||||
stream->adjust.v_total_max = adjust->v_total_max;
|
stream->adjust.v_total_max = adjust->v_total_max;
|
||||||
stream->adjust.v_total_mid = adjust->v_total_mid;
|
stream->adjust.v_total_mid = adjust->v_total_mid;
|
||||||
stream->adjust.v_total_mid_frame_num = adjust->v_total_mid_frame_num;
|
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)
|
|||||||
|
|
||||||
post_surface_trace(dc);
|
post_surface_trace(dc);
|
||||||
|
|
||||||
if (dc->ctx->dce_version >= DCE_VERSION_MAX)
|
/*
|
||||||
TRACE_DCN_CLOCK_STATE(&context->bw_ctx.bw.dcn.clk);
|
* Only relevant for DCN behavior where we can guarantee the optimization
|
||||||
else
|
* is safe to apply - retain the legacy behavior for DCE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (dc->ctx->dce_version < DCE_VERSION_MAX)
|
||||||
TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
|
TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
|
||||||
|
else {
|
||||||
|
TRACE_DCN_CLOCK_STATE(&context->bw_ctx.bw.dcn.clk);
|
||||||
|
|
||||||
if (is_flip_pending_in_pipes(dc, context))
|
if (is_flip_pending_in_pipes(dc, context))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < dc->res_pool->pipe_count; i++)
|
for (i = 0; i < dc->res_pool->pipe_count; i++)
|
||||||
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
|
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
|
||||||
context->res_ctx.pipe_ctx[i].plane_state == NULL) {
|
context->res_ctx.pipe_ctx[i].plane_state == NULL) {
|
||||||
context->res_ctx.pipe_ctx[i].pipe_idx = i;
|
context->res_ctx.pipe_ctx[i].pipe_idx = i;
|
||||||
dc->hwss.disable_plane(dc, &context->res_ctx.pipe_ctx[i]);
|
dc->hwss.disable_plane(dc, &context->res_ctx.pipe_ctx[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
process_deferred_updates(dc);
|
process_deferred_updates(dc);
|
||||||
|
|
||||||
dc->hwss.optimize_bandwidth(dc, context);
|
dc->hwss.optimize_bandwidth(dc, context);
|
||||||
|
|
||||||
if (dc->debug.enable_double_buffered_dsc_pg_support)
|
if (dc->debug.enable_double_buffered_dsc_pg_support)
|
||||||
dc->hwss.update_dsc_pg(dc, context, true);
|
dc->hwss.update_dsc_pg(dc, context, true);
|
||||||
|
}
|
||||||
|
|
||||||
dc->optimized_required = false;
|
dc->optimized_required = false;
|
||||||
dc->wm_optimized_required = false;
|
dc->wm_optimized_required = false;
|
||||||
@ -4169,12 +4182,9 @@ void dc_commit_updates_for_stream(struct dc *dc,
|
|||||||
if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
|
if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
|
||||||
new_pipe->plane_state->force_full_update = true;
|
new_pipe->plane_state->force_full_update = true;
|
||||||
}
|
}
|
||||||
} else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
|
} else if (update_type == UPDATE_TYPE_FAST) {
|
||||||
/*
|
/*
|
||||||
* Previous frame finished and HW is ready for optimization.
|
* Previous frame finished and HW is ready for optimization.
|
||||||
*
|
|
||||||
* Only relevant for DCN behavior where we can guarantee the optimization
|
|
||||||
* is safe to apply - retain the legacy behavior for DCE.
|
|
||||||
*/
|
*/
|
||||||
dc_post_update_surfaces_to_stream(dc);
|
dc_post_update_surfaces_to_stream(dc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user