panfrost: Pass the texture payload through a panfrost_ptr
authorBoris Brezillon <boris.brezillon@collabora.com>
Sun, 18 Oct 2020 08:27:48 +0000 (10:27 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 23 Oct 2020 14:48:22 +0000 (14:48 +0000)
We want to be able to pass a payload allocated from the pool, so let's
change the function prototype to allow that.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>

src/gallium/drivers/panfrost/pan_context.c
src/panfrost/lib/pan_texture.c
src/panfrost/lib/pan_texture.h

index 6f5742f..a09e4f8 100644 (file)
@@ -1045,8 +1045,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                                 prsrc->cubemap_stride,
                                 panfrost_translate_swizzle_4(composed_swizzle),
                                 prsrc->bo->ptr.gpu,
-                                prsrc->slices,
-                                so->bo);
+                                prsrc->slices, &so->bo->ptr);
         } else {
                 unsigned size = panfrost_estimate_texture_payload_size(
                                 so->base.u.tex.first_level,
index cda1802..8f3e4e9 100644 (file)
@@ -401,7 +401,7 @@ panfrost_new_texture_bifrost(
         unsigned swizzle,
         mali_ptr base,
         struct panfrost_slice *slices,
-        struct panfrost_bo *payload)
+        const struct panfrost_ptr *payload)
 {
         const struct util_format_description *desc =
                 util_format_description(format);
@@ -410,7 +410,7 @@ panfrost_new_texture_bifrost(
         assert(mali_format);
 
         panfrost_emit_texture_payload(
-                payload->ptr.cpu,
+                payload->cpu,
                 desc,
                 mali_format,
                 dim,
@@ -437,7 +437,7 @@ panfrost_new_texture_bifrost(
                 cfg.swizzle = swizzle;
                 cfg.texel_ordering = panfrost_modifier_to_layout(modifier);
                 cfg.levels = last_level - first_level;
-                cfg.surfaces = payload->ptr.gpu;
+                cfg.surfaces = payload->gpu;
 
                 /* We specify API-level LOD clamps in the sampler descriptor
                  * and use these clamps simply for bounds checking */
index fe25f96..c540012 100644 (file)
@@ -127,7 +127,7 @@ panfrost_new_texture_bifrost(
         unsigned swizzle,
         mali_ptr base,
         struct panfrost_slice *slices,
-        struct panfrost_bo *payload);
+        const struct panfrost_ptr *payload);
 
 
 unsigned