summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-10-26 14:34:04 -0400
committerRob Clark <[email protected]>2018-10-26 18:10:00 -0400
commitc41772d17ae155cc74775f58a37004d6b01d329e (patch)
tree9115949c19a57bbe2f99669b47f0ed734585966c /src/gallium
parent604b5f1dcabb7541a1d5bcf4178c44f81f5e015d (diff)
freedreno/a6xx: inline draw_impl()
Now that it is just called once per draw (instead of once for binning and once for draw), let's just inline it. If nothing else, it makes perf-annotate easier to look at. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_draw.c69
1 files changed, 31 insertions, 38 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
index f38b8012cc3..c9c4077e3a6 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
@@ -116,43 +116,6 @@ draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
}
}
-static void
-draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
- struct fd6_emit *emit, unsigned index_offset)
-{
- const struct pipe_draw_info *info = emit->info;
- enum pc_di_primtype primtype = ctx->primtypes[info->mode];
-
- fd6_emit_state(ring, emit);
-
- OUT_PKT4(ring, REG_A6XX_VFD_INDEX_OFFSET, 2);
- OUT_RING(ring, info->index_size ? info->index_bias : info->start); /* VFD_INDEX_OFFSET */
- OUT_RING(ring, info->start_instance); /* VFD_INSTANCE_START_OFFSET */
-
- OUT_PKT4(ring, REG_A6XX_PC_RESTART_INDEX, 1);
- OUT_RING(ring, info->primitive_restart ? /* PC_RESTART_INDEX */
- info->restart_index : 0xffffffff);
-
- /* 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);
-
- if (info->indirect) {
- draw_emit_indirect(ctx->batch, ring, primtype,
- info, index_offset);
- } else {
- draw_emit(ctx->batch, ring, primtype,
- info, index_offset);
- }
-
- emit_marker6(ring, 7);
- fd_reset_wfi(ctx->batch);
-}
-
/* fixup dirty shader state in case some "unrelated" (from the state-
* tracker's perspective) state change causes us to switch to a
* different variant.
@@ -244,7 +207,37 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
*/
emit.no_lrz_write = fp->writes_pos || fp->has_kill;
- draw_impl(ctx, ctx->batch->draw, &emit, index_offset);
+ struct fd_ringbuffer *ring = ctx->batch->draw;
+ enum pc_di_primtype primtype = ctx->primtypes[info->mode];
+
+ fd6_emit_state(ring, &emit);
+
+ OUT_PKT4(ring, REG_A6XX_VFD_INDEX_OFFSET, 2);
+ OUT_RING(ring, info->index_size ? info->index_bias : info->start); /* VFD_INDEX_OFFSET */
+ OUT_RING(ring, info->start_instance); /* VFD_INSTANCE_START_OFFSET */
+
+ OUT_PKT4(ring, REG_A6XX_PC_RESTART_INDEX, 1);
+ OUT_RING(ring, info->primitive_restart ? /* PC_RESTART_INDEX */
+ info->restart_index : 0xffffffff);
+
+ /* 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);
+
+ if (info->indirect) {
+ draw_emit_indirect(ctx->batch, ring, primtype,
+ info, index_offset);
+ } else {
+ draw_emit(ctx->batch, ring, primtype,
+ info, index_offset);
+ }
+
+ emit_marker6(ring, 7);
+ fd_reset_wfi(ctx->batch);
if (emit.streamout_mask) {
struct fd_ringbuffer *ring = ctx->batch->draw;