]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: add supports_baco callback for NV asics.
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Nov 2019 23:12:17 +0000 (18:12 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Nov 2019 21:42:48 +0000 (16:42 -0500)
BACO - Bus Active, Chip Off

Check the BACO capabilities from the powerplay table.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/nv.c

index 343f4799565799e5d3fa69ff225cafe81d2a39b1..8e7c6a4b0018ec9a53ccd82d5bccdb2c5b6b951f 100644 (file)
@@ -315,6 +315,16 @@ static int nv_asic_mode1_reset(struct amdgpu_device *adev)
        return ret;
 }
 
+static bool nv_asic_supports_baco(struct amdgpu_device *adev)
+{
+       struct smu_context *smu = &adev->smu;
+
+       if (smu_baco_is_support(smu))
+               return true;
+       else
+               return false;
+}
+
 static enum amd_reset_method
 nv_asic_reset_method(struct amdgpu_device *adev)
 {
@@ -620,6 +630,7 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
        .get_pcie_usage = &nv_get_pcie_usage,
        .need_reset_on_init = &nv_need_reset_on_init,
        .get_pcie_replay_count = &nv_get_pcie_replay_count,
+       .supports_baco = &nv_asic_supports_baco,
 };
 
 static int nv_common_early_init(void *handle)