diff options
Diffstat (limited to 'drivers/gpu/drm/amd')
| -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, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 44255cb0bb50..9d79e4ba0213 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
| @@ -2450,11 +2450,13 @@ void amdgpu_register_atpx_handler(void); | |||
| 2450 | void amdgpu_unregister_atpx_handler(void); | 2450 | void amdgpu_unregister_atpx_handler(void); |
| 2451 | bool amdgpu_has_atpx_dgpu_power_cntl(void); | 2451 | bool amdgpu_has_atpx_dgpu_power_cntl(void); |
| 2452 | bool amdgpu_is_atpx_hybrid(void); | 2452 | bool amdgpu_is_atpx_hybrid(void); |
| 2453 | bool amdgpu_atpx_dgpu_req_power_for_displays(void); | ||
| 2453 | #else | 2454 | #else |
| 2454 | static inline void amdgpu_register_atpx_handler(void) {} | 2455 | static inline void amdgpu_register_atpx_handler(void) {} |
| 2455 | static inline void amdgpu_unregister_atpx_handler(void) {} | 2456 | static inline void amdgpu_unregister_atpx_handler(void) {} |
| 2456 | static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } | 2457 | static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } |
| 2457 | static inline bool amdgpu_is_atpx_hybrid(void) { return false; } | 2458 | static inline bool amdgpu_is_atpx_hybrid(void) { return false; } |
| 2459 | static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false; } | ||
| 2458 | #endif | 2460 | #endif |
| 2459 | 2461 | ||
| 2460 | /* | 2462 | /* |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index 49de92600074..550c5ee704ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | |||
| @@ -29,6 +29,7 @@ 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 | bool is_hybrid; |
| 32 | bool dgpu_req_power_for_displays; | ||
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| 34 | static struct amdgpu_atpx_priv { | 35 | static struct amdgpu_atpx_priv { |
| @@ -73,6 +74,10 @@ bool amdgpu_is_atpx_hybrid(void) { | |||
| 73 | return amdgpu_atpx_priv.atpx.is_hybrid; | 74 | return amdgpu_atpx_priv.atpx.is_hybrid; |
| 74 | } | 75 | } |
| 75 | 76 | ||
| 77 | bool amdgpu_atpx_dgpu_req_power_for_displays(void) { | ||
| 78 | return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays; | ||
| 79 | } | ||
| 80 | |||
| 76 | /** | 81 | /** |
| 77 | * amdgpu_atpx_call - call an ATPX method | 82 | * amdgpu_atpx_call - call an ATPX method |
| 78 | * | 83 | * |
| @@ -213,6 +218,10 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) | |||
| 213 | atpx->is_hybrid = true; | 218 | atpx->is_hybrid = true; |
| 214 | } | 219 | } |
| 215 | 220 | ||
| 221 | atpx->dgpu_req_power_for_displays = false; | ||
| 222 | if (valid_bits & ATPX_DGPU_REQ_POWER_FOR_DISPLAYS) | ||
| 223 | atpx->dgpu_req_power_for_displays = true; | ||
| 224 | |||
| 216 | return 0; | 225 | return 0; |
| 217 | } | 226 | } |
| 218 | 227 | ||
