panfrost: Fix FBD issue
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 16 Dec 2019 16:46:32 +0000 (11:46 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 16 Dec 2019 17:50:26 +0000 (12:50 -0500)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: b0e915b4e65 ("panfrost: Emit SFBD/MFBD after a batch, instead of before")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3118>

src/gallium/drivers/panfrost/pan_fragment.c
src/gallium/drivers/panfrost/pan_job.c

index 438294926fd2e019bce8bf07dbef2526fad31c5f..88b2db3c94900deeae95c1714006d218de500853 100644 (file)
@@ -102,10 +102,6 @@ panfrost_fragment_job(struct panfrost_batch *batch, bool has_draws,
                 .framebuffer = framebuffer,
         };
 
-        /* Normally, there should be no padding. However, fragment jobs are
-         * shared with 64-bit Bifrost systems, and accordingly there is 4-bytes
-         * of zero padding in between. */
-
         struct panfrost_transfer transfer = panfrost_allocate_transient(batch, sizeof(header) + sizeof(payload));
         memcpy(transfer.cpu, &header, sizeof(header));
         memcpy(transfer.cpu + sizeof(header), &payload, sizeof(payload));
index dbab1df1b834b88ec8c3e4a29e5447196dbf0ee7..5722f4a1f3137118a0d3908d13b6bdb2c89c065c 100644 (file)
@@ -623,6 +623,7 @@ panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size)
                 assert(batch->polygon_list->size >= size);
         } else {
                 /* Create the BO as invisible, as there's no reason to map */
+                size = util_next_power_of_two(size);
 
                 batch->polygon_list = panfrost_batch_create_bo(batch, size,
                                                                PAN_BO_INVISIBLE,
@@ -962,7 +963,7 @@ panfrost_batch_submit(struct panfrost_batch *batch)
         /* Now that all draws are in, we can finally prepare the
          * FBD for the batch */
 
-        if (batch->framebuffer.gpu) {
+        if (batch->framebuffer.gpu && batch->first_job.gpu) {
                 struct panfrost_context *ctx = batch->ctx;
                 struct pipe_context *gallium = (struct pipe_context *) ctx;
                 struct panfrost_screen *screen = pan_screen(gallium->screen);