From 6469c1a4457417b2926afd8ff8d970b832fe89dd Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 29 Oct 2019 15:42:03 +0100 Subject: [PATCH] panfrost: Generate polygon list manually for SFBD On clears without draws, the SFBD GPUs need for userspace to generate the trivial polygon list. Signed-off-by: Tomeu Vizoso Reviewed-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_context.c | 10 ++++++++++ src/gallium/drivers/panfrost/pan_job.c | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index b7b77715fc8..14996b61661 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -57,6 +57,7 @@ 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); struct midgard_tiler_descriptor t = {}; unsigned height = batch->key.height; unsigned width = batch->key.width; @@ -100,6 +101,15 @@ panfrost_emit_midg_tiler(struct panfrost_batch *batch, unsigned vertex_count) /* Disable the tiler */ t.hierarchy_mask |= MALI_TILER_DISABLED; + + if (screen->require_sfbd) { + t.hierarchy_mask = 0xFFF; /* TODO: What's this? */ + t.polygon_list_size = 0x200; + + /* 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); + polygon_list_body[0] = 0xa0000000; /* TODO: Just that? */ + } } t.polygon_list_body = diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 9cff5232519..8df3480697d 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -670,11 +670,18 @@ panfrost_batch_get_tiler_heap(struct panfrost_batch *batch) struct panfrost_bo * panfrost_batch_get_tiler_dummy(struct panfrost_batch *batch) { + struct panfrost_screen *screen = pan_screen(batch->ctx->base.screen); + + uint32_t create_flags = 0; + if (batch->tiler_dummy) return batch->tiler_dummy; + if (!screen->require_sfbd) + create_flags = PAN_BO_INVISIBLE; + batch->tiler_dummy = panfrost_batch_create_bo(batch, 4096, - PAN_BO_INVISIBLE, + create_flags, PAN_BO_ACCESS_PRIVATE | PAN_BO_ACCESS_RW | PAN_BO_ACCESS_VERTEX_TILER | -- 2.30.2