[PATCH 2/2] media: uvcvideo: add device entry for Logitech C920 (046d:08e5)

From: Pol Fernández Fernández

Date: Mon Jun 29 2026 - 12:39:40 EST


The Logitech HD Pro Webcam C920 variant with USB ID 046d:08e5 is not
present in the device ID table and is matched only by the generic UVC
catch-all entry, receiving no device-specific quirks.

This device intermittently sends MJPEG frames at 1920x1080/30fps
without the EOI (0xFF 0xD9) End of Image marker, correctly signaling
the incomplete frame via UVC_STREAM_ERR in the UVC payload header.
Applications using strict JPEG decoders (libjpeg) display the corrupted
portion as a gray band covering the remainder of the frame. The issue
does not occur on Windows.

Two contributing factors were identified:

1. The C920 (08e5) operates at the USB 2.0 High Speed isochronous
ceiling (wMaxPacketSize = 3x1024 = 3072 bytes, altsetting 11).
The camera firmware has an intermittent bug where it occasionally
fails to finalize a JPEG frame and signals this correctly via
UVC_STREAM_ERR. No USB-level isochronous packet failures were
observed (iso_frame_desc.status was always 0).

2. uvcvideo forces wCompQuality to the maximum value returned by
GET_MAX during probe negotiation (61 for this device, on a
firmware-specific scale). The camera's default value from GET_CUR
is 0, which this firmware uses to indicate adaptive encoding mode.
Forcing maximum quality increases encoder pressure and raises the
frequency of UVC_STREAM_ERR events.

Add a device table entry with:
- UVC_QUIRK_RESTORE_CTRLS_ON_INIT and UVC_QUIRK_INVALID_DEVICE_SOF,
consistent with the existing entry for the related 046d:082d variant
of the same camera family.
- UVC_QUIRK_NO_FORCE_QUALITY to preserve wCompQuality=0 (adaptive
mode) during probe negotiation rather than overriding it with the
maximum value.
- UVC_QUIRK_DROP_STREAM_ERR to ensure frames flagged with
UVC_STREAM_ERR are silently dropped rather than delivered to
userspace as truncated JPEG data.

Tested on Linux 7.0.0 at 1920x1080 MJPEG 30fps. With this fix, 0
truncated frames were observed in 300-frame capture sequences
(previously 1-2% of frames were affected).

Signed-off-by: Pol Fernández Fernández <fernandezfernandezpol@xxxxxxxxx>
---
drivers/media/usb/uvc/uvc_driver.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index XXXXXXX..XXXXXXX 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2729,6 +2729,18 @@
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) },
+ /* Logitech HD Pro Webcam C920 (variant 08e5) */
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
+ | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x046d,
+ .idProduct = 0x08e5,
+ .bInterfaceClass = USB_CLASS_VIDEO,
+ .bInterfaceSubClass = 1,
+ .bInterfaceProtocol = 0,
+ .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT
+ | UVC_QUIRK_INVALID_DEVICE_SOF
+ | UVC_QUIRK_NO_FORCE_QUALITY
+ | UVC_QUIRK_DROP_STREAM_ERR) },
/* Chicony CNF7129 (Asus EEE 100HE) */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
--
2.43.0