public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] media: uvcvideo: Fixes for frame sequence number
@ 2026-03-20 13:35 Ricardo Ribalda
  2026-03-20 13:35 ` [PATCH v4 1/2] media: uvcvideo: Fix buffer sequence in frame gaps Ricardo Ribalda
  2026-03-20 13:35 ` [PATCH v4 2/2] media: uvcvideo: Fix sequence number when no EOF Ricardo Ribalda
  0 siblings, 2 replies; 6+ messages in thread
From: Ricardo Ribalda @ 2026-03-20 13:35 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Yunke Cao, Ricardo Ribalda, stable

This series fixes a couple of corner cases where the frame sequence
number is not properly handled.

Please note that the second patch has not been tested in a camera
without EOF. To emulate it I have used this:

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index b66d701f2582d..097bed2f7845f 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1360,6 +1360,8 @@ static void uvc_video_decode_end(struct uvc_streaming *stream,
 {
        /* Mark the buffer as done if the EOF marker is set. */
        if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) {
+               printk(KERN_ERR "Ignoring EOF\n");
+               return;
                uvc_dbg(stream->dev, FRAME, "Frame complete (EOF found)\n");
                if (data[0] == len)
                        uvc_dbg(stream->dev, FRAME, "EOF in empty payload\n");

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Changes in v4 (Thanks Hans):
- Fix 2/2 logic.
- Link to v3: https://lore.kernel.org/r/20260316-uvc-fid-v3-0-c793354469b5@chromium.org

Changes in v3:
- Fix typo in commit message.
- Add new patch
- Link to v2: https://lore.kernel.org/r/20260313-uvc-fid-v2-1-3f7a996d9047@chromium.org

Changes in v2 (Thanks Laurent):
- Improve commit message.
- Remove original timestamp and sequence assignment. It is not neeed
- Link to v1: https://lore.kernel.org/r/20260310-uvc-fid-v1-1-5e37dc3c7024@chromium.org

---
Ricardo Ribalda (2):
      media: uvcvideo: Fix buffer sequence in frame gaps
      media: uvcvideo: Fix sequence number when no EOF

 drivers/media/usb/uvc/uvc_video.c | 66 +++++++++++++++++++++++----------------
 1 file changed, 39 insertions(+), 27 deletions(-)
---
base-commit: a7da7fb57f2a787412da1a62292a17fa00fbfbdf
change-id: 20260310-uvc-fid-e1e55447b6f1

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-21 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 13:35 [PATCH v4 0/2] media: uvcvideo: Fixes for frame sequence number Ricardo Ribalda
2026-03-20 13:35 ` [PATCH v4 1/2] media: uvcvideo: Fix buffer sequence in frame gaps Ricardo Ribalda
2026-03-21 12:06   ` Hans de Goede
2026-03-20 13:35 ` [PATCH v4 2/2] media: uvcvideo: Fix sequence number when no EOF Ricardo Ribalda
2026-03-20 19:29   ` Ricardo Ribalda
2026-03-21 12:02   ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox