struct drm_device *ddev = dev_get_drvdata(dev);
struct amdgpu_device *adev = ddev->dev_private;
- if (adev->smu.ppt_funcs)
+ if (is_support_sw_smu(adev))
return smu_print_clk_levels(&adev->smu, PP_SCLK, buf);
else if (adev->powerplay.pp_funcs->print_clock_levels)
return amdgpu_dpm_print_clock_levels(adev, PP_SCLK, buf);
struct drm_device *ddev = dev_get_drvdata(dev);
struct amdgpu_device *adev = ddev->dev_private;
- if (adev->smu.ppt_funcs)
+ if (is_support_sw_smu(adev))
return smu_print_clk_levels(&adev->smu, PP_MCLK, buf);
else if (adev->powerplay.pp_funcs->print_clock_levels)
return amdgpu_dpm_print_clock_levels(adev, PP_MCLK, buf);
amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);
if (!amdgpu_sriov_vf(adev)) {
- if (amdgpu_dpm == 1 && adev->asic_type >= CHIP_VEGA20)
+ if (is_support_sw_smu(adev))
amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
else
amdgpu_device_ip_block_add(adev, &pp_smu_ip_block);
return ret;
}
+bool is_support_sw_smu(struct amdgpu_device *adev)
+{
+ if (amdgpu_dpm != 1)
+ return false;
+
+ if (adev->asic_type >= CHIP_VEGA20)
+ return true;
+
+ return false;
+}
+
int smu_feature_init_dpm(struct smu_context *smu)
{
struct smu_feature *feature = &smu->smu_feature;
struct smu_context *smu = &adev->smu;
int ret;
- if (adev->asic_type < CHIP_VEGA20)
+ if (!is_support_sw_smu(adev))
return -EINVAL;
smu->pool_size = adev->pm.smu_prv_buffer_size;
struct smu_context *smu = &adev->smu;
int ret;
- if (adev->asic_type < CHIP_VEGA20)
+ if (!is_support_sw_smu(adev))
return -EINVAL;
ret = smu_smc_table_sw_fini(smu);
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct smu_context *smu = &adev->smu;
- if (adev->asic_type < CHIP_VEGA20)
+ if (!is_support_sw_smu(adev))
return -EINVAL;
if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
struct smu_table_context *table_context = &smu->smu_table;
int ret = 0;
- if (adev->asic_type < CHIP_VEGA20)
+ if (!is_support_sw_smu(adev))
return -EINVAL;
if (!table_context->driver_pptable)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- if (adev->asic_type < CHIP_VEGA20)
+ if (!is_support_sw_smu(adev))
return -EINVAL;
return 0;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct smu_context *smu = &adev->smu;
- if (adev->asic_type < CHIP_VEGA20)
+ if (!is_support_sw_smu(adev))
return -EINVAL;
pr_info("SMU is resuming...\n");