Brian Johnson schrieb:
Isn't SXGA resolution defined as being 1280x1024?

On Sun, Jan 25, 2009 at 8:54 AM, GWater <[email protected]> wrote:
I think our last missing major feature is now SXGA. My progress is this:

1. The attached patch enabled me to make mplayer _request_ SXGA. Some I2C
messages are SOI968 specific (enabling SXGA in the sensor).

2. The attached image is the output I get from mplayer. As you can see the
NOKIA brand on my mobile is visible but most of the image is missing.

Ideas?

GWater

From 5bc49a6497c1bb05613dcc92762fb5ae9d89e236 Mon Sep 17 00:00:00 2001
From: Josua Grawitter <[email protected]>
Date: Sun, 25 Jan 2009 14:54:07 +0100
Subject: [PATCH] SXGA testing

Signed-off-by: Josua Grawitter <[email protected]>
---
 sn9c20x-bridge.c |   10 ++++++++--
 sn9c20x-dev.c    |    6 ++++++
 sn9c20x-v4l2.c   |    4 ++++
 sn9c20x.h        |    2 +-
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/sn9c20x-bridge.c b/sn9c20x-bridge.c
index fc89ece..1c21ebe 100644
--- a/sn9c20x-bridge.c
+++ b/sn9c20x-bridge.c
@@ -665,7 +665,7 @@ int sn9c20x_get_closest_resolution(struct usb_sn9c20x
*dev,

       for (i = SN9C20X_N_MODES - 1; i >= 0; i--) {
               if (*width >= sn9c20x_modes[i].width
-                   && *height >= sn9c20x_modes[i].height)
+                   || *height >= sn9c20x_modes[i].height)
                       break;
       }

@@ -691,7 +691,7 @@ int sn9c20x_set_resolution(struct usb_sn9c20x *dev,
       int width, int height)
 {
       int ret;
-       __u8 scale;
+       __u8 scale, buf;
       __u8 window[6];
       __u8 clrwindow[5];
       struct sn9c20x_video_mode *mode;
@@ -719,6 +719,12 @@ int sn9c20x_set_resolution(struct usb_sn9c20x *dev,
       window[4] = mode->window[2] >> 4;
       window[5] = mode->window[3] >> 3;

+       if (mode->width == 1280) {
+               sn9c20x_read_i2c_data(dev, 1, 0x12, &buf);
+               buf &= ~0x40;
+               sn9c20x_write_i2c_data(dev, 1, 0x12, &buf);
+       }
+
       usb_sn9c20x_control_write(dev, 0x10fb, clrwindow, 5);
       usb_sn9c20x_control_write(dev, 0x1180, window, 6);
       usb_sn9c20x_control_write(dev, SN9C20X_SCALE, &scale, 1);
diff --git a/sn9c20x-dev.c b/sn9c20x-dev.c
index 2287d4f..737fa64 100644
--- a/sn9c20x-dev.c
+++ b/sn9c20x-dev.c
@@ -76,6 +76,12 @@ struct sn9c20x_video_mode sn9c20x_modes[SN9C20X_N_MODES]
= {
               .scale = SN9C20X_NO_SCALE,
               .window = {0, 0, 640, 480}
       },
+       {
+               .width = 1280,
+               .height = 960,
+               .scale = SN9C20X_NO_SCALE,
+               .window = {0, 0, 1280, 960}
+       },
 };

 struct sn9c20x_video_format sn9c20x_fmts[SN9C20X_N_FMTS] = {
diff --git a/sn9c20x-v4l2.c b/sn9c20x-v4l2.c
index cecd2bf..8ab1966 100644
--- a/sn9c20x-v4l2.c
+++ b/sn9c20x-v4l2.c
@@ -985,6 +985,8 @@ int sn9c20x_vidioc_try_fmt_cap(struct file *file, void
*priv,
       if (index >= SN9C20X_N_FMTS)
               return -EINVAL;

+       UDIA_INFO("Requested resolution %dx%d\n", fmt->fmt.pix.width,
fmt->fmt.pix.height);
+
       sn9c20x_get_closest_resolution(dev, &fmt->fmt.pix.width,
                                      &fmt->fmt.pix.height);

@@ -1039,6 +1041,8 @@ int sn9c20x_vidioc_s_fmt_cap(struct file *file, void
*priv,

       dev = video_get_drvdata(priv);

+       UDIA_INFO("Requested resolution %dx%d\n", fmt->fmt.pix.width,
fmt->fmt.pix.height);
+
       UDIA_DEBUG("SET FMT %d : %d\n", fmt->type, fmt->fmt.pix.pixelformat);

       if (v4l_get_privileges(file) < 0)
diff --git a/sn9c20x.h b/sn9c20x.h
index d0cd202..dfcc978 100644
--- a/sn9c20x.h
+++ b/sn9c20x.h
@@ -304,7 +304,7 @@ extern struct sn9c20x_i2c_regs ov7670_init[];
 extern struct sn9c20x_i2c_regs hv7131r_init[];

 #define SN9C20X_N_FMTS 3
-#define SN9C20X_N_MODES        6
+#define SN9C20X_N_MODES        7

 extern struct sn9c20x_video_format sn9c20x_fmts[SN9C20X_N_FMTS];
 extern struct sn9c20x_video_mode sn9c20x_modes[SN9C20X_N_MODES];
--
1.6.0.6




--~--~---------~--~----~------------~-------~--~----~
Lets make microdia webcams plug'n play, (currently plug'n pray)
To post to this group, send email to [email protected]
Visit us online https://groups.google.com/group/microdia
-~----------~----~----~----~------~----~------~--~---


1280x960 was easier to calculate.

GWater

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to