diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2013-12-11 22:19:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 12:25:12 -0800 |
commit | d71c346c8c008f1b27eecdc15fa2fb5fb8fa1751 (patch) | |
tree | b9741f88d857e66b0894a941d14c7e186165e088 /drivers/gpu/drm | |
parent | ec3ee0c39ec8eee906aed39c1173e636d62840f9 (diff) | |
download | lwn-d71c346c8c008f1b27eecdc15fa2fb5fb8fa1751.tar.gz lwn-d71c346c8c008f1b27eecdc15fa2fb5fb8fa1751.zip |
drm/nouveau: only runtime suspend by default in optimus configuration
commit b25b4427e9dfba073cf9bc86603956ed395eb6e3 upstream.
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: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index e893c5362402..32c6b0a60fb3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -879,6 +879,12 @@ static int nouveau_pmops_runtime_suspend(struct device *dev) if (nouveau_runtime_pm == 0) 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; + } + drm_kms_helper_poll_disable(drm_dev); vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); nouveau_switcheroo_optimus_dsm(); |