diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-17 14:23:21 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-17 14:23:21 +0100 |
commit | be55066c6481b4c5e2cd39ef1c0f3be88cae0c93 (patch) | |
tree | 2630abb1c0f841a54285bd709deb6ebe9ab4c080 | |
parent | c187da9a24e98cbdf86f0f0dfbdcd9025c8a4c76 (diff) |
i830: Remove domain tracking from pixmaps.
The 4 integers can be reduced to a single boolean value, so do so.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/i830.h | 12 | ||||
-rw-r--r-- | src/i830_batchbuffer.c | 50 | ||||
-rw-r--r-- | src/i830_batchbuffer.h | 10 | ||||
-rw-r--r-- | src/i830_uxa.c | 2 |
4 files changed, 16 insertions, 58 deletions
@@ -168,14 +168,10 @@ struct intel_pixmap { struct list flush, batch, in_flight; - int8_t busy; - uint8_t tiling; uint16_t stride; - - uint16_t flush_write_domain; - uint16_t flush_read_domains; - uint16_t batch_write_domain; - uint16_t batch_read_domains; + uint8_t tiling; + int8_t busy :2; + int8_t batch_write :1; }; #if HAS_DEVPRIVATEKEYREC @@ -207,7 +203,7 @@ static inline void i830_set_pixmap_intel(PixmapPtr pixmap, struct intel_pixmap * static inline Bool i830_uxa_pixmap_is_dirty(PixmapPtr pixmap) { - return i830_get_pixmap_intel(pixmap)->flush_write_domain != 0; + return !list_is_empty(&i830_get_pixmap_intel(pixmap)->flush); } static inline Bool i830_pixmap_tiled(PixmapPtr pixmap) diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c index 46c9d4fb..6da20d7d 100644 --- a/src/i830_batchbuffer.c +++ b/src/i830_batchbuffer.c @@ -109,27 +109,11 @@ void intel_batch_teardown(ScrnInfoPtr scrn) intel->vertex_bo = NULL; } - while (!list_is_empty(&intel->batch_pixmaps)) { - struct intel_pixmap *entry; - - entry = list_first_entry(&intel->batch_pixmaps, - struct intel_pixmap, - batch); - - entry->batch_read_domains = entry->batch_write_domain = 0; - list_del(&entry->batch); - } - - while (!list_is_empty(&intel->flush_pixmaps)) { - struct intel_pixmap *entry; - - entry = list_first_entry(&intel->flush_pixmaps, - struct intel_pixmap, - flush); + while (!list_is_empty(&intel->batch_pixmaps)) + list_del(intel->batch_pixmaps.next); - entry->flush_read_domains = entry->flush_write_domain = 0; - list_del(&entry->flush); - } + while (!list_is_empty(&intel->flush_pixmaps)) + list_del(intel->flush_pixmaps.next); while (!list_is_empty(&intel->in_flight)) { struct intel_pixmap *entry; @@ -148,16 +132,8 @@ void intel_batch_do_flush(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); - while (!list_is_empty(&intel->flush_pixmaps)) { - struct intel_pixmap *entry; - - entry = list_first_entry(&intel->flush_pixmaps, - struct intel_pixmap, - flush); - - entry->flush_read_domains = entry->flush_write_domain = 0; - list_del(&entry->flush); - } + while (!list_is_empty(&intel->flush_pixmaps)) + list_del(intel->flush_pixmaps.next); intel->need_mi_flush = FALSE; } @@ -239,8 +215,8 @@ void intel_batch_submit(ScrnInfoPtr scrn) struct intel_pixmap, batch); - entry->batch_read_domains = entry->batch_write_domain = 0; entry->busy = -1; + entry->batch_write = 0; list_del(&entry->batch); } @@ -249,16 +225,8 @@ void intel_batch_submit(ScrnInfoPtr scrn) * the work. */ intel->need_mi_flush = !list_is_empty(&intel->flush_pixmaps); - while (!list_is_empty(&intel->flush_pixmaps)) { - struct intel_pixmap *entry; - - entry = list_first_entry(&intel->flush_pixmaps, - struct intel_pixmap, - flush); - - entry->flush_read_domains = entry->flush_write_domain = 0; - list_del(&entry->flush); - } + while (!list_is_empty(&intel->flush_pixmaps)) + list_del(intel->flush_pixmaps.next); while (!list_is_empty(&intel->in_flight)) { struct intel_pixmap *entry; diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h index 93f786a4..5375d2cf 100644 --- a/src/i830_batchbuffer.h +++ b/src/i830_batchbuffer.h @@ -123,19 +123,13 @@ intel_batch_mark_pixmap_domains(intel_screen_private *intel, { assert (read_domains); assert (write_domain == 0 || write_domain == read_domains); - assert (write_domain == 0 || - priv->flush_write_domain == 0 || - priv->flush_write_domain == write_domain); - - priv->flush_read_domains |= read_domains; - priv->batch_read_domains |= read_domains; - priv->flush_write_domain |= write_domain; - priv->batch_write_domain |= write_domain; + if (list_is_empty(&priv->batch)) list_add(&priv->batch, &intel->batch_pixmaps); if (list_is_empty(&priv->flush)) list_add(&priv->flush, &intel->flush_pixmaps); + priv->batch_write |= write_domain != 0; priv->busy = 1; } diff --git a/src/i830_uxa.c b/src/i830_uxa.c index 8d676656..7946f914 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -676,7 +676,7 @@ static Bool i830_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access) int ret; if (!list_is_empty(&priv->batch) && - (access == UXA_ACCESS_RW || priv->batch_write_domain)) + (access == UXA_ACCESS_RW || priv->batch_write)) intel_batch_submit(scrn); if (bo->size > intel->max_gtt_map_size) { |