[PATCH] xf86SetDesiredModes enhancements
jbarnes at virtuousgeek.org
Mon Mar 17 12:36:55 PDT 2008
On Monday, March 17, 2008 12:11 pm Keith Packard wrote:
> 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.
Yeah, I got mixed up between how output->crtc was used.
xf86InitialConfiguration sets it to what the CRTC mapping *will* be, but
other code made me think it was using it purely as a "current configuration"
> 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.
Something like the attached patch?
> 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.
Right, once this is working right I'll need to port it to the kernel along
with some other flicker reduction stuff there.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3430 bytes
Desc: not available
More information about the xorg