We're hiring!
*

Improvements to Mesa video decoding for Panfrost

Eric Smith avatar

Eric Smith
August 13, 2025

Share this post:

Reading time:

The recent Mesa 25.2 release has many interesting new features. One notable feature added to the Panfrost driver for ARM Mali GPUs is support for AFBC compressed YUV textures.

What does this mean? AFBC stands for "Arm Frame Buffer Compression", a lossless image compression scheme invented by Arm to reduce memory bandwidth and power consumption on embedded systems. Reducing bandwidth and power consumption is particularly important in scenarios like video playback, where huge amounts of data must be transferred between memory and the CPU, GPU, and video decoder.

YUV is the color space typically used for video content. It encodes color data in terms of luminance (which the eye is particularly sensitive to) and chroma. By storing fewer bits for chroma video encoders can save space without sacrificing much quality.

The combination of AFBC and YUV potentially opens large savings in the amount of data the chip processes when decoding a video and using the resulting image as a 3D texture. But until recently the Mesa 3D graphics drivers did not support using them together, or allowed it only for restricted combinations. This meant that in order to use decoded video as a texture, applications would either have to convert the images from YUV to RGB (which takes time and memory bandwidth) or leave the images in linear form (thereby greatly reducing the memory efficiency of the texture accesses).

All of this changes in the Panfrost Mesa driver in 25.2.0. Now OpenGL applications may use various YUV formats together with AFBC. In particular, the very useful YU08 fourcc format, which requires AFBC and is generated by Rockchip video decoders, is now supported. This will allow applications such as video compositors or movie players to take full advantage of GPU acceleration. In the past to do efficient hardware decoding, they were limited to displaying the video directly in full-screen. Now they can use the video as a texture and scale, rotate, and apply other effects in real time without using too much memory bandwidth.

This change has actually been in the works for a long time. The first merge request for it was created in December of 2024. The initial impressions were positive, and we got some useful feedback from early adopters using Kodi and FFmpeg on Rockchip hardware. Unfortunately, this early code was quite ugly and required a lot of special cases which reviewers (rightly) objected to. Collabora's own Boris Brezillon undertook the tedious but necessary job of refactoring and rewriting the Panfrost image layout code to make it easier to integrate the "oddball" formats like YU08. The result is much cleaner code in general and a better base for future developments. The initial version of the code is for OpenGL, but the refactor will help us to bring AFBC support to Vulkan as well in the future.

This Mesa release provides support AFBC for both 8 and 10-bit YUV images subsampled at 4:2:0 (with chroma at 1/4 the resolution of the luma). We are continuing to work in this area, and in upcoming releases will support AFBC for YUV 4:2:2 images (chroma at half the resolution of luma), which is not as common as 4:2:0 but has applications in higher quality video output. We're also looking into supporting additional YUV formats, of which there are many.

 

Comments (1)

  1. boogiepop:
    Aug 13, 2025 at 09:54 PM

    Thanks for taking this up. RK3588 really has some amazing VPU and now with AFBC support it is pratically possible do full 8k decoding for hevc and h264 with 0 copy.

    It was in past possible achieve this with direct rendering to KMS but now with wayland it is also easily possible in a normal DE.

    Interested users might give it a look at https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Rendering, this is for BSP kernel, but with time i think V4L2 requests will also will catch up as well, since a lot of patches are incoming both for V4L2 kernel mainline and ffmpeg mainline for v4l2-requests support.

    Reply to this comment

    Reply to this comment


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


 

Search the newsroom

Latest News & Events

From Vienna, with Open Source: XDC 2025

24/09/2025

Next week, Collabora will be taking part in the 2025 edition X.Org Developer's Conference! Taking place in Vienna, our engineers will be…

Demystifying the special ingredient at Kernel Recipes 2025

19/09/2025

Join us next week in Paris for Kernel Recipes! We're delighted to sponsor this kernel-focused event and contribute with a talk on GPU drivers.

PanVK now uses AFBC by default

17/09/2025

AFBC support has been merged to PanVK and will be available in the Mesa 25.3 release! This new enablement reduces memory bandwidth and boosts…

Open Since 2005 logo

Our website only uses a strictly necessary session cookie provided by our CMS system. To find out more please follow this link.

Collabora Limited © 2005-2025. All rights reserved. Privacy Notice. Sitemap.