drm/amd/display: Init clock value by current vbios CLKs
[ Upstream commit 7e0b367db8
]
[Why]
While booting into OS, driver updates DPP/DISP CLKs.
But init clock value is zero which is invalid.
[How]
Get current clocks value to update init clocks.
To avoid underflow.
Signed-off-by: Brandon Syu <Brandon.Syu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
parent
c137a880ae
commit
12db619c91
|
@ -97,8 +97,17 @@ void rn_update_clocks(struct clk_mgr *clk_mgr_base,
|
|||
new_clocks->dppclk_khz = 100000;
|
||||
}
|
||||
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {
|
||||
if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
|
||||
/*
|
||||
* Temporally ignore thew 0 cases for disp and dpp clks.
|
||||
* We may have a new feature that requires 0 clks in the future.
|
||||
*/
|
||||
if (new_clocks->dppclk_khz == 0 || new_clocks->dispclk_khz == 0) {
|
||||
new_clocks->dppclk_khz = clk_mgr_base->clks.dppclk_khz;
|
||||
new_clocks->dispclk_khz = clk_mgr_base->clks.dispclk_khz;
|
||||
}
|
||||
|
||||
if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr_base->clks.dppclk_khz)) {
|
||||
if (clk_mgr_base->clks.dppclk_khz > new_clocks->dppclk_khz)
|
||||
dpp_clock_lowered = true;
|
||||
clk_mgr_base->clks.dppclk_khz = new_clocks->dppclk_khz;
|
||||
update_dppclk = true;
|
||||
|
|
Loading…
Reference in New Issue