Re: [PATCH 4/5] media: iris: Preserve timestamps on error buffers

From: Nicolas Dufresne

Date: Tue Nov 03 2026 - 17:14:50 EST


Le mardi 03 novembre 2026 à 22:57 +0100, Bryan O'Donoghue a écrit :
> On 29/10/2026 04:58, Xilin Wu wrote:
> > Clearing timestamps on error buffers prevents clients such as libva-v4l2
> > from identifying the failed picture and can cause synchronization timeouts.
> >
> > Preserve the firmware-provided timestamp when returning an error buffer.
> >
> > Fixes: b791dcfcba3a ("media: iris: Add handling for corrupt and drop frames")
> > Signed-off-by: Xilin Wu <sophon@xxxxxxxxx>
> > ---
> > drivers/media/platform/qcom/iris/iris_buffer.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
> > index eb8de60c1177..f790483d13d4 100644
> > --- a/drivers/media/platform/qcom/iris/iris_buffer.c
> > +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
> > @@ -899,7 +899,8 @@ int iris_vb2_buffer_done(struct iris_inst *inst, struct iris_buffer *buf)
> > if (buf->flags & V4L2_BUF_FLAG_ERROR) {
> > state = VB2_BUF_STATE_ERROR;
> > vb2_set_plane_payload(vb2, 0, 0);
> > - vb2->timestamp = 0;
> > + /* Allow userspace to associate the error with the input frame. */
> > + vb2->timestamp = buf->timestamp;
> > v4l2_m2m_buf_done(vbuf, state);
> > return 0;
> > }
> >
> > --
> > 2.56.0
> >
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>

I'm generally ok with the change, not that I think libva-v4l2 is a good idea,
but we should not intentionally make userspace life difficult. Userspace should
not though assume that every OUTPUT buffer in error will generate an CAPTURE
buffer with error and copied timestamp, this would be completely off spec.

Nicolas

Attachment: signature.asc
Description: This is a digitally signed message part