Commit 8116188f authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
parent 99b38b4a
...@@ -11,6 +11,7 @@ config DRM_NOUVEAU ...@@ -11,6 +11,7 @@ config DRM_NOUVEAU
select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE if !EXPERT
select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
select MXM_WMI if ACPI
help help
Choose this option for open-source nVidia support. Choose this option for open-source nVidia support.
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/video.h> #include <acpi/video.h>
#include <acpi/acpi.h>
#include <linux/mxm-wmi.h>
#include "drmP.h" #include "drmP.h"
#include "drm.h" #include "drm.h"
...@@ -92,6 +94,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result) ...@@ -92,6 +94,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id) static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
{ {
mxm_wmi_call_mxds(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
return nouveau_dsm(handle, NOUVEAU_DSM_LED, mux_id, NULL); return nouveau_dsm(handle, NOUVEAU_DSM_LED, mux_id, NULL);
} }
...@@ -180,6 +183,14 @@ static bool nouveau_dsm_detect(void) ...@@ -180,6 +183,14 @@ static bool nouveau_dsm_detect(void)
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
int has_dsm = 0; int has_dsm = 0;
int vga_count = 0; int vga_count = 0;
bool guid_valid;
/* lookup the GUID */
guid_valid = mxm_wmi_supported();
if (!guid_valid)
return false;
printk("MXM GUID detected in BIOS\n");
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
vga_count++; vga_count++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment