aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_acpi.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2013-10-09 03:25:16 -0400
committerDave Airlie <airlied@redhat.com>2013-11-08 01:02:47 -0500
commit4c60fac111961e7eb71a08928c22b43cff55f1fb (patch)
tree84c677306b4ca1c9d07a4805255219028233cad4 /drivers/gpu/drm/nouveau/nouveau_acpi.c
parent4a15cdffa96bdd19d6233a25d394d0c50ab4d539 (diff)
drm/nouveau: consider CLASS_DISPLAY_3D devices while detecting dsm/optimus
The present code assumes that optimus is present whenever two VGA (PCI_CLASS_DISPLAY_VGA) devices are present. This does not seem to be the case of newer laptops with optimus, in which case the nvidia gpu is a PCI_CLASS_DISPLAY_3D device. Rework the logic so that we count both VGA and 3D devices, when contemplating if optimus is present on the platform. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70208 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_acpi.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index dd7d2e182719..f9a2df29a593 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -317,6 +317,16 @@ static bool nouveau_dsm_detect(void)
317 has_optimus = 1; 317 has_optimus = 1;
318 } 318 }
319 319
320 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_3D << 8, pdev)) != NULL) {
321 vga_count++;
322
323 retval = nouveau_dsm_pci_probe(pdev);
324 if (retval & NOUVEAU_DSM_HAS_MUX)
325 has_dsm |= 1;
326 if (retval & NOUVEAU_DSM_HAS_OPT)
327 has_optimus = 1;
328 }
329
320 /* find the optimus DSM or the old v1 DSM */ 330 /* find the optimus DSM or the old v1 DSM */
321 if (has_optimus == 1) { 331 if (has_optimus == 1) {
322 acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME, 332 acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME,