resolve_uncleared);
#endif
+ uint32_t reloc_size = 9;
+ uint32_t clear_size = 14;
+ uint32_t config_size = 11 + reloc_size;
+ uint32_t loadstore_size = 7 + reloc_size;
+ uint32_t tilecoords_size = 3;
+ uint32_t branch_size = 5 + reloc_size;
+ uint32_t color_store_size = 1;
+ cl_ensure_space(&vc4->rcl,
+ clear_size +
+ config_size +
+ loadstore_size +
+ xtiles * ytiles * (loadstore_size * 4 +
+ tilecoords_size * 3 +
+ branch_size +
+ color_store_size));
+
cl_u8(&vc4->rcl, VC4_PACKET_CLEAR_COLORS);
cl_u32(&vc4->rcl, vc4->clear_color[0]);
cl_u32(&vc4->rcl, vc4->clear_color[1]);
*/
struct vc4_surface *render_surf = csurf ? csurf : zsurf;
struct vc4_resource *render_tex = vc4_resource(render_surf->base.texture);
-
cl_start_reloc(&vc4->rcl, 1);
cl_u8(&vc4->rcl, VC4_PACKET_TILE_RENDERING_MODE_CONFIG);
cl_reloc(vc4, &vc4->rcl, render_tex->bo, render_surf->offset);
cl_u32(&vc4->rcl, 0); /* no address, since we're in None mode */
}
+ uint32_t color_hindex = ctex ? vc4_gem_hindex(vc4, ctex->bo) : 0;
+ uint32_t depth_hindex = ztex ? vc4_gem_hindex(vc4, ztex->bo) : 0;
+ uint32_t tile_alloc_hindex = vc4_gem_hindex(vc4, vc4->tile_alloc);
+
for (int y = 0; y < ytiles; y++) {
for (int x = 0; x < xtiles; x++) {
bool end_of_frame = (x == xtiles - 1 &&
vc4_rt_format_is_565(csurf->base.format) ?
VC4_LOADSTORE_TILE_BUFFER_BGR565 :
VC4_LOADSTORE_TILE_BUFFER_RGBA8888);
- cl_reloc(vc4, &vc4->rcl, ctex->bo,
- csurf->offset);
+ cl_reloc_hindex(&vc4->rcl, color_hindex,
+ csurf->offset);
vc4_tile_coordinates(vc4, x, y, &coords_emitted);
}
(zsurf->tiling <<
VC4_LOADSTORE_TILE_BUFFER_FORMAT_SHIFT));
cl_u8(&vc4->rcl, 0);
- cl_reloc(vc4, &vc4->rcl, ztex->bo,
- zsurf->offset);
+ cl_reloc_hindex(&vc4->rcl, depth_hindex,
+ zsurf->offset);
vc4_tile_coordinates(vc4, x, y, &coords_emitted);
}
cl_start_reloc(&vc4->rcl, 1);
cl_u8(&vc4->rcl, VC4_PACKET_BRANCH_TO_SUB_LIST);
- cl_reloc(vc4, &vc4->rcl, vc4->tile_alloc,
- (y * xtiles + x) * 32);
+ cl_reloc_hindex(&vc4->rcl, tile_alloc_hindex,
+ (y * xtiles + x) * 32);
if (vc4->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) {
vc4_tile_coordinates(vc4, x, y, &coords_emitted);
VC4_LOADSTORE_TILE_BUFFER_FORMAT_SHIFT));
cl_u8(&vc4->rcl,
VC4_STORE_TILE_BUFFER_DISABLE_COLOR_CLEAR);
- cl_reloc(vc4, &vc4->rcl, ztex->bo,
- zsurf->offset |
- ((end_of_frame &&
- !(vc4->resolve & PIPE_CLEAR_COLOR0)) ?
- VC4_LOADSTORE_TILE_BUFFER_EOF : 0));
+ cl_reloc_hindex(&vc4->rcl, depth_hindex,
+ zsurf->offset |
+ ((end_of_frame &&
+ !(vc4->resolve & PIPE_CLEAR_COLOR0)) ?
+ VC4_LOADSTORE_TILE_BUFFER_EOF : 0));
coords_emitted = false;
}
if (vc4_debug & VC4_DEBUG_CL) {
fprintf(stderr, "BCL:\n");
- vc4_dump_cl(vc4->bcl.base, vc4->bcl.end - vc4->bcl.base, false);
+ vc4_dump_cl(vc4->bcl.base, vc4->bcl.size, false);
fprintf(stderr, "RCL:\n");
- vc4_dump_cl(vc4->rcl.base, vc4->rcl.end - vc4->rcl.base, true);
+ vc4_dump_cl(vc4->rcl.base, vc4->rcl.size, true);
}
struct drm_vc4_submit_cl submit;
vc4->last_emit_seqno = submit.seqno;
+ if (vc4_debug & VC4_DEBUG_ALWAYS_SYNC) {
+ if (!vc4_wait_seqno(vc4->screen, vc4->last_emit_seqno,
+ PIPE_TIMEOUT_INFINITE)) {
+ fprintf(stderr, "Wait failed.\n");
+ abort();
+ }
+ }
+
vc4_reset_cl(&vc4->bcl);
vc4_reset_cl(&vc4->rcl);
vc4_reset_cl(&vc4->shader_rec);
util_slab_destroy(&vc4->transfer_pool);
+ pipe_surface_reference(&vc4->framebuffer.cbufs[0], NULL);
+ pipe_surface_reference(&vc4->framebuffer.zsbuf, NULL);
+ vc4_bo_unreference(&vc4->tile_alloc);
+ vc4_bo_unreference(&vc4->tile_state);
+
+ vc4_program_fini(pctx);
+
ralloc_free(vc4);
}
vc4_init_cl(vc4, &vc4->bcl);
vc4_init_cl(vc4, &vc4->rcl);
vc4_init_cl(vc4, &vc4->shader_rec);
+ vc4_init_cl(vc4, &vc4->uniforms);
vc4_init_cl(vc4, &vc4->bo_handles);
+ vc4_init_cl(vc4, &vc4->bo_pointers);
vc4->dirty = ~0;
vc4->fd = screen->fd;