Mesa (main): freedreno: Remove broken back_blit optimization.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 17 16:32:13 UTC 2021


Module: Mesa
Branch: main
Commit: 2a9225d05f544925cd8f92fff41af61f71a69dfa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a9225d05f544925cd8f92fff41af61f71a69dfa

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Jun 15 12:53:34 2021 -0700

freedreno: Remove broken back_blit optimization.

It wasn't checking that the transfer map would definitely overwrite all of
the data being initialized by the back blit, and if we knew that it
would then the caller would have provided PIPE_MAP_DISCARD_WHOLE_RESOURCE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11439>

---

 src/gallium/drivers/freedreno/freedreno_resource.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 59408c63859..e18cfa7c57b 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -833,18 +833,6 @@ resource_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
    if (usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE) {
       invalidate_resource(rsc, usage);
    } else {
-      struct fd_batch *write_batch = NULL;
-
-      /* hold a reference, so it doesn't disappear under us: */
-      fd_screen_lock(ctx->screen);
-      fd_batch_reference_locked(&write_batch, rsc->track->write_batch);
-      fd_screen_unlock(ctx->screen);
-
-      if ((usage & PIPE_MAP_WRITE) && write_batch && write_batch->back_blit) {
-         /* if only thing pending is a back-blit, we can discard it: */
-         fd_batch_reset(write_batch);
-      }
-
       unsigned op = translate_usage(usage);
       bool needs_flush = pending(rsc, !!(usage & PIPE_MAP_WRITE));
 
@@ -896,8 +884,6 @@ resource_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
                trans->staging_box.z = 0;
                buf = fd_bo_map(staging_rsc->bo);
 
-               fd_batch_reference(&write_batch, NULL);
-
                ctx->stats.staging_uploads++;
 
                return buf;
@@ -910,8 +896,6 @@ resource_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
          needs_flush = false;
       }
 
-      fd_batch_reference(&write_batch, NULL);
-
       /* The GPU keeps track of how the various bo's are being used, and
        * will wait if necessary for the proper operation to have
        * completed.



More information about the mesa-commit mailing list