panfrost: Set clear_color_[12] in the extra fb desc
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 6 Apr 2020 23:45:30 +0000 (19:45 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 24 Apr 2020 04:53:26 +0000 (06:53 +0200)
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/4680>

src/gallium/drivers/panfrost/pan_mfbd.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c

index c4063c317eaeb32f130f72583089a46dce5a196d..562a05ff2dfdb8f4fd5f3634943166f9f902964a 100644 (file)
@@ -161,6 +161,10 @@ panfrost_mfbd_clear(
         struct mali_render_target *rts,
         unsigned rt_count)
 {
+        struct panfrost_context *ctx = batch->ctx;
+        struct pipe_context *gallium = (struct pipe_context *) ctx;
+        struct panfrost_device *dev = pan_device(gallium->screen);
+
         for (unsigned i = 0; i < rt_count; ++i) {
                 if (!(batch->clear & (PIPE_CLEAR_COLOR0 << i)))
                         continue;
@@ -178,6 +182,11 @@ panfrost_mfbd_clear(
         if (batch->clear & PIPE_CLEAR_STENCIL) {
                 fb->clear_stencil = batch->clear_stencil;
         }
+
+        if (dev->quirks & IS_BIFROST) {
+                fbx->clear_color_1 = batch->clear_color[0][0];
+                fbx->clear_color_2 = 0xc0000000 | (fbx->clear_color_1 & 0xffff); /* WTF? */
+        }
 }
 
 static void
index 6bf0b7caf1c4356a17dc3338187a8b2dc5d6d59c..71beac01e6b2c4b707b57a338c9df33b702dd52b 100644 (file)
@@ -1670,7 +1670,9 @@ struct mali_framebuffer_extra  {
         };
 
 
-        u64 zero3, zero4;
+        u32 clear_color_1;
+        u32 clear_color_2;
+        u64 zero3;
 } __attribute__((packed));
 
 /* Flags for mfbd_flags */
index 9d1afcfefc1289dc551c0232cbfaa63e6e47f413..5e9c474e3d160e5589e8331db039148b2d49dac3 100644 (file)
@@ -1274,10 +1274,14 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_comput
                         pandecode_log("},\n");
                 }
 
-                if (fbx->zero3 || fbx->zero4) {
+                if (fbx->clear_color_1 | fbx->clear_color_2) {
+                        pandecode_prop("clear_color_1 = 0x%" PRIx32, fbx->clear_color_1);
+                        pandecode_prop("clear_color_2 = 0x%" PRIx32, fbx->clear_color_2);
+                }
+
+                if (fbx->zero3) {
                         pandecode_msg("XXX: fb_extra zeros tripped\n");
                         pandecode_prop("zero3 = 0x%" PRIx64, fbx->zero3);
-                        pandecode_prop("zero4 = 0x%" PRIx64, fbx->zero4);
                 }
 
                 pandecode_indent--;