drm/amdgpu/gfx8: clean up polaris11 PG enable
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 4 May 2016 14:13:35 +0000 (10:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 18:50:46 +0000 (14:50 -0400)
Fix the logic for enabling/disabling.

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

index 1ee616cae939a3e6c571593b9f690c07928d31c3..7cfeac1c134df83aec55cabd80ff7c3321a1aecb 100644 (file)
@@ -5390,12 +5390,20 @@ static int gfx_v8_0_set_powergating_state(void *handle,
                        gfx_v8_0_enable_gfx_dynamic_mg_power_gating(adev, false);
                break;
        case CHIP_POLARIS11:
-               if (adev->pg_flags & AMD_PG_SUPPORT_GFX_SMG)
-                       gfx_v8_0_enable_gfx_static_mg_power_gating(adev, enable);
-               else if (adev->pg_flags & AMD_PG_SUPPORT_GFX_DMG)
-                       gfx_v8_0_enable_gfx_dynamic_mg_power_gating(adev, enable);
+               if ((adev->pg_flags & AMD_PG_SUPPORT_GFX_SMG) && enable)
+                       gfx_v8_0_enable_gfx_static_mg_power_gating(adev, true);
+               else
+                       gfx_v8_0_enable_gfx_static_mg_power_gating(adev, false);
+
+               if ((adev->pg_flags & AMD_PG_SUPPORT_GFX_DMG) && enable)
+                       gfx_v8_0_enable_gfx_dynamic_mg_power_gating(adev, true);
+               else
+                       gfx_v8_0_enable_gfx_dynamic_mg_power_gating(adev, false);
+
+               if ((adev->pg_flags & AMD_PG_SUPPORT_GFX_QUICK_MG) && enable)
+                       polaris11_enable_gfx_quick_mg_power_gating(adev, true);
                else
-                       polaris11_enable_gfx_quick_mg_power_gating(adev, enable);
+                       polaris11_enable_gfx_quick_mg_power_gating(adev, false);
                break;
        default:
                break;