[PATCH 0/2] media: venus: vdec: fix drain and restart on SDM845

From: David Heidelberg via B4 Relay

Date: Mon Sep 28 2026 - 17:40:29 EST


Please consider this more as a bug-report than the proper fix.

On SDM845 (Venus v4) every V4L2_DEC_CMD_STOP kills the decoder
session: the firmware rejects the dummy 0xdeadb000 address of
the EOS buffer with HFI_ERR_SESSION_FATAL, both queues go into error
and userspace sees poll() fail at the end of every stream.

Patch 1 hands the firmware a real, mapped buffer for EOS, after which
the drain completes as designed: every frame is returned and the last
capture buffer is flagged.

Patch 2 fixes restarting after a seek when CAPTURE is streamed on before
OUTPUT, which left the decoder without any capture or DPB buffers.

Tested on Pixel 3 (blueline) with H.264: output is bit-exact against
ffmpeg's software decoder including the final frames, and drain,
DEC_CMD_START, seek with either queue order, and mid-stream seek all
return every frame followed by a LAST buffer.

Signed-off-by: David Heidelberg <david@xxxxxxx>
---
David Heidelberg (2):
media: venus: vdec: signal EOS with a real buffer
media: venus: vdec: Start capture after a seek that streams CAPTURE first

drivers/media/platform/qcom/venus/core.h | 4 +++
drivers/media/platform/qcom/venus/vdec.c | 51 +++++++++++++++++++++++++++++---
2 files changed, 51 insertions(+), 4 deletions(-)
---
base-commit: 7079a12d7506b07fb53b54a664bfad5fa9b16d70
change-id: 20260928-venus-vdec-eos-9a451a4c0561

Best regards,
--
David Heidelberg <david@xxxxxxx>