summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2018-09-21 12:02:34 -0700
committerRob Clark <[email protected]>2018-09-27 16:08:52 -0400
commit2516073cb654c8997955b0a21854649115945995 (patch)
tree24b425eaad8e5dcc3f41300f0c6352a04851e6b3
parentc3d58d9ffc7abbd7f60edfb8b323e2385e244a81 (diff)
freedreno/a6xx: Copy OUT_RING() part into each branch of the index if
Signed-off-by: Kristian H. Kristensen <[email protected]>
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_draw.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
index 332b1cf7bc2..c8d595c5d15 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
@@ -94,30 +94,42 @@ draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
idx_size = info->index_size * info->count;
idx_offset = index_offset + info->start * info->index_size;
src_sel = DI_SRC_SEL_DMA;
+
+
+ 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
+ * we know if we are binning or not
+ */
+ OUT_RINGP(ring, DRAW4(primtype, src_sel, idx_type, 0) | 0x2000,
+ &batch->draw_patches);
+ } else {
+ OUT_RING(ring, DRAW4(primtype, src_sel, idx_type, vismode) | 0x2000);
+ }
+ OUT_RING(ring, info->instance_count); /* NumInstances */
+ OUT_RING(ring, info->count); /* NumIndices */
+ OUT_RING(ring, 0x0); /* XXX */
+ OUT_RELOC(ring, fd_resource(idx_buffer)->bo, idx_offset, 0, 0);
+ OUT_RING (ring, idx_size);
} else {
idx_buffer = NULL;
idx_type = INDEX4_SIZE_32_BIT;
idx_size = 0;
idx_offset = 0;
src_sel = DI_SRC_SEL_AUTO_INDEX;
- }
- 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
- * we know if we are binning or not
- */
- OUT_RINGP(ring, DRAW4(primtype, src_sel, idx_type, 0) | 0x2000,
- &batch->draw_patches);
- } else {
- OUT_RING(ring, DRAW4(primtype, src_sel, idx_type, vismode) | 0x2000);
- }
- OUT_RING(ring, info->instance_count); /* NumInstances */
- OUT_RING(ring, info->count); /* NumIndices */
- if (idx_buffer) {
- OUT_RING(ring, 0x0); /* XXX */
- OUT_RELOC(ring, fd_resource(idx_buffer)->bo, idx_offset, 0, 0);
- OUT_RING (ring, idx_size);
+ 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
+ * we know if we are binning or not
+ */
+ OUT_RINGP(ring, DRAW4(primtype, src_sel, idx_type, 0) | 0x2000,
+ &batch->draw_patches);
+ } else {
+ OUT_RING(ring, DRAW4(primtype, src_sel, idx_type, vismode) | 0x2000);
+ }
+ OUT_RING(ring, info->instance_count); /* NumInstances */
+ OUT_RING(ring, info->count); /* NumIndices */
}
}