drm/amdgpu/atpx: add a query for ATPX dGPU power control
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jun 2016 17:08:21 +0000 (13:08 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 18:51:01 +0000 (14:51 -0400)
The runtime pm sequence is different depending on whether or
not the platform supports ATPX dGPU power control.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c

index 33bc79e378e1d629545d84f96eb0442421e15a15..3cc2bd797e51661c70893cf62e8ec3b7d859edba 100644 (file)
@@ -2400,9 +2400,11 @@ bool amdgpu_device_is_px(struct drm_device *dev);
 #if defined(CONFIG_VGA_SWITCHEROO)
 void amdgpu_register_atpx_handler(void);
 void amdgpu_unregister_atpx_handler(void);
+bool amdgpu_has_atpx_dgpu_power_cntl(void);
 #else
 static inline void amdgpu_register_atpx_handler(void) {}
 static inline void amdgpu_unregister_atpx_handler(void) {}
+static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; }
 #endif
 
 /*
index c5d280ce625b62795f4110375c54b77c097ba0ae..7b11af1d8c4f5aa1d65507160f472a95e755c8ad 100644 (file)
@@ -64,6 +64,10 @@ bool amdgpu_has_atpx(void) {
        return amdgpu_atpx_priv.atpx_detected;
 }
 
+bool amdgpu_has_atpx_dgpu_power_cntl(void) {
+       return amdgpu_atpx_priv.atpx.functions.power_cntl;
+}
+
 /**
  * amdgpu_atpx_call - call an ATPX method
  *