diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-11-27 08:31:16 -0500 |
---|---|---|
committer | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2019-12-03 04:25:04 +0000 |
commit | 9fb0904712a5d64ecd012f65dfda4f36819716d9 (patch) | |
tree | abfd96c6e8f1ab5d60b6276e23647543755899f2 /src/gallium/drivers/panfrost/pan_context.c | |
parent | 63cd5b8198cab169f8ba9f6250281a5f705fa6bb (diff) |
panfrost: Implement pan_tiler for non-hierarchy GPUs
The algorithm is as described. Nothing fancy here, just need to add some
new code paths depending on which model we're running on.
Tomeu:
- Also disable tiling when !hierarchy and !vertex_count
- Avoid creating polygon lists smaller than the minimum when
vertex_count > 0 but tile size smaller than 16 byte
- Take into account tile size when calculating polygon list size for
!hierarchy
- Allow 0-sized tiles in a single dimension
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index af8f94354e9..7ae4b692189 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -59,24 +59,25 @@ static struct midgard_tiler_descriptor panfrost_emit_midg_tiler(struct panfrost_batch *batch, unsigned vertex_count) { struct panfrost_screen *screen = pan_screen(batch->ctx->base.screen); + bool hierarchy = !(screen->quirks & MIDGARD_NO_HIER_TILING); struct midgard_tiler_descriptor t = {0}; unsigned height = batch->key.height; unsigned width = batch->key.width; t.hierarchy_mask = - panfrost_choose_hierarchy_mask(width, height, vertex_count); + panfrost_choose_hierarchy_mask(width, height, vertex_count, hierarchy); /* Compute the polygon header size and use that to offset the body */ unsigned header_size = panfrost_tiler_header_size( - width, height, t.hierarchy_mask); + width, height, t.hierarchy_mask, hierarchy); t.polygon_list_size = panfrost_tiler_full_size( - width, height, t.hierarchy_mask); + width, height, t.hierarchy_mask, hierarchy); /* Sanity check */ - if (t.hierarchy_mask) { + if (vertex_count) { struct panfrost_bo *tiler_heap; tiler_heap = panfrost_batch_get_tiler_heap(batch); @@ -92,6 +93,7 @@ panfrost_emit_midg_tiler(struct panfrost_batch *batch, unsigned vertex_count) struct panfrost_bo *tiler_dummy; tiler_dummy = panfrost_batch_get_tiler_dummy(batch); + header_size = MALI_TILER_MINIMUM_HEADER_SIZE; /* The tiler is disabled, so don't allow the tiler heap */ t.heap_start = tiler_dummy->gpu; @@ -101,11 +103,11 @@ panfrost_emit_midg_tiler(struct panfrost_batch *batch, unsigned vertex_count) t.polygon_list = tiler_dummy->gpu; /* Disable the tiler */ - t.hierarchy_mask |= MALI_TILER_DISABLED; - - if (screen->quirks & MIDGARD_SFBD) { - t.hierarchy_mask = 0xFFF; /* TODO: What's this? */ - t.polygon_list_size = 0x200; + if (hierarchy) + t.hierarchy_mask |= MALI_TILER_DISABLED; + else { + t.hierarchy_mask = MALI_TILER_USER; + t.polygon_list_size = MALI_TILER_MINIMUM_HEADER_SIZE + 4; /* We don't have a SET_VALUE job, so write the polygon list manually */ uint32_t *polygon_list_body = (uint32_t *) (tiler_dummy->cpu + header_size); |