aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2026-05-18 21:44:27 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2026-06-16 11:21:05 +0000
commit3b6f833c95eb65b29a9f506928467236a11d5169 (patch)
tree49006dc0e3cd16fe675523cee20d2b04d1b4182b
parent8bc06ffbbd80533eda0784d2a6f5a1476f9d550c (diff)
uvideo: increase isochronous transfer depth for throughput
Increase NFRAMES_MAX from 40 to 128 and IXFERS from 3 to 5 to keep more packets in flight on the USB bus. This brings throughput from ~13.5 MB/s to ~21 MB/s (for comparison on the same camera webcamd provided ~20MB/s. The linux driver also uses 5 IXFERS (but only 32 NFRAMES_MAX) Tested by: manu
-rw-r--r--sys/dev/usb/video/uvideo.c20
-rw-r--r--sys/dev/usb/video/uvideo.h4
2 files changed, 22 insertions, 2 deletions
diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c
index b35561ff6a24..9229aa34fc47 100644
--- a/sys/dev/usb/video/uvideo.c
+++ b/sys/dev/usb/video/uvideo.c
@@ -196,6 +196,8 @@ enum {
UVIDEO_ISOC_RX_0,
UVIDEO_ISOC_RX_1,
UVIDEO_ISOC_RX_2,
+ UVIDEO_ISOC_RX_3,
+ UVIDEO_ISOC_RX_4,
UVIDEO_BULK_RX,
UVIDEO_N_XFER
};
@@ -616,6 +618,24 @@ static const struct usb_config uvideo_isoc_config[UVIDEO_IXFERS] = {
.flags = {.short_xfer_ok = 1, .short_frames_ok = 1,},
.callback = &uvideo_isoc_callback,
},
+ [3] = {
+ .type = UE_ISOCHRONOUS,
+ .endpoint = UE_ADDR_ANY,
+ .direction = UE_DIR_IN,
+ .bufsize = 0,
+ .frames = UVIDEO_NFRAMES_MAX,
+ .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,},
+ .callback = &uvideo_isoc_callback,
+ },
+ [4] = {
+ .type = UE_ISOCHRONOUS,
+ .endpoint = UE_ADDR_ANY,
+ .direction = UE_DIR_IN,
+ .bufsize = 0,
+ .frames = UVIDEO_NFRAMES_MAX,
+ .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,},
+ .callback = &uvideo_isoc_callback,
+ },
};
static const struct usb_config uvideo_bulk_config[1] = {
diff --git a/sys/dev/usb/video/uvideo.h b/sys/dev/usb/video/uvideo.h
index fc811c5d65fa..9f8570aaf7ed 100644
--- a/sys/dev/usb/video/uvideo.h
+++ b/sys/dev/usb/video/uvideo.h
@@ -640,9 +640,9 @@ struct usb_video_format_desc {
/*
* Driver specific private definitions.
*/
-#define UVIDEO_NFRAMES_MAX 40
+#define UVIDEO_NFRAMES_MAX 128
-#define UVIDEO_IXFERS 3
+#define UVIDEO_IXFERS 5
struct uvideo_vs_iface {
uint8_t iface_index;
int numalts;