drm/amdgpu: use mask bit for deep sleep feature on dpm.
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 2 Nov 2016 05:35:15 +0000 (13:35 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Nov 2016 15:21:01 +0000 (10:21 -0500)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
drivers/gpu/drm/amd/amdgpu/kv_dpm.c

index e45bd052157b894e8b345fa377c440e02c0a49a0..955d6f21e2b34d5a89b379ea902f696b61c1b4ed 100644 (file)
@@ -52,6 +52,8 @@ enum amdgpu_dpm_event_src {
        AMDGPU_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL = 4
 };
 
+#define SCLK_DEEP_SLEEP_MASK 0x8
+
 struct amdgpu_ps {
        u32 caps; /* vbios flags */
        u32 class; /* vbios flags */
index 1caff75ab9fcff9a9d239dd10c92071486188d94..bd690a21fdfa855b6b8ee888c72d2130e2ca65a5 100644 (file)
@@ -5896,7 +5896,7 @@ static int ci_dpm_init(struct amdgpu_device *adev)
        pi->pcie_dpm_key_disabled = 0;
        pi->thermal_sclk_dpm_enabled = 0;
 
-       if (amdgpu_sclk_deep_sleep_en)
+       if (amdgpu_pp_feature_mask & SCLK_DEEP_SLEEP_MASK)
                pi->caps_sclk_ds = true;
        else
                pi->caps_sclk_ds = false;
index 352b5fad5a06394ab08db80defaa5d39a2492137..41fa351aa2411e557ec1395d73b24b2167e40f1e 100644 (file)
@@ -438,7 +438,7 @@ static int cz_dpm_init(struct amdgpu_device *adev)
                pi->caps_td_ramping = true;
                pi->caps_tcp_ramping = true;
        }
-       if (amdgpu_sclk_deep_sleep_en)
+       if (amdgpu_pp_feature_mask & SCLK_DEEP_SLEEP_MASK)
                pi->caps_sclk_ds = true;
        else
                pi->caps_sclk_ds = false;
index 61172d4a06570d02572e9a3044060a3c69be7fb0..5a1bc358bcb1849f13da6a3244d5d5e6d715c757 100644 (file)
@@ -2845,7 +2845,7 @@ static int kv_dpm_init(struct amdgpu_device *adev)
                pi->caps_tcp_ramping = true;
        }
 
-       if (amdgpu_sclk_deep_sleep_en)
+       if (amdgpu_pp_feature_mask & SCLK_DEEP_SLEEP_MASK)
                pi->caps_sclk_ds = true;
        else
                pi->caps_sclk_ds = false;