}
struct mali_single_framebuffer
-panfrost_emit_sfbd(struct panfrost_context *ctx)
+panfrost_emit_sfbd(struct panfrost_context *ctx, unsigned vertex_count)
{
struct mali_single_framebuffer framebuffer = {
.unknown2 = 0x1f,
}
struct bifrost_framebuffer
-panfrost_emit_mfbd(struct panfrost_context *ctx)
+panfrost_emit_mfbd(struct panfrost_context *ctx, unsigned vertex_count)
{
unsigned width = ctx->pipe_framebuffer.width;
unsigned height = ctx->pipe_framebuffer.height;
struct bifrost_framebuffer framebuffer = {
- /* The lower 0x1ff controls the hierarchy mask. Set more bits
- * on for more tile granularity (which can be a performance win
- * on some scenes, at memory bandwidth costs). For now, be lazy
- * and enable everything. This might be a terrible idea. */
-
- .tiler_hierarchy_mask = 0xff,
- .tiler_flags = 0x0,
-
- /* The hardware deals with suballocation; we don't care */
- .tiler_heap_start = ctx->tiler_heap.gpu,
- .tiler_heap_end = ctx->tiler_heap.gpu + ctx->tiler_heap.size,
-
- /* See pan_tiler.c */
- .tiler_polygon_list = ctx->tiler_polygon_list.gpu,
-
.width1 = MALI_POSITIVE(width),
.height1 = MALI_POSITIVE(height),
.width2 = MALI_POSITIVE(width),
.scratchpad = ctx->scratchpad.gpu,
};
+ framebuffer.tiler_hierarchy_mask =
+ panfrost_choose_hierarchy_mask(width, height, vertex_count);
+
/* Compute the polygon header size and use that to offset the body */
unsigned header_size = panfrost_tiler_header_size(
/* Sanity check */
unsigned total_size = header_size + body_size;
- assert(ctx->tiler_polygon_list.size >= total_size);
+
+ if (framebuffer.tiler_hierarchy_mask) {
+ assert(ctx->tiler_polygon_list.size >= total_size);
+
+ /* Specify allocated tiler structures */
+ framebuffer.tiler_polygon_list = ctx->tiler_polygon_list.gpu;
+
+ /* Allow the entire tiler heap */
+ framebuffer.tiler_heap_start = ctx->tiler_heap.gpu;
+ framebuffer.tiler_heap_end =
+ ctx->tiler_heap.gpu + ctx->tiler_heap.size;
+ } else {
+ /* The tiler is disabled, so don't allow the tiler heap */
+ framebuffer.tiler_heap_start = ctx->tiler_heap.gpu;
+ framebuffer.tiler_heap_end = framebuffer.tiler_heap_start;
+
+ /* Use a dummy polygon list */
+ framebuffer.tiler_polygon_list = ctx->tiler_dummy.gpu;
+
+ /* Also, set a "tiler disabled?" flag? */
+ framebuffer.tiler_hierarchy_mask |= 0x1000;
+ }
framebuffer.tiler_polygon_list_body =
framebuffer.tiler_polygon_list + header_size;
framebuffer.tiler_polygon_list_size =
header_size + body_size;
+
+
return framebuffer;
}
ctx->cmdstream_i = 0;
if (ctx->require_sfbd)
- ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx);
+ ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx, ~0);
else
- ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx);
+ ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx, ~0);
/* Reset varyings allocated */
ctx->varying_height = 0;
continue;
if (ctx->require_sfbd)
- ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx);
+ ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx, ~0);
else
- ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx);
+ ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx, ~0);
panfrost_attach_vt_framebuffer(ctx);
if (zb) {
if (ctx->require_sfbd)
- ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx);
+ ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx, ~0);
else
- ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx);
+ ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx, ~0);
panfrost_attach_vt_framebuffer(ctx);
screen->driver->allocate_slab(screen, &ctx->shaders, 4096, true, PAN_ALLOCATE_EXECUTE, 0, 0);
screen->driver->allocate_slab(screen, &ctx->tiler_heap, 32768, false, PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_GROWABLE, 1, 128);
screen->driver->allocate_slab(screen, &ctx->tiler_polygon_list, 128*128, false, PAN_ALLOCATE_INVISIBLE | PAN_ALLOCATE_GROWABLE, 1, 128);
+ screen->driver->allocate_slab(screen, &ctx->tiler_dummy, 1, false, PAN_ALLOCATE_INVISIBLE, 0, 0);
}
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;
struct panfrost_query *occlusion_query;
bool
panfrost_is_scanout(struct panfrost_context *ctx);
-mali_ptr panfrost_sfbd_fragment(struct panfrost_context *ctx);
-mali_ptr panfrost_mfbd_fragment(struct panfrost_context *ctx);
+mali_ptr panfrost_sfbd_fragment(struct panfrost_context *ctx, bool has_draws);
+mali_ptr panfrost_mfbd_fragment(struct panfrost_context *ctx, bool has_draws);
struct bifrost_framebuffer
-panfrost_emit_mfbd(struct panfrost_context *ctx);
+panfrost_emit_mfbd(struct panfrost_context *ctx, unsigned vertex_count);
struct mali_single_framebuffer
-panfrost_emit_sfbd(struct panfrost_context *ctx);
+panfrost_emit_sfbd(struct panfrost_context *ctx, unsigned vertex_count);
mali_ptr
-panfrost_fragment_job(struct panfrost_context *ctx);
+panfrost_fragment_job(struct panfrost_context *ctx, bool has_draws);
void
panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *meta, const char *src, int type, struct panfrost_shader_state *state);