Commit 39bca359 authored by Charlene Liu's avatar Charlene Liu Committed by Alex Deucher

drm/amd/display: add a option to force the clock at every mode change.

[Description]
This is for HW negative stress testing use.
force reset the dispclk and dppclk even the same clock already set in HW.
Signed-off-by: default avatarCharlene Liu <charlene.liu@amd.com>
Reviewed-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 54eef8a4
...@@ -151,7 +151,14 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base, ...@@ -151,7 +151,14 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base,
bool enter_display_off = false; bool enter_display_off = false;
bool dpp_clock_lowered = false; bool dpp_clock_lowered = false;
struct dmcu *dmcu = clk_mgr_base->ctx->dc->res_pool->dmcu; struct dmcu *dmcu = clk_mgr_base->ctx->dc->res_pool->dmcu;
bool force_reset = false;
if (clk_mgr_base->clks.dispclk_khz == 0 ||
dc->debug.force_clock_mode & 0x1) {
//this is from resume or boot up, if forced_clock cfg option used, we bypass program dispclk and DPPCLK, but need set them for S3.
force_reset = true;
//force_clock_mode 0x1: force reset the clock even it is the same clock as long as it is in Passive level.
}
display_count = clk_mgr_helper_get_active_display_cnt(dc, context); display_count = clk_mgr_helper_get_active_display_cnt(dc, context);
if (dc->res_pool->pp_smu) if (dc->res_pool->pp_smu)
pp_smu = &dc->res_pool->pp_smu->nv_funcs; pp_smu = &dc->res_pool->pp_smu->nv_funcs;
...@@ -223,7 +230,7 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base, ...@@ -223,7 +230,7 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base,
update_dispclk = true; update_dispclk = true;
} }
if (dc->config.forced_clocks == false) { if (dc->config.forced_clocks == false || (force_reset && safe_to_lower)) {
if (dpp_clock_lowered) { if (dpp_clock_lowered) {
// if clock is being lowered, increase DTO before lowering refclk // if clock is being lowered, increase DTO before lowering refclk
dcn20_update_clocks_update_dpp_dto(clk_mgr, context); dcn20_update_clocks_update_dpp_dto(clk_mgr, context);
......
...@@ -385,6 +385,7 @@ struct dc_debug_options { ...@@ -385,6 +385,7 @@ struct dc_debug_options {
#if defined(CONFIG_DRM_AMD_DC_DCN2_0) #if defined(CONFIG_DRM_AMD_DC_DCN2_0)
bool cm_in_bypass; bool cm_in_bypass;
#endif #endif
int force_clock_mode;/*every mode change.*/
}; };
struct dc_debug_data { struct dc_debug_data {
......
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