Skip to content

Commit d767b09

Browse files
Timur Kristófgregkh
authored andcommitted
drm/amd/display: Adjust DCE 8-10 clock, don't overclock by 15%
[ Upstream commit 1fc931b ] Adjust the nominal (and performance) clocks for DCE 8-10, and set them to 625 MHz, which is the value used by the legacy display code in amdgpu_atombios_get_clock_info. This was tested with Hawaii, Tonga and Fiji. These GPUs can output 4K 60Hz (10-bit depth) at 625 MHz. The extra 15% clock was added as a workaround for a Polaris issue which uses DCE 11, and should not have been used on DCE 8-10 which are already hardcoded to the highest possible display clock. Unfortunately, the extra 15% was mistakenly copied and kept even on code paths which don't affect Polaris. This commit fixes that and also adds a check to make sure not to exceed the maximum DCE 8-10 display clock. Fixes: 8cd61c3 ("drm/amd/display: Raise dispclk value for Polaris") Fixes: dc88b4a ("drm/amd/display: make clk mgr soc specific") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 1ae45b5) Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2ee86b7 commit d767b09

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ static const struct state_dependent_clocks dce80_max_clks_by_state[] = {
7272
/* ClocksStateLow */
7373
{ .display_clk_khz = 352000, .pixel_clk_khz = 330000},
7474
/* ClocksStateNominal */
75-
{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 },
75+
{ .display_clk_khz = 625000, .pixel_clk_khz = 400000 },
7676
/* ClocksStatePerformance */
77-
{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 } };
77+
{ .display_clk_khz = 625000, .pixel_clk_khz = 400000 } };
7878

7979
int dentist_get_divider_from_did(int did)
8080
{
@@ -403,11 +403,9 @@ static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
403403
{
404404
struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
405405
struct dm_pp_power_level_change_request level_change_req;
406-
int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
407-
408-
/*TODO: W/A for dal3 linux, investigate why this works */
409-
if (!clk_mgr_dce->dfs_bypass_active)
410-
patched_disp_clk = patched_disp_clk * 115 / 100;
406+
const int max_disp_clk =
407+
clk_mgr_dce->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
408+
int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
411409

412410
level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
413411
/* get max clock state from PPLIB */

0 commit comments

Comments
 (0)