Commit 0f56b418 authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher

drm/amd/display: add dcfclk reporting to pplib

Signed-off-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 70814f6f
...@@ -1065,7 +1065,7 @@ bool dc_pre_update_surfaces_to_stream( ...@@ -1065,7 +1065,7 @@ bool dc_pre_update_surfaces_to_stream(
{ {
int i, j; int i, j;
struct core_dc *core_dc = DC_TO_CORE(dc); struct core_dc *core_dc = DC_TO_CORE(dc);
uint32_t prev_disp_clk = core_dc->current_context->bw_results.dispclk_khz; int prev_disp_clk = core_dc->current_context->bw_results.dispclk_khz;
int new_disp_clk; int new_disp_clk;
struct dc_stream_status *stream_status = NULL; struct dc_stream_status *stream_status = NULL;
struct validate_context *context; struct validate_context *context;
...@@ -1146,6 +1146,7 @@ bool dc_pre_update_surfaces_to_stream( ...@@ -1146,6 +1146,7 @@ bool dc_pre_update_surfaces_to_stream(
} }
} }
if (core_dc->res_pool->funcs->validate_bandwidth)
if (core_dc->res_pool->funcs->validate_bandwidth(core_dc, context) != DC_OK) { if (core_dc->res_pool->funcs->validate_bandwidth(core_dc, context) != DC_OK) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
ret = false; ret = false;
...@@ -1153,29 +1154,15 @@ bool dc_pre_update_surfaces_to_stream( ...@@ -1153,29 +1154,15 @@ bool dc_pre_update_surfaces_to_stream(
} }
new_disp_clk = context->bw_results.dispclk_khz; new_disp_clk = context->bw_results.dispclk_khz;
if (core_dc->res_pool->funcs->apply_clk_constraints) { if (!IS_FPGA_MAXIMUS_DC(core_dc->ctx->dce_environment)
temp_context = core_dc->res_pool->funcs->apply_clk_constraints( && prev_disp_clk < new_disp_clk) {
core_dc,
context);
if (!temp_context) {
dm_error("%s:failed apply clk constraints\n", __func__);
ret = false;
goto unexpected_fail;
}
resource_validate_ctx_destruct(context);
ASSERT(core_dc->scratch_val_ctx == temp_context);
core_dc->scratch_val_ctx = context;
context = temp_context;
}
if (prev_disp_clk < new_disp_clk) {
pplib_apply_display_requirements(core_dc, context, pplib_apply_display_requirements(core_dc, context,
&context->pp_display_cfg); &context->pp_display_cfg);
context->res_ctx.pool->display_clock->funcs->set_clock( context->res_ctx.pool->display_clock->funcs->set_clock(
context->res_ctx.pool->display_clock, context->res_ctx.pool->display_clock,
context->bw_results.dispclk_khz * 115 / 100); new_disp_clk * 115 / 100);
core_dc->current_context->bw_results.dispclk_khz = core_dc->current_context->bw_results.dispclk_khz = new_disp_clk;
context->bw_results.dispclk_khz; core_dc->current_context->dispclk_khz = new_disp_clk;
} }
for (i = 0; i < new_surface_count; i++) for (i = 0; i < new_surface_count; i++)
...@@ -1211,10 +1198,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc) ...@@ -1211,10 +1198,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
core_dc->hwss.power_down_front_end( core_dc->hwss.power_down_front_end(
core_dc, &core_dc->current_context->res_ctx.pipe_ctx[i]); core_dc, &core_dc->current_context->res_ctx.pipe_ctx[i]);
} }
if (core_dc->res_pool->funcs->validate_bandwidth)
if (core_dc->res_pool->funcs->validate_bandwidth(
if (core_dc->res_pool->funcs->validate_bandwidth(core_dc, core_dc->current_context) core_dc, core_dc->current_context) != DC_OK) {
!= DC_OK) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
return false; return false;
} }
......
...@@ -316,6 +316,7 @@ struct validate_context { ...@@ -316,6 +316,7 @@ struct validate_context {
struct bw_calcs_output bw_results; struct bw_calcs_output bw_results;
/* Note: these are big structures, do *not* put on stack! */ /* Note: these are big structures, do *not* put on stack! */
struct dm_pp_display_configuration pp_display_cfg; struct dm_pp_display_configuration pp_display_cfg;
int dispclk_khz;
}; };
#endif /* _CORE_TYPES_H_ */ #endif /* _CORE_TYPES_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment