Mesa (main): panfrost: Add panfrost_make_resource_table helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 15:24:27 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue Apr  5 12:33:33 2022 -0400

panfrost: Add panfrost_make_resource_table helper

For Valhall drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>

---

 src/panfrost/lib/pan_encoder.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/panfrost/lib/pan_encoder.h b/src/panfrost/lib/pan_encoder.h
index ce80ef9e85c..585eaf7476b 100644
--- a/src/panfrost/lib/pan_encoder.h
+++ b/src/panfrost/lib/pan_encoder.h
@@ -231,4 +231,19 @@ panfrost_get_z_internal_format(enum pipe_format fmt)
 
 #endif /* PAN_ARCH */
 
+#if PAN_ARCH >= 9
+static inline void
+panfrost_make_resource_table(struct panfrost_ptr base, unsigned index,
+                             mali_ptr address, unsigned resource_count)
+{
+        if (resource_count == 0)
+                return;
+
+        pan_pack(base.cpu + index * pan_size(RESOURCE), RESOURCE, cfg) {
+                cfg.address = address;
+                cfg.size = resource_count * pan_size(BUFFER);
+        }
+}
+#endif
+
 #endif



More information about the mesa-commit mailing list