Skip to content

Commit 4aa5d5e

Browse files
Lyudealexdeucher
authored andcommitted
drm/amdgpu: Add amdgpu_atpx_get_dhandle()
Since it seems that some vendors are storing the ATIF ACPI methods under the same handle that ATPX lives under instead of the device's own handle, we're going to need to be able to retrieve this handle later so we can probe for ATIF there. Signed-off-by: Lyude Paul <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 2cd5fe2 commit 4aa5d5e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,12 @@ static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false;
18581858
static inline bool amdgpu_has_atpx(void) { return false; }
18591859
#endif
18601860

1861+
#if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI)
1862+
void *amdgpu_atpx_get_dhandle(void);
1863+
#else
1864+
static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; }
1865+
#endif
1866+
18611867
/*
18621868
* KMS
18631869
*/

drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ bool amdgpu_atpx_dgpu_req_power_for_displays(void) {
9090
return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays;
9191
}
9292

93+
#if defined(CONFIG_ACPI)
94+
void *amdgpu_atpx_get_dhandle(void) {
95+
return amdgpu_atpx_priv.dhandle;
96+
}
97+
#endif
98+
9399
/**
94100
* amdgpu_atpx_call - call an ATPX method
95101
*

0 commit comments

Comments
 (0)