From: Alyssa Rosenzweig Date: Thu, 18 Jul 2019 19:28:56 +0000 (-0700) Subject: panfrost/decode: Preserve empty tiler heap symmetry X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17752bae8e24a568e05dd4367441cf0d81094cce;p=mesa.git 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 --- 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");