fd2_gmem_init(pctx);
fd2_texture_init(pctx);
fd2_prog_init(pctx);
+ fd2_emit_init(pctx);
pctx = fd_context_init(&fd2_ctx->base, pscreen,
(screen->gpu_id >= 220) ? a22x_primtypes : a20x_primtypes,
fd_ringbuffer_flush(ring);
fd_ringmarker_mark(ctx->draw_start);
}
+
+static void
+fd2_emit_ib(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
+ struct fd_ringmarker *end)
+{
+ __OUT_IB(ring, false, start, end);
+}
+
+void
+fd2_emit_init(struct pipe_context *pctx)
+{
+ struct fd_context *ctx = fd_context(pctx);
+ ctx->emit_ib = fd2_emit_ib;
+}
void fd2_emit_state(struct fd_context *ctx, uint32_t dirty);
void fd2_emit_setup(struct fd_context *ctx);
+void fd2_emit_init(struct pipe_context *pctx);
+
#endif /* FD2_EMIT_H */
ctx->needs_rb_fbd = true;
}
+static void
+fd3_emit_ib(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
+ struct fd_ringmarker *end)
+{
+ __OUT_IB(ring, true, start, end);
+}
+
void
fd3_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
ctx->emit_const = fd3_emit_const;
ctx->emit_const_bo = fd3_emit_const_bo;
+ ctx->emit_ib = fd3_emit_ib;
}
A3XX_PC_VSTREAM_CONTROL_N(0));
/* emit IB to binning drawcmds: */
- OUT_IB(ring, ctx->binning_start, ctx->binning_end);
+ ctx->emit_ib(ring, ctx->binning_start, ctx->binning_end);
fd_reset_wfi(ctx);
fd_wfi(ctx, ring);
ctx->needs_rb_fbd = true;
}
+static void
+fd4_emit_ib(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
+ struct fd_ringmarker *end)
+{
+ __OUT_IB(ring, true, start, end);
+}
+
void
fd4_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
ctx->emit_const = fd4_emit_const;
ctx->emit_const_bo = fd4_emit_const_bo;
+ ctx->emit_ib = fd4_emit_ib;
}
const uint32_t *dwords, struct pipe_resource *prsc);
void (*emit_const_bo)(struct fd_ringbuffer *ring, enum shader_t type, boolean write,
uint32_t regid, uint32_t num, struct fd_bo **bos, uint32_t *offsets);
+
+ /* indirect-branch emit: */
+ void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
+ struct fd_ringmarker *end);
};
static inline struct fd_context *
fd_hw_query_prepare_tile(ctx, i, ctx->ring);
/* emit IB to drawcmds: */
- OUT_IB(ctx->ring, ctx->draw_start, ctx->draw_end);
+ ctx->emit_ib(ctx->ring, ctx->draw_start, ctx->draw_end);
fd_reset_wfi(ctx);
/* emit gmem2mem to transfer tile back to system memory: */
fd_hw_query_prepare_tile(ctx, 0, ctx->ring);
/* emit IB to drawcmds: */
- OUT_IB(ctx->ring, ctx->draw_start, ctx->draw_end);
+ ctx->emit_ib(ctx->ring, ctx->draw_start, ctx->draw_end);
fd_reset_wfi(ctx);
}
}
static inline void
-OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
- struct fd_ringmarker *end)
+__OUT_IB(struct fd_ringbuffer *ring, bool prefetch,
+ struct fd_ringmarker *start, struct fd_ringmarker *end)
{
uint32_t dwords = fd_ringmarker_dwords(start, end);
*/
emit_marker(ring, 6);
- OUT_PKT3(ring, CP_INDIRECT_BUFFER_PFD, 2);
+ OUT_PKT3(ring, prefetch ? CP_INDIRECT_BUFFER_PFE : CP_INDIRECT_BUFFER_PFD, 2);
fd_ringbuffer_emit_reloc_ring(ring, start, end);
OUT_RING(ring, dwords);