diff options
author | Rob Clark <[email protected]> | 2013-09-02 07:32:22 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2013-09-14 13:31:58 -0400 |
commit | 74052347f3fe32053bed72d623e7216b7b7f5605 (patch) | |
tree | bf251495580ddf6b86bc43556b0a2df477fe1a48 /src/gallium/drivers/freedreno/freedreno_draw.h | |
parent | 4712904ddc9f735365acaeec584d7f596fcf2a0b (diff) |
freedreno: fd_draw helper
Have a single helper that all draws come through.. mainly for a
convenient debug and instrumentation point.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_draw.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.h b/src/gallium/drivers/freedreno/freedreno_draw.h index 26a1dbbcaf1..7fb0abe2111 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.h +++ b/src/gallium/drivers/freedreno/freedreno_draw.h @@ -33,6 +33,8 @@ #include "pipe/p_context.h" #include "freedreno_context.h" +#include "freedreno_screen.h" +#include "freedreno_util.h" struct fd_ringbuffer; @@ -40,4 +42,24 @@ void fd_draw_emit(struct fd_context *ctx, const struct pipe_draw_info *info); void fd_draw_init(struct pipe_context *pctx); +static inline void +fd_draw(struct fd_context *ctx, enum pc_di_primtype primtype, + enum pc_di_src_sel src_sel, uint32_t count, + enum pc_di_index_size idx_type, + uint32_t idx_size, uint32_t idx_offset, + struct fd_bo *idx_bo) +{ + struct fd_ringbuffer *ring = ctx->ring; + + OUT_PKT3(ring, CP_DRAW_INDX, idx_bo ? 5 : 3); + OUT_RING(ring, 0x00000000); /* viz query info. */ + OUT_RING(ring, DRAW(primtype, src_sel, + idx_type, IGNORE_VISIBILITY)); + OUT_RING(ring, count); /* NumIndices */ + if (idx_bo) { + OUT_RELOC(ring, idx_bo, idx_offset, 0, 0); + OUT_RING (ring, idx_size); + } +} + #endif /* FREEDRENO_DRAW_H_ */ |