summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2015-05-18 13:17:08 -0400
committerJosh Boyer <jwboyer@fedoraproject.org>2015-05-18 13:17:08 -0400
commit65af5163146680da6d0c7b3f290e521c22aac544 (patch)
treee41fd43b44655a7e76400420406db5f243078e4e
parentf67345e16fb06bb2ad6541d93f100537c9d934de (diff)
downloadkernel-65af5163146680da6d0c7b3f290e521c22aac544.tar.gz
kernel-65af5163146680da6d0c7b3f290e521c22aac544.tar.xz
kernel-65af5163146680da6d0c7b3f290e521c22aac544.zip
Fix incorrect bandwidth on some Chicony webcams
- Fix DVB oops (rhbz 1220118)
-rw-r--r--kernel.spec5
-rw-r--r--v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch35
2 files changed, 40 insertions, 0 deletions
diff --git a/kernel.spec b/kernel.spec
index f0c98931a..93b65161a 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -619,6 +619,8 @@ Patch26201: ovl-don-t-remove-non-empty-opaque-directory.patch
#rhbz 1220118
Patch26202: media-Fix-regression-in-some-more-dib0700-based-devi.patch
+Patch26203: v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1359,6 +1361,8 @@ ApplyPatch ovl-don-t-remove-non-empty-opaque-directory.patch
#rhbz 1220118
ApplyPatch media-Fix-regression-in-some-more-dib0700-based-devi.patch
+ApplyPatch v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2220,6 +2224,7 @@ fi
#
%changelog
* Mon May 18 2015 Josh Boyer <jwboyer@fedoraproject.org>
+- Fix incorrect bandwidth on some Chicony webcams
- Fix DVB oops (rhbz 1220118)
* Mon May 18 2015 Josh Boyer <jwboyer@fedoraproject.org> - 4.1.0-0.rc3.git4.1
diff --git a/v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch b/v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch
new file mode 100644
index 000000000..77b2abb84
--- /dev/null
+++ b/v4l-uvcvideo-Fix-incorrect-bandwidth-with-Chicony-de.patch
@@ -0,0 +1,35 @@
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Mon, 18 May 2015 10:53:48 +0300
+Subject: [PATCH] v4l: uvcvideo: Fix incorrect bandwidth with Chicony device
+ 04f2:b50b
+
+The "TOSHIBA Web Camera - 5M" Chicony device (04f2:b50b) seems to
+compute the bandwidth on 16 bits and erroneously sign-extend it to
+32 bits, resulting in a huge bandwidth value. Detect and fix that
+condition by setting the 16 MSBs to 0 when they're all equal to 1.
+
+Reported-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/usb/uvc/uvc_video.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
+index 20ccc9d315dc..f839654ea436 100644
+--- a/drivers/media/usb/uvc/uvc_video.c
++++ b/drivers/media/usb/uvc/uvc_video.c
+@@ -119,6 +119,14 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
+ ctrl->dwMaxVideoFrameSize =
+ frame->dwMaxVideoFrameBufferSize;
+
++ /* The "TOSHIBA Web Camera - 5M" Chicony device (04f2:b50b) seems to
++ * compute the bandwidth on 16 bits and erroneously sign-extend it to
++ * 32 bits, resulting in a huge bandwidth value. Detect and fix that
++ * condition by setting the 16 MSBs to 0 when they're all equal to 1.
++ */
++ if ((ctrl->dwMaxPayloadTransferSize & 0xffff0000) == 0xffff0000)
++ ctrl->dwMaxPayloadTransferSize &= ~0xffff0000;
++
+ if (!(format->flags & UVC_FMT_FLAG_COMPRESSED) &&
+ stream->dev->quirks & UVC_QUIRK_FIX_BANDWIDTH &&
+ stream->intf->num_altsetting > 1) {