From: Felix Kuehling Date: Mon, 27 Nov 2017 23:29:43 +0000 (-0500) Subject: drm/amdgpu: fix get_max_engine_clock_in_mhz X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a9efcc19161e20623c285fac967a32842972cebe;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: fix get_max_engine_clock_in_mhz Use proper powerplay function. This fixes OpenCL initialization problems. Signed-off-by: Felix Kuehling Acked-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 896b16db58aa..01aa851938f8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -298,6 +298,9 @@ uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd) { struct amdgpu_device *adev = (struct amdgpu_device *)kgd; - /* The sclk is in quantas of 10kHz */ - return adev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk / 100; + /* the sclk is in quantas of 10kHz */ + if (amdgpu_sriov_vf(adev)) + return adev->clock.default_sclk / 100; + + return amdgpu_dpm_get_sclk(adev, false) / 100; }