]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: Add amdgpu_atpx_get_dhandle()
authorLyude Paul <lyude@redhat.com>
Tue, 26 Jun 2018 01:09:06 +0000 (21:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Jun 2018 20:32:18 +0000 (15:32 -0500)
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
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c

index 7df5d3d11aff91d415aa1329c757753ff602cb09..7dcbac8af9a7a8fb9c1cf46890d661be1ec34592 100644 (file)
@@ -1858,6 +1858,12 @@ static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false;
 static inline bool amdgpu_has_atpx(void) { return false; }
 #endif
 
+#if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI)
+void *amdgpu_atpx_get_dhandle(void);
+#else
+static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; }
+#endif
+
 /*
  * KMS
  */
index daa06e7c5bb73e2d4073fad2177bf50eee0be006..9ab89371d9e8dd5da264b6dc5f7df3d669a49358 100644 (file)
@@ -90,6 +90,12 @@ bool amdgpu_atpx_dgpu_req_power_for_displays(void) {
        return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays;
 }
 
+#if defined(CONFIG_ACPI)
+void *amdgpu_atpx_get_dhandle(void) {
+       return amdgpu_atpx_priv.dhandle;
+}
+#endif
+
 /**
  * amdgpu_atpx_call - call an ATPX method
  *