Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+11
+2
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 2450 2450 void amdgpu_unregister_atpx_handler(void); 2451 2451 bool amdgpu_has_atpx_dgpu_power_cntl(void); 2452 2452 bool amdgpu_is_atpx_hybrid(void); 2453 + bool amdgpu_atpx_dgpu_req_power_for_displays(void); 2453 2454 #else 2454 2455 static inline void amdgpu_register_atpx_handler(void) {} 2455 2456 static inline void amdgpu_unregister_atpx_handler(void) {} 2456 2457 static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } 2457 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 2460 #endif 2459 2461 2460 2462 /*
+9
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
··· 29 29 acpi_handle handle; 30 30 struct amdgpu_atpx_functions functions; 31 31 bool is_hybrid; 32 + bool dgpu_req_power_for_displays; 32 33 }; 33 34 34 35 static struct amdgpu_atpx_priv { ··· 72 71 73 72 bool amdgpu_is_atpx_hybrid(void) { 74 73 return amdgpu_atpx_priv.atpx.is_hybrid; 74 + } 75 + 76 + bool amdgpu_atpx_dgpu_req_power_for_displays(void) { 77 + return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays; 75 78 } 76 79 77 80 /** ··· 217 212 #endif 218 213 atpx->is_hybrid = true; 219 214 } 215 + 216 + atpx->dgpu_req_power_for_displays = false; 217 + if (valid_bits & ATPX_DGPU_REQ_POWER_FOR_DISPLAYS) 218 + atpx->dgpu_req_power_for_displays = true; 220 219 221 220 return 0; 222 221 }