drm/amdgpu: add a amdgpu_device_supports_baco helper
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 28 Oct 2019 18:47:38 +0000 (14:47 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Nov 2019 21:42:49 +0000 (16:42 -0500)
BACO - Bus Active, Chip Off

To check if a device supports BACO or not.  This will be
used in determining when to enable runtime pm.

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

index 6648e7788669661cb0b388c8f7b7f466be9d90fb..bdcfaf11f5e7ed0dae8920e173336686cd711849 100644 (file)
@@ -1141,6 +1141,7 @@ void amdgpu_device_program_register_sequence(struct amdgpu_device *adev,
                                             const u32 array_size);
 
 bool amdgpu_device_is_px(struct drm_device *dev);
+bool amdgpu_device_supports_baco(struct drm_device *dev);
 bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,
                                      struct amdgpu_device *peer_adev);
 
index 27ed48bde3fa27628f2199a021072334686969a4..314138a95ccd9cdee915e542665e371cc250095e 100644 (file)
@@ -153,6 +153,21 @@ bool amdgpu_device_is_px(struct drm_device *dev)
        return false;
 }
 
+/**
+ * amdgpu_device_supports_baco - Does the device support BACO
+ *
+ * @dev: drm_device pointer
+ *
+ * Returns true if the device supporte BACO,
+ * otherwise return false.
+ */
+bool amdgpu_device_supports_baco(struct drm_device *dev)
+{
+       struct amdgpu_device *adev = dev->dev_private;
+
+       return amdgpu_asic_supports_baco(adev);
+}
+
 /**
  * VRAM access helper functions.
  *