freedreno/a6xx: Move resolve blits to an IB

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Kristian H. Kristensen 2018-10-24 00:00:50 -07:00 committed by Rob Clark
parent 5f068cf3b0
commit b5a9bb28c6
3 changed files with 29 additions and 8 deletions

View file

@ -450,6 +450,7 @@ disable_msaa(struct fd_ringbuffer *ring)
}
static void prepare_tile_setup_ib(struct fd_batch *batch);
static void prepare_tile_fini_ib(struct fd_batch *batch);
/* before first tile */
static void
@ -470,6 +471,7 @@ fd6_emit_tile_init(struct fd_batch *batch)
fd6_cache_flush(batch, ring);
prepare_tile_setup_ib(batch);
prepare_tile_fini_ib(batch);
OUT_PKT7(ring, CP_SKIP_IB2_ENABLE_GLOBAL, 1);
OUT_RING(ring, 0x0);
@ -740,12 +742,13 @@ fd6_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile)
}
static void
emit_resolve_blit(struct fd_batch *batch, uint32_t base,
emit_resolve_blit(struct fd_batch *batch,
struct fd_ringbuffer *ring,
uint32_t base,
struct pipe_surface *psurf,
struct fd_resource *rsc,
unsigned buffer)
{
struct fd_ringbuffer *ring = batch->gmem;
uint32_t info = 0;
if (!rsc->valid)
@ -768,7 +771,7 @@ emit_resolve_blit(struct fd_batch *batch, uint32_t base,
OUT_PKT4(ring, REG_A6XX_RB_BLIT_INFO, 1);
OUT_RING(ring, info);
emit_blit(batch, batch->gmem, base, psurf, rsc);
emit_blit(batch, ring, base, psurf, rsc);
}
/*
@ -776,12 +779,16 @@ emit_resolve_blit(struct fd_batch *batch, uint32_t base,
*/
static void
fd6_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile)
prepare_tile_fini_ib(struct fd_batch *batch)
{
struct fd_context *ctx = batch->ctx;
struct fd_gmem_stateobj *gmem = &ctx->gmem;
struct pipe_framebuffer_state *pfb = &batch->framebuffer;
struct fd_ringbuffer *ring = batch->gmem;
struct fd_ringbuffer *ring;
batch->tile_fini = fd_submit_new_ringbuffer(batch->submit, 0x1000,
FD_RINGBUFFER_STREAMING);
ring = batch->tile_fini;
if (use_hw_binning(batch)) {
OUT_PKT7(ring, CP_SET_MARKER, 1);
@ -809,11 +816,13 @@ fd6_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile)
struct fd_resource *rsc = fd_resource(pfb->zsbuf->texture);
if (!rsc->stencil || (batch->resolve & FD_BUFFER_DEPTH)) {
emit_resolve_blit(batch, gmem->zsbuf_base[0], pfb->zsbuf, rsc,
emit_resolve_blit(batch, ring,
gmem->zsbuf_base[0], pfb->zsbuf, rsc,
FD_BUFFER_DEPTH);
}
if (rsc->stencil && (batch->resolve & FD_BUFFER_STENCIL)) {
emit_resolve_blit(batch, gmem->zsbuf_base[1], pfb->zsbuf, rsc->stencil,
emit_resolve_blit(batch, ring,
gmem->zsbuf_base[1], pfb->zsbuf, rsc->stencil,
FD_BUFFER_STENCIL);
}
}
@ -825,13 +834,19 @@ fd6_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile)
continue;
if (!(batch->resolve & (PIPE_CLEAR_COLOR0 << i)))
continue;
emit_resolve_blit(batch, gmem->cbuf_base[i], pfb->cbufs[i],
emit_resolve_blit(batch, ring, gmem->cbuf_base[i], pfb->cbufs[i],
fd_resource(pfb->cbufs[i]->texture),
FD_BUFFER_COLOR);
}
}
}
static void
fd6_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile)
{
fd6_emit_ib(batch->gmem, batch->tile_fini);
}
static void
fd6_emit_tile_fini(struct fd_batch *batch)
{

View file

@ -155,6 +155,11 @@ batch_fini(struct fd_batch *batch)
batch->tile_setup = NULL;
}
if (batch->tile_fini) {
fd_ringbuffer_del(batch->tile_fini);
batch->tile_fini = NULL;
}
fd_submit_del(batch->submit);
util_dynarray_fini(&batch->draw_patches);

View file

@ -163,6 +163,7 @@ struct fd_batch {
// TODO maybe more generically split out clear and clear_binning rings?
struct fd_ringbuffer *lrz_clear;
struct fd_ringbuffer *tile_setup;
struct fd_ringbuffer *tile_fini;
/**
* hw query related state: