From 979035bb9ce04db5fe30efa4f6daab0a40f6af57 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 19 Jul 2012 20:06:28 +0100 Subject: [PATCH] sna: Remove topmost unused 'flush' attribute Signed-off-by: Chris Wilson --- src/sna/sna.h | 1 - src/sna/sna_accel.c | 39 ++++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/sna/sna.h b/src/sna/sna.h index 3ced2b48..f274de9d 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -192,7 +192,6 @@ struct sna { #define SNA_FORCE_SHADOW 0x20 unsigned watch_flush; - unsigned flush; struct timeval timer_tv; uint32_t timer_expire[NUM_TIMERS]; diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 6ec982eb..4ef52d7e 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -12428,7 +12428,6 @@ sna_accel_flush_callback(CallbackListPtr *list, pointer user_data, pointer call_data) { struct sna *sna = user_data; - struct list preserve; /* XXX we should be able to reduce the frequency of flushes further * by checking for outgoing damage events or sync replies. Tricky, @@ -12438,26 +12437,32 @@ sna_accel_flush_callback(CallbackListPtr *list, return; /* flush any pending damage from shadow copies to tfp clients */ - list_init(&preserve); - while (!list_is_empty(&sna->dirty_pixmaps)) { - struct sna_pixmap *priv = list_first_entry(&sna->dirty_pixmaps, - struct sna_pixmap, - list); - if (!sna_pixmap_move_to_gpu(priv->pixmap, MOVE_READ)) - list_move(&priv->list, &preserve); - } - if (!list_is_empty(&preserve)) { - sna->dirty_pixmaps.next = preserve.next; - preserve.next->prev = &sna->dirty_pixmaps; - preserve.prev->next = &sna->dirty_pixmaps; - sna->dirty_pixmaps.prev = preserve.prev; + if (!list_is_empty(&sna->dirty_pixmaps)) { + struct list preserve; + + list_init(&preserve); + + do { + struct sna_pixmap *priv; + + priv = list_first_entry(&sna->dirty_pixmaps, + struct sna_pixmap, list); + if (!sna_pixmap_move_to_gpu(priv->pixmap, MOVE_READ)) + list_move(&priv->list, &preserve); + + } while (!list_is_empty(&sna->dirty_pixmaps)); + + if (!list_is_empty(&preserve)) { + sna->dirty_pixmaps.next = preserve.next; + preserve.next->prev = &sna->dirty_pixmaps; + preserve.prev->next = &sna->dirty_pixmaps; + sna->dirty_pixmaps.prev = preserve.prev; + } } kgem_submit(&sna->kgem); - kgem_sync(&sna->kgem); - sna->flush = false; sna->kgem.flush = false; } @@ -13121,7 +13126,7 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv) if (sna_accel_do_debug_memory(sna)) sna_accel_debug_memory(sna); - if (sna->flush == 0 && sna->watch_flush == 1) { + if (sna->watch_flush == 1) { DBG(("%s: removing watchers\n", __FUNCTION__)); DeleteCallback(&FlushCallback, sna_accel_flush_callback, sna); sna->watch_flush = 0;