Re: [PATCH] media: venus: vdec: Clear streamon flags on streaming errors
From: bod
Date: Sat Nov 07 2026 - 10:56:27 EST
On 2026-09-30 12:24 +0800, fengchenguang@xxxxxxxxxx wrote:
> From: Chenguang Feng <fengchenguang@xxxxxxxxxx>
>
> The decoder only clears inst->streamon_out and inst->streamon_cap on
> the success path. When vdec_start_output() runs with the decoder in
> the INIT or CAPTURE_SETUP state, it still sets streamon_out at its
> done: label even if venus_helper_process_initial_out_bufs() failed,
> and the error path of vdec_start_streaming() does not reset the
> flags. vdec_stop_streaming() skips the clearing as well whenever
> the hfi flush fails.
>
> In both cases the driver and vb2 disagree about the streaming state:
> vdec_decoder_cmd() and delayed_process_buf_func() keep going as if
> the queue were still streaming, and a later capture streamon assumes
> the output queue is streaming too.
>
> The encoder clears both flags unconditionally in the same
> situations, so make the decoder do the same and print an error when
> the flush fails.
>
> Fixes: beac82904a87 ("media: venus: make decoder compliant with stateful codec API")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Chenguang Feng <fengchenguang@xxxxxxxxxx>
Reviewed-by: Bryan O'Donoghue <bod@xxxxxxxxxx>