public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yoshihiro Kaneko <ykaneko0929@gmail.com>, linux-media@vger.kernel.org
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH/RFC 1/4] media: soc_camera: rcar_vin: Add UDS support
Date: Mon, 29 Feb 2016 16:31:56 +0300	[thread overview]
Message-ID: <56D4484C.1040605@cogentembedded.com> (raw)
In-Reply-To: <1456751563-21246-2-git-send-email-ykaneko0929@gmail.com>

Hello.

On 2/29/2016 4:12 PM, Yoshihiro Kaneko wrote:

> From: Yoshihiko Mori <yoshihiko.mori.nx@renesas.com>
>
> Add UDS control for R-Car Gen3. Up down scaler can be vertical and
> horizontal scaling.
>
> Signed-off-by: Yoshihiko Mori <yoshihiko.mori.nx@renesas.com>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>   drivers/media/platform/soc_camera/rcar_vin.c | 175 +++++++++++++++++++++------
>   1 file changed, 140 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
> index dc75a80..a22141b 100644
> --- a/drivers/media/platform/soc_camera/rcar_vin.c
> +++ b/drivers/media/platform/soc_camera/rcar_vin.c
> @@ -90,6 +90,7 @@
>
>   /* Register bit fields for R-Car VIN */
>   /* Video n Main Control Register bits */
> +#define VNMC_SCLE		(1 << 26)

    This is gen3 only, right? Please add a comment about that.

>   #define VNMC_FOC		(1 << 21)
>   #define VNMC_YCAL		(1 << 19)
>   #define VNMC_INF_YUV8_BT656	(0 << 16)
> @@ -132,6 +133,17 @@
>   #define VNDMR2_FTEV		(1 << 17)
>   #define VNDMR2_VLV(n)		((n & 0xf) << 12)
>
> +/* UDS */
> +#define VNUDS_CTRL_REG		0x80	/* Scaling Control Registers */
> +#define VNUDS_CTRL_AMD		(1 << 30)
> +#define VNUDS_CTRL_BC		(1 << 20)
> +#define VNUDS_CTRL_TDIPC	(1 << 1)
> +
> +#define VNUDS_SCALE_REG		0x84	/* Scaling Factor Register */
> +#define VNUDS_PASS_BWIDTH_REG	0x90	/* Passband Registers */
> +#define VNUDS_IPC_REG		0x98	/* 2D IPC Setting Register */
> +#define VNUDS_CLIP_SIZE_REG	0xA4	/* UDS Output Size Clipping Register */
> +
>   #define VIN_MAX_WIDTH		2048
>   #define VIN_MAX_HEIGHT		2048
>
> @@ -526,6 +538,14 @@ struct rcar_vin_cam {
>   	const struct soc_mbus_pixelfmt	*extra_fmt;
>   };
>
> +static inline int is_scaling(struct rcar_vin_cam *cam)

    s/int/bool/.

> +{
> +	if (cam->width != cam->out_width || cam->height != cam->out_height)
> +		return 1;

    s/1/true/.

> +
> +	return 0;

    s/0/false/.

[...]
> +static unsigned long rcar_vin_compute_ratio(unsigned int input,
> +		unsigned int output)
> +{
> +#ifdef DISABLE_UDS_CTRL_AMD

    This not #define'd, right?

> +	return (input - 1) * 4096 / (output - 1);
> +#else
> +	if (output > input)
> +		return input * 4096 / output;
> +	else
> +		return (input - 1) * 4096 / (output - 1);
> +#endif
> +}
[...]
> -	/* Horizontal upscaling is carried out by scaling down from double size */
> -	if (value < 4096)
> -		value *= 2;
> +		dev_dbg(icd->parent, "XS Value: %x\n", value);
> +		iowrite32(value, priv->base + VNXS_REG);
>
> -	set_coeff(priv, value);
> +		/*
> +		 * Horizontal upscaling is carried out
> +		 * by scaling down from double size
> +		 */
> +		if (value < 4096)
> +			value *= 2;
> +
> +		set_coeff(priv, value);
> +
> +		/* Set Start/End Pixel/Line Post-Clip */
> +		iowrite32(0, priv->base + VNSPPOC_REG);
> +		iowrite32(0, priv->base + VNSLPOC_REG);
> +		iowrite32((cam->out_width - 1) << dsize,
> +			priv->base + VNEPPOC_REG);

    Please align the continuation line to start under the second (.

[...]

MBR, Sergei


  reply	other threads:[~2016-02-29 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 13:12 [PATCH/RFC 0/4] media: soc_camera: rcar_vin: Add UDS and NV16 scaling support Yoshihiro Kaneko
2016-02-29 13:12 ` [PATCH/RFC 1/4] media: soc_camera: rcar_vin: Add UDS support Yoshihiro Kaneko
2016-02-29 13:31   ` Sergei Shtylyov [this message]
2016-02-29 13:12 ` [PATCH/RFC 2/4] media: soc_camera: rcar_vin: Add get_selection callback function Yoshihiro Kaneko
2016-02-29 13:12 ` [PATCH/RFC 3/4] media: soc_camera: rcar_vin: Add cropcap " Yoshihiro Kaneko
2016-02-29 13:12 ` [PATCH/RFC 4/4] media: soc_camera: rcar_vin: Add NV16 scaling support Yoshihiro Kaneko
2016-02-29 13:27 ` [PATCH/RFC 0/4] media: soc_camera: rcar_vin: Add UDS and " Hans Verkuil
2016-03-02 17:26   ` Yoshihiro Kaneko
2016-03-02 21:45     ` Niklas Söderlund
2016-03-10 15:50       ` Yoshihiro Kaneko

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=56D4484C.1040605@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=horms@verge.net.au \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=ykaneko0929@gmail.com \
    /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