diff options
author | Rob Clark <robclark@freedesktop.org> | 2016-05-20 16:00:26 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-07-02 08:58:50 -0400 |
commit | 2081c1ecc00682302faa9555cc0551fc14a338f0 (patch) | |
tree | 857c6f1f4544bdf98a4381be7cc10af1c5fb60da | |
parent | 2c3b54c27820edcf2d74e96faa812f8dd29f56df (diff) |
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>
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_context.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_emit.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_emit.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_gmem.c | 2 |
4 files changed, 4 insertions, 9 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_context.c b/src/gallium/drivers/freedreno/a2xx/fd2_context.c index 058f8219ed57..ec76a2279991 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_context.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_context.c @@ -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; } diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c index 4f667ab7d570..f8d03ca5eb02 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c @@ -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 diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_emit.h b/src/gallium/drivers/freedreno/a2xx/fd2_emit.h index 3c146c171515..6a26c85c142b 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_emit.h +++ b/src/gallium/drivers/freedreno/a2xx/fd2_emit.h @@ -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); diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c index aa47267444f8..eba2cec82f4c 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c @@ -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 */ |