From 04b8f0a5a16ff71c5e55e0281dbcaa32554703ec Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 2 Oct 2011 09:36:38 +0100 Subject: [PATCH] sna/accel: Add a compile option to force flushing on every blockhandler Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 008e552a..69e6dec6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -56,6 +56,7 @@ #define FORCE_GPU_ONLY 0 #define FORCE_FALLBACK 0 +#define FORCE_FLUSH 0 #define USE_SPANS 0 @@ -3310,14 +3311,6 @@ static void sna_deferred_free(struct sna *sna) } } -static uint64_t read_timer(int fd) -{ - uint64_t count = 0; - int ret = read(fd, &count, sizeof(count)); - return count; - (void)ret; -} - static struct sna_pixmap *sna_accel_scanout(struct sna *sna) { PixmapPtr front = sna->shadow ? sna->shadow : sna->front; @@ -3325,10 +3318,18 @@ static struct sna_pixmap *sna_accel_scanout(struct sna *sna) return priv && priv->gpu_bo ? priv : NULL; } -#if HAVE_SYS_TIMERFD_H +#if HAVE_SYS_TIMERFD_H && !FORCE_FLUSH #include #include +static uint64_t read_timer(int fd) +{ + uint64_t count = 0; + int ret = read(fd, &count, sizeof(count)); + return count; + (void)ret; +} + static void _sna_accel_disarm_timer(struct sna *sna, int id) { struct itimerspec to;