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 <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Tomeu Vizoso 2019-10-29 15:42:03 +01:00
parent 8e1ae5fa14
commit 6469c1a445
2 changed files with 18 additions and 1 deletions

View File

@ -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 =

View File

@ -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 |