drm/amdgpu: add GFX_PIPELINE capacity check for updating gfx cgpg
authorPrike Liang <Prike.Liang@amd.com>
Tue, 15 Oct 2019 09:24:25 +0000 (17:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Oct 2019 20:23:54 +0000 (16:23 -0400)
Before disable gfx pipeline power gating need check the flag AMD_PG_SUPPORT_GFX_PIPELINE.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 035e45a7abfd01e7e0c302d12275009b049fc5c4..f545ecbe2ce25601f4733a1bc0283d744260878b 100644 (file)
@@ -4296,7 +4296,8 @@ static void gfx_v9_0_update_gfx_cg_power_gating(struct amdgpu_device *adev,
                        gfx_v9_0_enable_gfx_pipeline_powergating(adev, true);
        } else {
                gfx_v9_0_enable_gfx_cg_power_gating(adev, false);
-               gfx_v9_0_enable_gfx_pipeline_powergating(adev, false);
+               if (adev->pg_flags & AMD_PG_SUPPORT_GFX_PIPELINE)
+                       gfx_v9_0_enable_gfx_pipeline_powergating(adev, false);
        }
 
        amdgpu_gfx_rlc_exit_safe_mode(adev);