Mesa (main): iris: Demote all callers of iris_flush_and_dirty_for_history() to iris_dirty_for_history().

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 4 17:53:22 UTC 2022


Module: Mesa
Branch: main
Commit: bbb103be0e04ed98ac9810d98e7208db47a763b5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbb103be0e04ed98ac9810d98e7208db47a763b5

Author: Francisco Jerez <currojerez at riseup.net>
Date:   Thu Apr 30 15:11:19 2020 -0700

iris: Demote all callers of iris_flush_and_dirty_for_history() to iris_dirty_for_history().

The unconditional flushing performed by
iris_flush_and_dirty_for_history() is now redundant with the memory
barriers introduced previously in this series, which should be in a
better position to determine from which domain the buffer will
actually be used in the future, and whether an additional flush or
invalidation is required or redundant with other PIPE_CONTROL commands
emitted elsewhere.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>

---

 src/gallium/drivers/iris/iris_blit.c     |  9 ++-------
 src/gallium/drivers/iris/iris_clear.c    | 10 +++-------
 src/gallium/drivers/iris/iris_resource.c | 17 -----------------
 src/gallium/drivers/iris/iris_resource.h |  5 -----
 4 files changed, 5 insertions(+), 36 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index 3f1239cd5c1..34b2e06cb35 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -559,10 +559,7 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
 
    blorp_batch_finish(&blorp_batch);
 
-   iris_flush_and_dirty_for_history(ice, batch, (struct iris_resource *)
-                                    info->dst.resource,
-                                    PIPE_CONTROL_RENDER_TARGET_FLUSH,
-                                    "cache history: post-blit");
+   iris_dirty_for_history(ice, (struct iris_resource *)info->dst.resource);
 }
 
 static void
@@ -780,9 +777,7 @@ iris_resource_copy_region(struct pipe_context *ctx,
                        dsty, dstz, &s_src_res->base.b, src_level, src_box);
    }
 
-   iris_flush_and_dirty_for_history(ice, batch, (struct iris_resource *)p_dst,
-                                    PIPE_CONTROL_RENDER_TARGET_FLUSH,
-                                    "cache history: post copy_region");
+   iris_dirty_for_history(ice, (struct iris_resource *) p_dst);
 }
 
 void
diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c
index ffd117e4a30..16387b43aa5 100644
--- a/src/gallium/drivers/iris/iris_clear.c
+++ b/src/gallium/drivers/iris/iris_clear.c
@@ -366,9 +366,7 @@ clear_color(struct iris_context *ice,
    blorp_batch_finish(&blorp_batch);
    iris_batch_sync_region_end(batch);
 
-   iris_flush_and_dirty_for_history(ice, batch, res,
-                                    PIPE_CONTROL_RENDER_TARGET_FLUSH,
-                                    "cache history: post color clear");
+   iris_dirty_for_history(ice, res);
 
    iris_resource_finish_render(ice, res, level,
                                box->z, box->depth, aux_usage);
@@ -544,8 +542,7 @@ clear_depth_stencil(struct iris_context *ice,
        can_fast_clear_depth(ice, z_res, level, box, render_condition_enabled,
                             depth)) {
       fast_clear_depth(ice, z_res, level, box, depth);
-      iris_flush_and_dirty_for_history(ice, batch, res, 0,
-                                       "cache history: post fast Z clear");
+      iris_dirty_for_history(ice, res);
       clear_depth = false;
       z_res = false;
    }
@@ -595,8 +592,7 @@ clear_depth_stencil(struct iris_context *ice,
    blorp_batch_finish(&blorp_batch);
    iris_batch_sync_region_end(batch);
 
-   iris_flush_and_dirty_for_history(ice, batch, res, 0,
-                                    "cache history: post slow ZS clear");
+   iris_dirty_for_history(ice, res);
 
    if (clear_depth && z_res) {
       iris_resource_finish_render(ice, z_res, level, box->z, box->depth,
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 2a8673b6c99..7bebaae1de3 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -2567,23 +2567,6 @@ iris_flush_bits_for_history(struct iris_context *ice,
    return flush;
 }
 
-void
-iris_flush_and_dirty_for_history(struct iris_context *ice,
-                                 struct iris_batch *batch,
-                                 struct iris_resource *res,
-                                 uint32_t extra_flags,
-                                 const char *reason)
-{
-   if (res->base.b.target != PIPE_BUFFER)
-      return;
-
-   uint32_t flush = iris_flush_bits_for_history(ice, res) | extra_flags;
-
-   iris_emit_pipe_control_flush(batch, reason, flush);
-
-   iris_dirty_for_history(ice, res);
-}
-
 bool
 iris_resource_set_clear_color(struct iris_context *ice,
                               struct iris_resource *res,
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index bb4330800f4..ad99747a438 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -342,11 +342,6 @@ void iris_dirty_for_history(struct iris_context *ice,
 uint32_t iris_flush_bits_for_history(struct iris_context *ice,
                                      struct iris_resource *res);
 
-void iris_flush_and_dirty_for_history(struct iris_context *ice,
-                                      struct iris_batch *batch,
-                                      struct iris_resource *res,
-                                      uint32_t extra_flags,
-                                      const char *reason);
 
 unsigned iris_get_num_logical_layers(const struct iris_resource *res,
                                      unsigned level);



More information about the mesa-commit mailing list