Bug 29929 - Failure to switch external monitors: xrandr --auto should free unused crtcs
Summary: Failure to switch external monitors: xrandr --auto should free unused crtcs
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xrandr (show other bugs)
Version: 7.5 (2009.10)
Hardware: All All
: medium major
Assignee: Keith Packard
QA Contact: Xorg Project Team
URL:
Whiteboard: 2011BRB_Reviewed
Keywords:
: 37586 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-01 02:29 UTC by tim.holy
Modified: 2018-08-10 20:33 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description tim.holy 2010-09-01 02:29:27 UTC
If your laptop video card has only 2 crtcs (one of which is devoted to the laptop LVDS display), then switching between two different external monitors often fails if one of them is connected with a digital (DVI) connector and the other uses a VGA connector, unless one explicitly turns off the first output, e.g.,
xrandr --output VGA-0 --off

xrandr's command line output does not clearly convey the problem or the solution; moreover, the behavior of "xrandr --auto" clearly does not live up to the second promise it makes in the man page:

--auto: For connected but disabled outputs, this will enable them using their preferred mode (or, something close to 96dpi if they have no preferred mode). For disconnected but enabled outputs, this will disable them.

The "disabling disconnected outputs" part must be incomplete because the crtc remains held by the first output even though it is disconnected, resulting in errors like:
xrandr: cannot find crtc for output DVI-0

For more information, see the discussion here:
https://bugs.freedesktop.org/show_bug.cgi?id=29852

Suggested fixes:
1. xrandr --auto should first turn off any disconnected outputs before enabling new outputs
2. The output of xrandr -q should more clearly distinguish disconnected but not disabled outputs.
Comment 1 Jeremy Huddleston Sequoia 2011-10-08 19:32:26 UTC
*** Bug 37586 has been marked as a duplicate of this bug. ***
Comment 2 bugzilla 2012-10-24 01:53:13 UTC
This problem persists as of xrandr 1.3.5 / Xorg 1.13.0
Comment 3 gezuru 2012-12-14 15:57:06 UTC
Yes please. This is needed when switching from a "1 internal screen" to a "2 external screens" setup or back. Otherwise xrandr cannot enable some configurations that are completely valid.
Comment 4 Chris Bainbridge 2014-04-28 13:01:48 UTC
Bug still present in Debian Testing / xrandr 1.4.1
This is a Macbook 13 with passive cables, so displays present are: eDP1 HDMI1 HDMI2 HDMI3

To reproduce: 
$ xrandr --output eDP1 --off --output HDMI1 --auto --output HDMI2 --auto --output HDMI3 --auto
xrandr: cannot find crtc for output HDMI3

or while triplehead is active:
$ xrandr --output HDMI1 --off --output HDMI2 --off --output HDMI3 --off --output eDP1 --auto
xrandr: cannot find crtc for output eDP1

There is (/would be) a crtc available since the three external monitors are being turned off.

Workaround turning external monitors on:

xrandr --output eDP1 --off --output HDMI1 --auto --output HDMI2 --auto --right-of HDMI1
xrandr --output HDMI3 --auto --right-of HDMI2

Workaround turning external monitors off:

xrandr --output HDMI3 --off
xrandr --output HDMI1 --off --output HDMI2 --off --output eDP1 --auto

ie. turning eDP1 or HDMI3 off first releases the crtc. But afaics it shouldn't be necessary to split the xrandr calls like this? xrandr should calculate that there will be a free crtc from the --off operation.
Comment 5 GitLab Migration User 2018-08-10 20:33:31 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/app/xrandr/issues/10.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.