drm/amd/powerplay: fix pre-check condition for setting clock range
authorPrike Liang <Prike.Liang@amd.com>
Mon, 2 Mar 2020 01:36:15 +0000 (09:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Mar 2020 14:42:08 +0000 (09:42 -0500)
commit80381d40c9bf5218db06a7d7246c5478c95987ee
treef3f6ea8f9e2b320e5a17fd67e0e00783d21a9214
parenta0275dfc82c9034eefbeffd556cca6dd239d7925
drm/amd/powerplay: fix pre-check condition for setting clock range

This fix will handle some MP1 FW issue like as mclk dpm table in renoir has a reverse
dpm clock layout and a zero frequency dpm level as following case.

cat pp_dpm_mclk
0: 1200Mhz
1: 1200Mhz
2: 800Mhz
3: 0Mhz

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
drivers/gpu/drm/amd/powerplay/smu_v12_0.c