#include "util/u_debug.h"
#include "util/ralloc.h"
#include "util/u_inlines.h"
-#include "util/u_suballoc.h"
#include "util/hash_table.h"
#include "lima_screen.h"
void *
lima_ctx_buff_alloc(struct lima_context *ctx, enum lima_ctx_buff buff,
- unsigned size, bool uploader)
+ unsigned size)
{
struct lima_ctx_buff_state *cbs = ctx->buffer_state + buff;
void *ret = NULL;
cbs->size = align(size, 0x40);
- if (uploader)
- u_upload_alloc(ctx->uploader, 0, cbs->size, 0x40, &cbs->offset,
- &cbs->res, &ret);
- else
- u_suballocator_alloc(ctx->suballocator, cbs->size, 0x10,
- &cbs->offset, &cbs->res);
+ u_upload_alloc(ctx->uploader, 0, cbs->size, 0x40, &cbs->offset,
+ &cbs->res, &ret);
return ret;
}
if (ctx->blitter)
util_blitter_destroy(ctx->blitter);
- if (ctx->suballocator)
- u_suballocator_destroy(ctx->suballocator);
-
if (ctx->uploader)
u_upload_destroy(ctx->uploader);
ctx->base.stream_uploader = ctx->uploader;
ctx->base.const_uploader = ctx->uploader;
- /* for varying output which need not mmap */
- ctx->suballocator =
- u_suballocator_create(&ctx->base, 1024 * 1024, 0,
- PIPE_USAGE_STREAM, 0, false);
- if (!ctx->suballocator)
- goto err_out;
-
util_dynarray_init(&ctx->vs_cmd_array, ctx);
util_dynarray_init(&ctx->plbu_cmd_array, ctx);
{
struct lima_render_state *render =
lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_plb_rsw,
- sizeof(*render), true);
+ sizeof(*render));
/* do hw support RGBA independ blend?
* PIPE_CAP_INDEP_BLEND_ENABLE
uint32_t *attribute =
lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_attribute_info,
- MAX2(1, ve->num_elements) * 8, true);
+ MAX2(1, ve->num_elements) * 8);
int n = 0;
for (int i = 0; i < ve->num_elements; i++) {
int size = vs->uniform_pending_offset + vs->constant_size + 32;
void *vs_const_buff =
- lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_uniform, size, true);
+ lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_uniform, size);
if (ccb->buffer)
memcpy(vs_const_buff, ccb->buffer, ccb->size);
uint16_t *fp16_const_buff =
lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_uniform,
- const_buff_size * sizeof(uint16_t), true);
+ const_buff_size * sizeof(uint16_t));
uint32_t *array =
- lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_uniform_array, 4, true);
+ lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_uniform_array, 4);
for (int i = 0; i < const_buff_size; i++)
fp16_const_buff[i] = util_float_to_half(const_buff[i]);
uint32_t *varying =
lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_varying_info,
- vs->num_outputs * 8, true);
+ vs->num_outputs * 8);
int n = 0;
int offset = 0;
if (vs_cmd_size) {
void *vs_cmd =
- lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_vs_cmd, vs_cmd_size, true);
+ lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_vs_cmd, vs_cmd_size);
memcpy(vs_cmd, util_dynarray_begin(&ctx->vs_cmd_array), vs_cmd_size);
util_dynarray_clear(&ctx->vs_cmd_array);
vs_cmd_va = lima_ctx_buff_va(ctx, lima_ctx_buff_gp_vs_cmd,
}
void *plbu_cmd =
- lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_plbu_cmd, plbu_cmd_size, true);
+ lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_plbu_cmd, plbu_cmd_size);
memcpy(plbu_cmd, util_dynarray_begin(&ctx->plbu_cmd_array), plbu_cmd_size);
util_dynarray_clear(&ctx->plbu_cmd_array);
plbu_cmd_va = lima_ctx_buff_va(ctx, lima_ctx_buff_gp_plbu_cmd,
uint32_t pp_stack_va = 0;
if (ctx->pp_max_stack_size) {
lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_stack, screen->num_pp *
- ctx->pp_max_stack_size * pp_stack_pp_size, true);
+ ctx->pp_max_stack_size * pp_stack_pp_size);
pp_stack_va = lima_ctx_buff_va(ctx, lima_ctx_buff_pp_stack,
LIMA_CTX_BUFF_SUBMIT_PP);
}