From: Alyssa Rosenzweig Date: Tue, 18 Feb 2020 13:30:10 +0000 (-0500) Subject: panfrost: Cleanup transfer_map X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c52e16c9c296988dea283164622373caaf228e5;p=mesa.git panfrost: Cleanup transfer_map A lot of these checks are obsolete since we've started tracking BO accesses correctly. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Tested-by: Marge Bot Part-of: --- 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?! */ } }