|
@@ -327,13 +327,14 @@ static bool dce_clock_set_min_clocks_state(
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-static void dce_set_clock(
|
|
|
+static int dce_set_clock(
|
|
|
struct display_clock *clk,
|
|
|
int requested_clk_khz)
|
|
|
{
|
|
|
struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
|
|
|
struct bp_pixel_clock_parameters pxl_clk_params = { 0 };
|
|
|
struct dc_bios *bp = clk->ctx->dc_bios;
|
|
|
+ int actual_clock = requested_clk_khz;
|
|
|
|
|
|
/* Make sure requested clock isn't lower than minimum threshold*/
|
|
|
if (requested_clk_khz > 0)
|
|
@@ -351,15 +352,17 @@ static void dce_set_clock(
|
|
|
/* Cache the fixed display clock*/
|
|
|
clk_dce->dfs_bypass_disp_clk =
|
|
|
pxl_clk_params.dfs_bypass_display_clock;
|
|
|
+ actual_clock = pxl_clk_params.dfs_bypass_display_clock;
|
|
|
}
|
|
|
|
|
|
/* from power down, we need mark the clock state as ClocksStateNominal
|
|
|
* from HWReset, so when resume we will call pplib voltage regulator.*/
|
|
|
if (requested_clk_khz == 0)
|
|
|
clk->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
|
|
|
+ return actual_clock;
|
|
|
}
|
|
|
|
|
|
-static void dce_psr_set_clock(
|
|
|
+static int dce_psr_set_clock(
|
|
|
struct display_clock *clk,
|
|
|
int requested_clk_khz)
|
|
|
{
|
|
@@ -367,13 +370,15 @@ static void dce_psr_set_clock(
|
|
|
struct dc_context *ctx = clk_dce->base.ctx;
|
|
|
struct core_dc *core_dc = DC_TO_CORE(ctx->dc);
|
|
|
struct dmcu *dmcu = core_dc->res_pool->dmcu;
|
|
|
+ int actual_clk_khz = requested_clk_khz;
|
|
|
|
|
|
- dce_set_clock(clk, requested_clk_khz);
|
|
|
+ actual_clk_khz = dce_set_clock(clk, requested_clk_khz);
|
|
|
|
|
|
- dmcu->funcs->set_psr_wait_loop(dmcu, requested_clk_khz / 1000 / 7);
|
|
|
+ dmcu->funcs->set_psr_wait_loop(dmcu, actual_clk_khz / 1000 / 7);
|
|
|
+ return actual_clk_khz;
|
|
|
}
|
|
|
|
|
|
-static void dce112_set_clock(
|
|
|
+static int dce112_set_clock(
|
|
|
struct display_clock *clk,
|
|
|
int requested_clk_khz)
|
|
|
{
|
|
@@ -383,7 +388,7 @@ static void dce112_set_clock(
|
|
|
struct core_dc *core_dc = DC_TO_CORE(clk->ctx->dc);
|
|
|
struct abm *abm = core_dc->res_pool->abm;
|
|
|
struct dmcu *dmcu = core_dc->res_pool->dmcu;
|
|
|
-
|
|
|
+ int actual_clock = requested_clk_khz;
|
|
|
/* Prepare to program display clock*/
|
|
|
memset(&dce_clk_params, 0, sizeof(dce_clk_params));
|
|
|
|
|
@@ -397,6 +402,7 @@ static void dce112_set_clock(
|
|
|
dce_clk_params.clock_type = DCECLOCK_TYPE_DISPLAY_CLOCK;
|
|
|
|
|
|
bp->funcs->set_dce_clock(bp, &dce_clk_params);
|
|
|
+ actual_clock = dce_clk_params.target_clock_frequency;
|
|
|
|
|
|
/* from power down, we need mark the clock state as ClocksStateNominal
|
|
|
* from HWReset, so when resume we will call pplib voltage regulator.*/
|
|
@@ -415,8 +421,8 @@ static void dce112_set_clock(
|
|
|
|
|
|
if (abm->funcs->is_dmcu_initialized(abm))
|
|
|
dmcu->funcs->set_psr_wait_loop(dmcu,
|
|
|
- requested_clk_khz / 1000 / 7);
|
|
|
-
|
|
|
+ actual_clock / 1000 / 7);
|
|
|
+ return actual_clock;
|
|
|
}
|
|
|
|
|
|
static void dce_clock_read_integrated_info(struct dce_disp_clk *clk_dce)
|