panfrost: Update Bifrost fields in mali_shader_meta
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 30 Apr 2020 08:32:11 +0000 (10:32 +0200)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 1 May 2020 14:52:19 +0000 (16:52 +0200)
Not much is known currently about these fields and their values, but
this gets things going in the scenarios we have been testing with so
far.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4832>

src/gallium/drivers/panfrost/pan_cmdstream.c

index f1e690c72eb8a4fc7ed3fa6e9130150abaed628e..02e15d6c8e5148a1364c48bd1f121bdd019ccf48 100644 (file)
@@ -327,9 +327,19 @@ panfrost_shader_meta_init(struct panfrost_context *ctx,
         meta->sampler_count = ctx->sampler_count[st];
 
         if (dev->quirks & IS_BIFROST) {
-                meta->bifrost1.unk1 = 0x800200;
+                if (st == PIPE_SHADER_VERTEX)
+                        meta->bifrost1.unk1 = 0x800000;
+                else {
+                        /* First clause ATEST |= 0x4000000.
+                         * Less than 32 regs |= 0x200 */
+                        meta->bifrost1.unk1 = 0x958020;
+                }
+
                 meta->bifrost1.uniform_buffer_count = panfrost_ubo_count(ctx, st);
-                meta->bifrost2.preload_regs = 0xC0;
+                if (st == PIPE_SHADER_VERTEX)
+                        meta->bifrost2.preload_regs = 0xC0;
+                else
+                        meta->bifrost2.preload_regs = 0x1;
                 meta->bifrost2.uniform_count = MIN2(ss->uniform_count,
                                                     ss->uniform_cutoff);
         } else {
@@ -340,7 +350,6 @@ panfrost_shader_meta_init(struct panfrost_context *ctx,
                 meta->midgard1.flags_lo = 0x220;
                 meta->midgard1.uniform_buffer_count = panfrost_ubo_count(ctx, st);
         }
-
 }
 
 static unsigned