radeonsi: always use Wave32 for GS fast launch, because Wave64 hangs
[mesa.git] / src / gallium / drivers / panfrost / pan_sfbd.c
index eb0f24b0a8adb0dfafcd10a6096e3a33453c12ff..a163fa9b6a61221ff508ecca27fcbbd82ee69f63 100644 (file)
@@ -25,7 +25,6 @@
 #include "pan_bo.h"
 #include "pan_context.h"
 #include "pan_util.h"
-#include "pan_format.h"
 
 #include "util/format/u_format.h"
 
@@ -69,6 +68,7 @@ panfrost_sfbd_format(struct pipe_surface *surf)
 
         case PIPE_FORMAT_A4B4G4R4_UNORM:
         case PIPE_FORMAT_B4G4R4A4_UNORM:
+        case PIPE_FORMAT_R4G4B4A4_UNORM:
                 fmt.unk1 = 0x4;
                 fmt.nr_channels = MALI_POSITIVE(1);
                 fmt.unk2 = 0x5;
@@ -141,9 +141,9 @@ panfrost_sfbd_set_cbuf(
         fb->framebuffer = base;
         fb->stride = stride;
 
-        if (rsrc->layout == PAN_LINEAR)
+        if (rsrc->layout == MALI_TEXTURE_LINEAR)
                 fb->format.block = MALI_BLOCK_LINEAR;
-        else if (rsrc->layout == PAN_TILED) {
+        else if (rsrc->layout == MALI_TEXTURE_TILED) {
                 fb->format.block = MALI_BLOCK_TILED;
                 fb->stride *= 16;
         } else {
@@ -163,7 +163,7 @@ panfrost_sfbd_set_zsbuf(
         unsigned level = surf->u.tex.level;
         assert(surf->u.tex.first_layer == 0);
 
-        if (rsrc->layout != PAN_LINEAR)
+        if (rsrc->layout != MALI_TEXTURE_TILED)
                 unreachable("Invalid render layout.");
 
         fb->depth_buffer = rsrc->bo->gpu + rsrc->slices[level].offset;
@@ -174,16 +174,12 @@ panfrost_sfbd_set_zsbuf(
                 return;
 
         if (panfrost_is_z24s8_variant(surf->format)) {
-
                 /* Stencil data is interleaved with depth */
                 fb->stencil_buffer = fb->depth_buffer;
                 fb->stencil_stride = fb->depth_stride;
-        } else if (surf->format == PIPE_FORMAT_Z32_UNORM ||
-                   surf->format == PIPE_FORMAT_Z32_FLOAT) {
-
+        } else if (surf->format == PIPE_FORMAT_Z32_FLOAT) {
                 /* No stencil, nothing to do */
         } else if (surf->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) {
-
                 /* Stencil data in separate buffer */
                 struct panfrost_resource *stencil = rsrc->separate_stencil;
                 struct panfrost_slice stencil_slice = stencil->slices[level];
@@ -200,7 +196,7 @@ panfrost_emit_sfbd(struct panfrost_batch *batch, unsigned vertex_count)
 {
         struct panfrost_context *ctx = batch->ctx;
         struct pipe_context *gallium = (struct pipe_context *) ctx;
-        struct panfrost_screen *screen = pan_screen(gallium->screen);
+        struct panfrost_device *dev = pan_device(gallium->screen);
 
         unsigned width = batch->key.width;
         unsigned height = batch->key.height;
@@ -213,12 +209,14 @@ panfrost_emit_sfbd(struct panfrost_batch *batch, unsigned vertex_count)
         struct mali_single_framebuffer framebuffer = {
                 .width = MALI_POSITIVE(width),
                 .height = MALI_POSITIVE(height),
-                .unknown2 = 0x1f,
+                .shared_memory = {
+                        .shared_workgroup_count = ~0,
+                        .scratchpad = panfrost_batch_get_scratchpad(batch, shift, dev->thread_tls_alloc, dev->core_count)->gpu,
+                },
                 .format = {
                         .unk3 = 0x3,
                 },
                 .clear_flags = 0x1000,
-                .scratchpad = panfrost_batch_get_scratchpad(batch, shift, screen->thread_tls_alloc, screen->core_count)->gpu,
                 .tiler = panfrost_emit_midg_tiler(batch, vertex_count),
         };
 
@@ -269,5 +267,5 @@ panfrost_sfbd_fragment(struct panfrost_batch *batch, bool has_draws)
                 fb.format.unk2 |= MALI_SFBD_FORMAT_MSAA_B;
         }
 
-        return panfrost_upload_transient(batch, &fb, sizeof(fb)) | MALI_SFBD;
+        return panfrost_upload_transient(batch, &fb, sizeof(fb));
 }