On Thu Dec 11 15:20:39 2025 +0530, Renjiang Han wrote:
> When hfi_session_flush is issued, all queued buffers are returned to
> the V4L2 driver. Some of these buffers are not processed and have
> bytesused = 0. Currently, the driver marks such buffers as error even
> during drain operations, which can incorrectly flag EOS buffers.
> 
> Only capture buffers with zero payload (and not EOS) should be marked
> with VB2_BUF_STATE_ERROR. The check is performed inside the non-EOS
> branch to ensure correct handling.
> 
> Fixes: 51df3c81ba10b ("media: venus: vdec: Mark flushed buffers with error 
> state")
> Signed-off-by: Renjiang Han <[email protected]>
> Reviewed-by: Vikash Garodia <[email protected]>
> Cc: [email protected]
> Signed-off-by: Bryan O'Donoghue <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/qcom/venus/vdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

---

diff --git a/drivers/media/platform/qcom/venus/vdec.c 
b/drivers/media/platform/qcom/venus/vdec.c
index 4a6641fdffcf..d0bd2d86a31f 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1440,10 +1440,10 @@ static void vdec_buf_done(struct venus_inst *inst, 
unsigned int buf_type,
                                inst->drain_active = false;
                                inst->codec_state = VENUS_DEC_STATE_STOPPED;
                        }
+               } else {
+                       if (!bytesused)
+                               state = VB2_BUF_STATE_ERROR;
                }
-
-               if (!bytesused)
-                       state = VB2_BUF_STATE_ERROR;
        } else {
                vbuf->sequence = inst->sequence_out++;
        }
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to