diff options
author | Kristian H. Kristensen <[email protected]> | 2019-11-26 10:57:56 -0800 |
---|---|---|
committer | Kristian H. Kristensen <[email protected]> | 2019-12-19 09:56:05 -0800 |
commit | f8c0ea61e4f467d37e1070f901c928f00693c742 (patch) | |
tree | 96e39f8ec68f4246bce57d1a275176acbe6ceb5e /src/gallium/drivers/freedreno | |
parent | 183d482f7fe1dbd0fa27d86835abe59df7e3366f (diff) |
freedreno/a6xx: Move handle_rgba_blit() up
If we move this function up, we don't have to forward declare it.
Reviewed-by: Eric Anholt <[email protected]>
Signed-off-by: Kristian H. Kristensen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2848>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c index 8ae4f5542e7..fd97e7d8026 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c @@ -637,7 +637,57 @@ fd6_clear_surface(struct fd_context *ctx, emit_blit_or_clear_texture(ctx, ring, &info, color); } -static bool handle_rgba_blit(struct fd_context *ctx, const struct pipe_blit_info *info); +static bool +handle_rgba_blit(struct fd_context *ctx, const struct pipe_blit_info *info) +{ + struct fd_batch *batch; + + debug_assert(!(info->mask & PIPE_MASK_ZS)); + + if (!can_do_blit(info)) + return false; + + fd_fence_ref(&ctx->last_fence, NULL); + + batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true); + + fd6_emit_restore(batch, batch->draw); + fd6_emit_lrz_flush(batch->draw); + + mtx_lock(&ctx->screen->lock); + + fd_batch_resource_used(batch, fd_resource(info->src.resource), false); + fd_batch_resource_used(batch, fd_resource(info->dst.resource), true); + + mtx_unlock(&ctx->screen->lock); + + emit_setup(batch); + + if ((info->src.resource->target == PIPE_BUFFER) && + (info->dst.resource->target == PIPE_BUFFER)) { + assert(fd_resource(info->src.resource)->layout.tile_mode == TILE6_LINEAR); + assert(fd_resource(info->dst.resource)->layout.tile_mode == TILE6_LINEAR); + emit_blit_buffer(ctx, batch->draw, info); + } else { + /* I don't *think* we need to handle blits between buffer <-> !buffer */ + debug_assert(info->src.resource->target != PIPE_BUFFER); + debug_assert(info->dst.resource->target != PIPE_BUFFER); + emit_blit_or_clear_texture(ctx, batch->draw, info, NULL); + } + + fd6_event_write(batch, batch->draw, 0x1d, true); + fd6_event_write(batch, batch->draw, FACENESS_FLUSH, true); + fd6_event_write(batch, batch->draw, CACHE_FLUSH_TS, true); + fd6_cache_inv(batch, batch->draw); + + fd_resource(info->dst.resource)->valid = true; + batch->needs_flush = true; + + fd_batch_flush(batch, false); + fd_batch_reference(&batch, NULL); + + return true; +} /** * Re-written z/s blits can still fail for various reasons (for example MSAA). @@ -732,58 +782,6 @@ handle_zs_blit(struct fd_context *ctx, const struct pipe_blit_info *info) } static bool -handle_rgba_blit(struct fd_context *ctx, const struct pipe_blit_info *info) -{ - struct fd_batch *batch; - - debug_assert(!(info->mask & PIPE_MASK_ZS)); - - if (!can_do_blit(info)) - return false; - - fd_fence_ref(&ctx->last_fence, NULL); - - batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true); - - fd6_emit_restore(batch, batch->draw); - fd6_emit_lrz_flush(batch->draw); - - mtx_lock(&ctx->screen->lock); - - fd_batch_resource_used(batch, fd_resource(info->src.resource), false); - fd_batch_resource_used(batch, fd_resource(info->dst.resource), true); - - mtx_unlock(&ctx->screen->lock); - - emit_setup(batch); - - if ((info->src.resource->target == PIPE_BUFFER) && - (info->dst.resource->target == PIPE_BUFFER)) { - assert(fd_resource(info->src.resource)->layout.tile_mode == TILE6_LINEAR); - assert(fd_resource(info->dst.resource)->layout.tile_mode == TILE6_LINEAR); - emit_blit_buffer(ctx, batch->draw, info); - } else { - /* I don't *think* we need to handle blits between buffer <-> !buffer */ - debug_assert(info->src.resource->target != PIPE_BUFFER); - debug_assert(info->dst.resource->target != PIPE_BUFFER); - emit_blit_or_clear_texture(ctx, batch->draw, info, NULL); - } - - fd6_event_write(batch, batch->draw, 0x1d, true); - fd6_event_write(batch, batch->draw, FACENESS_FLUSH, true); - fd6_event_write(batch, batch->draw, CACHE_FLUSH_TS, true); - fd6_cache_inv(batch, batch->draw); - - fd_resource(info->dst.resource)->valid = true; - batch->needs_flush = true; - - fd_batch_flush(batch, false); - fd_batch_reference(&batch, NULL); - - return true; -} - -static bool fd6_blit(struct fd_context *ctx, const struct pipe_blit_info *info) { if (info->mask & PIPE_MASK_ZS) |