mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 09:02:21 -04:00
drm/amd/pm: Unify version check in SMUv12
Use common helper function for firmware version check and logging in SMUv12. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -35,8 +35,6 @@
|
||||
|
||||
int smu_v12_0_check_fw_status(struct smu_context *smu);
|
||||
|
||||
int smu_v12_0_check_fw_version(struct smu_context *smu);
|
||||
|
||||
int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate);
|
||||
|
||||
int smu_v12_0_powergate_vcn(struct smu_context *smu, bool gate);
|
||||
|
||||
@@ -1457,7 +1457,7 @@ static const struct pptable_funcs renoir_ppt_funcs = {
|
||||
.get_power_profile_mode = renoir_get_power_profile_mode,
|
||||
.read_sensor = renoir_read_sensor,
|
||||
.check_fw_status = smu_v12_0_check_fw_status,
|
||||
.check_fw_version = smu_v12_0_check_fw_version,
|
||||
.check_fw_version = smu_cmn_check_fw_version,
|
||||
.powergate_sdma = smu_v12_0_powergate_sdma,
|
||||
.set_gfx_cgpg = smu_v12_0_set_gfx_cgpg,
|
||||
.gfx_off_control = smu_v12_0_gfx_off_control,
|
||||
|
||||
@@ -70,42 +70,6 @@ int smu_v12_0_check_fw_status(struct smu_context *smu)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
int smu_v12_0_check_fw_version(struct smu_context *smu)
|
||||
{
|
||||
struct amdgpu_device *adev = smu->adev;
|
||||
uint32_t if_version = 0xff, smu_version = 0xff;
|
||||
uint8_t smu_program, smu_major, smu_minor, smu_debug;
|
||||
int ret = 0;
|
||||
|
||||
ret = smu_cmn_get_smc_version(smu, &if_version, &smu_version);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
smu_program = (smu_version >> 24) & 0xff;
|
||||
smu_major = (smu_version >> 16) & 0xff;
|
||||
smu_minor = (smu_version >> 8) & 0xff;
|
||||
smu_debug = (smu_version >> 0) & 0xff;
|
||||
if (smu->is_apu)
|
||||
adev->pm.fw_version = smu_version;
|
||||
|
||||
/*
|
||||
* 1. if_version mismatch is not critical as our fw is designed
|
||||
* to be backward compatible.
|
||||
* 2. New fw usually brings some optimizations. But that's visible
|
||||
* only on the paired driver.
|
||||
* Considering above, we just leave user a verbal message instead
|
||||
* of halt driver loading.
|
||||
*/
|
||||
if (if_version != smu->smc_driver_if_version) {
|
||||
dev_info(smu->adev->dev, "smu driver if version = 0x%08x, smu fw if version = 0x%08x, "
|
||||
"smu fw program = %d, smu fw version = 0x%08x (%d.%d.%d)\n",
|
||||
smu->smc_driver_if_version, if_version,
|
||||
smu_program, smu_version, smu_major, smu_minor, smu_debug);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate)
|
||||
{
|
||||
if (!smu->is_apu)
|
||||
|
||||
Reference in New Issue
Block a user