All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	p.wiesner@phytec.de
Subject: Re: [PATCH 10/20] mt9m111: rewrite make_rect for positioning in debug
Date: Sun, 1 Aug 2010 11:33:35 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1008011127220.310@axis700.grange> (raw)
In-Reply-To: <1280501618-23634-11-git-send-email-m.grzeschik@pengutronix.de>

On Fri, 30 Jul 2010, Michael Grzeschik wrote:

> If DEBUG is defined it is possible to set upper left corner
> 
> Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  drivers/media/video/mt9m111.c |   31 +++++++++++++++++++++++--------
>  1 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
> index e8d8e9b..db5ac32 100644
> --- a/drivers/media/video/mt9m111.c
> +++ b/drivers/media/video/mt9m111.c
> @@ -428,14 +428,7 @@ static int mt9m111_make_rect(struct i2c_client *client,
>  			     struct v4l2_rect *rect)
>  {
>  	struct mt9m111 *mt9m111 = to_mt9m111(client);
> -
> -	if (mt9m111->fmt->code == V4L2_MBUS_FMT_SBGGR8_1X8 ||
> -	    mt9m111->fmt->code == V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE) {
> -		/* Bayer format - even size lengths */
> -		rect->width	= ALIGN(rect->width, 2);
> -		rect->height	= ALIGN(rect->height, 2);
> -		/* Let the user play with the starting pixel */
> -	}
> +	enum v4l2_mbus_pixelcode code = mt9m111->fmt->code;
>  
>  	/* FIXME: the datasheet doesn't specify minimum sizes */
>  	soc_camera_limit_side(&rect->left, &rect->width,
> @@ -444,6 +437,28 @@ static int mt9m111_make_rect(struct i2c_client *client,
>  	soc_camera_limit_side(&rect->top, &rect->height,
>  		     MT9M111_MIN_DARK_ROWS, 2, MT9M111_MAX_HEIGHT);
>  
> +	switch (code) {
> +	case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE:
> +		/* unprocessed Bayer pattern format, IFP is bypassed */
> +#ifndef DEBUG
> +		/* assure that Bayer sequence is BGGR */
> +		/* in debug mode, let user play with starting pixel */
> +		rect->left	= ALIGN(rect->left, 2);
> +		rect->top	= ALIGN(rect->top, 2) + 1;
> +#endif
> +	case V4L2_MBUS_FMT_SBGGR8_1X8:
> +		/* processed Bayer pattern format, sequence is fixed */
> +		/* assure even side lengths for both Bayer modes */
> +		rect->width	= ALIGN(rect->width, 2);
> +		rect->height	= ALIGN(rect->height, 2);
> +	default:

hm, don't think I like it. First, why do you only enable it for SBGGR10 
and not for SBGGR8? This choice has nothing to do with how many bytes per 
pixel this format has. It allows you to select the starting _pixel_, not 
byte. And I wouldn't bind this to DEBUG. Either enable or disable 
completely... If you want to disable it, you would have to check for 
regressions. I would keep it - just to make sure we don't break anything.

> +		/* needed to avoid compiler warnings */;
> +	}
> +
> +	dev_dbg(&client->dev, "%s: rect: left=%d top=%d width=%d height=%d "
> +		"mf: pixelcode=%d\n", __func__, rect->left, rect->top,
> +		rect->width, rect->height, code);
> +
>  	return mt9m111_setup_rect(client, rect);
>  }
>  
> -- 
> 1.7.1

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

  reply	other threads:[~2010-08-01  9:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 14:53 [PATCH 00/20] MT9M111/MT9M131 Michael Grzeschik
2010-07-30 14:53 ` [PATCH 01/20] mt9m111: Added indication that MT9M131 is supported by this driver Michael Grzeschik
2010-07-31 19:49   ` Guennadi Liakhovetski
2010-07-31 20:10   ` Robert Jarzmik
2010-07-31 20:16     ` Guennadi Liakhovetski
2010-07-31 20:28       ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 02/20] mt9m111: init chip after read CHIP_VERSION Michael Grzeschik
2010-07-31 20:09   ` Guennadi Liakhovetski
2010-07-31 20:36     ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 03/20] mt9m111: register cleanup hex to dec bitoffset Michael Grzeschik
2010-07-31 20:40   ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 04/20] mt9m111: added new bit offset defines Michael Grzeschik
2010-07-31 20:44   ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 05/20] mt9m111: added default row/col/width/height values Michael Grzeschik
2010-07-31 20:25   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 06/20] mt9m111: changed MAX_{HEIGHT,WIDTH} values to silicon pixelcount Michael Grzeschik
2010-07-31 20:51   ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 07/20] mt9m111: changed MIN_DARK_COLS to MT9M131 spec count Michael Grzeschik
2010-07-30 14:53 ` [PATCH 08/20] mt9m111: cropcap use defined default rect properties in defrect Michael Grzeschik
2010-07-30 14:53 ` [PATCH 09/20] mt9m111: cropcap check if type is CAPTURE Michael Grzeschik
2010-07-30 14:53 ` [PATCH 10/20] mt9m111: rewrite make_rect for positioning in debug Michael Grzeschik
2010-08-01  9:33   ` Guennadi Liakhovetski [this message]
2010-07-30 14:53 ` [PATCH 11/20] mt9m111: added mt9m111 format structure Michael Grzeschik
2010-08-01 16:48   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 12/20] mt9m111: s_crop add calculation of output size Michael Grzeschik
2010-08-01 19:38   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 13/20] mt9m111: s_crop check for VIDEO_CAPTURE type Michael Grzeschik
2010-07-30 14:53 ` [PATCH 14/20] mt9m111: added reg_mask function Michael Grzeschik
2010-07-30 14:53 ` [PATCH 15/20] mt9m111: rewrite setup_rect, added soft_crop for smooth panning Michael Grzeschik
2010-07-30 14:53 ` [PATCH 16/20] mt9m111: added more supported BE colour formats Michael Grzeschik
2010-07-30 14:53 ` [PATCH 17/20] mt9m111: rewrite set_pixfmt Michael Grzeschik
2010-07-30 14:53 ` [PATCH 18/20] mt9m111: make use of testpattern in debug mode Michael Grzeschik
2010-07-30 14:53 ` [PATCH 19/20] mt9m111: try_fmt rewrite to use preset values Michael Grzeschik
2010-07-30 14:53 ` [PATCH 20/20] mt9m111: s_fmt make use of try_fmt Michael Grzeschik
2010-07-30 15:38 ` [PATCH 00/20] MT9M111/MT9M131 Guennadi Liakhovetski
2010-07-31 10:33   ` Robert Jarzmik
2010-08-02 10:35   ` Michael Grzeschik

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=Pine.LNX.4.64.1008011127220.310@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=p.wiesner@phytec.de \
    --cc=robert.jarzmik@free.fr \
    /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.