diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-06-02 09:04:01 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 14:51:07 -0400 |
commit | 2f5af82eeab2622913f92aec3d08df33c5fd0b20 (patch) | |
tree | 815bbdd1486d2479d09abe47661956078f3840c1 /drivers/gpu/drm/amd/amdgpu | |
parent | 410ca8d13b89761cac3cb637ea7670377c620538 (diff) |
drm/amdgpu/atpx: track whether if this is a hybrid graphics platform
hybrid graphics in this case refers to systems which use the new
platform d3 cold ACPI methods as opposed to ATPX for 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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 3cc2bd797e51..b6c8309ce891 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -2401,10 +2401,12 @@ bool amdgpu_device_is_px(struct drm_device *dev); | |||
2401 | void amdgpu_register_atpx_handler(void); | 2401 | void amdgpu_register_atpx_handler(void); |
2402 | void amdgpu_unregister_atpx_handler(void); | 2402 | void amdgpu_unregister_atpx_handler(void); |
2403 | bool amdgpu_has_atpx_dgpu_power_cntl(void); | 2403 | bool amdgpu_has_atpx_dgpu_power_cntl(void); |
2404 | bool amdgpu_is_atpx_hybrid(void); | ||
2404 | #else | 2405 | #else |
2405 | static inline void amdgpu_register_atpx_handler(void) {} | 2406 | static inline void amdgpu_register_atpx_handler(void) {} |
2406 | static inline void amdgpu_unregister_atpx_handler(void) {} | 2407 | static inline void amdgpu_unregister_atpx_handler(void) {} |
2407 | static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } | 2408 | static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } |
2409 | static inline bool amdgpu_is_atpx_hybrid(void) { return false; } | ||
2408 | #endif | 2410 | #endif |
2409 | 2411 | ||
2410 | /* | 2412 | /* |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index 90dfedc5a5ca..3e973c7942f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | |||
@@ -28,6 +28,7 @@ struct amdgpu_atpx_functions { | |||
28 | struct amdgpu_atpx { | 28 | struct amdgpu_atpx { |
29 | acpi_handle handle; | 29 | acpi_handle handle; |
30 | struct amdgpu_atpx_functions functions; | 30 | struct amdgpu_atpx_functions functions; |
31 | bool is_hybrid; | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | static struct amdgpu_atpx_priv { | 34 | static struct amdgpu_atpx_priv { |
@@ -68,6 +69,10 @@ bool amdgpu_has_atpx_dgpu_power_cntl(void) { | |||
68 | return amdgpu_atpx_priv.atpx.functions.power_cntl; | 69 | return amdgpu_atpx_priv.atpx.functions.power_cntl; |
69 | } | 70 | } |
70 | 71 | ||
72 | bool amdgpu_is_atpx_hybrid(void) { | ||
73 | return amdgpu_atpx_priv.atpx.is_hybrid; | ||
74 | } | ||
75 | |||
71 | /** | 76 | /** |
72 | * amdgpu_atpx_call - call an ATPX method | 77 | * amdgpu_atpx_call - call an ATPX method |
73 | * | 78 | * |
@@ -192,9 +197,11 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) | |||
192 | ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED)) | 197 | ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED)) |
193 | atpx->functions.power_cntl = true; | 198 | atpx->functions.power_cntl = true; |
194 | 199 | ||
200 | atpx->is_hybrid = false; | ||
195 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { | 201 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { |
196 | printk("Hybrid Graphics, ATPX dGPU power cntl disabled\n"); | 202 | printk("ATPX Hybrid Graphics\n"); |
197 | atpx->functions.power_cntl = false; | 203 | atpx->functions.power_cntl = false; |
204 | atpx->is_hybrid = true; | ||
198 | } | 205 | } |
199 | 206 | ||
200 | return 0; | 207 | return 0; |