diff options
author | Rob Clark <[email protected]> | 2016-06-27 11:28:37 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-07-30 09:23:42 -0400 |
commit | f02a64dbdd2ec147167ad60357bd46d8d964290a (patch) | |
tree | d4d0a74b53481862a46df052af1653b59e4337b7 /src/gallium/drivers/freedreno/freedreno_context.c | |
parent | eeafaf2d37cdc7f83f997e8babd8f770243ecf25 (diff) |
freedreno: move more batch related tracking to fd_batch
To flush batches out of order, the gmem code needs to not depend on
state from fd_context (since that may apply to a more recent batch).
So this all moves into batch.
The one exception is the gmem/pipe/tile state itself. But this is
only used from gmem code (and batches are flushed serially). The
alternative would be having to re-calculate GMEM layout on every
batch, even if the dimensions of the render targets are the same.
Note: This opens up the possibility of pushing gmem/submit into a
helper thread.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_context.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index 3614370bf33..b9a1fe97745 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -45,21 +45,14 @@ void fd_context_render(struct pipe_context *pctx) { struct fd_context *ctx = fd_context(pctx); - - DBG("needs_flush: %d", ctx->needs_flush); - - if (!ctx->needs_flush) - return; + struct fd_batch *new_batch; fd_batch_flush(ctx->batch); + new_batch = fd_batch_create(ctx); + util_copy_framebuffer_state(&new_batch->framebuffer, &ctx->batch->framebuffer); fd_batch_reference(&ctx->batch, NULL); - ctx->batch = fd_batch_create(ctx); - - ctx->needs_flush = false; - ctx->cleared = ctx->partial_cleared = ctx->restore = ctx->resolve = 0; - ctx->gmem_reason = 0; - ctx->num_draws = 0; + ctx->batch = new_batch; } static void @@ -120,8 +113,6 @@ fd_context_destroy(struct pipe_context *pctx) fd_prog_fini(pctx); fd_hw_query_fini(pctx); - util_dynarray_fini(&ctx->draw_patches); - if (ctx->blitter) util_blitter_destroy(ctx->blitter); @@ -190,8 +181,6 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen, fd_reset_wfi(ctx); - util_dynarray_init(&ctx->draw_patches); - util_slab_create(&ctx->transfer_pool, sizeof(struct fd_transfer), 16, UTIL_SLAB_SINGLETHREADED); |