aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-12-05 21:57:45 -0500
committerDave Airlie <airlied@redhat.com>2011-05-03 23:38:46 -0400
commit8116188fdef5946bcbb2d73e41d7412a57ffb034 (patch)
treee2ef4a120cc581ff92e5f63d868b7c050e98fada
parent99b38b4acc0d7dbbab443273577cff60080fcfad (diff)
nouveau/acpi: hook up to the MXM method for mux switching.
this hooks up nouveau to the MXM mux switching method. With this in place I can switch the LVDS MUX on my T410s, I expect we need a bit more work for other laptops. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/Kconfig1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index de70959b9ed5..e2f8a38d5f24 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -11,6 +11,7 @@ config DRM_NOUVEAU
11 select FRAMEBUFFER_CONSOLE if !EXPERT 11 select FRAMEBUFFER_CONSOLE if !EXPERT
12 select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT 12 select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
13 select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT 13 select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
14 select MXM_WMI if ACPI
14 help 15 help
15 Choose this option for open-source nVidia support. 16 Choose this option for open-source nVidia support.
16 17
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index a54238058dc5..1aa33d96d5d6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -4,6 +4,8 @@
4#include <acpi/acpi_drivers.h> 4#include <acpi/acpi_drivers.h>
5#include <acpi/acpi_bus.h> 5#include <acpi/acpi_bus.h>
6#include <acpi/video.h> 6#include <acpi/video.h>
7#include <acpi/acpi.h>
8#include <linux/mxm-wmi.h>
7 9
8#include "drmP.h" 10#include "drmP.h"
9#include "drm.h" 11#include "drm.h"
@@ -92,6 +94,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
92 94
93static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id) 95static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
94{ 96{
97 mxm_wmi_call_mxds(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
95 return nouveau_dsm(handle, NOUVEAU_DSM_LED, mux_id, NULL); 98 return nouveau_dsm(handle, NOUVEAU_DSM_LED, mux_id, NULL);
96} 99}
97 100
@@ -180,6 +183,14 @@ static bool nouveau_dsm_detect(void)
180 struct pci_dev *pdev = NULL; 183 struct pci_dev *pdev = NULL;
181 int has_dsm = 0; 184 int has_dsm = 0;
182 int vga_count = 0; 185 int vga_count = 0;
186 bool guid_valid;
187
188 /* lookup the GUID */
189 guid_valid = mxm_wmi_supported();
190 if (!guid_valid)
191 return false;
192
193 printk("MXM GUID detected in BIOS\n");
183 194
184 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { 195 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
185 vga_count++; 196 vga_count++;