Reduce calls to RRGetInfo.

RRGetInfo can be expensive. Don't invoke it when quering Xinerama
information or setting a new CRTC configuration.
This commit is contained in:
Keith Packard 2006-11-16 13:50:48 -08:00
parent 8b2a7e94a1
commit b5aa9eb8e6
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;