drm/amdgpu: fix modprobe failure for uvd_4/5/6
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix modprobe failure for uvd_4/5/6
For uvd_4/5/6, amdgpu driver will only power on them when there are jobs assigned to decode/enc rings.uvd_4/5/6 dpm was broken since amdgpu_dpm_set_powergating_by_smu only covers gfx block.
The change would add more IP block support in amdgpu_dpm_set_powergating_by_smu For GFX/UVD/VCN/VCE, if the new SMU driver is supported, invoke new power gate helper function smu_dpm_set_power_gate, otherwise, fallback to legacy powerplay helper function pp_set_powergating_by_smu. For other IP blocks always invoke legacy powerplay helper function.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 11 ++++++++++- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +10 -1
@@ -948,12 +948,21 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t blockswitch (block_type) {case AMD_IP_BLOCK_TYPE_GFX : +case AMD_IP_BLOCK_TYPE_UVD : +case AMD_IP_BLOCK_TYPE_VCN : +case AMD_IP_BLOCK_TYPE_VCE :if (swsmu) - ret =smu_gfx_off_control (&adev->smu, gate); + ret =smu_dpm_set_power_gate (&adev->smu, block_type, gate);else ret = ((adev)->powerplay.pp_funcs->set_powergating_by_smu ( (adev)->powerplay.pp_handle, block_type, gate));break ; +case AMD_IP_BLOCK_TYPE_GMC : +case AMD_IP_BLOCK_TYPE_ACP : +case AMD_IP_BLOCK_TYPE_SDMA : + ret = ((adev)->powerplay.pp_funcs->set_powergating_by_smu ( + (adev)->powerplay.pp_handle, block_type, gate)); +break ;default :break ; }
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -233,6 +233,9 @@ int smu_dpm_set_power_gate(struct smu_context *smu, uint32_t block_type,case AMD_IP_BLOCK_TYPE_VCE : ret =smu_dpm_set_vce_enable (smu, gate);break ; +case AMD_IP_BLOCK_TYPE_GFX : + ret =smu_gfx_off_control (smu, gate); +break ;default :break ; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1561377497-2257-1-git-send-email-Hawking.Zhang-5C7GfCeVMHo@public.gmane.org
Yin, Tianci (Rico)
Reviewed-by________________________________
From: Hawking Zhang <[email protected]>
Sent: Monday, June 24, 2019 19:58
To: [email protected]; Deucher, Alexander; Yin, Tianci (Rico)
Cc: Zhang, Hawking
Subject: [PATCH] drm/amdgpu: fix modprobe failure for uvd_4/5/6
For uvd_4/5/6, amdgpu driver will only power on them when there are jobs assigned to decode/enc rings.uvd_4/5/6 dpm was broken since amdgpu_dpm_set_powergating_by_smu only covers gfx block.
The change would add more IP block support in amdgpu_dpm_set_powergating_by_smu For GFX/UVD/VCN/VCE, if the new SMU driver is supported, invoke new power gate helper function smu_dpm_set_power_gate, otherwise, fallback to legacy powerplay helper function pp_set_powergating_by_smu. For other IP blocks always invoke legacy powerplay helper function.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 11 ++++++++++- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +10 -1
@@ -948,12 +948,21 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t blockswitch (block_type) {case AMD_IP_BLOCK_TYPE_GFX : +case AMD_IP_BLOCK_TYPE_UVD : +case AMD_IP_BLOCK_TYPE_VCN : +case AMD_IP_BLOCK_TYPE_VCE :if (swsmu) - ret =smu_gfx_off_control (&adev->smu, gate); + ret =smu_dpm_set_power_gate (&adev->smu, block_type, gate);else ret = ((adev)->powerplay.pp_funcs->set_powergating_by_smu ( (adev)->powerplay.pp_handle, block_type, gate));break ; +case AMD_IP_BLOCK_TYPE_GMC : +case AMD_IP_BLOCK_TYPE_ACP : +case AMD_IP_BLOCK_TYPE_SDMA : + ret = ((adev)->powerplay.pp_funcs->set_powergating_by_smu ( + (adev)->powerplay.pp_handle, block_type, gate)); +break ;default :break ; }
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -233,6 +233,9 @@ int smu_dpm_set_power_gate(struct smu_context *smu, uint32_t block_type,case AMD_IP_BLOCK_TYPE_VCE : ret =smu_dpm_set_vce_enable (smu, gate);break ; +case AMD_IP_BLOCK_TYPE_GFX : + ret =smu_gfx_off_control (smu, gate); +break ;default :break ; }
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx