summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a4xx/fd4_draw.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-05-20 15:36:10 -0400
committerRob Clark <[email protected]>2016-07-30 09:23:42 -0400
commit9bbd239a4039522d7c1023ecb21764679447bb2d (patch)
treede6633fb1936d05c929e34a88987c69884ed45f9 /src/gallium/drivers/freedreno/a4xx/fd4_draw.c
parent12aec78993edface7f530eede9e018b5fa1897b7 (diff)
freedreno: introduce fd_batch
Introduce the batch object, to track a batch/submit's worth of ringbuffers and other bookkeeping. In this first step, just move the ringbuffers into batch, since that is mostly uninteresting churn. For now there is just a single batch at a time. Note that one outcome of this change is that rb's are allocated/freed on each use. But the expectation is that the bo pool in libdrm_freedreno will save us the GEM bo alloc/free which was the initial reason to implement a rb pool in gallium. The purpose of the batch is to eventually facilitate out-of-order rendering, with batches associated to framebuffer state, and tracking the dependencies on other batches. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a4xx/fd4_draw.c')
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_draw.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_draw.c b/src/gallium/drivers/freedreno/a4xx/fd4_draw.c
index b9bae8adc54..e0513860a71 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_draw.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_draw.c
@@ -164,22 +164,24 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
emit.key.binning_pass = false;
emit.dirty = dirty;
+ struct fd_ringbuffer *ring = ctx->batch->draw;
+
if (ctx->rasterizer->rasterizer_discard) {
- fd_wfi(ctx, ctx->ring);
- OUT_PKT3(ctx->ring, CP_REG_RMW, 3);
- OUT_RING(ctx->ring, REG_A4XX_RB_RENDER_CONTROL);
- OUT_RING(ctx->ring, ~A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
- OUT_RING(ctx->ring, A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
+ fd_wfi(ctx, ring);
+ OUT_PKT3(ring, CP_REG_RMW, 3);
+ OUT_RING(ring, REG_A4XX_RB_RENDER_CONTROL);
+ OUT_RING(ring, ~A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
+ OUT_RING(ring, A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
}
- draw_impl(ctx, ctx->ring, &emit);
+ draw_impl(ctx, ctx->batch->draw, &emit);
if (ctx->rasterizer->rasterizer_discard) {
- fd_wfi(ctx, ctx->ring);
- OUT_PKT3(ctx->ring, CP_REG_RMW, 3);
- OUT_RING(ctx->ring, REG_A4XX_RB_RENDER_CONTROL);
- OUT_RING(ctx->ring, ~A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
- OUT_RING(ctx->ring, 0);
+ fd_wfi(ctx, ring);
+ OUT_PKT3(ring, CP_REG_RMW, 3);
+ OUT_RING(ring, REG_A4XX_RB_RENDER_CONTROL);
+ OUT_RING(ring, ~A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
+ OUT_RING(ring, 0);
}
/* and now binning pass: */
@@ -187,7 +189,7 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
emit.dirty = dirty & ~(FD_DIRTY_BLEND);
emit.vp = NULL; /* we changed key so need to refetch vp */
emit.fp = NULL;
- draw_impl(ctx, ctx->binning_ring, &emit);
+ draw_impl(ctx, ctx->batch->binning, &emit);
return true;
}
@@ -217,7 +219,7 @@ static void
fd4_clear_binning(struct fd_context *ctx, unsigned dirty)
{
struct fd4_context *fd4_ctx = fd4_context(ctx);
- struct fd_ringbuffer *ring = ctx->binning_ring;
+ struct fd_ringbuffer *ring = ctx->batch->binning;
struct fd4_emit emit = {
.debug = &ctx->debug,
.vtx = &fd4_ctx->solid_vbuf_state,
@@ -251,7 +253,7 @@ fd4_clear(struct fd_context *ctx, unsigned buffers,
const union pipe_color_union *color, double depth, unsigned stencil)
{
struct fd4_context *fd4_ctx = fd4_context(ctx);
- struct fd_ringbuffer *ring = ctx->ring;
+ struct fd_ringbuffer *ring = ctx->batch->draw;
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
unsigned char mrt_comp[A4XX_MAX_RENDER_TARGETS] = {0};
unsigned dirty = ctx->dirty;