Additional YUV420 10bit fmts#6959
Merged
pelwell merged 2 commits intoraspberrypi:rpi-6.12.yfrom Jul 16, 2025
Merged
Conversation
This adds FOURCCs for 3-plane 10/12/16bit YCbCr formats used by software decoders like ffmpeg, dav1d and libvpx. The intended use-case is buffer sharing between decoders and GPUs by allocating buffers with e.g. udmabuf or dma-heaps, avoiding unnecessary copies and format conversions in various scenarios. Unlike formats typically used by hardware decoders the 10/12bit formats use a LSB alignment. In order to allow fast implementations in GL and Vulkan the padding must contain only zeros, so the float representation can be calculated by multiplying with 2^6=64 or 2^4=16 respectively. MRs or branches for Mesa, Vulkan, Gstreamer, Weston and Mutter can be found at: - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34303 - https://github.com/rmader/Vulkan-Docs/commits/ycbcr-16bit-lsb-formats/ - https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8540 - https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1753 - https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4348 The naming scheme follows the 'P' and 'Q' formats. The 'S' stands for 'software' and was selected in order to make remembering easy. The 'Sx16' formats could as well be 'Qx16'. We stick with 'S' as 16bit software decoders are likely much more common than hardware ones for the foreseeable future. Note that these formats already have Vulkan equivalents: - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM Signed-off-by: Robert Mader <robert.mader@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Link: https://lore.kernel.org/r/20250509133535.60330-1-robert.mader@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
There are now formats defined for 2-plane YUV420 at 10, 12, and 16 bit depth using the most significant bits of the 16bit word (P010, P012, and P016), and 3-plane YUV420 at those depths using the least significant bits of the 16 bit word (S010, S012, and S016). VC4_GEN_6 can support all those formats although only composing using at most 10bits of resolution, so add them as supported formats for all planes. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Contributor
Author
|
Actually we can add DRM_FORMAT_Q01[026] as well. |
Contributor
Author
No I won't as they don't exist! Only Q410 and Q401 which are YUV444 formats. |
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Jul 17, 2025
kernel: ARM: dts: watchdog param creates early-watchdog See: raspberrypi/linux#6961 kernel: Additional YUV420 10bit fmts See: raspberrypi/linux#6959 kernel: Update panel-waveshare-dsi-v2 driver See: raspberrypi/linux#6957
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Jul 17, 2025
kernel: ARM: dts: watchdog param creates early-watchdog See: raspberrypi/linux#6961 kernel: Additional YUV420 10bit fmts See: raspberrypi/linux#6959 kernel: Update panel-waveshare-dsi-v2 driver See: raspberrypi/linux#6957
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of Robert Mader's patch that is on drm-misc-next adding the format definitions, and then add that support to vc4.
@cillian64
libdrm updates at https://gitlab.freedesktop.org/6by9/libdrm/-/tree/add_formats?ref_type=heads (I'll create a PR for that once I've added support for the other test patterns).