aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2018-06-25 21:09:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-07-05 17:38:58 -0400
commit24aeefcdee255d21cc43bb511d5fdb760062199d (patch)
tree08f6801076346fcff95d1b0fa36948e3ffeb4953 /drivers/gpu/drm/amd/amdgpu
parentaa03c075d02f89ae5acae10df1c8a3b095a440e7 (diff)
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 <lyude@redhat.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.h6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 219fea72beeb..8a440b9fa0fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1867,6 +1867,12 @@ static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false;
1867static inline bool amdgpu_has_atpx(void) { return false; } 1867static inline bool amdgpu_has_atpx(void) { return false; }
1868#endif 1868#endif
1869 1869
1870#if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI)
1871void *amdgpu_atpx_get_dhandle(void);
1872#else
1873static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; }
1874#endif
1875
1870/* 1876/*
1871 * KMS 1877 * KMS
1872 */ 1878 */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index a3896412a019..b33f1680c9a3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -90,6 +90,12 @@ bool amdgpu_atpx_dgpu_req_power_for_displays(void) {
90 return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays; 90 return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays;
91} 91}
92 92
93#if defined(CONFIG_ACPI)
94void *amdgpu_atpx_get_dhandle(void) {
95 return amdgpu_atpx_priv.dhandle;
96}
97#endif
98
93/** 99/**
94 * amdgpu_atpx_call - call an ATPX method 100 * amdgpu_atpx_call - call an ATPX method
95 * 101 *