Commit b25b4427 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Dave Airlie

drm/nouveau: only runtime suspend by default in optimus configuration

The intent was to only enable it by default for optimus, e.g. see the
runtime_idle callback. The suspend callback may be called directly, e.g.
as a result of nouveau_crtc_set_config.
Reported-by: default avatarStefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Tested-by: default avatarStefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 0f58411d
...@@ -858,6 +858,12 @@ static int nouveau_pmops_runtime_suspend(struct device *dev) ...@@ -858,6 +858,12 @@ static int nouveau_pmops_runtime_suspend(struct device *dev)
if (nouveau_runtime_pm == 0) if (nouveau_runtime_pm == 0)
return -EINVAL; return -EINVAL;
/* are we optimus enabled? */
if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) {
DRM_DEBUG_DRIVER("failing to power off - not optimus\n");
return -EINVAL;
}
nv_debug_level(SILENT); nv_debug_level(SILENT);
drm_kms_helper_poll_disable(drm_dev); drm_kms_helper_poll_disable(drm_dev);
vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF);
......
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