for (int i = 0; i < LIMA_CTX_PLB_MAX_NUM; i++) {
if (ctx->plb[i])
lima_bo_free(ctx->plb[i]);
+ if (ctx->gp_tile_heap[i])
+ lima_bo_free(ctx->gp_tile_heap[i]);
}
if (ctx->plb_gp_stream)
ctx->plb[i] = lima_bo_create(screen, ctx->plb_size, 0);
if (!ctx->plb[i])
goto err_out;
+ ctx->gp_tile_heap[i] = lima_bo_create(screen, gp_tile_heap_size, 0);
+ if (!ctx->gp_tile_heap[i])
+ goto err_out;
}
unsigned plb_gp_stream_size =
unsigned plb_gp_size;
struct lima_bo *plb[LIMA_CTX_PLB_MAX_NUM];
+ struct lima_bo *gp_tile_heap[LIMA_CTX_PLB_MAX_NUM];
+ #define gp_tile_heap_size 0x100000
struct lima_bo *plb_gp_stream;
+
struct hash_table *plb_pp_stream;
uint32_t plb_index;
struct lima_screen *screen = lima_screen(ctx->base.screen);
lima_submit_add_bo(ctx->gp_submit, ctx->plb_gp_stream, LIMA_SUBMIT_BO_READ);
lima_submit_add_bo(ctx->gp_submit, ctx->plb[ctx->plb_index], LIMA_SUBMIT_BO_WRITE);
- lima_submit_add_bo(ctx->gp_submit, screen->gp_buffer, LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(ctx->gp_submit, ctx->gp_tile_heap[ctx->plb_index], LIMA_SUBMIT_BO_WRITE);
lima_dump_command_stream_print(
ctx->plb_gp_stream->map + ctx->plb_index * ctx->plb_gp_size,
struct lima_resource *res = lima_resource(ctx->framebuffer.base.cbufs[0]->texture);
lima_submit_add_bo(ctx->pp_submit, res->bo, LIMA_SUBMIT_BO_WRITE);
lima_submit_add_bo(ctx->pp_submit, ctx->plb[ctx->plb_index], LIMA_SUBMIT_BO_READ);
+ lima_submit_add_bo(ctx->pp_submit, ctx->gp_tile_heap[ctx->plb_index], LIMA_SUBMIT_BO_READ);
lima_submit_add_bo(ctx->pp_submit, screen->pp_buffer, LIMA_SUBMIT_BO_READ);
}
gp_frame_reg->vs_cmd_end = vs_cmd_va + vs_cmd_size;
gp_frame_reg->plbu_cmd_start = plbu_cmd_va;
gp_frame_reg->plbu_cmd_end = plbu_cmd_va + plbu_cmd_size;
- gp_frame_reg->tile_heap_start = screen->gp_buffer->va + gp_tile_heap_offset;
- gp_frame_reg->tile_heap_end = screen->gp_buffer->va + gp_buffer_size;
+ gp_frame_reg->tile_heap_start = ctx->gp_tile_heap[ctx->plb_index]->va;
+ gp_frame_reg->tile_heap_end = ctx->gp_tile_heap[ctx->plb_index]->va + gp_tile_heap_size;
lima_dump_command_stream_print(
&gp_frame, sizeof(gp_frame), false, "add gp frame\n");
if (screen->ro)
free(screen->ro);
- if (screen->gp_buffer)
- lima_bo_free(screen->gp_buffer);
-
if (screen->pp_buffer)
lima_bo_free(screen->pp_buffer);
if (!screen->pp_ra)
goto err_out1;
- screen->gp_buffer = lima_bo_create(screen, gp_buffer_size, 0);
- if (!screen->gp_buffer)
- goto err_out1;
-
screen->pp_buffer = lima_bo_create(screen, pp_buffer_size, 0);
if (!screen->pp_buffer)
- goto err_out2;
+ goto err_out1;
/* fs program for clear buffer?
* const0 1 0 0 -1.67773, mov.v0 $0 ^const0.xxxx, stop
screen->ro = renderonly_dup(ro);
if (!screen->ro) {
fprintf(stderr, "Failed to dup renderonly object\n");
- goto err_out3;
+ goto err_out2;
}
}
return &screen->base;
-err_out3:
- lima_bo_free(screen->pp_buffer);
err_out2:
- lima_bo_free(screen->gp_buffer);
+ lima_bo_free(screen->pp_buffer);
err_out1:
lima_bo_table_fini(screen);
err_out0:
struct ra_regs *pp_ra;
- struct lima_bo *gp_buffer;
- #define gp_tile_heap_offset 0x000000
- #define gp_buffer_size 0x100000
-
struct lima_bo *pp_buffer;
#define pp_frame_rsw_offset 0x0000
#define pp_clear_program_offset 0x0040