panfrost: Clean up a bit the tiler structs for Bifrost

And set a fixed hierarchy mask for now that seems to generally work.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>
This commit is contained in:
Tomeu Vizoso 2020-04-09 09:39:17 +02:00
parent 0d6019302e
commit 0a0b670d63
3 changed files with 32 additions and 14 deletions

View file

@ -699,7 +699,6 @@ panfrost_batch_get_tiler_heap(struct panfrost_batch *batch)
return batch->tiler_heap;
}
/* TODO: Figure out how to remove the hardcoded values */
mali_ptr
panfrost_batch_get_tiler_meta(struct panfrost_batch *batch, unsigned vertex_count)
{
@ -717,13 +716,12 @@ panfrost_batch_get_tiler_meta(struct panfrost_batch *batch, unsigned vertex_coun
.tiler_heap_start = tiler_heap->gpu,
.tiler_heap_free = tiler_heap->gpu,
.tiler_heap_end = tiler_heap->gpu + tiler_heap->size,
.unk1 = 0x1,
.unk7e007e = 0x7e007e,
};
tiler_heap_meta.zeros[10] = 0x1;
tiler_heap_meta.zeros[11] = 0x7e007e;
struct bifrost_tiler_meta tiler_meta = {
.hierarchy_mask = 0xf0,
.hierarchy_mask = 0x28,
.flags = 0x0,
.width = MALI_POSITIVE(batch->key.width),
.height = MALI_POSITIVE(batch->key.height),

View file

@ -1028,12 +1028,14 @@ struct bifrost_tiler_heap_meta {
mali_ptr tiler_heap_end;
/* hierarchy weights? but they're still 0 after the job has run... */
u32 zeros[12];
u32 zeros[10];
u32 unk1;
u32 unk7e007e;
} __attribute__((packed));
struct bifrost_tiler_meta {
u64 zero0;
u16 hierarchy_mask;
u16 hierarchy_mask; /* Five values observed: 0xa, 0x14, 0x28, 0x50, 0xa0 */
u16 flags;
u16 width;
u16 height;

View file

@ -2596,13 +2596,6 @@ pandecode_tiler_heap_meta(mali_ptr gpu_va, int job_no)
pandecode_prop("zero = 0x%x", h->zero);
}
for (int i = 0; i < 12; i++) {
if (h->zeros[i] != 0) {
pandecode_msg("XXX: tiler heap zero %d tripped, value %x\n",
i, h->zeros[i]);
}
}
pandecode_prop("heap_size = 0x%x", h->heap_size);
MEMORY_PROP(h, tiler_heap_start);
MEMORY_PROP(h, tiler_heap_free);
@ -2620,6 +2613,23 @@ pandecode_tiler_heap_meta(mali_ptr gpu_va, int job_no)
free(a);
}
for (int i = 0; i < 10; i++) {
if (h->zeros[i] != 0) {
pandecode_msg("XXX: tiler heap zero %d tripped, value %x\n",
i, h->zeros[i]);
}
}
if (h->unk1 != 0x1) {
pandecode_msg("XXX: tiler heap unk1 tripped\n");
pandecode_prop("unk1 = 0x%x", h->unk1);
}
if (h->unk7e007e != 0x7e007e) {
pandecode_msg("XXX: tiler heap unk7e007e tripped\n");
pandecode_prop("unk7e007e = 0x%x", h->unk7e007e);
}
pandecode_indent--;
pandecode_log("};\n");
}
@ -2641,7 +2651,15 @@ pandecode_tiler_meta(mali_ptr gpu_va, int job_no)
pandecode_prop("zero1 = 0x%" PRIx64, t->zero1);
}
if (t->hierarchy_mask != 0xa &&
t->hierarchy_mask != 0x14 &&
t->hierarchy_mask != 0x28 &&
t->hierarchy_mask != 0x50 &&
t->hierarchy_mask != 0xa0)
pandecode_prop("XXX: Unexpected hierarchy_mask (not 0xa, 0x14, 0x28, 0x50 or 0xa0)!");
pandecode_prop("hierarchy_mask = 0x%" PRIx16, t->hierarchy_mask);
pandecode_prop("flags = 0x%" PRIx16, t->flags);
pandecode_prop("width = MALI_POSITIVE(%d)", t->width + 1);