diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-10-01 13:01:41 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-10-01 13:01:41 +1000 |
commit | 9fc3d2e7eb9e9e47fbf78a04b2951048f1ddc1be (patch) | |
tree | 8651b96c9e0ecff76957b7992401e04aaa3c6001 | |
parent | b15a810e97b8279cdbbfc90ede9e3fb51157f92b (diff) | |
download | nouveau-9fc3d2e7eb9e9e47fbf78a04b2951048f1ddc1be.tar.gz |
v3.17-rc7
-rw-r--r-- | drm/nouveau_acpi.c | 16 | ||||
-rw-r--r-- | drm/nouveau_drm.c | 1 | ||||
-rw-r--r-- | drm/nouveau_vga.c | 9 |
3 files changed, 12 insertions, 14 deletions
diff --git a/drm/nouveau_acpi.c b/drm/nouveau_acpi.c index 279206997..622424692 100644 --- a/drm/nouveau_acpi.c +++ b/drm/nouveau_acpi.c @@ -46,7 +46,6 @@ static struct nouveau_dsm_priv { bool dsm_detected; bool optimus_detected; acpi_handle dhandle; - acpi_handle other_handle; acpi_handle rom_handle; } nouveau_dsm_priv; @@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev) if (!dhandle) return false; - if (!acpi_has_method(dhandle, "_DSM")) { - nouveau_dsm_priv.other_handle = dhandle; + if (!acpi_has_method(dhandle, "_DSM")) return false; - } + if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102, 1 << NOUVEAU_DSM_POWER)) retval |= NOUVEAU_DSM_HAS_MUX; @@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void) printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", acpi_method_name); nouveau_dsm_priv.dsm_detected = true; - /* - * On some systems hotplug events are generated for the device - * being switched off when _DSM is executed. They cause ACPI - * hotplug to trigger and attempt to remove the device from - * the system, which causes it to break down. Prevent that from - * happening by setting the no_hotplug flag for the involved - * ACPI device objects. - */ - acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle); - acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle); ret = true; } diff --git a/drm/nouveau_drm.c b/drm/nouveau_drm.c index 250a5e88c..9c3af96a7 100644 --- a/drm/nouveau_drm.c +++ b/drm/nouveau_drm.c @@ -627,6 +627,7 @@ int nouveau_pmops_suspend(struct device *dev) pci_save_state(pdev); pci_disable_device(pdev); + pci_ignore_hotplug(pdev); pci_set_power_state(pdev, PCI_D3hot); return 0; } diff --git a/drm/nouveau_vga.c b/drm/nouveau_vga.c index 18d55d447..c7592ec8e 100644 --- a/drm/nouveau_vga.c +++ b/drm/nouveau_vga.c @@ -108,7 +108,16 @@ void nouveau_vga_fini(struct nouveau_drm *drm) { struct drm_device *dev = drm->dev; + bool runtime = false; + + if (nouveau_runtime_pm == 1) + runtime = true; + if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) + runtime = true; + vga_switcheroo_unregister_client(dev->pdev); + if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) + vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); vga_client_register(dev->pdev, NULL, NULL, NULL); } |