Mark all CRTC as currently unused for second picking CRTC pass
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Jun 2015 07:27:49 +0000 (08:27 +0100)
committerAdam Jackson <ajax@redhat.com>
Wed, 1 Jul 2015 15:13:07 +0000 (11:13 -0400)
commit3d03be780fca4949b11ead46c5ea5d3266c03c32
treee966485bcc17a468da2ad4cd1d69d096e796471c
parent53ef3fc13b3e282902892e3140765460c6f93276
Mark all CRTC as currently unused for second picking CRTC pass

We perform two passes over the CRTC in order to find the preferred CRTC
for each enabled output. In the first pass, we try to preserve the
existing output <-> CRTC relationships (to avoid unnecessary flicker).
If that pass fails, we try again but with all outputs first disabled.
However, the logic to preserve an active CRTC was not disabled along
with the outputs - meaning that if one was active but its associated
output was disabled by the user, then that CRTC would remain unavailable
for other outputs. The result would be that we would try to assign more
CRTC than available (i.e. if the user request 3 new HDMI outputs on a
system with only 3 CRTC, and wished to switch off an active internal
panel, we would report "cannot find CRTC" even though that configuration
could be established.)

Reported-and-tested-by: Nathan Schulte <nmschulte@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
xrandr.c