drm/radeon: fixes for gfx clockgating on CIK
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 12 Aug 2013 21:25:26 +0000 (17:25 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Aug 2013 20:30:55 +0000 (16:30 -0400)
Clockgating requires signalling between the CP and the
RLC to work properly.  Resetting the CP block in the
CP resume code messed up the internal coordination
between the blocks.  Removing the reset allows gfx
clockgating to work properly.  However, when gfx clock
gating is enabled, there is a strange interaction with
dpm which causes the chip to stay in the high performance
level all the time, so leave gfx clockgating disabled
for now.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/radeon_asic.c

index b7859fe3df80175bbe419d6a87042386b0748faf..1f088800295d4df93db113e234ca593d57d81993 100644 (file)
@@ -3974,13 +3974,6 @@ static int cik_cp_resume(struct radeon_device *rdev)
 {
        int r;
 
-       /* Reset all cp blocks */
-       WREG32(GRBM_SOFT_RESET, SOFT_RESET_CP);
-       RREG32(GRBM_SOFT_RESET);
-       mdelay(15);
-       WREG32(GRBM_SOFT_RESET, 0);
-       RREG32(GRBM_SOFT_RESET);
-
        r = cik_cp_load_microcode(rdev);
        if (r)
                return r;
@@ -5060,9 +5053,9 @@ static void cik_enable_cgcg(struct radeon_device *rdev, bool enable)
 
        orig = data = RREG32(RLC_CGCG_CGLS_CTRL);
 
-       cik_enable_gui_idle_interrupt(rdev, enable);
-
        if (enable && (rdev->cg_flags & RADEON_CG_SUPPORT_GFX_CGCG)) {
+               cik_enable_gui_idle_interrupt(rdev, true);
+
                tmp = cik_halt_rlc(rdev);
 
                cik_select_se_sh(rdev, 0xffffffff, 0xffffffff);
@@ -5075,6 +5068,8 @@ static void cik_enable_cgcg(struct radeon_device *rdev, bool enable)
 
                data |= CGCG_EN | CGLS_EN;
        } else {
+               cik_enable_gui_idle_interrupt(rdev, false);
+
                RREG32(CB_CGTT_SCLK_CTRL);
                RREG32(CB_CGTT_SCLK_CTRL);
                RREG32(CB_CGTT_SCLK_CTRL);
@@ -5383,7 +5378,7 @@ void cik_update_cg(struct radeon_device *rdev,
 static void cik_init_cg(struct radeon_device *rdev)
 {
 
-       cik_update_cg(rdev, RADEON_CG_BLOCK_GFX, false); /* XXX true */
+       cik_update_cg(rdev, RADEON_CG_BLOCK_GFX, true);
 
        if (rdev->has_uvd)
                si_init_uvd_internal_cg(rdev);
index 630853b96841c2d23e6633981d9efc3ae021f703..6152169d011f4f373c8916dc667e977e626d442d 100644 (file)
@@ -2439,7 +2439,7 @@ int radeon_asic_init(struct radeon_device *rdev)
                rdev->num_crtc = 6;
                rdev->has_uvd = true;
                rdev->cg_flags =
-                       RADEON_CG_SUPPORT_GFX_MGCG |
+                       /*RADEON_CG_SUPPORT_GFX_MGCG |*/
                        RADEON_CG_SUPPORT_GFX_MGLS |
                        /*RADEON_CG_SUPPORT_GFX_CGCG |*/
                        RADEON_CG_SUPPORT_GFX_CGLS |
@@ -2464,7 +2464,7 @@ int radeon_asic_init(struct radeon_device *rdev)
                if (rdev->family == CHIP_KAVERI) {
                        rdev->num_crtc = 4;
                        rdev->cg_flags =
-                               RADEON_CG_SUPPORT_GFX_MGCG |
+                               /*RADEON_CG_SUPPORT_GFX_MGCG |*/
                                RADEON_CG_SUPPORT_GFX_MGLS |
                                /*RADEON_CG_SUPPORT_GFX_CGCG |*/
                                RADEON_CG_SUPPORT_GFX_CGLS |
@@ -2492,7 +2492,7 @@ int radeon_asic_init(struct radeon_device *rdev)
                } else {
                        rdev->num_crtc = 2;
                        rdev->cg_flags =
-                               RADEON_CG_SUPPORT_GFX_MGCG |
+                               /*RADEON_CG_SUPPORT_GFX_MGCG |*/
                                RADEON_CG_SUPPORT_GFX_MGLS |
                                /*RADEON_CG_SUPPORT_GFX_CGCG |*/
                                RADEON_CG_SUPPORT_GFX_CGLS |