diff options
author | 2008-06-26 21:00:27 +0000 | |
---|---|---|
committer | 2008-06-26 21:00:27 +0000 | |
commit | 4ad088781be13fcdb4de5d20e929ffa9d7c77e49 (patch) | |
tree | e4911d1e9edef3eca3b1a2d71c1c7febbe5349f1 | |
parent | Kill the silly ``drm_device_t'' and ``drm_file_t'' typedefs. just use (diff) | |
download | wireguard-openbsd-4ad088781be13fcdb4de5d20e929ffa9d7c77e49.tar.xz wireguard-openbsd-4ad088781be13fcdb4de5d20e929ffa9d7c77e49.zip |
Make video stream work properly on uhci and ohci by adding an ohci
isoc xfer workaround.
Improved and OK deraadt@
-rw-r--r-- | sys/dev/usb/uvideo.c | 11 | ||||
-rw-r--r-- | sys/dev/usb/uvideo.h | 5 |
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 7449eb25e8c..0623b96d974 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.41 2008/06/23 04:58:00 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.42 2008/06/26 21:00:27 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -1078,7 +1078,14 @@ uvideo_vs_open(struct uvideo_softc *sc) } /* calculate optimal isoc xfer size */ - sc->sc_nframes = UVIDEO_SFRAMES_MAX / sc->sc_vs_curr->max_packet_size; + if (strncmp(sc->sc_udev->bus->bdev.dv_xname, "ohci", 4) == 0) { + /* ohci workaround */ + sc->sc_nframes = 6400 / + sc->sc_vs_curr->max_packet_size; + } else { + sc->sc_nframes = UGETDW(sc->sc_desc_probe.dwMaxVideoFrameSize) / + sc->sc_vs_curr->max_packet_size; + } if (sc->sc_nframes > UVIDEO_NFRAMES_MAX) sc->sc_nframes = UVIDEO_NFRAMES_MAX; DPRINTF(1, "%s: nframes=%d\n", DEVNAME(sc), sc->sc_nframes); diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h index c9a9e449b94..3ef0a92ca61 100644 --- a/sys/dev/usb/uvideo.h +++ b/sys/dev/usb/uvideo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.h,v 1.14 2008/06/09 20:51:31 mglocker Exp $ */ +/* $OpenBSD: uvideo.h,v 1.15 2008/06/26 21:00:27 mglocker Exp $ */ /* * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -327,8 +327,7 @@ struct usb_video_frame_mjpeg_desc { /* * Driver specific private definitions. */ -#define UVIDEO_NFRAMES_MAX 34 /* XXX find optimal value */ -#define UVIDEO_SFRAMES_MAX 6400 /* XXX find optimal value */ +#define UVIDEO_NFRAMES_MAX 40 struct uvideo_vs_iface { struct uvideo_softc *sc; |