static void
emit_setup(struct fd_ringbuffer *ring)
{
- OUT_PKT7(ring, CP_EVENT_WRITE, 1);
- OUT_RING(ring, LRZ_FLUSH);
-
- OUT_PKT7(ring, CP_SKIP_IB2_ENABLE_GLOBAL, 1);
- OUT_RING(ring, 0x0);
-
- OUT_PKT4(ring, REG_A5XX_PC_POWER_CNTL, 1);
- OUT_RING(ring, 0x00000003); /* PC_POWER_CNTL */
-
- OUT_PKT4(ring, REG_A5XX_VFD_POWER_CNTL, 1);
- OUT_RING(ring, 0x00000003); /* VFD_POWER_CNTL */
-
- /* 0x10000000 for BYPASS.. 0x7c13c080 for GMEM: */
- OUT_WFI5(ring);
- OUT_PKT4(ring, REG_A5XX_RB_CCU_CNTL, 1);
- OUT_RING(ring, 0x10000000); /* RB_CCU_CNTL */
-
OUT_PKT4(ring, REG_A5XX_RB_RENDER_CNTL, 1);
OUT_RING(ring, 0x00000008);
batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true);
- fd5_emit_restore(batch, batch->draw);
- fd5_emit_lrz_flush(batch->draw);
-
emit_setup(batch->draw);
if ((info->src.resource->target == PIPE_BUFFER) &&
fd5_emit_shader(ring, v);
}
-static void
-emit_setup(struct fd_context *ctx)
-{
- struct fd_ringbuffer *ring = ctx->batch->draw;
-
- fd5_emit_restore(ctx->batch, ring);
- fd5_emit_lrz_flush(ring);
-
- OUT_PKT7(ring, CP_SKIP_IB2_ENABLE_GLOBAL, 1);
- OUT_RING(ring, 0x0);
-
- OUT_PKT7(ring, CP_EVENT_WRITE, 1);
- OUT_RING(ring, PC_CCU_INVALIDATE_COLOR);
-
- OUT_PKT4(ring, REG_A5XX_PC_POWER_CNTL, 1);
- OUT_RING(ring, 0x00000003); /* PC_POWER_CNTL */
-
- OUT_PKT4(ring, REG_A5XX_VFD_POWER_CNTL, 1);
- OUT_RING(ring, 0x00000003); /* VFD_POWER_CNTL */
-
- /* 0x10000000 for BYPASS.. 0x7c13c080 for GMEM: */
- fd_wfi(ctx->batch, ring);
- OUT_PKT4(ring, REG_A5XX_RB_CCU_CNTL, 1);
- OUT_RING(ring, 0x10000000); /* RB_CCU_CNTL */
-
- OUT_PKT4(ring, REG_A5XX_RB_CNTL, 1);
- OUT_RING(ring, A5XX_RB_CNTL_BYPASS);
-}
-
static void
fd5_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info)
{
struct fd_ringbuffer *ring = ctx->batch->draw;
unsigned nglobal = 0;
- emit_setup(ctx);
-
v = ir3_shader_variant(so->shader, key, false, &ctx->debug);
if (!v)
return;
static void
fd5_emit_sysmem_prep(struct fd_batch *batch)
{
- struct pipe_framebuffer_state *pfb = &batch->framebuffer;
struct fd_ringbuffer *ring = batch->gmem;
fd5_emit_restore(batch, ring);
OUT_PKT4(ring, REG_A5XX_RB_CCU_CNTL, 1);
OUT_RING(ring, 0x10000000); /* RB_CCU_CNTL */
+ OUT_PKT4(ring, REG_A5XX_RB_CNTL, 1);
+ OUT_RING(ring, A5XX_RB_CNTL_WIDTH(0) |
+ A5XX_RB_CNTL_HEIGHT(0) |
+ A5XX_RB_CNTL_BYPASS);
+
+ /* remaining setup below here does not apply to blit/compute: */
+ if (batch->nondraw)
+ return;
+
+ struct pipe_framebuffer_state *pfb = &batch->framebuffer;
+
OUT_PKT4(ring, REG_A5XX_GRAS_SC_WINDOW_SCISSOR_TL, 2);
OUT_RING(ring, A5XX_GRAS_SC_WINDOW_SCISSOR_TL_X(0) |
A5XX_GRAS_SC_WINDOW_SCISSOR_TL_Y(0));
OUT_PKT7(ring, CP_SET_VISIBILITY_OVERRIDE, 1);
OUT_RING(ring, 0x1);
- OUT_PKT4(ring, REG_A5XX_RB_CNTL, 1);
- OUT_RING(ring, A5XX_RB_CNTL_WIDTH(0) |
- A5XX_RB_CNTL_HEIGHT(0) |
- A5XX_RB_CNTL_BYPASS);
-
patch_draws(batch, IGNORE_VISIBILITY);
emit_zs(ring, pfb->zsbuf, NULL);
batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true);
- fd6_emit_restore(batch, batch->draw);
- fd6_emit_lrz_flush(batch->draw);
-
fd_screen_lock(ctx->screen);
fd_batch_resource_read(batch, fd_resource(info->src.resource));
struct fd_ringbuffer *ring = ctx->batch->draw;
unsigned nglobal = 0;
- fd6_emit_restore(ctx->batch, ring);
-
v = ir3_shader_variant(so->shader, key, false, &ctx->debug);
if (!v)
return;
static void
fd6_emit_sysmem_prep(struct fd_batch *batch)
{
- struct pipe_framebuffer_state *pfb = &batch->framebuffer;
struct fd_ringbuffer *ring = batch->gmem;
fd6_emit_restore(batch, ring);
fd_log(batch, "END PROLOGUE");
}
+ /* remaining setup below here does not apply to blit/compute: */
+ if (batch->nondraw)
+ return;
+
+ struct pipe_framebuffer_state *pfb = &batch->framebuffer;
+
if (pfb->width > 0 && pfb->height > 0)
set_scissor(ring, 0, 0, pfb->width - 1, pfb->height - 1);
else
batch->submit = fd_submit_new(ctx->pipe);
if (batch->nondraw) {
- batch->draw = alloc_ring(batch, 0x100000, FD_RINGBUFFER_PRIMARY);
+ batch->gmem = alloc_ring(batch, 0x1000, FD_RINGBUFFER_PRIMARY);
+ batch->draw = alloc_ring(batch, 0x100000, 0);
} else {
batch->gmem = alloc_ring(batch, 0x100000, FD_RINGBUFFER_PRIMARY);
batch->draw = alloc_ring(batch, 0x100000, 0);
fd_fence_ref(&batch->fence, NULL);
fd_ringbuffer_del(batch->draw);
- if (!batch->nondraw) {
- if (batch->binning)
- fd_ringbuffer_del(batch->binning);
- fd_ringbuffer_del(batch->gmem);
- } else {
- debug_assert(!batch->binning);
- debug_assert(!batch->gmem);
+ fd_ringbuffer_del(batch->gmem);
+
+ if (batch->binning) {
+ fd_ringbuffer_del(batch->binning);
+ batch->binning = NULL;
}
if (batch->prologue) {
} else {
ctx->screen->emit_ib(batch->gmem, batch->draw);
}
+
fd_log(batch, "TILE[%d]: END DRAW IB", i);
fd_reset_wfi(batch);
if (batch->nondraw) {
DBG("%p: rendering non-draw", batch);
+ render_sysmem(batch);
ctx->stats.batch_nondraw++;
} else if (sysmem) {
fd_log(batch, "%p: rendering sysmem %ux%u (%s/%s), num_draws=%u",