pan/bit: Use packs for Bifrost unit tests
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 14 Aug 2020 19:27:40 +0000 (15:27 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Aug 2020 11:43:52 +0000 (11:43 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>

src/panfrost/bifrost/test/bi_submit.c

index be43f95dac629f414ca358a57582976c428ff367..85837eb49633298e95048970de4f0e529f739c68 100644 (file)
@@ -139,32 +139,23 @@ bit_vertex(struct panfrost_device *dev, panfrost_program prog,
         struct panfrost_bo *var = bit_bo_create(dev, 4096);
         struct panfrost_bo *attr = bit_bo_create(dev, 4096);
 
-        struct mali_attr_meta vmeta = {
-                .index = 0,
-                .format = MALI_RGBA32UI
-        };
+        pan_pack(var->cpu, ATTRIBUTE, cfg) {
+                cfg.format = (MALI_RGBA32UI << 12);
+                cfg.unknown = true;
+        }
 
-        union mali_attr vary = {
-                .elements = (var->gpu + 1024) | MALI_ATTR_LINEAR,
-                .size = 1024
-        };
+        pan_pack(attr->cpu, ATTRIBUTE, cfg)
+                cfg.format = (MALI_RGBA32UI << 12);
 
-        union mali_attr attr_ = {
-                .elements = (attr->gpu + 1024) | MALI_ATTR_LINEAR,
-                .size = 1024
-        };
-
-        pan_pack(ubo->cpu, UNIFORM_BUFFER, cfg) {
-                cfg.entries = 64;
-                cfg.pointer = ubo->gpu + 1024;
+        pan_pack(var->cpu + 256, ATTRIBUTE_BUFFER, cfg) {
+                cfg.pointer = (var->gpu + 1024);
+                cfg.size = 1024;
         }
 
-        memcpy(var->cpu, &vmeta, sizeof(vmeta));
-
-        vmeta.unknown1 = 0x2; /* XXX: only attrib? */
-        memcpy(attr->cpu, &vmeta, sizeof(vmeta));
-        memcpy(var->cpu + 256, &vary, sizeof(vary));
-        memcpy(attr->cpu + 256, &attr_, sizeof(vary));
+        pan_pack(attr->cpu + 256, ATTRIBUTE_BUFFER, cfg) {
+                cfg.pointer = (attr->gpu + 1024);
+                cfg.size = 1024;
+        }
 
         if (sz_ubo)
                 memcpy(ubo->cpu + 1024, iubo, sz_ubo);