OSDN Git Service

drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish
authorLang Yu <Lang.Yu@amd.com>
Mon, 24 Jan 2022 06:25:34 +0000 (14:25 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jan 2022 23:00:34 +0000 (18:00 -0500)
commitd435c1ed56b9f9347189924395588cfdf7489af5
tree4a35248fdbfca8cfb8bd0dec40b6985b79ea1fd8
parente9287ef8d46cee538c9a71bb8978b2f7e975c452
drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish

Some clients(e.g., kfd) query sclk/mclk through this function.
As cyan skillfish doesn't support dpm, for sclk, set min/max
to CYAN_SKILLFISH_SCLK_MIN/CYAN_SKILLFISH_SCLK_MAX(to maintain the
existing logic).For others, set both min and max to current value.

Before this patch:
 # /opt/rocm/opencl/bin/clinfo

 Max clock frequency:                           0Mhz

After this patch:
 # /opt/rocm/opencl/bin/clinfo

 Max clock frequency:                           2000Mhz

v2:
 - Maintain the existing min/max sclk logic.(Lijo)
v3:
 - Avoid fetching metrics table twice.(Lijo)

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c