diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-02-24 06:22:23 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-02-25 04:49:50 +0000 |
commit | f943047e48698c7d3a482835f335d0d69a02014c (patch) | |
tree | fb3de8d8ae932f1189737c1b86b1121bb4a8809b /src/gallium/drivers/panfrost/include/panfrost-job.h | |
parent | c6be9969d25e60544a42a4cfd6062dd2a7e1ac1d (diff) |
panfrost: Decode render target swizzle/channels
On MRT-capable systems, the framebuffer format is encoded as a 64-bit
word in the render target descriptor. Previously, the two 32-bit
words were exposed as opaque hex values. This commit identifies a 12-bit
Mali swizzle and a 2-bit channel counter, removing some of the magic. It
also adds decoding support for the AFBC and MSAA enable bits, which were
already known but otherwise ignored in pandecode.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/include/panfrost-job.h')
-rw-r--r-- | src/gallium/drivers/panfrost/include/panfrost-job.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h index 82b3cfb2a4f..7a2735ad363 100644 --- a/src/gallium/drivers/panfrost/include/panfrost-job.h +++ b/src/gallium/drivers/panfrost/include/panfrost-job.h @@ -1346,15 +1346,26 @@ struct mali_single_framebuffer { /* More below this, maybe */ } __attribute__((packed)); -/* Format bits for the render target */ +/* Format bits for the render target flags */ -#define MALI_MFBD_FORMAT_AFBC (1 << 10) -#define MALI_MFBD_FORMAT_MSAA (1 << 12) -#define MALI_MFBD_FORMAT_NO_ALPHA (1 << 25) +#define MALI_MFBD_FORMAT_AFBC (1 << 5) +#define MALI_MFBD_FORMAT_MSAA (1 << 7) + +struct mali_rt_format { + unsigned unk1 : 32; + unsigned unk2 : 3; + + unsigned nr_channels : 2; /* MALI_POSITIVE */ + + unsigned flags : 11; + + unsigned swizzle : 12; + + unsigned unk4 : 4; +} __attribute__((packed)); struct bifrost_render_target { - u32 unk1; // = 0x4000000 - u32 format; + struct mali_rt_format format; u64 zero1; |