diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-11-13 22:00:01 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-12-21 16:42:37 -0500 |
commit | d39d5c2c9dcfb9e9aec2be154784a12f5b4a6c97 (patch) | |
tree | 52e3c5f18c3d973b5c3d1e45ecfcb39412844050 /drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c | |
parent | 92b05d827df2ffe348f7dc2cfb67807a4efdadd2 (diff) | |
download | op-kernel-dev-d39d5c2c9dcfb9e9aec2be154784a12f5b4a6c97.zip op-kernel-dev-d39d5c2c9dcfb9e9aec2be154784a12f5b4a6c97.tar.gz |
drm/amd/powerplay: add atomctrl function to calculate CZ sclk dividers
Use atombios to calculate the values.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c index 8b47ea0..ea87c90 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c @@ -313,6 +313,28 @@ int atomctrl_get_memory_pll_dividers_vi(struct pp_hwmgr *hwmgr, return result; } +int atomctrl_get_engine_pll_dividers_kong(struct pp_hwmgr *hwmgr, + uint32_t clock_value, + pp_atomctrl_clock_dividers_kong *dividers) +{ + COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V4 pll_parameters; + int result; + + pll_parameters.ulClock = clock_value; + + result = cgs_atom_exec_cmd_table + (hwmgr->device, + GetIndexIntoMasterTable(COMMAND, ComputeMemoryEnginePLL), + &pll_parameters); + + if (0 == result) { + dividers->pll_post_divider = pll_parameters.ucPostDiv; + dividers->real_clock = pll_parameters.ulClock; + } + + return result; +} + int atomctrl_get_engine_pll_dividers_vi( struct pp_hwmgr *hwmgr, uint32_t clock_value, |