panfrost: Use draw pack for compute jobs
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 25 Aug 2020 19:07:41 +0000 (15:07 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 14:53:53 +0000 (14:53 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>

src/gallium/drivers/panfrost/pan_compute.c

index bccd249c31d888979329a24c4e24b48c4e44ac2c..6fdb5f0482aa5204c3e32243f7308b8d6ee1f278 100644 (file)
@@ -105,6 +105,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
 
         /* TODO: Stub */
         struct midgard_payload_vertex_tiler payload = { 0 };
+        struct mali_draw_packed postfix;
 
         /* We implement OpenCL inputs as uniforms (or a UBO -- same thing), so
          * reuse the graphics path for this by lowering to Gallium */
@@ -119,12 +120,15 @@ panfrost_launch_grid(struct pipe_context *pipe,
         if (info->input)
                 pipe->set_constant_buffer(pipe, PIPE_SHADER_COMPUTE, 0, &ubuf);
 
-        mali_ptr push = 0;
-        payload.postfix.gl_enables = (dev->quirks & IS_BIFROST) ? 0x2 : 0x6;
-        payload.postfix.shader = panfrost_emit_compute_shader_meta(batch, PIPE_SHADER_COMPUTE);
-        payload.postfix.uniform_buffers = panfrost_emit_const_buf(batch, PIPE_SHADER_COMPUTE, &push);
-        payload.postfix.uniforms = push;
-        payload.postfix.shared_memory = panfrost_emit_shared_memory(batch, info);
+        pan_pack(&postfix, DRAW, cfg) {
+                cfg.unknown_1 = (dev->quirks & IS_BIFROST) ? 0x2 : 0x6;
+                cfg.state = panfrost_emit_compute_shader_meta(batch, PIPE_SHADER_COMPUTE);
+                cfg.shared = panfrost_emit_shared_memory(batch, info);
+                cfg.uniform_buffers = panfrost_emit_const_buf(batch,
+                                PIPE_SHADER_COMPUTE, &cfg.push_uniforms);
+        }
+
+        memcpy(&payload.postfix, &postfix, sizeof(postfix));
 
         /* Invoke according to the grid info */