summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-05-14 22:21:39 +0000
committerAlyssa Rosenzweig <[email protected]>2019-05-16 01:15:37 +0000
commitd699ffbf0e889980fcbfb8f39bc5ed9add90310a (patch)
treec98e5668ac803304c3d0dd5cf8f902628cc3f8ea /src
parentccfcb9d818b40564001b3cf2516367526de26c1d (diff)
panfrost/decode: Futureproof texture dumping
One field was not dumped for some reason. It's observed to be 0, but it's still good to have it available. Also, extra fields might be snuck in the bitmaps array (it's variable-lengthed at the end), and we want to guard against that possibility, so we dump a little more. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pandecode/decode.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pandecode/decode.c b/src/gallium/drivers/panfrost/pandecode/decode.c
index 9d9b9b31bcd..5a1fcf75ead 100644
--- a/src/gallium/drivers/panfrost/pandecode/decode.c
+++ b/src/gallium/drivers/panfrost/pandecode/decode.c
@@ -29,6 +29,7 @@
#include <stdbool.h>
#include <stdarg.h>
#include "mmap.h"
+#include "util/u_math.h"
#include "../pan_pretty_print.h"
#include "../midgard/disassemble.h"
@@ -1456,6 +1457,7 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
pandecode_prop("height = MALI_POSITIVE(%" PRId16 ")", t->height + 1);
pandecode_prop("depth = MALI_POSITIVE(%" PRId16 ")", t->depth + 1);
+ pandecode_prop("unknown1 = %" PRId16, t->unknown1);
pandecode_prop("unknown3 = %" PRId16, t->unknown3);
pandecode_prop("unknown3A = %" PRId8, t->unknown3A);
pandecode_prop("nr_mipmap_levels = %" PRId8, t->nr_mipmap_levels);
@@ -1492,6 +1494,12 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
pandecode_log(".swizzled_bitmaps = {\n");
pandecode_indent++;
+ /* A bunch of bitmap pointers follow.
+ * We work out the correct number,
+ * based on the mipmap/cubemap
+ * properties, but dump extra
+ * possibilities to futureproof */
+
int bitmap_count = MALI_NEGATIVE(t->nr_mipmap_levels);
if (!f.is_not_cubemap) {
@@ -1506,9 +1514,12 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
bitmap_count = max_count;
}
- for (int i = 0; i < bitmap_count; ++i) {
+ /* Dump more to be safe, but not _that_ much more */
+ int safe_count = MIN2(bitmap_count * 2, max_count);
+
+ for (int i = 0; i < safe_count; ++i) {
char *a = pointer_as_memory_reference(t->swizzled_bitmaps[i]);
- pandecode_log("%s, \n", a);
+ pandecode_log("%s%s, \n", (i >= bitmap_count) ? "// " : "", a);
free(a);
}