aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-09-14 14:01:41 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-22 10:30:30 -0400
commitefc83cf423df99bd6c1899cf0b65897f1ee75751 (patch)
tree14ca67f1f2328a2f8cb1cdaef487b446e43d18a2 /drivers/gpu
parent9cee3c1f95298fb98bbec9e8410d4da64a271fe5 (diff)
drm/amdgpu/atpx: check for ATIF dGPU wake for display events support
Some ATPX laptops implement special circuitry to generate display hotplug events via ACPI when the dGPU is powered off. Check if this is supported. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c9
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);
2450void amdgpu_unregister_atpx_handler(void); 2450void amdgpu_unregister_atpx_handler(void);
2451bool amdgpu_has_atpx_dgpu_power_cntl(void); 2451bool amdgpu_has_atpx_dgpu_power_cntl(void);
2452bool amdgpu_is_atpx_hybrid(void); 2452bool amdgpu_is_atpx_hybrid(void);
2453bool amdgpu_atpx_dgpu_req_power_for_displays(void);
2453#else 2454#else
2454static inline void amdgpu_register_atpx_handler(void) {} 2455static inline void amdgpu_register_atpx_handler(void) {}
2455static inline void amdgpu_unregister_atpx_handler(void) {} 2456static inline void amdgpu_unregister_atpx_handler(void) {}
2456static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } 2457static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; }
2457static inline bool amdgpu_is_atpx_hybrid(void) { return false; } 2458static inline bool amdgpu_is_atpx_hybrid(void) { return false; }
2459static 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
34static struct amdgpu_atpx_priv { 35static 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
77bool 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