From: Kevin Wang Date: Mon, 11 Mar 2019 03:00:48 +0000 (+0800) Subject: drm/amd/powerplay: move the smc_if_version to asic file X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1fb4f15548240df4f4bd9a855ee09942d6accc74;p=openwrt%2Fstaging%2Fblogic.git drm/amd/powerplay: move the smc_if_version to asic file each asic may be has different smc if version, so move its to asic file to implement. Signed-off-by: Kevin Wang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h index 6a4e9f242aaf..2083139533e9 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h @@ -401,6 +401,8 @@ struct smu_context uint32_t workload_setting[WORKLOAD_POLICY_MAX]; uint32_t power_profile_mode; uint32_t default_power_profile_mode; + + uint32_t smc_if_version; }; struct pptable_funcs { diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index f90410435e4c..17143888e37e 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -234,8 +234,8 @@ static int smu_v11_0_check_fw_version(struct smu_context *smu) if (ret) goto err; - if (smu_version == SMU11_DRIVER_IF_VERSION) - return 0; + if (smu_version != smu->smc_if_version) + ret = -EINVAL; err: return ret; } diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index c2135baf7976..7e9e8ad9a300 100644 --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c @@ -2408,4 +2408,5 @@ static const struct pptable_funcs vega20_ppt_funcs = { void vega20_set_ppt_funcs(struct smu_context *smu) { smu->ppt_funcs = &vega20_ppt_funcs; + smu->smc_if_version = SMU11_DRIVER_IF_VERSION; }