Re: [PATCH RFC 0/7] media: qcom: iris: add support for decoding 10bit formats

From: Neil Armstrong

Date: Thu Apr 09 2026 - 03:43:16 EST


On 4/9/26 03:40, Dmitry Baryshkov wrote:
On Wed, Apr 08, 2026 at 09:04:02PM -0400, Nicolas Dufresne wrote:
Hi,

Le jeudi 09 avril 2026 à 03:02 +0300, Dmitry Baryshkov a écrit :
On Wed, Apr 08, 2026 at 06:43:53PM +0200, Neil Armstrong wrote:
This adds the plumbing to support decoding HEVC and AV1
streams into 10bit pixel formats, linear and compressed.

This has only been tested on SM8650 with HEVC, and was inspired by
Venus and the downstream vidc driver for the buffer
calculations and HFI messages.

I was unable to get 10bit decoding working with Gstreamer
and ffmpeg, but v4l2-ctl works with:

Any particular errors? I assume Gstreamer needs to be taught about
Q10C. But P010 should (hopefully) work.

P010 should work for both Gst and FFMPEG, its probably a user error, or there is
a hidden bug in the driver that make it fail, v4l2-ctl is very permissive as it
simply dump to disk. You should provide an updated fluster score, so you have to
use one of these.

For Q10C on GStreamer, it needs mapping [0] and you need some bugfix [1] and
another that I will be sending tomorrow. We had never tested video compression
with this module before.

[0] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195
[1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/11222

The last issue has to do with:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/38965e2d9c1119674a65dc437ee7e8ec95339f31/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c#L4378

V4L2 format gives us the number of allocation, but not really the number of
planes, and we forgot to initialize that number for the "opaque" format case. A
tempory fix might be to add this after S_FMT:

if (GST_VIDEO_INFO_FORMAT (&info.vinfo) == GST_VIDEO_FORMAT_DMA_DRM)
n_v4l_planes = format.fmt.pix_mp.num_planes;

Works for AFBC and QC at leat, since both are unambiguously single plane, and so
cannot have mplane variants.

Reading this made me realize another suggestion for Neil:

Please check that the data returned by Iris matches the display driver
expectations. See the comments in the _dpu_format_populate_addrs_ubwc().

I just checked and they match as I already checked against the venus driver already,
which shares the same calculation scheme.

I had to add the HFI_PROP_UBWC_STRIDE_SCANLINE command otherwise the firmware
would give other alignments and wouldn't display properly with some streams.

Neil



Let me know how far you get! Please be aware that Robert and I are making these
patches based on feedback, we don't have access to any boards capable of
decoding to QC compressed formats.


v4l2-ctl --verbose --set-fmt-video-out=pixelformat=HEVC --set-fmt-video=pixelformat=P010 --stream-mmap --stream-out-mmap --stream-from-hdr Big_Buck_Bunny_1080_10s_30MB_main10.h265.hdr --stream-to out.P010
v4l2-ctl --verbose --set-fmt-video-out=pixelformat=HEVC --set-fmt-video=pixelformat=Q10C --stream-mmap --stream-out-mmap --stream-from-hdr Big_Buck_Bunny_1080_10s_30MB_main10.h265.hdr --stream-to out.QC10

The non-10bit decoding still works as before.

With Big_Buck_Bunny_1080_10s_30MB reencoded in 10-bit profile
and tranformed in v4l2 header format with [1]:
ffmpeg -i Big_Buck_Bunny_1080_10s_30MB.h264 -pix_fmt yuv420p10le -c:v libx265 -crf 28 -x265-params profile=main10 Big_Buck_Bunny_1080_10s_30MB_main10.h265
/path/to/mkhdr.sh Big_Buck_Bunny_1080_10s_30MB_main10.h265 raw Big_Buck_Bunny_1080_10s_30MB_main10.h265.hdr

The frames correctness has been verified buy displaying them
via Vulkan DMA_BUF import, including QC10C and QC08C.

In GStreamer, once the video4linux plugin issues are fixed, you should be able
to display the frames using glimagesink. GL only allow for RGB render, which
damages the data, so its not good enough for conformance testing with
compression enabled, but usually just doing visual inspection is acceptable.

Nice! Looking forward to testing Q08C aka NV12-UBWC on the display.
Maybe I should try rebuilding the plugins with the mentioned patches and
provide my r-b or report issues there.