From patchwork Wed Oct 6 08:59:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 235441 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o969013Q010150 for ; Wed, 6 Oct 2010 09:00:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932279Ab0JFI75 (ORCPT ); Wed, 6 Oct 2010 04:59:57 -0400 Received: from perceval.irobotique.be ([92.243.18.41]:48875 "EHLO perceval.irobotique.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932114Ab0JFI7m (ORCPT ); Wed, 6 Oct 2010 04:59:42 -0400 Received: from localhost.localdomain (unknown [91.178.188.185]) by perceval.irobotique.be (Postfix) with ESMTPSA id C009B35FEA for ; Wed, 6 Oct 2010 08:59:39 +0000 (UTC) From: Laurent Pinchart To: linux-media@vger.kernel.org Subject: [PATCH 07/14] uvcvideo: Set bandwidth to at least 1024 with the FIX_BANDWIDTH quirk Date: Wed, 6 Oct 2010 10:59:45 +0200 Message-Id: <1286355592-13603-8-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: <1286355592-13603-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1286355592-13603-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Oct 2010 09:00:02 +0000 (UTC) diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index ee5e233..5a2022c 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c @@ -138,6 +138,15 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, bandwidth /= 8; bandwidth += 12; + /* The bandwidth estimate is too low for many cameras. Don't use + * maximum packet sizes lower than 1024 bytes to try and work + * around the problem. According to measurements done on two + * different camera models, the value is high enough to get most + * resolutions working while not preventing two simultaneous + * VGA streams at 15 fps. + */ + bandwidth = max_t(u32, bandwidth, 1024); + ctrl->dwMaxPayloadTransferSize = bandwidth; } }