From 1b241c59e834ba4702a79530c3ea373101d55788 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Jan 2015 10:53:20 +1300 Subject: [PATCH] vc4: Add dumping for the TILE_RENDERING_MODE_CONFIG packet. I wanted to read it, so I wrote parsing. --- src/gallium/drivers/vc4/vc4_cl_dump.c | 71 ++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/vc4/vc4_cl_dump.c b/src/gallium/drivers/vc4/vc4_cl_dump.c index 6c380219ce1..c9044b4ab81 100644 --- a/src/gallium/drivers/vc4/vc4_cl_dump.c +++ b/src/gallium/drivers/vc4/vc4_cl_dump.c @@ -95,6 +95,75 @@ dump_VC4_PACKET_CLIPPER_Z_SCALING(void *cl, uint32_t offset, uint32_t hw_offset) scale[0], scale[1]); } +static void +dump_VC4_PACKET_TILE_RENDERING_MODE_CONFIG(void *cl, uint32_t offset, uint32_t hw_offset) +{ + uint32_t *render_offset = cl + offset; + uint16_t *shorts = cl + offset + 4; + uint8_t *bytes = cl + offset + 8; + + fprintf(stderr, "0x%08x 0x%08x: color offset 0x%08x\n", + offset, hw_offset, + *render_offset); + + fprintf(stderr, "0x%08x 0x%08x: width %d\n", + offset + 4, hw_offset + 4, + shorts[0]); + + fprintf(stderr, "0x%08x 0x%08x: height %d\n", + offset + 6, hw_offset + 6, + shorts[1]); + + const char *format = "???"; + switch ((bytes[0] >> 2) & 3) { + case 0: + format = "BGR565_DITHERED"; + break; + case 1: + format = "RGBA8888"; + break; + case 2: + format = "BGR565"; + break; + } + if (shorts[2] & VC4_RENDER_CONFIG_TILE_BUFFER_64BIT) + format = "64bit"; + + const char *tiling = "???"; + switch ((bytes[0] >> 6) & 3) { + case 0: + tiling = "linear"; + break; + case 1: + tiling = "T"; + break; + case 2: + tiling = "LT"; + break; + } + + fprintf(stderr, "0x%08x 0x%08x: 0x%02x %s %s %s\n", + offset + 8, hw_offset + 8, + bytes[0], + format, tiling, + (bytes[0] & VC4_RENDER_CONFIG_MS_MODE_4X) ? "ms" : "ss"); + + const char *earlyz = ""; + if (bytes[1] & (1 << 3)) { + earlyz = "early_z disabled"; + } else { + if (bytes[1] & (1 << 2)) + earlyz = "early_z >"; + else + earlyz = "early_z <"; + } + + fprintf(stderr, "0x%08x 0x%08x: 0x%02x %s\n", + offset + 9, hw_offset + 9, + bytes[1], + earlyz); +} + static void dump_VC4_PACKET_TILE_COORDINATES(void *cl, uint32_t offset, uint32_t hw_offset) { @@ -165,7 +234,7 @@ static const struct packet_info { PACKET_DUMP(VC4_PACKET_CLIPPER_Z_SCALING, 9), PACKET(VC4_PACKET_TILE_BINNING_MODE_CONFIG, 16), - PACKET(VC4_PACKET_TILE_RENDERING_MODE_CONFIG, 11), + PACKET_DUMP(VC4_PACKET_TILE_RENDERING_MODE_CONFIG, 11), PACKET(VC4_PACKET_CLEAR_COLORS, 14), PACKET_DUMP(VC4_PACKET_TILE_COORDINATES, 3),