summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2020-02-06 21:07:04 -0800
committerFrancisco Jerez <currojerez@riseup.net>2020-02-06 21:37:06 -0800
commitf66d3900eb7876cfa71d36e3d2dfdffa8816dc0e (patch)
treedd41e7434d2fad7f1c4571688892181591bfae60
parent74bc585df27ba894a9025242f9e8f1762b113a99 (diff)
WIP: iris: Remove render cache set-based synchronization.
-rw-r--r--src/gallium/drivers/iris/iris_batch.c2
-rw-r--r--src/gallium/drivers/iris/iris_blorp.c5
-rw-r--r--src/gallium/drivers/iris/iris_context.h5
-rw-r--r--src/gallium/drivers/iris/iris_pipe_control.c6
-rw-r--r--src/gallium/drivers/iris/iris_resolve.c44
5 files changed, 4 insertions, 58 deletions
diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
index 2c00c95fb2a..e77c8e25f0e 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -384,8 +384,6 @@ iris_batch_reset(struct iris_batch *batch)
iris_batch_add_syncpt(batch, syncpt, I915_EXEC_FENCE_SIGNAL);
iris_syncpt_reference(screen, &syncpt, NULL);
- iris_cache_sets_clear(batch);
-
assert(!batch->sync_region_depth);
iris_batch_sync_boundary(batch);
iris_batch_mark_reset_sync(batch);
diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c
index e0508840e7c..9d16e337520 100644
--- a/src/gallium/drivers/iris/iris_blorp.c
+++ b/src/gallium/drivers/iris/iris_blorp.c
@@ -368,11 +368,6 @@ iris_blorp_exec(struct blorp_batch *blorp_batch,
ice->state.dirty |= ~skip_bits;
- if (params->dst.enabled) {
- iris_render_cache_add_bo(batch, params->dst.addr.buffer,
- params->dst.view.format,
- params->dst.aux_usage);
- }
if (params->dst.enabled)
iris_bo_bump_seqno(params->dst.addr.buffer, batch->next_seqno,
IRIS_DOMAIN_RENDER_WRITE);
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 247fdc9fa03..6ba4440aa04 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -974,17 +974,12 @@ void iris_predraw_resolve_framebuffer(struct iris_context *ice,
bool *draw_aux_buffer_disabled);
void iris_postdraw_update_resolve_tracking(struct iris_context *ice,
struct iris_batch *batch);
-void iris_cache_sets_clear(struct iris_batch *batch);
void iris_flush_depth_and_render_caches(struct iris_batch *batch);
void iris_cache_flush_for_read(struct iris_batch *batch, struct iris_bo *bo);
void iris_cache_flush_for_render(struct iris_batch *batch,
struct iris_bo *bo,
enum isl_format format,
enum isl_aux_usage aux_usage);
-void iris_render_cache_add_bo(struct iris_batch *batch,
- struct iris_bo *bo,
- enum isl_format format,
- enum isl_aux_usage aux_usage);
void iris_cache_flush_for_depth(struct iris_batch *batch, struct iris_bo *bo);
int iris_get_driver_query_info(struct pipe_screen *pscreen, unsigned index,
struct pipe_driver_query_info *info);
diff --git a/src/gallium/drivers/iris/iris_pipe_control.c b/src/gallium/drivers/iris/iris_pipe_control.c
index fe4e4b8a3dc..3cae862f48d 100644
--- a/src/gallium/drivers/iris/iris_pipe_control.c
+++ b/src/gallium/drivers/iris/iris_pipe_control.c
@@ -245,8 +245,7 @@ iris_texture_barrier(struct pipe_context *ctx, unsigned flags)
struct iris_batch *render_batch = &ice->batches[IRIS_BATCH_RENDER];
struct iris_batch *compute_batch = &ice->batches[IRIS_BATCH_COMPUTE];
- if (render_batch->contains_draw ||
- render_batch->cache.render->entries) {
+ if (render_batch->contains_draw) {
iris_batch_maybe_flush(render_batch, 48);
iris_emit_pipe_control_flush(render_batch,
"API: texture barrier (1/2)",
@@ -292,8 +291,7 @@ iris_memory_barrier(struct pipe_context *ctx, unsigned flags)
}
for (int i = 0; i < IRIS_BATCH_COUNT; i++) {
- if (ice->batches[i].contains_draw ||
- ice->batches[i].cache.render->entries) {
+ if (ice->batches[i].contains_draw) {
iris_batch_maybe_flush(&ice->batches[i], 24);
iris_emit_pipe_control_flush(&ice->batches[i], "API: memory barrier",
bits);
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index 52c2a94482a..70808f6196e 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -314,9 +314,6 @@ iris_postdraw_update_resolve_tracking(struct iris_context *ice,
struct iris_resource *res = (void *) surf->base.texture;
enum isl_aux_usage aux_usage = ice->state.draw_aux_usage[i];
- iris_render_cache_add_bo(batch, res->bo, surf->view.format,
- aux_usage);
-
if (may_have_resolved_color) {
union pipe_surface_desc *desc = &surf->base.u;
unsigned num_layers =
@@ -329,16 +326,6 @@ iris_postdraw_update_resolve_tracking(struct iris_context *ice,
}
/**
- * Clear the cache-tracking sets.
- */
-void
-iris_cache_sets_clear(struct iris_batch *batch)
-{
- hash_table_foreach(batch->cache.render, render_entry)
- _mesa_hash_table_remove(batch->cache.render, render_entry);
-}
-
-/**
* Emits an appropriate flush for a BO if it has been rendered to within the
* same batchbuffer as a read that's about to be emitted.
*
@@ -363,17 +350,12 @@ iris_flush_depth_and_render_caches(struct iris_batch *batch)
"cache tracker: render-to-texture",
PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE |
PIPE_CONTROL_CONST_CACHE_INVALIDATE);
-
- iris_cache_sets_clear(batch);
}
void
iris_cache_flush_for_read(struct iris_batch *batch,
struct iris_bo *bo)
{
- if (_mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo))
- iris_flush_depth_and_render_caches(batch);
-
iris_emit_buffer_barrier_for(batch, bo, IRIS_DOMAIN_OTHER_READ);
}
@@ -416,38 +398,16 @@ iris_cache_flush_for_render(struct iris_batch *batch,
*/
struct hash_entry *entry =
_mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo);
- if (entry && entry->data != format_aux_tuple(format, aux_usage))
+ if (entry && entry->data != format_aux_tuple(format, aux_usage)) {
iris_flush_depth_and_render_caches(batch);
-}
-
-void
-iris_render_cache_add_bo(struct iris_batch *batch,
- struct iris_bo *bo,
- enum isl_format format,
- enum isl_aux_usage aux_usage)
-{
-#ifndef NDEBUG
- struct hash_entry *entry =
- _mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo);
- if (entry) {
- /* Otherwise, someone didn't do a flush_for_render and that would be
- * very bad indeed.
- */
- assert(entry->data == format_aux_tuple(format, aux_usage));
+ entry->data = format_aux_tuple(format, aux_usage);
}
-#endif
-
- _mesa_hash_table_insert_pre_hashed(batch->cache.render, bo->hash, bo,
- format_aux_tuple(format, aux_usage));
}
void
iris_cache_flush_for_depth(struct iris_batch *batch,
struct iris_bo *bo)
{
- if (_mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo))
- iris_flush_depth_and_render_caches(batch);
-
iris_emit_buffer_barrier_for(batch, bo, IRIS_DOMAIN_DEPTH_WRITE);
}