From 17752bae8e24a568e05dd4367441cf0d81094cce Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 18 Jul 2019 12:28:56 -0700 Subject: [PATCH] panfrost/decode: Preserve empty tiler heap symmetry If tiler_heap_end == tiler_heap_start, ensure it's printed the same rather than one erroring out as hex. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/pandecode/decode.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index 4132dc530ee..36ea4ca8d97 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -464,7 +464,10 @@ pandecode_midgard_tiler_descriptor(const struct midgard_tiler_descriptor *t) MEMORY_PROP(t, heap_start); - { + if (t->heap_start == t->heap_end) { + /* Print identically to show symmetry for empty tiler heaps */ + MEMORY_PROP(t, heap_start); + } else { /* Points to the end of a buffer */ char *a = pointer_as_memory_reference(t->heap_end - 1); pandecode_prop("heap_end = %s + 1", a); @@ -1970,11 +1973,16 @@ pandecode_tiler_heap_meta(mali_ptr gpu_va, int job_no) /* this might point to the beginning of another buffer, when it's * really the end of the tiler heap buffer, so we have to be careful - * here. + * here. but for zero length, we need the same pointer. */ - char *a = pointer_as_memory_reference(h->tiler_heap_end - 1); - pandecode_prop("tiler_heap_end = %s + 1", a); - free(a); + + if (h->tiler_heap_end == h->tiler_heap_start) { + MEMORY_PROP(h, tiler_heap_start); + } else { + char *a = pointer_as_memory_reference(h->tiler_heap_end - 1); + pandecode_prop("tiler_heap_end = %s + 1", a); + free(a); + } pandecode_indent--; pandecode_log("};\n"); -- 2.30.2