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

Author: Nanley Chery <[email protected]>
Date:   Tue Oct 17 12:12:49 2023 -0400

iris: Inline import_aux_info

This function is only used once. By inlining it, we can more easily
compare the CCS plane import code with the clear color plane import
code.

Reviewed-by: Jianxun Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>

---

 src/gallium/drivers/iris/iris_resource.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resource.c 
b/src/gallium/drivers/iris/iris_resource.c
index 2786febe857..bb6706f7e16 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1029,20 +1029,6 @@ iris_resource_init_aux_buf(struct iris_screen *screen,
    return true;
 }
 
-static void
-import_aux_info(struct iris_resource *res,
-                const struct iris_resource *aux_res)
-{
-   assert(aux_res->aux.surf.row_pitch_B && aux_res->aux.offset);
-   assert(res->bo == aux_res->aux.bo);
-   assert(res->aux.surf.row_pitch_B == aux_res->aux.surf.row_pitch_B);
-   assert(res->bo->size >= aux_res->aux.offset + res->aux.surf.size_B);
-
-   iris_bo_reference(aux_res->aux.bo);
-   res->aux.bo = aux_res->aux.bo;
-   res->aux.offset = aux_res->aux.offset;
-}
-
 static uint32_t
 iris_buffer_alignment(uint64_t size)
 {
@@ -1434,8 +1420,14 @@ iris_resource_from_handle(struct pipe_screen *pscreen,
          } else if (plane > main_plane) {
             /* Fill out some aux surface fields. */
             assert(!devinfo->has_flat_ccs);
-
-            import_aux_info(main_res, plane_res);
+            assert(plane_res->aux.bo->size >=
+                   plane_res->aux.offset + main_res->aux.surf.size_B);
+            assert(main_res->aux.surf.row_pitch_B ==
+                   plane_res->aux.surf.row_pitch_B);
+
+            iris_bo_reference(plane_res->aux.bo);
+            main_res->aux.bo = plane_res->aux.bo;
+            main_res->aux.offset = plane_res->aux.offset;
             map_aux_addresses(screen, main_res, whandle->format, main_plane);
          } else {
             /* Fill out fields that are convenient to initialize now. */

Reply via email to