freedreno/a6xx: Move emit_marker and wfi to draw_impl()
authorKristian H. Kristensen <hoegsberg@chromium.org>
Fri, 21 Sep 2018 04:19:57 +0000 (21:19 -0700)
committerRob Clark <robdclark@gmail.com>
Thu, 27 Sep 2018 20:08:52 +0000 (16:08 -0400)
This way the markers clearly bracket the draw call and isn't
duplicated for both direct and indirect draw code.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index b3ce712d0d7b691ed40ddb139cf32a6724d7ad94..077088c7eb3319baa7f77bc4e0524608c9d2a665 100644 (file)
@@ -52,14 +52,6 @@ fd6_draw(struct fd_batch *batch, struct fd_ringbuffer *ring,
                uint32_t idx_size, uint32_t idx_offset,
                struct pipe_resource *idx_buffer)
 {
-       /* for debug after a lock up, write a unique counter value
-        * to scratch7 for each draw, to make it easier to match up
-        * register dumps to cmdstream.  The combination of IB
-        * (scratch6) and DRAW is enough to "triangulate" the
-        * particular draw that caused lockup.
-        */
-       emit_marker6(ring, 7);
-
        OUT_PKT7(ring, CP_DRAW_INDX_OFFSET, idx_buffer ? 7 : 3);
        if (vismode == USE_VISIBILITY) {
                /* leave vis mode blank for now, it will be patched up when
@@ -77,10 +69,6 @@ fd6_draw(struct fd_batch *batch, struct fd_ringbuffer *ring,
                OUT_RELOC(ring, fd_resource(idx_buffer)->bo, idx_offset, 0, 0);
                OUT_RING (ring, idx_size);
        }
-
-       emit_marker6(ring, 7);
-
-       fd_reset_wfi(batch);
 }
 
 static inline void
@@ -98,8 +86,6 @@ fd6_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
        if (info->indirect) {
                struct fd_resource *ind = fd_resource(info->indirect->buffer);
 
-               emit_marker6(ring, 7);
-
                if (info->index_size) {
                        struct pipe_resource *idx = info->index.resource;
                        unsigned max_indicies = (idx->width0 - info->indirect->offset) /
@@ -121,9 +107,6 @@ fd6_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
                        OUT_RELOC(ring, ind->bo, info->indirect->offset, 0, 0);
                }
 
-               emit_marker6(ring, 7);
-               fd_reset_wfi(batch);
-
                return;
        }
 
@@ -169,9 +152,21 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
                        info->restart_index : 0xffffffff);
 
        fd6_emit_render_cntl(ctx, false, emit->key.binning_pass);
+
+       /* for debug after a lock up, write a unique counter value
+        * to scratch7 for each draw, to make it easier to match up
+        * register dumps to cmdstream.  The combination of IB
+        * (scratch6) and DRAW is enough to "triangulate" the
+        * particular draw that caused lockup.
+        */
+       emit_marker6(ring, 7);
+
        fd6_draw_emit(ctx->batch, ring, primtype,
                        emit->key.binning_pass ? IGNORE_VISIBILITY : USE_VISIBILITY,
                        info, index_offset);
+
+       emit_marker6(ring, 7);
+       fd_reset_wfi(ctx->batch);
 }
 
 /* fixup dirty shader state in case some "unrelated" (from the state-