diff --git a/dix/resource.c b/dix/resource.c index b6ef99f10..a42cd007f 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -620,7 +620,12 @@ ilog2(int val) unsigned int ResourceClientBits(void) { - return (ilog2(LimitClients)); + static unsigned int cached = 0; + + if (cached == 0) + cached = ilog2(LimitClients); + + return cached; } /*****************