aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-08-25 19:00:54 -0400
committerDave Airlie <airlied@redhat.com>2016-08-31 02:54:05 -0400
commit279cf3f23870f7eb8ca071115e06d3d5ca0a2b9e (patch)
tree22742864be6b52c5f6a89a356d125a01e5eb03c5
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
drm/nouveau/acpi: use DSM if bridge does not support D3cold
Even if PR3 support is available on the bridge, it will not be used if the PCI layer considers it unavailable (i.e. on all laptops from 2013 and 2014). Ensure that this condition is checked to allow a fallback to the Optimus DSM for device poweroff. Initially I wanted to call pci_d3cold_enable before checking bridge_d3 (in case the user changed d3cold_allowed), but that is such an unlikely case and likely fragile anyway. The current patch is suggested by Mika in http://www.spinics.net/lists/linux-pci/msg52599.html Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index f2ad17aa33f0..dc57b628e074 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -225,6 +225,17 @@ static bool nouveau_pr3_present(struct pci_dev *pdev)
225 if (!parent_pdev) 225 if (!parent_pdev)
226 return false; 226 return false;
227 227
228 if (!parent_pdev->bridge_d3) {
229 /*
230 * Parent PCI bridge is currently not power managed.
231 * Since userspace can change these afterwards to be on
232 * the safe side we stick with _DSM and prevent usage of
233 * _PR3 from the bridge.
234 */
235 pci_d3cold_disable(pdev);
236 return false;
237 }
238
228 parent_adev = ACPI_COMPANION(&parent_pdev->dev); 239 parent_adev = ACPI_COMPANION(&parent_pdev->dev);
229 if (!parent_adev) 240 if (!parent_adev)
230 return false; 241 return false;