panfrost: Merge varyings_mem into transient buffers

Theoretically we would like these split since varyings can have
specially optimized flags (no map, coherent local). For now, since
neither of these flags is particularly meaningful right now, merge them
together instead of special casing varyings_mem.

Saves upwards of 64MB of RAM per context.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig
2019-07-16 11:36:11 -07:00
parent 6f880f128f
commit a301250ece
3 changed files with 5 additions and 15 deletions
+5 -11
View File
@@ -255,9 +255,6 @@ panfrost_invalidate_frame(struct panfrost_context *ctx)
ctx->payload_vertex.postfix.framebuffer = 0;
ctx->payload_tiler.postfix.framebuffer = 0;
/* Reset varyings allocated */
ctx->varying_height = 0;
if (ctx->rasterizer)
ctx->dirty |= PAN_DIRTY_RASTERIZER;
@@ -509,18 +506,17 @@ panfrost_emit_varyings(
unsigned stride,
unsigned count)
{
mali_ptr varying_address = ctx->varying_mem.bo->gpu + ctx->varying_height;
/* Fill out the descriptor */
slot->elements = varying_address | MALI_ATTR_LINEAR;
slot->stride = stride;
slot->size = stride * count;
slot->shift = slot->extra_flags = 0;
ctx->varying_height += ALIGN_POT(slot->size, 64);
assert(ctx->varying_height < ctx->varying_mem.bo->size);
struct panfrost_transfer transfer =
panfrost_allocate_transient(ctx, slot->size);
return varying_address;
slot->elements = transfer.gpu | MALI_ATTR_LINEAR;
return transfer.gpu;
}
static void
@@ -2531,7 +2527,6 @@ panfrost_destroy(struct pipe_context *pipe)
util_blitter_destroy(panfrost->blitter_wallpaper);
panfrost_drm_free_slab(screen, &panfrost->scratchpad);
panfrost_drm_free_slab(screen, &panfrost->varying_mem);
panfrost_drm_free_slab(screen, &panfrost->shaders);
panfrost_drm_free_slab(screen, &panfrost->tiler_heap);
panfrost_drm_free_slab(screen, &panfrost->tiler_polygon_list);
@@ -2678,7 +2673,6 @@ panfrost_setup_hardware(struct panfrost_context *ctx)
struct panfrost_screen *screen = pan_screen(gallium->screen);
panfrost_drm_allocate_slab(screen, &ctx->scratchpad, 64, false, 0, 0, 0);
panfrost_drm_allocate_slab(screen, &ctx->varying_mem, 16384, false, PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_COHERENT_LOCAL, 0, 0);
panfrost_drm_allocate_slab(screen, &ctx->shaders, 4096, true, PAN_ALLOCATE_EXECUTE, 0, 0);
panfrost_drm_allocate_slab(screen, &ctx->tiler_heap, 32768, false, PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_GROWABLE, 1, 128);
panfrost_drm_allocate_slab(screen, &ctx->tiler_polygon_list, 128*128, false, PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_GROWABLE, 1, 128);
@@ -107,7 +107,6 @@ struct panfrost_context {
struct panfrost_memory shaders;
struct panfrost_memory scratchpad;
struct panfrost_memory tiler_heap;
struct panfrost_memory varying_mem;
struct panfrost_memory tiler_polygon_list;
struct panfrost_memory tiler_dummy;
struct panfrost_memory depth_stencil_buffer;
@@ -136,8 +135,6 @@ struct panfrost_context {
union mali_attr attributes[PIPE_MAX_ATTRIBS];
unsigned varying_height;
struct mali_single_framebuffer vt_framebuffer_sfbd;
struct bifrost_framebuffer vt_framebuffer_mfbd;
-1
View File
@@ -284,7 +284,6 @@ panfrost_drm_submit_vs_fs_job(struct panfrost_context *ctx, bool has_draws, bool
panfrost_job_add_bo(job, ctx->shaders.bo);
panfrost_job_add_bo(job, ctx->scratchpad.bo);
panfrost_job_add_bo(job, ctx->tiler_heap.bo);
panfrost_job_add_bo(job, ctx->varying_mem.bo);
panfrost_job_add_bo(job, ctx->tiler_polygon_list.bo);
if (job->first_job.gpu) {