From eb3fb7c9633f79077c7c650efe0edec1840926da Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 1 Jan 2012 16:35:01 -0300 Subject: [media] gspca: Add a need_max_bandwidth flag to sd_desc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some cameras will pretty much entirely fill all the image buffers all the time even though they are using compression. This patch adds a flag to sd_desc, which drivers for such cameras can set. When this flag is set the bandwidth calculation code will no longer assume that the image buffer size is a worst case and less bandwidth than imagebufsize * fps will be used on average. This patch sets this new flag for 3 drivers: * For spca561 (for rev12a cameras) and nw80x cams as these simply don't work when given less bandwidth than imagebufsize * fps. * For sn9c20x cameras, because these show severy jpeg artifacts when given less bandwidth than imagebufsize * fps and since these are usb2 cameras there is plenty bandwidth anyways. Signed-off-by: Hans de Goede Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/gspca.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/gspca/gspca.c') diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index a8643bcd2ec..b044c8a10a1 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -638,7 +638,8 @@ static u32 which_bandwidth(struct gspca_dev *gspca_dev) bandwidth = gspca_dev->cam.cam_mode[i].sizeimage; /* if the image is compressed, estimate its mean size */ - if (bandwidth < gspca_dev->cam.cam_mode[i].width * + if (!gspca_dev->cam.needs_full_bandwidth && + bandwidth < gspca_dev->cam.cam_mode[i].width * gspca_dev->cam.cam_mode[i].height) bandwidth = bandwidth * 3 / 8; /* 0.375 */ -- cgit v1.2.3-70-g09d2