panfrost: Set rt_count_2 for bpp>4 formats
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 2 Jul 2019 16:54:23 +0000 (09:54 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 10 Jul 2019 13:12:07 +0000 (06:12 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_mfbd.c

index d14fb4269dbe85e9bf091c10a5315f1f8d935a1c..f262f6a592d97f8674c4046a1eb4c6b774b498bd 100644 (file)
@@ -307,7 +307,14 @@ panfrost_mfbd_fragment(struct panfrost_context *ctx, bool has_draws)
 
         for (int cb = 0; cb < ctx->pipe_framebuffer.nr_cbufs; ++cb) {
                 struct pipe_surface *surf = ctx->pipe_framebuffer.cbufs[cb];
+                unsigned bpp = util_format_get_blocksize(surf->format);
+
                 panfrost_mfbd_set_cbuf(&rts[cb], surf);
+
+                /* What is this? Looks like some extension of the bpp field.
+                 * Maybe it establishes how much internal tilebuffer space is
+                 * reserved? */
+                fb.rt_count_2 = MAX2(fb.rt_count_2, ALIGN_POT(bpp, 4) / 4);
         }
 
         if (ctx->pipe_framebuffer.zsbuf) {