From 36ac9b7191a4bbbe4fb25ced9ee27d1e91308a15 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Sat, 21 Jan 2012 14:41:44 +0800 Subject: [PATCH] glamor-fbo: Tweek the cache bucket calculation. And also reduce the expire count to 100 which should be good enough on x11perf and cairo-trace testing. Signed-off-by: Zhigang Gong --- glamor/glamor_fbo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c index 75bdf2ac8..ffda04ae0 100644 --- a/glamor/glamor_fbo.c +++ b/glamor/glamor_fbo.c @@ -6,7 +6,7 @@ #include "glamor_priv.h" -#define GLAMOR_CACHE_EXPIRE_MAX 1000 +#define GLAMOR_CACHE_EXPIRE_MAX 100 #define GLAMOR_CACHE_DEFAULT 0 #define GLAMOR_CACHE_EXACT_SIZE 1 @@ -51,7 +51,7 @@ static inline unsigned long __fls(unsigned long x) inline static int cache_wbucket(int size) { - int order = __fls(size / 256); + int order = __fls(size / 32); if (order >= CACHE_BUCKET_WCOUNT) order = CACHE_BUCKET_WCOUNT - 1; return order; @@ -59,7 +59,7 @@ inline static int cache_wbucket(int size) inline static int cache_hbucket(int size) { - int order = __fls(size / 256); + int order = __fls(size / 32); if (order >= CACHE_BUCKET_HCOUNT) order = CACHE_BUCKET_HCOUNT - 1; return order;