freedreno/all: move more emit helpers to screen
framebuffer_barrier() still depends on the ctx, but the rest can move to screen. Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
parent
684f4b5843
commit
c6fab232c8
|
@ -566,11 +566,11 @@ fd2_emit_restore(struct fd_context *ctx, struct fd_ringbuffer *ring)
|
||||||
void
|
void
|
||||||
fd2_emit_init_screen(struct pipe_screen *pscreen)
|
fd2_emit_init_screen(struct pipe_screen *pscreen)
|
||||||
{
|
{
|
||||||
|
struct fd_screen *screen = fd_screen(pscreen);
|
||||||
|
screen->emit_ib = fd2_emit_ib;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fd2_emit_init(struct pipe_context *pctx)
|
fd2_emit_init(struct pipe_context *pctx)
|
||||||
{
|
{
|
||||||
struct fd_context *ctx = fd_context(pctx);
|
|
||||||
ctx->emit_ib = fd2_emit_ib;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -951,11 +951,10 @@ fd3_emit_init_screen(struct pipe_screen *pscreen)
|
||||||
struct fd_screen *screen = fd_screen(pscreen);
|
struct fd_screen *screen = fd_screen(pscreen);
|
||||||
screen->emit_const = fd3_emit_const;
|
screen->emit_const = fd3_emit_const;
|
||||||
screen->emit_const_bo = fd3_emit_const_bo;
|
screen->emit_const_bo = fd3_emit_const_bo;
|
||||||
|
screen->emit_ib = fd3_emit_ib;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fd3_emit_init(struct pipe_context *pctx)
|
fd3_emit_init(struct pipe_context *pctx)
|
||||||
{
|
{
|
||||||
struct fd_context *ctx = fd_context(pctx);
|
|
||||||
ctx->emit_ib = fd3_emit_ib;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -939,12 +939,11 @@ fd4_emit_init_screen(struct pipe_screen *pscreen)
|
||||||
|
|
||||||
screen->emit_const = fd4_emit_const;
|
screen->emit_const = fd4_emit_const;
|
||||||
screen->emit_const_bo = fd4_emit_const_bo;
|
screen->emit_const_bo = fd4_emit_const_bo;
|
||||||
|
screen->emit_ib = fd4_emit_ib;
|
||||||
|
screen->mem_to_mem = fd4_mem_to_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fd4_emit_init(struct pipe_context *pctx)
|
fd4_emit_init(struct pipe_context *pctx)
|
||||||
{
|
{
|
||||||
struct fd_context *ctx = fd_context(pctx);
|
|
||||||
ctx->emit_ib = fd4_emit_ib;
|
|
||||||
ctx->mem_to_mem = fd4_mem_to_mem;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1125,12 +1125,11 @@ fd5_emit_init_screen(struct pipe_screen *pscreen)
|
||||||
struct fd_screen *screen = fd_screen(pscreen);
|
struct fd_screen *screen = fd_screen(pscreen);
|
||||||
screen->emit_const = fd5_emit_const;
|
screen->emit_const = fd5_emit_const;
|
||||||
screen->emit_const_bo = fd5_emit_const_bo;
|
screen->emit_const_bo = fd5_emit_const_bo;
|
||||||
|
screen->emit_ib = fd5_emit_ib;
|
||||||
|
screen->mem_to_mem = fd5_mem_to_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fd5_emit_init(struct pipe_context *pctx)
|
fd5_emit_init(struct pipe_context *pctx)
|
||||||
{
|
{
|
||||||
struct fd_context *ctx = fd_context(pctx);
|
|
||||||
ctx->emit_ib = fd5_emit_ib;
|
|
||||||
ctx->mem_to_mem = fd5_mem_to_mem;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1336,13 +1336,13 @@ fd6_emit_init_screen(struct pipe_screen *pscreen)
|
||||||
struct fd_screen *screen = fd_screen(pscreen);
|
struct fd_screen *screen = fd_screen(pscreen);
|
||||||
screen->emit_const = fd6_emit_const;
|
screen->emit_const = fd6_emit_const;
|
||||||
screen->emit_const_bo = fd6_emit_const_bo;
|
screen->emit_const_bo = fd6_emit_const_bo;
|
||||||
|
screen->emit_ib = fd6_emit_ib;
|
||||||
|
screen->mem_to_mem = fd6_mem_to_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fd6_emit_init(struct pipe_context *pctx)
|
fd6_emit_init(struct pipe_context *pctx)
|
||||||
{
|
{
|
||||||
struct fd_context *ctx = fd_context(pctx);
|
struct fd_context *ctx = fd_context(pctx);
|
||||||
ctx->emit_ib = fd6_emit_ib;
|
|
||||||
ctx->mem_to_mem = fd6_mem_to_mem;
|
|
||||||
ctx->framebuffer_barrier = fd6_framebuffer_barrier;
|
ctx->framebuffer_barrier = fd6_framebuffer_barrier;
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,9 +327,6 @@ struct fd_context {
|
||||||
/* compute: */
|
/* compute: */
|
||||||
void (*launch_grid)(struct fd_context *ctx, const struct pipe_grid_info *info);
|
void (*launch_grid)(struct fd_context *ctx, const struct pipe_grid_info *info);
|
||||||
|
|
||||||
/* indirect-branch emit: */
|
|
||||||
void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringbuffer *target);
|
|
||||||
|
|
||||||
/* query: */
|
/* query: */
|
||||||
struct fd_query * (*create_query)(struct fd_context *ctx, unsigned query_type);
|
struct fd_query * (*create_query)(struct fd_context *ctx, unsigned query_type);
|
||||||
void (*query_prepare)(struct fd_batch *batch, uint32_t num_tiles);
|
void (*query_prepare)(struct fd_batch *batch, uint32_t num_tiles);
|
||||||
|
@ -340,11 +337,6 @@ struct fd_context {
|
||||||
/* blitter: */
|
/* blitter: */
|
||||||
bool (*blit)(struct fd_context *ctx, const struct pipe_blit_info *info);
|
bool (*blit)(struct fd_context *ctx, const struct pipe_blit_info *info);
|
||||||
|
|
||||||
/* simple gpu "memcpy": */
|
|
||||||
void (*mem_to_mem)(struct fd_ringbuffer *ring, struct pipe_resource *dst,
|
|
||||||
unsigned dst_off, struct pipe_resource *src, unsigned src_off,
|
|
||||||
unsigned sizedwords);
|
|
||||||
|
|
||||||
/* handling for barriers: */
|
/* handling for barriers: */
|
||||||
void (*framebuffer_barrier)(struct fd_context *ctx);
|
void (*framebuffer_barrier)(struct fd_context *ctx);
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ render_tiles(struct fd_batch *batch)
|
||||||
if (ctx->emit_tile) {
|
if (ctx->emit_tile) {
|
||||||
ctx->emit_tile(batch, tile);
|
ctx->emit_tile(batch, tile);
|
||||||
} else {
|
} else {
|
||||||
ctx->emit_ib(batch->gmem, batch->draw);
|
ctx->screen->emit_ib(batch->gmem, batch->draw);
|
||||||
}
|
}
|
||||||
fd_reset_wfi(batch);
|
fd_reset_wfi(batch);
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ render_sysmem(struct fd_batch *batch)
|
||||||
ctx->query_prepare_tile(batch, 0, batch->gmem);
|
ctx->query_prepare_tile(batch, 0, batch->gmem);
|
||||||
|
|
||||||
/* emit IB to drawcmds: */
|
/* emit IB to drawcmds: */
|
||||||
ctx->emit_ib(batch->gmem, batch->draw);
|
ctx->screen->emit_ib(batch->gmem, batch->draw);
|
||||||
fd_reset_wfi(batch);
|
fd_reset_wfi(batch);
|
||||||
|
|
||||||
if (ctx->emit_sysmem_fini)
|
if (ctx->emit_sysmem_fini)
|
||||||
|
|
|
@ -102,6 +102,14 @@ struct fd_screen {
|
||||||
void (*emit_const_bo)(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
|
void (*emit_const_bo)(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
|
||||||
uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets);
|
uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets);
|
||||||
|
|
||||||
|
/* indirect-branch emit: */
|
||||||
|
void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringbuffer *target);
|
||||||
|
|
||||||
|
/* simple gpu "memcpy": */
|
||||||
|
void (*mem_to_mem)(struct fd_ringbuffer *ring, struct pipe_resource *dst,
|
||||||
|
unsigned dst_off, struct pipe_resource *src, unsigned src_off,
|
||||||
|
unsigned sizedwords);
|
||||||
|
|
||||||
int64_t cpu_gpu_time_delta;
|
int64_t cpu_gpu_time_delta;
|
||||||
|
|
||||||
struct fd_batch_cache batch_cache;
|
struct fd_batch_cache batch_cache;
|
||||||
|
|
|
@ -564,7 +564,7 @@ ir3_emit_vs_driver_params(const struct ir3_shader_variant *v,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy index_bias or start from draw params: */
|
/* copy index_bias or start from draw params: */
|
||||||
ctx->mem_to_mem(ring, vertex_params_rsc, 0,
|
ctx->screen->mem_to_mem(ring, vertex_params_rsc, 0,
|
||||||
indirect->buffer, src_off, 1);
|
indirect->buffer, src_off, 1);
|
||||||
|
|
||||||
emit_const(ctx, ring, v, offset * 4, 0,
|
emit_const(ctx, ring, v, offset * 4, 0,
|
||||||
|
@ -638,7 +638,7 @@ ir3_emit_cs_consts(const struct ir3_shader_variant *v, struct fd_ringbuffer *rin
|
||||||
0x1000);
|
0x1000);
|
||||||
indirect_offset = 0;
|
indirect_offset = 0;
|
||||||
|
|
||||||
ctx->mem_to_mem(ring, indirect, 0, info->indirect,
|
ctx->screen->mem_to_mem(ring, indirect, 0, info->indirect,
|
||||||
info->indirect_offset, 3);
|
info->indirect_offset, 3);
|
||||||
} else {
|
} else {
|
||||||
pipe_resource_reference(&indirect, info->indirect);
|
pipe_resource_reference(&indirect, info->indirect);
|
||||||
|
|
Loading…
Reference in New Issue