iris: Open-code iris_cache_flush_for_read() and iris_cache_flush_for_depth().
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 6 Feb 2020 04:36:35 +0000 (20:36 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 23:12:22 +0000 (23:12 +0000)
These have become one-liners now so they can be easily inlined.

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

src/gallium/drivers/iris/iris_blorp.c
src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_resolve.c

index b8aa81fb8311786dca793dc3d0979e64478b7c34..4c3f98eb6b24ae1e3dcf13e236e0d07e9b7fdc92 100644 (file)
@@ -282,16 +282,19 @@ iris_blorp_exec(struct blorp_batch *blorp_batch,
     * data.
     */
    if (params->src.enabled)
-      iris_cache_flush_for_read(batch, params->src.addr.buffer);
+      iris_emit_buffer_barrier_for(batch, params->src.addr.buffer,
+                                   IRIS_DOMAIN_OTHER_READ);
    if (params->dst.enabled) {
       iris_cache_flush_for_render(batch, params->dst.addr.buffer,
                                   params->dst.view.format,
                                   params->dst.aux_usage);
    }
    if (params->depth.enabled)
-      iris_cache_flush_for_depth(batch, params->depth.addr.buffer);
+      iris_emit_buffer_barrier_for(batch, params->depth.addr.buffer,
+                                   IRIS_DOMAIN_DEPTH_WRITE);
    if (params->stencil.enabled)
-      iris_cache_flush_for_depth(batch, params->stencil.addr.buffer);
+      iris_emit_buffer_barrier_for(batch, params->stencil.addr.buffer,
+                                   IRIS_DOMAIN_DEPTH_WRITE);
 
    iris_require_command_space(batch, 1400);
 
index 7827df1f4c17a18ce4e05d6d55595c918aff9a25..9d799d888bc89fe692b4ce3205c730137baa8306 100644 (file)
@@ -911,12 +911,10 @@ void iris_predraw_resolve_framebuffer(struct iris_context *ice,
 void iris_postdraw_update_resolve_tracking(struct iris_context *ice,
                                            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_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);
 int iris_get_driver_query_group_info(struct pipe_screen *pscreen,
index 95326ec210129b70cab3a3073ea4ebee4f10577d..68f37f48bcfa4de0db122d3cc090b2f8eb9c3dc9 100644 (file)
@@ -108,7 +108,7 @@ resolve_sampler_views(struct iris_context *ice,
                                        isv->view.array_len);
       }
 
-      iris_cache_flush_for_read(batch, res->bo);
+      iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_OTHER_READ);
    }
 }
 
@@ -146,7 +146,7 @@ resolve_image_views(struct iris_context *ice,
                                       aux_usage, false);
       }
 
-      iris_cache_flush_for_read(batch, res->bo);
+      iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_OTHER_READ);
    }
 }
 
@@ -204,11 +204,13 @@ iris_predraw_resolve_framebuffer(struct iris_context *ice,
                                         zs_surf->u.tex.level,
                                         zs_surf->u.tex.first_layer,
                                         num_layers);
-            iris_cache_flush_for_depth(batch, z_res->bo);
+            iris_emit_buffer_barrier_for(batch, z_res->bo,
+                                         IRIS_DOMAIN_DEPTH_WRITE);
          }
 
          if (s_res) {
-            iris_cache_flush_for_depth(batch, s_res->bo);
+            iris_emit_buffer_barrier_for(batch, s_res->bo,
+                                         IRIS_DOMAIN_DEPTH_WRITE);
          }
       }
    }
@@ -357,13 +359,6 @@ iris_flush_depth_and_render_caches(struct iris_batch *batch)
                                 PIPE_CONTROL_CONST_CACHE_INVALIDATE);
 }
 
-void
-iris_cache_flush_for_read(struct iris_batch *batch,
-                          struct iris_bo *bo)
-{
-   iris_emit_buffer_barrier_for(batch, bo, IRIS_DOMAIN_OTHER_READ);
-}
-
 static void *
 format_aux_tuple(enum isl_format format, enum isl_aux_usage aux_usage)
 {
@@ -412,13 +407,6 @@ iris_cache_flush_for_render(struct iris_batch *batch,
    }
 }
 
-void
-iris_cache_flush_for_depth(struct iris_batch *batch,
-                           struct iris_bo *bo)
-{
-   iris_emit_buffer_barrier_for(batch, bo, IRIS_DOMAIN_DEPTH_WRITE);
-}
-
 static void
 iris_resolve_color(struct iris_context *ice,
                    struct iris_batch *batch,