From: Kristian H. Kristensen Date: Fri, 21 Sep 2018 04:25:27 +0000 (-0700) Subject: freedreno/a6xx: Inline fd6_draw() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adcd83fb22670622ed6362ca30697c9ee990af27;p=mesa.git freedreno/a6xx: Inline fd6_draw() Simplify the code a bit by inlining this helper. Signed-off-by: Kristian H. Kristensen --- diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index 077088c7eb3..41c439721bd 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -43,34 +43,6 @@ /* 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