From ef47d9c3ba63e9a6243fe5c81ccc60c8246352b4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 16 Nov 2006 13:50:48 -0800 Subject: [PATCH] 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) --- randr/rrcrtc.c | 7 ------- randr/rrxinerama.c | 6 +++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index c945468bf..b81c390f1 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -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); diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index a8e4b390b..771ed0976 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -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;