freedreno/a2xx: move setup/restore cmds into binning pass
Rather than doing a separate submit at context create, move these cmds to before first tile, as is done on a3xx/a4xx. Otherwise state can be overwritten by other contexts. Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
@@ -120,7 +120,5 @@ fd2_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
||||
/* construct vertex state used for solid ops (clear, and gmem<->mem) */
|
||||
fd2_ctx->solid_vertexbuf = create_solid_vertexbuf(pctx);
|
||||
|
||||
fd2_emit_setup(&fd2_ctx->base);
|
||||
|
||||
return pctx;
|
||||
}
|
||||
|
||||
@@ -316,10 +316,8 @@ fd2_emit_state(struct fd_context *ctx, uint32_t dirty)
|
||||
/* emit per-context initialization:
|
||||
*/
|
||||
void
|
||||
fd2_emit_setup(struct fd_context *ctx)
|
||||
fd2_emit_restore(struct fd_context *ctx, struct fd_ringbuffer *ring)
|
||||
{
|
||||
struct fd_ringbuffer *ring = ctx->ring;
|
||||
|
||||
OUT_PKT0(ring, REG_A2XX_TP0_CHICKEN, 1);
|
||||
OUT_RING(ring, 0x00000002);
|
||||
|
||||
@@ -442,9 +440,6 @@ fd2_emit_setup(struct fd_context *ctx)
|
||||
OUT_RING(ring, 0x00000000); /* RB_BLEND_GREEN */
|
||||
OUT_RING(ring, 0x00000000); /* RB_BLEND_BLUE */
|
||||
OUT_RING(ring, 0x000000ff); /* RB_BLEND_ALPHA */
|
||||
|
||||
fd_ringbuffer_flush(ring);
|
||||
fd_ringmarker_mark(ctx->draw_start);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -43,7 +43,7 @@ struct fd2_vertex_buf {
|
||||
void fd2_emit_vertex_bufs(struct fd_ringbuffer *ring, uint32_t val,
|
||||
struct fd2_vertex_buf *vbufs, uint32_t n);
|
||||
void fd2_emit_state(struct fd_context *ctx, uint32_t dirty);
|
||||
void fd2_emit_setup(struct fd_context *ctx);
|
||||
void fd2_emit_restore(struct fd_context *ctx, struct fd_ringbuffer *ring);
|
||||
|
||||
void fd2_emit_init(struct pipe_context *pctx);
|
||||
|
||||
|
||||
@@ -336,6 +336,8 @@ fd2_emit_tile_init(struct fd_context *ctx)
|
||||
enum pipe_format format = pipe_surface_format(pfb->cbufs[0]);
|
||||
uint32_t reg;
|
||||
|
||||
fd2_emit_restore(ctx, ctx->ring);
|
||||
|
||||
OUT_PKT3(ring, CP_SET_CONSTANT, 4);
|
||||
OUT_RING(ring, CP_REG(REG_A2XX_RB_SURFACE_INFO));
|
||||
OUT_RING(ring, gmem->bin_w); /* RB_SURFACE_INFO */
|
||||
|
||||
Reference in New Issue
Block a user