panfrost: Don't flush explicitly when mipmapping
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 20 May 2020 18:33:38 +0000 (14:33 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Jun 2020 18:10:59 +0000 (18:10 +0000)
The reorder work already takes cares of this nicely.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5284>

src/gallium/drivers/panfrost/pan_resource.c

index 5ae67ed..8b57aba 100644 (file)
@@ -790,7 +790,6 @@ panfrost_generate_mipmap(
         unsigned first_layer,
         unsigned last_layer)
 {
-        struct panfrost_context *ctx = pan_context(pctx);
         struct panfrost_resource *rsrc = pan_resource(prsrc);
 
         /* Generating a mipmap invalidates the written levels, so make that
@@ -801,16 +800,7 @@ panfrost_generate_mipmap(
         for (unsigned l = base_level + 1; l <= last_level; ++l)
                 rsrc->slices[l].initialized = false;
 
-        /* Beyond that, we just delegate the hard stuff. We're careful to
-         * include flushes on both ends to make sure the data is really valid.
-         * We could be doing a lot better perf-wise, especially once we have
-         * reorder-type optimizations in place. But for now prioritize
-         * correctness. */
-
-        panfrost_flush_batches_accessing_bo(ctx, rsrc->bo, PAN_BO_ACCESS_RW);
-        panfrost_bo_wait(rsrc->bo, INT64_MAX, PAN_BO_ACCESS_RW);
-
-        /* We've flushed the original buffer if needed, now trigger a blit */
+        /* Beyond that, we just delegate the hard stuff. */
 
         bool blit_res = util_gen_mipmap(
                                 pctx, prsrc, format,
@@ -818,14 +808,6 @@ panfrost_generate_mipmap(
                                 first_layer, last_layer,
                                 PIPE_TEX_FILTER_LINEAR);
 
-        /* If the blit was successful, flush once more. If it wasn't, well, let
-         * the gallium frontend deal with it. */
-
-        if (blit_res) {
-                panfrost_flush_batches_accessing_bo(ctx, rsrc->bo, PAN_BO_ACCESS_WRITE);
-                panfrost_bo_wait(rsrc->bo, INT64_MAX, PAN_BO_ACCESS_WRITE);
-        }
-
         return blit_res;
 }