*/
#include "util/u_memory.h"
+#include "util/u_blitter.h"
#include "util/u_upload_mgr.h"
#include "util/u_math.h"
#include "util/u_debug.h"
lima_state_fini(ctx);
+ if (ctx->blitter)
+ util_blitter_destroy(ctx->blitter);
+
if (ctx->suballocator)
u_suballocator_destroy(ctx->suballocator);
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)
slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
+ ctx->blitter = util_blitter_create(&ctx->base);
+ if (!ctx->blitter)
+ goto err_out;
+
ctx->uploader = u_upload_create_default(&ctx->base);
if (!ctx->uploader)
goto err_out;
util_dynarray_init(&ctx->vs_cmd_array, ctx);
util_dynarray_init(&ctx->plbu_cmd_array, ctx);
- if (screen->gpu_type == DRM_LIMA_PARAM_GPU_ID_MALI450)
- ctx->plb_max_blk = 4096;
- else
- ctx->plb_max_blk = 512;
- ctx->plb_size = ctx->plb_max_blk * LIMA_CTX_PLB_BLK_SIZE;
- ctx->plb_gp_size = ctx->plb_max_blk * 4;
+ ctx->plb_size = screen->plb_max_blk * LIMA_CTX_PLB_BLK_SIZE;
+ ctx->plb_gp_size = screen->plb_max_blk * 4;
for (int i = 0; i < lima_ctx_num_plb; i++) {
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 =
/* plb gp stream is static for any framebuffer */
for (int i = 0; i < lima_ctx_num_plb; i++) {
uint32_t *plb_gp_stream = ctx->plb_gp_stream->map + i * ctx->plb_gp_size;
- for (int j = 0; j < ctx->plb_max_blk; j++)
+ for (int j = 0; j < screen->plb_max_blk; j++)
plb_gp_stream[j] = ctx->plb[i]->va + LIMA_CTX_PLB_BLK_SIZE * j;
}
return lima_submit_has_bo(ctx->gp_submit, bo, write) ||
lima_submit_has_bo(ctx->pp_submit, bo, write);
}
+
+bool
+lima_is_scanout(struct lima_context *ctx)
+{
+ /* If there is no color buffer, it's an FBO */
+ if (!ctx->framebuffer.base.nr_cbufs)
+ return false;
+
+ return ctx->framebuffer.base.cbufs[0]->texture->bind & PIPE_BIND_DISPLAY_TARGET ||
+ ctx->framebuffer.base.cbufs[0]->texture->bind & PIPE_BIND_SCANOUT ||
+ ctx->framebuffer.base.cbufs[0]->texture->bind & PIPE_BIND_SHARED;
+}