drm/amd/pm: avoid to load smu firmware for APUs
Subsystems (3)
PATCH 1/1 drm/amd/pm: avoid to load smu firmware for APUs
Certain call paths still load the SMU firmware for APUs, which needs to be skipped.
Signed-off-by Tim Huang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 8 +++----- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 +++----- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 +++----- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -5
@@ -7324,11 +7324,9 @@ static int gfx_v10_0_hw_init(void *handle)* loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ -if (!(adev->flags &AMD_IS_APU )) { - r =amdgpu_pm_load_smu_firmware (adev,NULL ); -if (r) -return r; - } + r =amdgpu_pm_load_smu_firmware (adev,NULL ); +if (r) +return r;gfx_v10_0_disable_gpa_mode (adev); }
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -5
@@ -4558,11 +4558,9 @@ static int gfx_v11_0_hw_init(void *handle)* loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ -if (!(adev->flags &AMD_IS_APU )) { - r =amdgpu_pm_load_smu_firmware (adev,NULL ); -if (r) -return r; - } + r =amdgpu_pm_load_smu_firmware (adev,NULL ); +if (r) +return r; }gfx_v11_0_constants_init (adev);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +3 -5
@@ -3306,11 +3306,9 @@ static int gfx_v12_0_hw_init(void *handle)* loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ -if (!(adev->flags &AMD_IS_APU )) { - r =amdgpu_pm_load_smu_firmware (adev,NULL ); -if (r) -return r; - } + r =amdgpu_pm_load_smu_firmware (adev,NULL ); +if (r) +return r; }gfx_v12_0_constants_init (adev);
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +1 -1
@@ -618,7 +618,7 @@ int amdgpu_pm_load_smu_firmware(struct amdgpu_device *adev, uint32_t *smu_versioconst struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;int r =0 ; -if (!pp_funcs || !pp_funcs->load_firmware) +if (!pp_funcs || !pp_funcs->load_firmware || adev->flags &AMD_IS_APU )return 0 ;mutex_lock (&adev->pm.mutex);
Signature · 1 line
2.43.0
[Public]
Reviewed-by Alex Deucher <[email protected]>
________________________________
From: Huang, Tim <[email protected]>
Sent: Sunday, June 30, 2024 11:45 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Tim <[email protected]>
Subject: [PATCH] drm/amd/pm: avoid to load smu firmware for APUs
Certain call paths still load the SMU firmware for APUs, which needs to be skipped.
Signed-off-by Tim Huang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 8 +++----- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 +++----- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 +++----- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -5
@@ -7324,11 +7324,9 @@ static int gfx_v10_0_hw_init(void *handle)* loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ -if (!(adev->flags &AMD_IS_APU )) { - r =amdgpu_pm_load_smu_firmware (adev,NULL ); -if (r) -return r; - } + r =amdgpu_pm_load_smu_firmware (adev,NULL ); +if (r) +return r;gfx_v10_0_disable_gpa_mode (adev); }
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -5
@@ -4558,11 +4558,9 @@ static int gfx_v11_0_hw_init(void *handle)* loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ -if (!(adev->flags &AMD_IS_APU )) { - r =amdgpu_pm_load_smu_firmware (adev,NULL ); -if (r) -return r; - } + r =amdgpu_pm_load_smu_firmware (adev,NULL ); +if (r) +return r; }gfx_v11_0_constants_init (adev);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +3 -5
@@ -3306,11 +3306,9 @@ static int gfx_v12_0_hw_init(void *handle)* loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ -if (!(adev->flags &AMD_IS_APU )) { - r =amdgpu_pm_load_smu_firmware (adev,NULL ); -if (r) -return r; - } + r =amdgpu_pm_load_smu_firmware (adev,NULL ); +if (r) +return r; }gfx_v12_0_constants_init (adev);
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +1 -1
@@ -618,7 +618,7 @@ int amdgpu_pm_load_smu_firmware(struct amdgpu_device *adev, uint32_t *smu_versioconst struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;int r =0 ; -if (!pp_funcs || !pp_funcs->load_firmware) +if (!pp_funcs || !pp_funcs->load_firmware || adev->flags &AMD_IS_APU )return 0 ;mutex_lock (&adev->pm.mutex);
--
2.43.0