media: venus: vdec: fix error state assignment for zero bytesused
Subsystems (4)
PATCH v3 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.
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.
---
The error state assignment in the Venus vdec driver for Qualcomm
platforms is updated to ensure that VB2_BUF_STATE_ERROR is applied
only to non-EOS capture buffers with zero bytesused. Ensures false
error reports do not occur during drain operations.
---
Changes in v3:
- 1, Update commit message.
- 2, Move empty line between tags.
- 3, Update cover letter message.
- Link to v2: https://lore.kernel.org/r/[email protected]
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]>
Bryan O'Donoghue
maintainerQuoted 54 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.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]>---
The error state assignment in the Venus vdec driver for Qualcomm
platforms is updated to ensure thatVB2_BUF_STATE_ERRORis applied
only to non-EOS capture buffers with zero bytesused. Ensures false
error reports do not occur during drain operations.
---
Changes in v3:
- 1, Update commit message.
- 2, Move empty line between tags.
- 3, Update cover letter message.
- Link to v2: https://lore.kernel.org/r/[email protected]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-24183a8538cd
Quoted 4 lines
Best regards,
--
Renjiang Han <[email protected]>
Dikshita, Vikash.
This change makes sense to me. If you are NAKing please do so now.
---
bod
Vikash Garodia
maintainerHi Bryan,
Quoted 58 lines · Bryan O'Donoghue
Quoted 57 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.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]>---
The error state assignment in the Venus vdec driver for Qualcomm platforms is updated to ensure thatVB2_BUF_STATE_ERRORis applied only to non-EOS capture buffers with zero bytesused. Ensures false error reports do not occur during drain operations.
---
Changes in v3:
- 1, Update commit message.
- 2, Move empty line between tags.
- 3, Update cover letter message.
- Link to v2: https://lore.kernel.org/r/20251208-fix-error-state-
[email protected]Changes in v2:
- 1. Update commit message.
- 2. Add a Fixes tag.
- Link to v1: https://lore.kernel.org/r/20251126-fix-error-state-
[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
Quoted 9 lines
Quoted 4 lines
Best regards,
Signature · 1 line
Renjiang Han <[email protected]>Dikshita, Vikash.
This change makes sense to me. If you are NAKing please do so now.
This is good to go.
Regards,
Vikash
Quoted 41 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.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]>---
The error state assignment in the Venus vdec driver for Qualcomm
platforms is updated to ensure thatVB2_BUF_STATE_ERRORis applied
only to non-EOS capture buffers with zero bytesused. Ensures false
error reports do not occur during drain operations.
---
Changes in v3:
- 1, Update commit message.
- 2, Move empty line between tags.
- 3, Update cover letter message.
- Link to v2: https://lore.kernel.org/r/[email protected]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 +2
-0@@ -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)
drivers/media/platform/qcom/venus/vdec.c static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +1
-4+ state =VB2_BUF_STATE_ERROR ; } - -if (!bytesused) - state =VB2_BUF_STATE_ERROR ; }else { vbuf->sequence = inst->sequence_out++; } ---