freedreno/a4xx: pass number of instances to draw
authorRob Clark <robclark@freedesktop.org>
Sun, 21 Dec 2014 16:14:24 +0000 (11:14 -0500)
committerRob Clark <robclark@freedesktop.org>
Tue, 24 Feb 2015 19:23:38 +0000 (14:23 -0500)
a4xx has it's own draw packet, so needs equivalent update to what a3xx
already got.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_draw.c
src/gallium/drivers/freedreno/a4xx/fd4_draw.h
src/gallium/drivers/freedreno/a4xx/fd4_gmem.c

index aa3df9fc57bb8d3fbee580e1aa405ce5f2b182ff..29dc2ed002ec0932eb9c66c5e03184d35644b152 100644 (file)
@@ -305,7 +305,7 @@ fd4_clear(struct fd_context *ctx, unsigned buffers,
        OUT_RING(ring, 0x00000001);
 
        fd4_draw(ctx, ring, DI_PT_RECTLIST, USE_VISIBILITY,
-                       DI_SRC_SEL_AUTO_INDEX, 2, INDEX_SIZE_IGN, 0, 0, NULL);
+                       DI_SRC_SEL_AUTO_INDEX, 2, 1, INDEX_SIZE_IGN, 0, 0, NULL);
 
        OUT_PKT3(ring, CP_UNKNOWN_1A, 1);
        OUT_RING(ring, 0x00000000);
index dd2516aa98597543326fecbeb502c23d3d9acb8d..1bd376ca6ec59a4eb7223ab04f358b0fe1b0ead8 100644 (file)
@@ -51,7 +51,7 @@ fd4_draw(struct fd_context *ctx, struct fd_ringbuffer *ring,
                enum pc_di_primtype primtype,
                enum pc_di_vis_cull_mode vismode,
                enum pc_di_src_sel src_sel, uint32_t count,
-               enum a4xx_index_size idx_type,
+               uint32_t instances, enum a4xx_index_size idx_type,
                uint32_t idx_size, uint32_t idx_offset,
                struct fd_bo *idx_bo)
 {
@@ -73,7 +73,7 @@ fd4_draw(struct fd_context *ctx, struct fd_ringbuffer *ring,
        } else {
                OUT_RING(ring, DRAW4(primtype, src_sel, idx_type, vismode));
        }
-       OUT_RING(ring, 0x1);               /* XXX */
+       OUT_RING(ring, instances);         /* NumInstances */
        OUT_RING(ring, count);             /* NumIndices */
        if (idx_bo) {
                OUT_RING(ring, 0x0);           /* XXX */
@@ -127,7 +127,8 @@ fd4_draw_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
        }
 
        fd4_draw(ctx, ring, ctx->primtypes[info->mode], vismode, src_sel,
-                       info->count, idx_type, idx_size, idx_offset, idx_bo);
+                       info->count, info->instance_count,
+                       idx_type, idx_size, idx_offset, idx_bo);
 }
 
 #endif /* FD4_DRAW_H_ */
index 7f852e0cde9b4f4e041f0177a4055fd072dc4e79..2c579955712984f2b711c7150e3649af6e09baf2 100644 (file)
@@ -156,7 +156,7 @@ emit_gmem2mem_surf(struct fd_context *ctx,
                        A4XX_RB_COPY_DEST_INFO_SWAP(fd4_pipe2swap(psurf->format)));
 
        fd4_draw(ctx, ring, DI_PT_RECTLIST, IGNORE_VISIBILITY,
-                       DI_SRC_SEL_AUTO_INDEX, 2, INDEX_SIZE_IGN, 0, 0, NULL);
+                       DI_SRC_SEL_AUTO_INDEX, 2, 1, INDEX_SIZE_IGN, 0, 0, NULL);
 }
 
 static void
@@ -270,7 +270,7 @@ emit_mem2gmem_surf(struct fd_context *ctx, uint32_t base,
        fd4_emit_gmem_restore_tex(ring, psurf);
 
        fd4_draw(ctx, ring, DI_PT_RECTLIST, IGNORE_VISIBILITY,
-                       DI_SRC_SEL_AUTO_INDEX, 2, INDEX_SIZE_IGN, 0, 0, NULL);
+                       DI_SRC_SEL_AUTO_INDEX, 2, 1, INDEX_SIZE_IGN, 0, 0, NULL);
 }
 
 static void