Mesa (main): iris: Change a param of iris_resource_init_aux_buf

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 11 04:39:16 UTC 2021


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

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Tue Oct 19 08:12:30 2021 -0700

iris: Change a param of iris_resource_init_aux_buf

Have iris_resource_init_aux_buf compute the clear color state size
(with an iris_screen struct) instead of passing it in directly.

We're going to move the function call soon. This keeps us from having to
move a passed in variable along with it.

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13555>

---

 src/gallium/drivers/iris/iris_resource.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 96424eb8a0c..d8c48465419 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -853,8 +853,8 @@ iris_resource_configure_aux(struct iris_screen *screen,
  * Returns false on unexpected error (e.g. mapping a BO failed).
  */
 static bool
-iris_resource_init_aux_buf(struct iris_resource *res,
-                           unsigned clear_color_state_size)
+iris_resource_init_aux_buf(struct iris_screen *screen,
+                           struct iris_resource *res)
 {
    void *map = iris_bo_map(NULL, res->aux.bo, MAP_WRITE | MAP_RAW);
 
@@ -873,11 +873,11 @@ iris_resource_init_aux_buf(struct iris_resource *res,
 
    /* Zero the indirect clear color to match ::fast_clear_color. */
    memset((char *)map + res->aux.clear_color_offset, 0,
-          clear_color_state_size);
+          iris_get_aux_clear_color_state_size(screen));
 
    iris_bo_unmap(res->aux.bo);
 
-   if (clear_color_state_size > 0) {
+   if (iris_get_aux_clear_color_state_size(screen) > 0) {
       res->aux.clear_color_bo = res->aux.bo;
       iris_bo_reference(res->aux.clear_color_bo);
    }
@@ -1112,9 +1112,7 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
    if (res->aux.surf.size_B > 0) {
       res->aux.bo = res->bo;
       iris_bo_reference(res->aux.bo);
-      unsigned clear_color_state_size =
-         iris_get_aux_clear_color_state_size(screen);
-      if (!iris_resource_init_aux_buf(res, clear_color_state_size))
+      if (!iris_resource_init_aux_buf(screen, res))
          goto fail;
       map_aux_addresses(screen, res, res->surf.format, 0);
    }



More information about the mesa-commit mailing list