mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 11:00:11 +01:00
freedreno: per-generation OUT_IB packet
Some a4xx firmware doesn't implement the "PFD" (prefetch-disabled) version of the CP_INDIRECT_BUFFER packet. So allow for PFD vs PFE per generation. Switch a3xx and a4xx over to using prefetch-enabled version (which is also what blob does.. it seems only on a2xx we cannot use PFE). Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
c03f3dd0a5
commit
6062941e4d
9 changed files with 43 additions and 6 deletions
|
|
@ -109,6 +109,7 @@ fd2_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -446,3 +446,17 @@ fd2_emit_setup(struct fd_context *ctx)
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,4 +45,6 @@ void fd2_emit_vertex_bufs(struct fd_ringbuffer *ring, uint32_t val,
|
|||
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 */
|
||||
|
|
|
|||
|
|
@ -891,10 +891,18 @@ fd3_emit_restore(struct fd_context *ctx)
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -853,7 +853,7 @@ emit_binning_pass(struct fd_context *ctx)
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -885,10 +885,18 @@ fd4_emit_restore(struct fd_context *ctx)
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,6 +386,10 @@ struct fd_context {
|
|||
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 *
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ render_tiles(struct fd_context *ctx)
|
|||
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: */
|
||||
|
|
@ -349,7 +349,7 @@ render_sysmem(struct fd_context *ctx)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,8 +265,8 @@ OUT_WFI(struct fd_ringbuffer *ring)
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
|
|||
*/
|
||||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue