freedreno/a6xx: don't allocate binning rb
authorRob Clark <robdclark@gmail.com>
Mon, 15 Oct 2018 13:56:35 +0000 (09:56 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 17 Oct 2018 16:44:49 +0000 (12:44 -0400)
Now that a single cmdstream is used for both binning and draw passes, we
can skip allocation of cmdstream buffer for binning.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_batch.c

index a714d97f5cd2e698791d953cc9654a63e5a14bb3..487176cc6381f98cd4476822cd8b69d8432bde38 100644 (file)
@@ -56,12 +56,15 @@ batch_init(struct fd_batch *batch)
 
        batch->draw    = fd_ringbuffer_new(ctx->pipe, size);
        if (!batch->nondraw) {
-               batch->binning = fd_ringbuffer_new(ctx->pipe, size);
                batch->gmem    = fd_ringbuffer_new(ctx->pipe, size);
 
                fd_ringbuffer_set_parent(batch->gmem, NULL);
                fd_ringbuffer_set_parent(batch->draw, batch->gmem);
-               fd_ringbuffer_set_parent(batch->binning, batch->gmem);
+
+               if (ctx->screen->gpu_id < 600) {
+                       batch->binning = fd_ringbuffer_new(ctx->pipe, size);
+                       fd_ringbuffer_set_parent(batch->binning, batch->gmem);
+               }
        } else {
                fd_ringbuffer_set_parent(batch->draw, NULL);
        }
@@ -131,7 +134,8 @@ batch_fini(struct fd_batch *batch)
 
        fd_ringbuffer_del(batch->draw);
        if (!batch->nondraw) {
-               fd_ringbuffer_del(batch->binning);
+               if (batch->binning)
+                       fd_ringbuffer_del(batch->binning);
                fd_ringbuffer_del(batch->gmem);
        } else {
                debug_assert(!batch->binning);