Mesa (master): panfrost: Cleanup transfer_map

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 18 14:41:42 UTC 2020


Module: Mesa
Branch: master
Commit: 4c52e16c9c296988dea283164622373caaf228e5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c52e16c9c296988dea283164622373caaf228e5

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Feb 18 08:30:10 2020 -0500

panfrost: Cleanup transfer_map

A lot of these checks are obsolete since we've started tracking BO
accesses correctly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3849>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3849>

---

 src/gallium/drivers/panfrost/pan_resource.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 6d5c9ab5cbd..6eeb4b832ed 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -572,6 +572,7 @@ panfrost_transfer_map(struct pipe_context *pctx,
                       const struct pipe_box *box,
                       struct pipe_transfer **out_transfer)
 {
+        struct panfrost_context *ctx = pan_context(pctx);
         int bytes_per_pixel = util_format_get_blocksize(resource->format);
         struct panfrost_resource *rsrc = pan_resource(resource);
         struct panfrost_bo *bo = rsrc->bo;
@@ -588,26 +589,6 @@ panfrost_transfer_map(struct pipe_context *pctx,
         /* If we haven't already mmaped, now's the time */
         panfrost_bo_mmap(bo);
 
-        /* Check if we're bound for rendering and this is a read pixels. If so,
-         * we need to flush */
-
-        struct panfrost_context *ctx = pan_context(pctx);
-        struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer;
-
-        bool is_bound = false;
-
-        for (unsigned c = 0; c < fb->nr_cbufs; ++c) {
-                /* If cbufs is NULL, we're definitely not bound here */
-
-                if (fb->cbufs[c])
-                        is_bound |= fb->cbufs[c]->texture == resource;
-        }
-
-        if (is_bound && (usage & PIPE_TRANSFER_READ))
-                 assert(level == 0);
-
-        /* TODO: Respect usage flags */
-
         if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) {
                 /* If the BO is used by one of the pending batches or if it's
                  * not ready yet (still accessed by one of the already flushed
@@ -655,8 +636,6 @@ panfrost_transfer_map(struct pipe_context *pctx,
                 } else if (usage & PIPE_TRANSFER_READ) {
                         panfrost_flush_batches_accessing_bo(ctx, bo, PAN_BO_ACCESS_WRITE);
                         panfrost_bo_wait(bo, INT64_MAX, PAN_BO_ACCESS_WRITE);
-                } else {
-                        /* Why are you even mapping?! */
                 }
         }
 



More information about the mesa-commit mailing list