Don't prepare outputs & crtcs if set_mode_major is present

A driver with this hook will take care of preparing the outputs & crtcs,
so calling the prepare functions will just cause unnecessary flicker.

Fixes bug #21077
(cherry picked from commit 94648bb797)

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Jesse Barnes 2009-05-04 15:38:22 -07:00 committed by Keith Packard
parent eac2b3658a
commit fdbb6fd3d3

View File

@ -2444,18 +2444,23 @@ _X_EXPORT Bool
xf86SetDesiredModes (ScrnInfoPtr scrn) xf86SetDesiredModes (ScrnInfoPtr scrn)
{ {
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CrtcPtr crtc = config->crtc[0];
int c; int c;
/* A driver with this hook will take care of this */
if (!crtc->funcs->set_mode_major) {
xf86PrepareOutputs(scrn); xf86PrepareOutputs(scrn);
xf86PrepareCrtcs(scrn); xf86PrepareCrtcs(scrn);
}
for (c = 0; c < config->num_crtc; c++) for (c = 0; c < config->num_crtc; c++)
{ {
xf86CrtcPtr crtc = config->crtc[c];
xf86OutputPtr output = NULL; xf86OutputPtr output = NULL;
int o; int o;
RRTransformPtr transform; RRTransformPtr transform;
crtc = config->crtc[c];
/* Skip disabled CRTCs */ /* Skip disabled CRTCs */
if (!crtc->enabled) if (!crtc->enabled)
continue; continue;