freedreno: get rid of noop render
authorRob Clark <robdclark@gmail.com>
Tue, 17 Jul 2018 13:54:23 +0000 (09:54 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 17 Jul 2018 15:00:00 +0000 (11:00 -0400)
This was basically to avoid a zero-dword IB (indirect-branch), but
instead just don't emit the IB packet in that case.

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

index 9918c259e48e9dac69ae8b36d012d1f9be679241..6244e3bcc25215fe46f48574d83c6b02aa638a2d 100644 (file)
@@ -276,10 +276,6 @@ batch_flush(struct fd_batch *batch, bool force)
        DBG("%p: needs_flush=%d", batch, batch->needs_flush);
 
        if (!batch->needs_flush) {
-               if (force) {
-                       fd_gmem_render_noop(batch);
-                       goto out;
-               }
                return;
        }
 
@@ -310,7 +306,6 @@ batch_flush(struct fd_batch *batch, bool force)
 
        debug_assert(batch->reference.count > 0);
 
-out:
        if (batch == batch->ctx->batch) {
                batch_reset(batch);
        } else {
index 1cd254b3629540e2edf5690815391df9a6ff0ec2..95b4c16e091dcb1276008f56f28a4727436f79d5 100644 (file)
@@ -442,21 +442,6 @@ fd_gmem_render_tiles(struct fd_batch *batch)
        flush_ring(batch);
 }
 
-/* special case for when we need to create a fence but have no rendering
- * to flush.. just emit a no-op string-marker packet.
- */
-void
-fd_gmem_render_noop(struct fd_batch *batch)
-{
-       struct fd_context *ctx = batch->ctx;
-       struct pipe_context *pctx = &ctx->base;
-
-       pctx->emit_string_marker(pctx, "noop", 4);
-       /* emit IB to drawcmds (which contain the string marker): */
-       ctx->emit_ib(batch->gmem, batch->draw);
-       flush_ring(batch);
-}
-
 /* tile needs restore if it isn't completely contained within the
  * cleared scissor:
  */
index 07e13f573288e7546192d5e157c7bd68795148c1..144e9506cfb4079a7e25448a28dc15411de05020 100644 (file)
@@ -63,7 +63,6 @@ struct fd_gmem_stateobj {
 struct fd_batch;
 
 void fd_gmem_render_tiles(struct fd_batch *batch);
-void fd_gmem_render_noop(struct fd_batch *batch);
 
 bool fd_gmem_needs_restore(struct fd_batch *batch, struct fd_tile *tile,
                uint32_t buffers);
index cdac08be6e2583660313a15af2ffcdaa98c8ab10..d8dec0151d05c7a5dd7d0fbf847fc1a74485780c 100644 (file)
@@ -355,6 +355,9 @@ OUT_WFI5(struct fd_ringbuffer *ring)
 static inline void
 __OUT_IB(struct fd_ringbuffer *ring, bool prefetch, struct fd_ringbuffer *target)
 {
+       if (target->cur == target->start)
+               return;
+
        unsigned count = fd_ringbuffer_cmd_count(target);
 
        debug_assert(__gpu_id(ring) < 500);
@@ -382,6 +385,9 @@ __OUT_IB(struct fd_ringbuffer *ring, bool prefetch, struct fd_ringbuffer *target
 static inline void
 __OUT_IB5(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
 {
+       if (target->cur == target->start)
+               return;
+
        unsigned count = fd_ringbuffer_cmd_count(target);
 
        for (unsigned i = 0; i < count; i++) {