diff options
author | Italo Nicola <italonicola@collabora.com> | 2023-06-22 11:55:01 +0000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-08-07 19:35:12 +0000 |
commit | c1ad78476d52085203d22596d1eb59521d43a5ce (patch) | |
tree | 6cc37ef7e3ce1c920ec56b26bc060bb07ae35ef3 | |
parent | 4685628411926486eb0ed0ff1a6b72f16d7965a2 (diff) |
panfrost: advertise support for YUYV and variants
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
-rw-r--r-- | src/panfrost/lib/pan_format.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/panfrost/lib/pan_format.c b/src/panfrost/lib/pan_format.c index 7c758c2ec5f..ee47c36a91f 100644 --- a/src/panfrost/lib/pan_format.c +++ b/src/panfrost/lib/pan_format.c @@ -170,10 +170,32 @@ const struct pan_blendable_format } #endif +#if PAN_ARCH == 7 +#define YUV_NO_SWAP (0) +#define YUV_SWAP (1) + +#define FMT_YUV(pipe, mali, swizzle, swap, siting, flags) \ + [PIPE_FORMAT_##pipe] = { \ + .hw = (MALI_YUV_SWIZZLE_##swizzle) | ((YUV_##swap) << 3) | \ + ((MALI_YUV_CR_SITING_##siting) << 9) | ((MALI_##mali) << 12), \ + .bind = FLAGS_##flags, \ + } +#endif + /* clang-format off */ const struct panfrost_format GENX(panfrost_pipe_format)[PIPE_FORMAT_COUNT] = { FMT(NONE, CONSTANT, 0000, L, VTR_), +#if PAN_ARCH == 7 + /* Multiplane formats */ + FMT_YUV(R8G8_R8B8_UNORM, YUYV8, UVYA, NO_SWAP, CO_SITED, _T__), + FMT_YUV(G8R8_B8R8_UNORM, VYUY8, UYVA, SWAP, CO_SITED, _T__), + FMT_YUV(R8B8_R8G8_UNORM, YUYV8, VYUA, NO_SWAP, CO_SITED, _T__), + FMT_YUV(B8R8_G8R8_UNORM, VYUY8, VUYA, SWAP, CO_SITED, _T__), + FMT_YUV(R8_G8B8_420_UNORM, Y8_UV8_420, YUVA, NO_SWAP, CO_SITED, _T__), + FMT_YUV(G8_B8R8_420_UNORM, Y8_UV8_420, YVUA, NO_SWAP, CO_SITED, _T__), +#endif + #if PAN_ARCH <= 7 FMT(ETC1_RGB8, ETC2_RGB8, RGB1, L, _T__), FMT(ETC2_RGB8, ETC2_RGB8, RGB1, L, _T__), |