aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/si.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-08-08 18:00:10 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:30:49 -0400
commit0116e1efafe09a2d99042943a850deaa1d9b069c (patch)
tree04054fb3c4bd40024997c20cacc4bdf78802dc47 /drivers/gpu/drm/radeon/si.c
parent64d8a728c7deb40e8db3c09b614ffe90415c7664 (diff)
drm/radeon: use new cg/pg flags for SI
Allows us finer grained control over clock and powergating on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/si.c')
-rw-r--r--drivers/gpu/drm/radeon/si.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index fb2058c9670d..e116128f3d8f 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -5121,39 +5121,44 @@ static void si_enable_mc_ls(struct radeon_device *rdev,
5121 5121
5122static void si_init_cg(struct radeon_device *rdev) 5122static void si_init_cg(struct radeon_device *rdev)
5123{ 5123{
5124 si_enable_mgcg(rdev, true); 5124 if (rdev->cg_flags & RADEON_CG_SUPPORT_GFX_MGCG)
5125 si_enable_cgcg(rdev, false); 5125 si_enable_mgcg(rdev, true);
5126 /* disable MC LS on Tahiti */ 5126 if (rdev->cg_flags & RADEON_CG_SUPPORT_GFX_CGCG)
5127 if (rdev->family == CHIP_TAHITI) 5127 si_enable_cgcg(rdev, false/*true*/);
5128 /* Disable MC LS on tahiti */
5129 if (!(rdev->cg_flags & RADEON_CG_SUPPORT_MC_LS))
5128 si_enable_mc_ls(rdev, false); 5130 si_enable_mc_ls(rdev, false);
5129 if (rdev->has_uvd) { 5131 if (rdev->has_uvd) {
5130 si_enable_uvd_mgcg(rdev, true); 5132 if (rdev->cg_flags & RADEON_CG_SUPPORT_UVD_MGCG)
5133 si_enable_uvd_mgcg(rdev, true);
5131 si_init_uvd_internal_cg(rdev); 5134 si_init_uvd_internal_cg(rdev);
5132 } 5135 }
5133} 5136}
5134 5137
5135static void si_fini_cg(struct radeon_device *rdev) 5138static void si_fini_cg(struct radeon_device *rdev)
5136{ 5139{
5137 if (rdev->has_uvd) 5140 if (rdev->has_uvd) {
5138 si_enable_uvd_mgcg(rdev, false); 5141 if (rdev->cg_flags & RADEON_CG_SUPPORT_UVD_MGCG)
5139 si_enable_cgcg(rdev, false); 5142 si_enable_uvd_mgcg(rdev, false);
5140 si_enable_mgcg(rdev, false); 5143 }
5144 if (rdev->cg_flags & RADEON_CG_SUPPORT_GFX_CGCG)
5145 si_enable_cgcg(rdev, false);
5146 if (rdev->cg_flags & RADEON_CG_SUPPORT_GFX_MGCG)
5147 si_enable_mgcg(rdev, false);
5141} 5148}
5142 5149
5143static void si_init_pg(struct radeon_device *rdev) 5150static void si_init_pg(struct radeon_device *rdev)
5144{ 5151{
5145 bool has_pg = false; 5152 if (rdev->pg_flags) {
5146#if 0 5153 if (rdev->pg_flags & RADEON_PG_SUPPORT_SDMA) {
5147 /* only cape verde supports PG */ 5154 si_init_dma_pg(rdev);
5148 if (rdev->family == CHIP_VERDE) 5155 si_enable_dma_pg(rdev, true);
5149 has_pg = true; 5156 }
5150#endif
5151 if (has_pg) {
5152 si_init_ao_cu_mask(rdev); 5157 si_init_ao_cu_mask(rdev);
5153 si_init_dma_pg(rdev); 5158 if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG) {
5154 si_enable_dma_pg(rdev, true); 5159 si_init_gfx_cgpg(rdev);
5155 si_init_gfx_cgpg(rdev); 5160 si_enable_gfx_cgpg(rdev, true);
5156 si_enable_gfx_cgpg(rdev, true); 5161 }
5157 } else { 5162 } else {
5158 WREG32(RLC_SAVE_AND_RESTORE_BASE, rdev->rlc.save_restore_gpu_addr >> 8); 5163 WREG32(RLC_SAVE_AND_RESTORE_BASE, rdev->rlc.save_restore_gpu_addr >> 8);
5159 WREG32(RLC_CLEAR_STATE_RESTORE_BASE, rdev->rlc.clear_state_gpu_addr >> 8); 5164 WREG32(RLC_CLEAR_STATE_RESTORE_BASE, rdev->rlc.clear_state_gpu_addr >> 8);
@@ -5162,15 +5167,11 @@ static void si_init_pg(struct radeon_device *rdev)
5162 5167
5163static void si_fini_pg(struct radeon_device *rdev) 5168static void si_fini_pg(struct radeon_device *rdev)
5164{ 5169{
5165 bool has_pg = false; 5170 if (rdev->pg_flags) {
5166 5171 if (rdev->pg_flags & RADEON_PG_SUPPORT_SDMA)
5167 /* only cape verde supports PG */ 5172 si_enable_dma_pg(rdev, false);
5168 if (rdev->family == CHIP_VERDE) 5173 if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG)
5169 has_pg = true; 5174 si_enable_gfx_cgpg(rdev, false);
5170
5171 if (has_pg) {
5172 si_enable_dma_pg(rdev, false);
5173 si_enable_gfx_cgpg(rdev, false);
5174 } 5175 }
5175} 5176}
5176 5177