[PATCH] xf86SetDesiredModes enhancements

Keith Packard keithp at keithp.com
Mon Mar 17 12:11:59 PDT 2008

On Mon, 2008-03-17 at 11:17 -0700, Jesse Barnes wrote:

> So the server part of this patchset adds a new callback, ->get_crtc, to the 
> xf86OutputFuncs structure.  The new xf86GetCurrentConfig routine uses this 
> callback to build an accurate picture of which CRTCs are mapped to which 
> outputs (or NULL if the output is currently disabled) and which outputs are 
> currently active.  The call to xf86GetCurrentConfig replaces the output & 
> CRTC DPMS off calls, which eliminates one set of flicker from the startup & 
> VT switch code paths.

This won't work -- you're assuming that the crtcs that the desired
initial configuration will match the crtc/output mapping present in the
hardware before the X server starts.

The underlying assumption that the driver makes is that all mode setting
operations affect only the target crtc and outputs. However, if any of
those outputs are currently being driven by another crtc, the output
must be taken away from that crtc (and that other crtc turned off)
before the output can be assigned to new crtc. If you fail to observe
this protocol, you will lock up machines.

So, what you want to do in xf86SetDesiredModes is just turn off all
outputs and crtcs which are not hooked up the way the server will set
them up. For outputs, I think that's fairly straightforward; just
DPMSModeOff whenever the output->crtc != output->funcs->get_crtc
(output). For crtcs, you want to turn them off if no output is going to
use them, or if the set of outputs using a crtc changes.

The goal here should be to eliminate flashing when you're not switching
the output/crtc configuration, and to make sure things work reliably
when you are. We might be able to reduce flashing when you are switching
configuration around, but that's not supposed to happen very often,
especially once we have kernel mode setting that sets the desired mode
when the system is booted.

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20080317/5686c05c/attachment.pgp>

More information about the xorg mailing list