panfrost: Don't call panfrost_vt_init for compute
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 25 Aug 2020 16:52:45 +0000 (12:52 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 14:53:53 +0000 (14:53 +0000)
Given we emit shared memory immediately after anyway, the function call
doesn't do anything but zero-initializing the payload and setting some
magic bits. We can do that ourselves at the call site.

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_cmdstream.c
src/gallium/drivers/panfrost/pan_cmdstream.h
src/gallium/drivers/panfrost/pan_compute.c

index 7d7ec775dc0fd7a0ee73e92a26cebfc3213680c5..610e7f89c6ca8385385d5422ce9c8f6d9d34d236 100644 (file)
@@ -51,7 +51,7 @@ panfrost_bo_access_for_stage(enum pipe_shader_type stage)
                PAN_BO_ACCESS_VERTEX_TILER;
 }
 
-static mali_ptr
+mali_ptr
 panfrost_vt_emit_shared_memory(struct panfrost_batch *batch)
 {
         struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
index 3603dcc2bc3ff657d5a522dcd3ad0355dd0244f0..18ecee6a375193d1fbdd6644a3e463bdbcb52ae6 100644 (file)
@@ -81,6 +81,9 @@ mali_ptr
 panfrost_emit_vertex_data(struct panfrost_batch *batch,
                           mali_ptr *buffers);
 
+mali_ptr
+panfrost_vt_emit_shared_memory(struct panfrost_batch *batch);
+
 void
 panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
                                  unsigned vertex_count,
index 14ec88e70f38df828367e8b4e45def9ce5acd795..bccd249c31d888979329a24c4e24b48c4e44ac2c 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "pan_context.h"
 #include "pan_cmdstream.h"
+#include "panfrost-quirks.h"
 #include "pan_bo.h"
 #include "util/u_memory.h"
 #include "nir_serialize.h"
@@ -95,6 +96,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
                 const struct pipe_grid_info *info)
 {
         struct panfrost_context *ctx = pan_context(pipe);
+        struct panfrost_device *dev = pan_device(pipe->screen);
 
         /* TODO: Do we want a special compute-only batch? */
         struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
@@ -102,7 +104,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
         ctx->compute_grid = info;
 
         /* TODO: Stub */
-        struct midgard_payload_vertex_tiler payload;
+        struct midgard_payload_vertex_tiler payload = { 0 };
 
         /* We implement OpenCL inputs as uniforms (or a UBO -- same thing), so
          * reuse the graphics path for this by lowering to Gallium */
@@ -117,9 +119,8 @@ panfrost_launch_grid(struct pipe_context *pipe,
         if (info->input)
                 pipe->set_constant_buffer(pipe, PIPE_SHADER_COMPUTE, 0, &ubuf);
 
-        panfrost_vt_init(ctx, PIPE_SHADER_COMPUTE, &payload.prefix, &payload.postfix);
-
         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;