summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-17 14:23:21 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-06-17 15:06:56 +0100
commite0d8a49b8710f9b110638ab154af410625eb4f8d (patch)
treea6e6d2390fbda2b2ca0fc73164711f37aae9f89e /src
parent70233b3d2d55d95c7b6af7e84e272b35daae9bd0 (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> (cherry picked from commit be55066c6481b4c5e2cd39ef1c0f3be88cae0c93) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'src')
-rw-r--r--src/i830.h12
-rw-r--r--src/i830_batchbuffer.c50
-rw-r--r--src/i830_batchbuffer.h10
-rw-r--r--src/i830_uxa.c2
4 files changed, 16 insertions, 58 deletions
diff --git a/src/i830.h b/src/i830.h
index 94fe6455..4ca04812 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -169,14 +169,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
@@ -208,7 +204,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 af4d7801..7ff57eea 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;
}
@@ -232,8 +208,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);
}
@@ -242,16 +218,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 564b6a17..6422c8bf 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 64417679..d75a6c8d 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -664,7 +664,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) {