Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add get_clockgating callback for nbio v6.1

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Huang Rui and committed by
Alex Deucher
e96487a6 12ad27fa

+17
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
··· 49 49 {AMD_CG_SUPPORT_MC_MGCG, "Memory Controller Medium Grain Clock Gating"}, 50 50 {AMD_CG_SUPPORT_SDMA_LS, "System Direct Memory Access Light Sleep"}, 51 51 {AMD_CG_SUPPORT_SDMA_MGCG, "System Direct Memory Access Medium Grain Clock Gating"}, 52 + {AMD_CG_SUPPORT_BIF_MGCG, "Bus Interface Medium Grain Clock Gating"}, 52 53 {AMD_CG_SUPPORT_BIF_LS, "Bus Interface Light Sleep"}, 53 54 {AMD_CG_SUPPORT_UVD_MGCG, "Unified Video Decoder Medium Grain Clock Gating"}, 54 55 {AMD_CG_SUPPORT_VCE_MGCG, "Video Compression Engine Medium Grain Clock Gating"},
+15
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
··· 206 206 WREG32_PCIE(smnPCIE_CNTL2, data); 207 207 } 208 208 209 + void nbio_v6_1_get_clockgating_state(struct amdgpu_device *adev, u32 *flags) 210 + { 211 + int data; 212 + 213 + /* AMD_CG_SUPPORT_BIF_MGCG */ 214 + data = RREG32_PCIE(smnCPM_CONTROL); 215 + if (data & CPM_CONTROL__LCLK_DYN_GATE_ENABLE_MASK) 216 + *flags |= AMD_CG_SUPPORT_BIF_MGCG; 217 + 218 + /* AMD_CG_SUPPORT_BIF_LS */ 219 + data = RREG32_PCIE(smnPCIE_CNTL2); 220 + if (data & PCIE_CNTL2__SLV_MEM_LS_EN_MASK) 221 + *flags |= AMD_CG_SUPPORT_BIF_LS; 222 + } 223 + 209 224 struct nbio_hdp_flush_reg nbio_v6_1_hdp_flush_reg; 210 225 struct nbio_pcie_index_data nbio_v6_1_pcie_index_data; 211 226
+1
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.h
··· 48 48 u32 nbio_v6_1_get_rev_id(struct amdgpu_device *adev); 49 49 void nbio_v6_1_update_medium_grain_clock_gating(struct amdgpu_device *adev, bool enable); 50 50 void nbio_v6_1_update_medium_grain_light_sleep(struct amdgpu_device *adev, bool enable); 51 + void nbio_v6_1_get_clockgating_state(struct amdgpu_device *adev, u32 *flags); 51 52 void nbio_v6_1_detect_hw_virt(struct amdgpu_device *adev); 52 53 53 54 #endif