aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2018-06-25 21:09:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-06-28 16:32:18 -0400
commit4aa5d5eb82bb237d0bb3a38b2a7555054d018081 (patch)
tree2551e1d46953f95978b6c453a2e11155a1067a34 /drivers
parent2cd5fe22d9a45cdf11c62bbe8db3ce9101207510 (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> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers')
-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 7df5d3d11aff..7dcbac8af9a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1858,6 +1858,12 @@ static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false;
1858static inline bool amdgpu_has_atpx(void) { return false; } 1858static inline bool amdgpu_has_atpx(void) { return false; }
1859#endif 1859#endif
1860 1860
1861#if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI)
1862void *amdgpu_atpx_get_dhandle(void);
1863#else
1864static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; }
1865#endif
1866
1861/* 1867/*
1862 * KMS 1868 * KMS
1863 */ 1869 */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index daa06e7c5bb7..9ab89371d9e8 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 *