aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2017-01-05 05:48:44 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-01-27 11:13:07 -0500
commitebd843d6ee915394094777c72f01fe55356c8eae (patch)
tree3a0e85d0f2d9fc86eb17a594fd257373cfde49e1 /drivers/gpu
parenta8503b15ab770967c13bc61ae8a2216165c9760a (diff)
drm/amdgpu: add get clockgating_state method for gfx v8
Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index d604ba37541f..0907173d9681 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -5872,6 +5872,45 @@ static int gfx_v8_0_set_powergating_state(void *handle,
5872 return 0; 5872 return 0;
5873} 5873}
5874 5874
5875static void gfx_v8_0_get_clockgating_state(void *handle, u32 *flags)
5876{
5877 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
5878 int data;
5879
5880 /* AMD_CG_SUPPORT_GFX_MGCG */
5881 data = RREG32(mmRLC_CGTT_MGCG_OVERRIDE);
5882 if (!(data & RLC_CGTT_MGCG_OVERRIDE__CPF_MASK))
5883 *flags |= AMD_CG_SUPPORT_GFX_MGCG;
5884
5885 /* AMD_CG_SUPPORT_GFX_CGLG */
5886 data = RREG32(mmRLC_CGCG_CGLS_CTRL);
5887 if (data & RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK)
5888 *flags |= AMD_CG_SUPPORT_GFX_CGCG;
5889
5890 /* AMD_CG_SUPPORT_GFX_CGLS */
5891 if (data & RLC_CGCG_CGLS_CTRL__CGLS_EN_MASK)
5892 *flags |= AMD_CG_SUPPORT_GFX_CGLS;
5893
5894 /* AMD_CG_SUPPORT_GFX_CGTS */
5895 data = RREG32(mmCGTS_SM_CTRL_REG);
5896 if (!(data & CGTS_SM_CTRL_REG__OVERRIDE_MASK))
5897 *flags |= AMD_CG_SUPPORT_GFX_CGTS;
5898
5899 /* AMD_CG_SUPPORT_GFX_CGTS_LS */
5900 if (!(data & CGTS_SM_CTRL_REG__LS_OVERRIDE_MASK))
5901 *flags |= AMD_CG_SUPPORT_GFX_CGTS_LS;
5902
5903 /* AMD_CG_SUPPORT_GFX_RLC_LS */
5904 data = RREG32(mmRLC_MEM_SLP_CNTL);
5905 if (data & RLC_MEM_SLP_CNTL__RLC_MEM_LS_EN_MASK)
5906 *flags |= AMD_CG_SUPPORT_GFX_RLC_LS | AMD_CG_SUPPORT_GFX_MGLS;
5907
5908 /* AMD_CG_SUPPORT_GFX_CP_LS */
5909 data = RREG32(mmCP_MEM_SLP_CNTL);
5910 if (data & CP_MEM_SLP_CNTL__CP_MEM_LS_EN_MASK)
5911 *flags |= AMD_CG_SUPPORT_GFX_CP_LS | AMD_CG_SUPPORT_GFX_MGLS;
5912}
5913
5875static void gfx_v8_0_send_serdes_cmd(struct amdgpu_device *adev, 5914static void gfx_v8_0_send_serdes_cmd(struct amdgpu_device *adev,
5876 uint32_t reg_addr, uint32_t cmd) 5915 uint32_t reg_addr, uint32_t cmd)
5877{ 5916{
@@ -6910,6 +6949,7 @@ static const struct amd_ip_funcs gfx_v8_0_ip_funcs = {
6910 .post_soft_reset = gfx_v8_0_post_soft_reset, 6949 .post_soft_reset = gfx_v8_0_post_soft_reset,
6911 .set_clockgating_state = gfx_v8_0_set_clockgating_state, 6950 .set_clockgating_state = gfx_v8_0_set_clockgating_state,
6912 .set_powergating_state = gfx_v8_0_set_powergating_state, 6951 .set_powergating_state = gfx_v8_0_set_powergating_state,
6952 .get_clockgating_state = gfx_v8_0_get_clockgating_state,
6913}; 6953};
6914 6954
6915static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { 6955static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {