media: iris: fix the decoder source change, seek and START sequences
Get series with b4
b4 am 20261125-topic-iris-decoder-drc-fixes-v1-0-58b9f6b3fe86@linaro.org change-id 20261125-topic-iris-decoder-drc-fixes-e16b5460f474Versions newest first
- v1 Latest11 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | media: iris: vdec: accept V4L2_DEC_CMD_START on a running decoderdrivers/ | +5 | 0 replies | |
| 2/11 | media: iris: restart the buffer sequence numbers at each STREAMONdrivers/ | +2 | 0 replies | |
| 3/11 | media: iris: vdec: update the minimum CAPTURE buffer count on S_FMTdrivers/ drivers/ drivers/ +1 more | +19 | 0 replies | |
| 4/11 | media: iris: vdec: reconfigure the decoder on START after a source changedrivers/ drivers/ drivers/ | +67 | 0 replies | |
| 5/11 | media: iris: clear the stopped state when the decoder resumesdrivers/ drivers/ | +9 | 0 replies | |
| 6/11 | media: iris: don't return a spurious LAST bufferdrivers/ drivers/ | +9 | 0 replies | |
| 7/11 | media: iris: vdec: keep the visible rectangle on S_FMT(CAPTURE)drivers/ | +7 | 0 replies | |
| 8/11 | media: iris: gen2: don't align the decoder input resolutiondrivers/ | +2 | 0 replies | |
| 9/11 | media: iris: vdec: resume an unchanged VP9 settings change after a seekdrivers/ drivers/ drivers/ +2 more | +104 | 0 replies | |
| 10/11 | media: iris: vdec: complete an unchanged first settings change for FFmpegdrivers/ drivers/ drivers/ +2 more | +65 | 0 replies | |
| 11/11 | media: iris: record the LAST buffer returned with an errordrivers/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/11] media: iris: fix the decoder source change, seek and START sequences
The iris stateful decoder fails the v4l2-compliance streaming tests on streams with resolution changes, and FFmpeg stops after the first frame of some streams. This series fixes the decoder sequences of the specification a player uses: source change completed with STREAMOFF/STREAMON(CAPTURE) or V4L2_DEC_CMD_START, seek with STREAMOFF/STREAMON(OUTPUT), drain, and CAPTURE started before the first source change.
FFMpeg is largely not compliant with the V4L2 M2M spec for DRC and seek handling, freezing and stopping for such streams. While the kernel can't and won't fix an userspace program, we made sure the basic FFMpeg kept working when fixing DRC and Seeking. Proper fixes for multiple DRCs should be done in the FFMpeg code instead of the kernel.
Depends on:
- https://lore.kernel.org/all/[email protected]/
- https://lore.kernel.org/all/20261031-fix_v4l2_compliance_unlimited_opens-v1-1-f20cc9231ee3@oss.qualcomm.com/
- https://lore.kernel.org/all/[email protected]/
Log of v4l2-compliance run with an H.264 stream with the following DRC changes:
- 176x144
- 1600x900
- 1264x800
- 1592x1080
- 1024x768
- 532x312
v4l2-compliance 1.33.0-5524, 64 bits, 64-bit time_t v4l2-compliance SHA: d2e89246cefc 2026-10-30 13:45:36
Compliance test for iris_driver device /dev/video0:
Driver Info:
Driver name : iris_driver Card type : Iris Decoder Bus info : platform:aa00000.video-codec:de Driver version : 7.4.0 Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar Streaming
Extended Pix Format
Detected Stateful Decoder
Required ioctls:
test VIDIOC_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 12 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK
test Composing: OK
test Scaling: OK (Not Supported)
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test CREATE_BUFS maximum buffers: OK test VIDIOC_REMOVE_BUFS: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported) test blocking wait: OK
Test input 0:
Streaming ioctls:
test read/write: OK (Not Supported)
Video Capture Multiplanar: Captured 556 buffers
test MMAP (select, REQBUFS): OK
Video Capture Multiplanar: Captured 556 buffers
test MMAP (epoll, REQBUFS): OK
Video Capture Multiplanar: Captured 556 buffers
test MMAP (select, CREATE_BUFS): OK
Video Capture Multiplanar: Captured 556 buffers
test MMAP (epoll, CREATE_BUFS): OK
test USERPTR (select): OK (Not Supported)
warn: v4l2-test-buffers.cpp(2223): Cannot test DMABUF, specify --expbuf-device
test DMABUF (select): OK (Not Supported)
Total for iris_driver device /dev/video0: 55, Succeeded: 55, Failed: 0, Warnings: 1
Similar check was done with HEVC, VP9 and AV1 with modified compliance tool to allow setting the default decoder format.
Assisted by an LLM for generating test suite, test streams and issues pointing in the mainline iris driver against the dowstream driver and behaviour of the firmware on a SM8650 HDK device.
---
Neil Armstrong (11):
media: iris: vdec: accept V4L2_DEC_CMD_START on a running decoder
media: iris: restart the buffer sequence numbers at each STREAMON
media: iris: vdec: update the minimum CAPTURE buffer count on S_FMT
media: iris: vdec: reconfigure the decoder on START after a source change
media: iris: clear the stopped state when the decoder resumes
media: iris: don't return a spurious LAST buffer
media: iris: vdec: keep the visible rectangle on S_FMT(CAPTURE)
media: iris: gen2: don't align the decoder input resolution
media: iris: vdec: resume an unchanged VP9 settings change after a seek
media: iris: vdec: complete an unchanged first settings change for FFmpeg
media: iris: record the LAST buffer returned with an error
drivers/media/platform/qcom/iris/iris_buffer.c | 41 ++++++ drivers/media/platform/qcom/iris/iris_buffer.h | 1 + drivers/media/platform/qcom/iris/iris_common.c | 5 +- .../platform/qcom/iris/iris_hfi_gen1_response.c | 9 +- .../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +- .../platform/qcom/iris/iris_hfi_gen2_response.c | 53 +++++-- drivers/media/platform/qcom/iris/iris_instance.h | 10 ++ drivers/media/platform/qcom/iris/iris_vb2.c | 24 ++- drivers/media/platform/qcom/iris/iris_vdec.c | 161 ++++++++++++++++++++- drivers/media/platform/qcom/iris/iris_vdec.h | 9 ++ drivers/media/platform/qcom/iris/iris_vidc.c | 5 + 11 files changed, 294 insertions(+), 27 deletions(-)
---
base-commit: a78785697f5d3851eecc3f6bdcc05f357fd89695
change-id: 20261125-topic-iris-decoder-drc-fixes-e16b5460f474
Best regards,
Signature · 1 line
Neil Armstrong <[email protected]>