freedreno/a6xx: Inline fd6_draw()
authorKristian H. Kristensen <hoegsberg@chromium.org>
Fri, 21 Sep 2018 04:25:27 +0000 (21:25 -0700)
committerRob Clark <robdclark@gmail.com>
Thu, 27 Sep 2018 20:08:52 +0000 (16:08 -0400)
Simplify the code a bit by inlining this helper.

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

index 077088c7eb3319baa7f77bc4e0524608c9d2a665..41c439721bd163439f47998a1e4de92037ca28b2 100644 (file)
 /* some bits in common w/ a4xx: */
 #include "a4xx/fd4_draw.h"
 
-static inline void
-fd6_draw(struct fd_batch *batch, 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,
-               uint32_t instances, enum a4xx_index_size idx_type,
-               uint32_t idx_size, uint32_t idx_offset,
-               struct pipe_resource *idx_buffer)
-{
-       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, instances);         /* NumInstances */
-       OUT_RING(ring, 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);
-       }
-}
-
 static inline void
 fd6_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
                enum pc_di_primtype primtype,
@@ -126,9 +98,23 @@ fd6_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
                src_sel = DI_SRC_SEL_AUTO_INDEX;
        }
 
-       fd6_draw(batch, ring, primtype, vismode, src_sel,
-                       info->count, info->instance_count,
-                       idx_type, idx_size, idx_offset, idx_buffer);
+       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);
+       }
 }
 
 static void