static void
lima_update_submit_wb(struct lima_context *ctx, unsigned buffers)
{
+ struct lima_submit *submit = lima_submit_get(ctx);
struct lima_context_framebuffer *fb = &ctx->framebuffer;
/* add to submit when the buffer is dirty and resolve is clear (not added before) */
if (fb->base.nr_cbufs && (buffers & PIPE_CLEAR_COLOR0) &&
!(ctx->resolve & PIPE_CLEAR_COLOR0)) {
struct lima_resource *res = lima_resource(fb->base.cbufs[0]->texture);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, res->bo, LIMA_SUBMIT_BO_WRITE);
+ lima_submit_add_bo(submit, LIMA_PIPE_PP, res->bo, LIMA_SUBMIT_BO_WRITE);
}
/* add to submit when the buffer is dirty and resolve is clear (not added before) */
if (fb->base.zsbuf && (buffers & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) &&
!(ctx->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) {
struct lima_resource *res = lima_resource(fb->base.zsbuf->texture);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, res->bo, LIMA_SUBMIT_BO_WRITE);
+ lima_submit_add_bo(submit, LIMA_PIPE_PP, res->bo, LIMA_SUBMIT_BO_WRITE);
}
ctx->resolve |= buffers;
static void
lima_update_gp_attribute_info(struct lima_context *ctx, const struct pipe_draw_info *info)
{
+ struct lima_submit *submit = lima_submit_get(ctx);
struct lima_vertex_element_state *ve = ctx->vertex_elements;
struct lima_context_vertex_buffer *vb = &ctx->vertex_buffers;
struct pipe_vertex_buffer *pvb = vb->vb + pve->vertex_buffer_index;
struct lima_resource *res = lima_resource(pvb->buffer.resource);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_GP, res->bo, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_GP, res->bo, LIMA_SUBMIT_BO_READ);
unsigned start = info->index_size ? (ctx->min_index + info->index_bias) : info->start;
attribute[n++] = res->bo->va + pvb->buffer_offset + pve->src_offset
static void
lima_update_varying(struct lima_context *ctx, const struct pipe_draw_info *info)
{
+ struct lima_submit *submit = lima_submit_get(ctx);
struct lima_screen *screen = lima_screen(ctx->base.screen);
struct lima_vs_shader_state *vs = ctx->vs;
uint32_t gp_output_size;
*/
ctx->gp_output = lima_bo_create(screen, gp_output_size, 0);
assert(ctx->gp_output);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_GP, ctx->gp_output, LIMA_SUBMIT_BO_WRITE);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, ctx->gp_output, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_GP, ctx->gp_output, LIMA_SUBMIT_BO_WRITE);
+ lima_submit_add_bo(submit, LIMA_PIPE_PP, ctx->gp_output, LIMA_SUBMIT_BO_READ);
for (int i = 0; i < vs->num_outputs; i++) {
struct lima_varying_info *v = vs->varying + i;
const struct pipe_draw_info *info)
{
struct lima_context *ctx = lima_context(pctx);
+ struct lima_submit *submit = lima_submit_get(ctx);
struct pipe_resource *indexbuf = NULL;
/* Mali Utgard GPU always need min/max index info for index draw,
ctx->index_offset = 0;
}
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_GP, ctx->index_res->bo, LIMA_SUBMIT_BO_READ);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, ctx->index_res->bo, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_GP, ctx->index_res->bo, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_PP, ctx->index_res->bo, LIMA_SUBMIT_BO_READ);
lima_draw_vbo_update(pctx, info);
if (indexbuf)
if (!lima_update_vs_state(ctx) || !lima_update_fs_state(ctx))
return;
+ struct lima_submit *submit = lima_submit_get(ctx);
+
lima_dump_command_stream_print(
ctx->vs->bo->map, ctx->vs->shader_size, false,
"add vs at va %x\n", ctx->vs->bo->va);
ctx->fs->bo->map, ctx->fs->shader_size, false,
"add fs at va %x\n", ctx->fs->bo->va);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_GP, ctx->vs->bo, LIMA_SUBMIT_BO_READ);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, ctx->fs->bo, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_GP, ctx->vs->bo, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_PP, ctx->fs->bo, LIMA_SUBMIT_BO_READ);
if (info->index_size)
lima_draw_vbo_indexed(pctx, info);
desc->va[va_idx + 1] |= va >> (32 - va_bit_idx);
}
+/*
+ * Note: this function is used by both draw and flush code path,
+ * make sure no lima_submit_get() is called inside this.
+ */
void
lima_texture_desc_set_res(struct lima_context *ctx, lima_tex_desc *desc,
struct pipe_resource *prsc,
void
lima_update_textures(struct lima_context *ctx)
{
+ struct lima_submit *submit = lima_submit_get(ctx);
struct lima_texture_stateobj *lima_tex = &ctx->tex_stateobj;
assert (lima_tex->num_samplers <= 16);
for (int i = 0; i < lima_tex->num_samplers; i++) {
struct lima_sampler_view *texture = lima_sampler_view(lima_tex->textures[i]);
struct lima_resource *rsc = lima_resource(texture->base.texture);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, rsc->bo, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(submit, LIMA_PIPE_PP, rsc->bo, LIMA_SUBMIT_BO_READ);
}
/* do not regenerate texture desc if no change */