media: venus: vdec: fix error state assignment for zero bytesused
Subsystems (4)
PATCH v2 1/1 media: venus: vdec: fix error state assignment for zero bytesused
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.
This patch moves the zero-bytesused check inside the non-EOS branch so that only capture buffers with zero payload (and not EOS) are marked with VB2_BUF_STATE_ERROR.
---
This patch refines the error state assignment logic in the Venus vdec
driver for Qualcomm platforms. Specifically, it ensures that the buffer
state is only set to VB2_BUF_STATE_ERROR for non-EOS capture buffers
with zero bytesused, preventing false error reporting during drain
operations.
---
Changes in v2:
- 1. Update commit message.
- 2. Add a Fixes tag.
- Link to v1: https://lore.kernel.org/r/[email protected]
--- drivers/media/platform/qcom/venus/vdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/vdec.c +3 -3
@@ -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++; }
---
base-commit: 663d0d1af3faefe673cabf4b6b077149a87ad71f
change-id: 20251126-fix-error-state-24183a8538cd
Best regards,
Signature · 1 line
Renjiang Han <[email protected]>
Quoted 6 lines · Renjiang Han
When
hfi_session_flushis 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.This patch moves the zero-bytesused check inside the non-EOS branch
Documentation/process/submitting-patches.rst, "This patch".
Quoted 6 lines
so that only capture buffers with zero payload (and not EOS) are marked with
VB2_BUF_STATE_ERROR.Fixes 51df3c81ba10b ("media: venus: vdec: Mark flushed buffers with error state")Signed-off-by Renjiang Han <[email protected]>
No empty lines between tags.
Quoted 42 lines
---
This patch refines the error state assignment logic in the Venus vdec
driver for Qualcomm platforms. Specifically, it ensures that the buffer
state is only set toVB2_BUF_STATE_ERRORfor non-EOS capture buffers
with zero bytesused, preventing false error reporting during drain
operations.
---
Changes in v2:
- 1. Update commit message.
- 2. Add a Fixes tag.
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/media/platform/qcom/venus/vdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/qcom/venus/vdec.c +3
-4@@ -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++; } ---base-commit:
663d0d1af3faefe673cabf4b6b077149a87ad71f
change-id: 20251126-fix-error-state-24183a8538cdBest regards,
Signature · 1 line
Renjiang Han <[email protected]>
Signature · 2 lines
With best wishes Dmitry
Quoted 8 lines · Dmitry Baryshkov
Quoted 6 lines · Renjiang Han
When
hfi_session_flushis 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.This patch moves the zero-bytesused check inside the non-EOS branch
Documentation/process/submitting-patches.rst, "This patch".
OK, thanks for your reminder. I will update it.
Quoted 8 lines
Quoted 7 lines
so that only capture buffers with zero payload (and not EOS) are marked with
VB2_BUF_STATE_ERROR.Fixes 51df3c81ba10b ("media: venus: vdec: Mark flushed buffers with error state")Signed-off-by Renjiang Han <[email protected]>No empty lines between tags.
OK, thanks for your comment. I will update it.
Quoted 43 lines
Quoted 43 lines
---
This patch refines the error state assignment logic in the Venus vdec
driver for Qualcomm platforms. Specifically, it ensures that the buffer
state is only set toVB2_BUF_STATE_ERRORfor non-EOS capture buffers
with zero bytesused, preventing false error reporting during drain
operations.
---
Changes in v2:
- 1. Update commit message.
- 2. Add a Fixes tag.
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/media/platform/qcom/venus/vdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/qcom/venus/vdec.c +3
-4@@ -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++; } ---base-commit:
663d0d1af3faefe673cabf4b6b077149a87ad71f
change-id: 20251126-fix-error-state-24183a8538cdBest regards,
Signature · 1 line
Renjiang Han <[email protected]>
Signature · 2 lines
Best regards, Renjiang Han