From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v2 8/9] ov772x: Compute window size registers at runtime
Date: Fri, 20 Jul 2012 16:14:10 +0200 [thread overview]
Message-ID: <4306234.EcsJDFQ6d6@avalon> (raw)
In-Reply-To: <Pine.LNX.4.64.1207201554130.5505@axis700.grange>
Hi Guennadi,
On Friday 20 July 2012 15:58:25 Guennadi Liakhovetski wrote:
> On Wed, 18 Jul 2012, Laurent Pinchart wrote:
> > Instead of hardcoding register arrays, compute the values at runtime.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > drivers/media/video/ov772x.c | 162
> > +++++++++++++++++------------------------- 1 files changed, 65
> > insertions(+), 97 deletions(-)
> >
> > diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c
> > index 3874dbc..aa2ba9e 100644
> > --- a/drivers/media/video/ov772x.c
> > +++ b/drivers/media/video/ov772x.c
>
> I'm afraid, I still don't quite agree with your changes to size macros.
> This is not a huge deal, but I'd preserve the current (Q)VGA_* naming for
> now until we find a better solution. How about this patch merged with yours:
I still like my solution better, but you're the driver maintainer :-)
> diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c
> index a2dde04..76a80b6 100644
> --- a/drivers/media/video/ov772x.c
> +++ b/drivers/media/video/ov772x.c
> @@ -360,8 +360,12 @@
> #define SCAL0_ACTRL 0x08 /* Auto scaling factor control */
> #define SCAL1_2_ACTRL 0x04 /* Auto scaling factor control */
>
> -#define OV772X_DEFAULT_WIDTH 640
> -#define OV772X_DEFAULT_HEIGHT 480
> +#define VGA_WIDTH 640
> +#define VGA_HEIGHT 480
> +#define QVGA_WIDTH 320
> +#define QVGA_HEIGHT 240
> +#define OV772X_MAX_WIDTH VGA_WIDTH
> +#define OV772X_MAX_HEIGHT VGA_HEIGHT
>
> /*
> * ID
> @@ -488,8 +492,8 @@ static const struct ov772x_win_size ov772x_win_sizes[] =
> { .rect = {
> .left = 140,
> .top = 14,
> - .width = 640,
> - .height = 480,
> + .width = VGA_WIDTH,
> + .height = VGA_HEIGHT,
> },
> }, {
> .name = "QVGA",
> @@ -497,8 +501,8 @@ static const struct ov772x_win_size ov772x_win_sizes[] =
> { .rect = {
> .left = 252,
> .top = 6,
> - .width = 320,
> - .height = 240,
> + .width = QVGA_WIDTH,
> + .height = QVGA_HEIGHT,
> },
> },
> };
> @@ -858,8 +862,8 @@ static int ov772x_g_crop(struct v4l2_subdev *sd, struct
> v4l2_crop *a) {
> a->c.left = 0;
> a->c.top = 0;
> - a->c.width = OV772X_DEFAULT_WIDTH;
> - a->c.height = OV772X_DEFAULT_HEIGHT;
> + a->c.width = VGA_WIDTH;
> + a->c.height = VGA_HEIGHT;
> a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>
> return 0;
> @@ -869,8 +873,8 @@ static int ov772x_cropcap(struct v4l2_subdev *sd, struct
> v4l2_cropcap *a) {
> a->bounds.left = 0;
> a->bounds.top = 0;
> - a->bounds.width = OV772X_DEFAULT_WIDTH;
> - a->bounds.height = OV772X_DEFAULT_HEIGHT;
> + a->bounds.width = OV772X_MAX_WIDTH;
> + a->bounds.height = OV772X_MAX_HEIGHT;
> a->defrect = a->bounds;
> a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
> a->pixelaspect.numerator = 1;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2012-07-20 14:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 13:58 [PATCH v2 0/9] Miscellaneous ov772x cleanups and fixes Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 1/9] ov772x: Fix memory leak in probe error path Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 2/9] ov772x: Select the default format at probe time Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 3/9] ov772x: Don't fail in s_fmt if the requested format isn't supported Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 4/9] ov772x: try_fmt must not default to the current format Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 5/9] ov772x: Make to_ov772x convert from v4l2_subdev to ov772x_priv Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 6/9] ov772x: Add ov772x_read() and ov772x_write() functions Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 7/9] ov772x: Add support for SBGGR10 format Laurent Pinchart
2012-07-18 13:58 ` [PATCH v2 8/9] ov772x: Compute window size registers at runtime Laurent Pinchart
2012-07-20 13:58 ` Guennadi Liakhovetski
2012-07-20 14:14 ` Laurent Pinchart [this message]
2012-07-18 13:58 ` [PATCH v2 9/9] ov772x: Stop sensor readout right after reset Laurent Pinchart
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=4306234.EcsJDFQ6d6@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski@gmx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.