summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-10-25 13:27:09 +0800
committerChia-I Wu <[email protected]>2014-10-25 14:28:08 +0800
commit762c68b8796bea8a277c883b94f7184a8307f274 (patch)
treef7c7223fac41c7a88eb8faf22509ef2f5e2563cc /src/gallium
parent08599f668c5d991ab19376a19cb2e14e5245db95 (diff)
ilo: improve blob decoding
The last few dwords were skipped if the total number of dwords was not a multiple of 4. Change the formatting for better readability. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/ilo/ilo_builder_decode.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/gallium/drivers/ilo/ilo_builder_decode.c b/src/gallium/drivers/ilo/ilo_builder_decode.c
index 922acc00cc1..3a9ae248d1d 100644
--- a/src/gallium/drivers/ilo/ilo_builder_decode.c
+++ b/src/gallium/drivers/ilo/ilo_builder_decode.c
@@ -79,21 +79,44 @@ writer_decode_blob(const struct ilo_builder *builder,
enum ilo_builder_writer_type which,
const struct ilo_builder_item *item)
{
- const unsigned state_size = sizeof(uint32_t) * 4;
+ const unsigned state_size = sizeof(uint32_t);
const unsigned count = item->size / state_size;
unsigned offset = item->offset;
unsigned i;
- for (i = 0; i < count; i++) {
+ for (i = 0; i < count; i += 4) {
const uint32_t *dw = writer_pointer(builder, which, offset);
- writer_dw(builder, which, offset, 0, "BLOB%d", i);
- /* output a single line for all four DWords */
- ilo_printf("(% f, % f, % f, % f) (0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
- uif(dw[0]), uif(dw[1]), uif(dw[2]), uif(dw[3]),
- dw[0], dw[1], dw[2], dw[3]);
+ writer_dw(builder, which, offset, 0, "BLOB%d", i / 4);
+
+ switch (count - i) {
+ case 1:
+ ilo_printf("(%10.4f, %10c, %10c, %10c) "
+ "(0x%08x, %10c, %10c, %10c)\n",
+ uif(dw[0]), 'X', 'X', 'X',
+ dw[0], 'X', 'X', 'X');
+ break;
+ case 2:
+ ilo_printf("(%10.4f, %10.4f, %10c, %10c) "
+ "(0x%08x, 0x%08x, %10c, %10c)\n",
+ uif(dw[0]), uif(dw[1]), 'X', 'X',
+ dw[0], dw[1], 'X', 'X');
+ break;
+ case 3:
+ ilo_printf("(%10.4f, %10.4f, %10.4f, %10c) "
+ "(0x%08x, 0x%08x, 0x%08x, %10c)\n",
+ uif(dw[0]), uif(dw[1]), uif(dw[2]), 'X',
+ dw[0], dw[1], dw[2], 'X');
+ break;
+ default:
+ ilo_printf("(%10.4f, %10.4f, %10.4f, %10.4f) "
+ "(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
+ uif(dw[0]), uif(dw[1]), uif(dw[2]), uif(dw[3]),
+ dw[0], dw[1], dw[2], dw[3]);
+ break;
+ }
- offset += state_size;
+ offset += state_size * 4;
}
}