Reduce calls to RRGetInfo.

RRGetInfo can be expensive. Don't invoke it when quering Xinerama
information or setting a new CRTC configuration.
(cherry picked from commit b5aa9eb8e6eda36856a075f4b008c33f6c706bad)
This commit is contained in:
Keith Packard 2006-11-16 13:50:48 -08:00 committed by Eric Anholt
parent 07b26e690c
commit ef47d9c3ba
2 changed files with 5 additions and 8 deletions

View File

@ -632,13 +632,6 @@ ProcRRSetCrtcConfig (ClientPtr client)
pScreen = crtc->pScreen;
pScrPriv = rrGetScrPriv(pScreen);
if (!RRGetInfo (pScreen))
{
if (outputs)
xfree (outputs);
return BadAlloc;
}
time = ClientTimeToServerTime(stuff->timestamp);
configTime = ClientTimeToServerTime(stuff->configTimestamp);

View File

@ -260,7 +260,11 @@ ProcRRXineramaQueryScreens(ClientPtr client)
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
if (RRXineramaScreenActive (pScreen))
RRGetInfo (pScreen);
{
rrScrPriv(pScreen);
if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0)
RRGetInfo (pScreen);
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;