RandR: config time updates when hardware config changes.

The config time in the RandR protocol reflects when the hardware state has
changed. It was getting changed anytime the driver changed the usage
of the hardware as well.
This commit is contained in:
Keith Packard 2006-12-12 22:59:03 -08:00
parent 78689d0d66
commit 98d18a6578
5 changed files with 29 additions and 15 deletions

View File

@ -415,7 +415,11 @@ RRTellChanged (ScreenPtr pScreen)
if (pScrPriv->changed)
{
UpdateCurrentTime ();
pScrPriv->lastConfigTime = currentTime;
if (pScrPriv->configChanged)
{
pScrPriv->lastConfigTime = currentTime;
pScrPriv->configChanged = FALSE;
}
pScrPriv->changed = FALSE;
WalkTree (pScreen, TellChanged, (pointer) pScreen);
for (i = 0; i < pScrPriv->numOutputs; i++)

View File

@ -216,11 +216,14 @@ typedef struct _rrScrPriv {
TimeStamp lastSetTime; /* last changed by client */
TimeStamp lastConfigTime; /* possible configs changed */
RRCloseScreenProcPtr CloseScreen;
Bool changed; /* some config changed */
Bool configChanged; /* configuration changed */
Bool layoutChanged; /* screen layout changed */
CARD16 minWidth, minHeight;
CARD16 maxWidth, maxHeight;
CARD16 width, height; /* last known screen size */
Bool layoutChanged; /* screen layout changed */
int numOutputs;
RROutputPtr *outputs;
@ -619,10 +622,13 @@ ProcRRDeleteOutputMode (ClientPtr client);
/* rroutput.c */
/*
* Notify the output of some change
* Notify the output of some change. configChanged indicates whether
* any external configuration (mode list, clones, connected status)
* has changed, or whether the change was strictly internal
* (which crtc is in use)
*/
void
RROutputChanged (RROutputPtr output);
RROutputChanged (RROutputPtr output, Bool configChanged);
/*
* Create an output

View File

@ -136,7 +136,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
break;
if (j == crtc->numOutputs)
{
RROutputChanged (outputs[i]);
RROutputChanged (outputs[i], FALSE);
RRCrtcChanged (crtc, FALSE);
}
}
@ -151,7 +151,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
break;
if (i == numOutputs)
{
RROutputChanged (crtc->outputs[j]);
RROutputChanged (crtc->outputs[j], FALSE);
RRCrtcChanged (crtc, FALSE);
}
}

View File

@ -69,6 +69,7 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh)
output->modes = modes;
output->changed = TRUE;
pScrPriv->changed = TRUE;
pScrPriv->configChanged = TRUE;
return mode;
}
@ -205,6 +206,7 @@ RRGetInfo (ScreenPtr pScreen)
rotations = 0;
pScrPriv->changed = FALSE;
pScrPriv->configChanged = FALSE;
if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations))
return FALSE;

View File

@ -28,7 +28,7 @@ RESTYPE RROutputType;
* Notify the output of some change
*/
void
RROutputChanged (RROutputPtr output)
RROutputChanged (RROutputPtr output, Bool configChanged)
{
ScreenPtr pScreen = output->pScreen;
@ -37,6 +37,8 @@ RROutputChanged (RROutputPtr output)
{
rrScrPriv (pScreen);
pScrPriv->changed = TRUE;
if (configChanged)
pScrPriv->configChanged = TRUE;
}
}
@ -106,7 +108,7 @@ RROutputAttachScreen (RROutputPtr output, ScreenPtr pScreen)
output->pScreen = pScreen;
pScrPriv->outputs = outputs;
pScrPriv->outputs[pScrPriv->numOutputs++] = output;
RROutputChanged (output);
RROutputChanged (output, FALSE);
return TRUE;
}
@ -142,7 +144,7 @@ RROutputSetClones (RROutputPtr output,
memcpy (newClones, clones, numClones * sizeof (RROutputPtr));
output->clones = newClones;
output->numClones = numClones;
RROutputChanged (output);
RROutputChanged (output, TRUE);
return TRUE;
}
@ -186,7 +188,7 @@ RROutputSetModes (RROutputPtr output,
output->modes = newModes;
output->numModes = numModes;
output->numPreferred = numPreferred;
RROutputChanged (output);
RROutputChanged (output, TRUE);
return TRUE;
}
@ -219,7 +221,7 @@ RROutputSetCrtcs (RROutputPtr output,
memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr));
output->crtcs = newCrtcs;
output->numCrtcs = numCrtcs;
RROutputChanged (output);
RROutputChanged (output, TRUE);
return TRUE;
}
@ -229,7 +231,7 @@ RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc)
if (output->crtc == crtc)
return;
output->crtc = crtc;
RROutputChanged (output);
RROutputChanged (output, FALSE);
}
Bool
@ -239,7 +241,7 @@ RROutputSetConnection (RROutputPtr output,
if (output->connection == connection)
return TRUE;
output->connection = connection;
RROutputChanged (output);
RROutputChanged (output, TRUE);
return TRUE;
}
@ -251,7 +253,7 @@ RROutputSetSubpixelOrder (RROutputPtr output,
return TRUE;
output->subpixelOrder = subpixelOrder;
RROutputChanged (output);
RROutputChanged (output, FALSE);
return TRUE;
}
@ -264,7 +266,7 @@ RROutputSetPhysicalSize (RROutputPtr output,
return TRUE;
output->mmWidth = mmWidth;
output->mmHeight = mmHeight;
RROutputChanged (output);
RROutputChanged (output, FALSE);
return TRUE;
}