Mesa (main): iris: Directly access BOs rather than using iris_resource_bo(...)

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 24 10:43:34 UTC 2022


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jan 19 07:20:57 2022 -0800

iris: Directly access BOs rather than using iris_resource_bo(...)

iris_resource_bo() is convenient when we only have a pipe_resource *
variable, and don't need to do a lot with it other than get at the BO.

When we need to do more with a resource, we usually cast it to
iris_resource *, at which point we can just use res->bo instead.

This patch updates iris_copy_region to use src_res->bo, dst_res->bo,
rather than iris_resource_bo(src) and iris_resource_bo(dst), since we
already have those cast versions on hand.

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14667>

---

 src/gallium/drivers/iris/iris_blit.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index 3ff8e84994f..6cfdadeb80f 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -640,20 +640,20 @@ iris_copy_region(struct blorp_context *blorp,
 
    if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
       struct blorp_address src_addr = {
-         .buffer = iris_resource_bo(src), .offset = src_box->x,
+         .buffer = src_res->bo, .offset = src_box->x,
          .mocs = iris_mocs(src_res->bo, &screen->isl_dev,
                            ISL_SURF_USAGE_RENDER_TARGET_BIT),
       };
       struct blorp_address dst_addr = {
-         .buffer = iris_resource_bo(dst), .offset = dstx,
+         .buffer = dst_res->bo, .offset = dstx,
          .reloc_flags = EXEC_OBJECT_WRITE,
          .mocs = iris_mocs(dst_res->bo, &screen->isl_dev,
                            ISL_SURF_USAGE_TEXTURE_BIT),
       };
 
-      iris_emit_buffer_barrier_for(batch, iris_resource_bo(src),
+      iris_emit_buffer_barrier_for(batch, src_res->bo,
                                    IRIS_DOMAIN_OTHER_READ);
-      iris_emit_buffer_barrier_for(batch, iris_resource_bo(dst),
+      iris_emit_buffer_barrier_for(batch, dst_res->bo,
                                    IRIS_DOMAIN_RENDER_WRITE);
 
       iris_batch_maybe_flush(batch, 1500);
@@ -679,9 +679,9 @@ iris_copy_region(struct blorp_context *blorp,
                                    dstz, src_box->depth,
                                    dst_aux_usage, dst_clear_supported);
 
-      iris_emit_buffer_barrier_for(batch, iris_resource_bo(src),
+      iris_emit_buffer_barrier_for(batch, src_res->bo,
                                    IRIS_DOMAIN_OTHER_READ);
-      iris_emit_buffer_barrier_for(batch, iris_resource_bo(dst),
+      iris_emit_buffer_barrier_for(batch, dst_res->bo,
                                    IRIS_DOMAIN_RENDER_WRITE);
 
       blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);



More information about the mesa-commit mailing list