pan/bi: add support for I420 and YV12 sampling

These formats can be directly sampled, and they have a lower stride
alignment requirement.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24266>
This commit is contained in:
Italo Nicola 2023-07-20 17:20:58 +00:00 committed by Marge Bot
parent b890a5ff61
commit 4eb0a98e5a
2 changed files with 5 additions and 1 deletions

View file

@ -194,6 +194,8 @@ const struct panfrost_format GENX(panfrost_pipe_format)[PIPE_FORMAT_COUNT] = {
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__),
FMT_YUV(R8_G8_B8_420_UNORM, Y8_U8_V8_420, YUVA, NO_SWAP, CO_SITED, _T__),
FMT_YUV(R8_B8_G8_420_UNORM, Y8_U8_V8_420, YVUA, NO_SWAP, CO_SITED, _T__),
#endif
#if PAN_ARCH <= 7

View file

@ -195,9 +195,11 @@ format_minimum_alignment(const struct panfrost_device *dev,
return 63;
switch (format) {
/* For v7+, NV12 and NV21 have a looser alignment requirement of 16 bytes */
/* For v7+, NV12/NV21/I420 have a looser alignment requirement of 16 bytes */
case PIPE_FORMAT_R8_G8B8_420_UNORM:
case PIPE_FORMAT_G8_B8R8_420_UNORM:
case PIPE_FORMAT_R8_G8_B8_420_UNORM:
case PIPE_FORMAT_R8_B8_G8_420_UNORM:
return 16;
default:
return 64;