From: Jean-Francois Moine <moinejf@free.fr>
To: Jose Alberto Reguero <jareguero@telefonica.net>,
Hans de Goede <hdegoede@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: Re: Problem with gspca and zc3xx
Date: Tue, 12 Jan 2010 09:36:35 +0100 [thread overview]
Message-ID: <20100112093635.66aa9d57@tele> (raw)
In-Reply-To: <201001111549.55439.jareguero@telefonica.net>
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
On Mon, 11 Jan 2010 15:49:55 +0100
Jose Alberto Reguero <jareguero@telefonica.net> wrote:
> I take another image with 640x480 and the bad bottom lines are 8. The
> right side look right this time. The good sizes are:
> 320x240->320x232
> 640x480->640x472
Hi Jose Alberto and Hans,
Hans, I modified a bit your patch to handle the 2 resolutions (also, the
problem with pas202b does not exist anymore). May you sign or ack it?
Jose Alberto, the attached patch is to be applied to the last version
of the gspca in my test repository at LinuxTv.org
http://linuxtv.org/hg/~jfrancois/gspca
May you try it?
Regards.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
[-- Attachment #2: zc3xx.pat --]
[-- Type: application/octet-stream, Size: 2571 bytes --]
diff -r 1496806932f0 linux/drivers/media/video/gspca/zc3xx.c
--- a/linux/drivers/media/video/gspca/zc3xx.c Mon Jan 11 19:06:12 2010 +0100
+++ b/linux/drivers/media/video/gspca/zc3xx.c Tue Jan 12 09:29:21 2010 +0100
@@ -192,6 +192,19 @@
.priv = 0},
};
+static const struct v4l2_pix_format broken_vga_mode[] = {
+ {320, 232, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 320,
+ .sizeimage = 320 * 232 * 4 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 1},
+ {640, 472, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
+ .bytesperline = 640,
+ .sizeimage = 640 * 472 * 3 / 8 + 590,
+ .colorspace = V4L2_COLORSPACE_JPEG,
+ .priv = 0},
+};
+
static const struct v4l2_pix_format sif_mode[] = {
{176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
.bytesperline = 176,
@@ -6606,7 +6619,6 @@
struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam;
int sensor;
- int vga = 1; /* 1: vga, 0: sif */
static const u8 gamma[SENSOR_MAX] = {
4, /* SENSOR_ADCM2700 0 */
4, /* SENSOR_CS2102 1 */
@@ -6628,6 +6640,27 @@
3, /* SENSOR_TAS5130CXX 17 */
3, /* SENSOR_TAS5130C_VF0250 18 */
};
+ static const u8 mode_tb[SENSOR_MAX] = {
+ 2, /* SENSOR_ADCM2700 0 */
+ 1, /* SENSOR_CS2102 1 */
+ 1, /* SENSOR_CS2102K 2 */
+ 1, /* SENSOR_GC0305 3 */
+ 1, /* SENSOR_HDCS2020b 4 */
+ 1, /* SENSOR_HV7131B 5 */
+ 1, /* SENSOR_HV7131C 6 */
+ 1, /* SENSOR_ICM105A 7 */
+ 2, /* SENSOR_MC501CB 8 */
+ 1, /* SENSOR_MI0360SOC 9 */
+ 2, /* SENSOR_OV7620 10 */
+ 1, /* SENSOR_OV7630C 11 */
+ 0, /* SENSOR_PAS106 12 */
+ 1, /* SENSOR_PAS202B 13 */
+ 1, /* SENSOR_PB0330 14 */
+ 1, /* SENSOR_PO2030 15 */
+ 1, /* SENSOR_TAS5130CK 16 */
+ 1, /* SENSOR_TAS5130CXX 17 */
+ 1, /* SENSOR_TAS5130C_VF0250 18 */
+ };
/* define some sensors from the vendor/product */
sd->sharpness = SHARPNESS_DEF;
@@ -6701,7 +6734,6 @@
case 0x0f:
PDEBUG(D_PROBE, "Find Sensor PAS106");
sd->sensor = SENSOR_PAS106;
- vga = 0; /* SIF */
break;
case 0x10:
case 0x12:
@@ -6777,12 +6809,20 @@
cam = &gspca_dev->cam;
/*fixme:test*/
gspca_dev->nbalt--;
- if (vga) {
+ switch (mode_tb[sd->sensor]) {
+ case 0:
+ cam->cam_mode = sif_mode;
+ cam->nmodes = ARRAY_SIZE(sif_mode);
+ break;
+ case 1:
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
- } else {
- cam->cam_mode = sif_mode;
- cam->nmodes = ARRAY_SIZE(sif_mode);
+ break;
+ default:
+/* case 2: */
+ cam->cam_mode = broken_vga_mode;
+ cam->nmodes = ARRAY_SIZE(broken_vga_mode);
+ break;
}
sd->brightness = BRIGHTNESS_DEF;
sd->contrast = CONTRAST_DEF;
next prev parent reply other threads:[~2010-01-12 8:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-08 23:15 Problem with gspca and zc3xx Jose Alberto Reguero
2010-01-10 8:37 ` Jean-Francois Moine
2010-01-10 10:31 ` Jose Alberto Reguero
2010-01-11 8:37 ` Hans de Goede
2010-01-11 9:55 ` Jean-Francois Moine
2010-01-11 14:49 ` Jose Alberto Reguero
2010-01-12 8:36 ` Jean-Francois Moine [this message]
2010-01-12 11:54 ` Hans de Goede
2010-01-12 14:57 ` Jose Alberto Reguero
2010-01-13 13:50 ` Jose Alberto Reguero
2010-01-14 16:26 ` Jose Alberto Reguero
2010-05-06 18:09 ` Mauro Carvalho Chehab
2010-05-06 18:32 ` Jean-Francois Moine
2010-01-11 22:03 ` Hans de Goede
-- strict thread matches above, loose matches on Subject: below --
2010-01-28 13:35 Fabio Rossi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100112093635.66aa9d57@tele \
--to=moinejf@free.fr \
--cc=hdegoede@redhat.com \
--cc=jareguero@telefonica.net \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox