linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Yoshihiro Kaneko <ykaneko0929@gmail.com>,
	Simon Horman <horms@verge.net.au>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-sh@vger.kernel.org
Subject: Re: [PATCH v2] v4l: vsp1: Align crop rectangle to even boundary for YUV formats
Date: Thu, 18 Jun 2015 20:21:08 +0000	[thread overview]
Message-ID: <14792550.FyoUCuzjPK@avalon> (raw)
In-Reply-To: <1432817979-2929-1-git-send-email-ykaneko0929@gmail.com>

Hi Kaneko-san,

Thank you for the patch.

On Thursday 28 May 2015 21:59:39 Yoshihiro Kaneko wrote:
> From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> 
> Make sure that there are valid values in the crop rectangle to ensure
> that the color plane doesn't get shifted when cropping.
> Since there is no distinction between 12bit and 16bit YUV formats in
> at the subdev level, use the more restrictive 12bit limits for all YUV
> formats.
> 
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and applied to my tree with a summary of the commit message added as a source 
code comment.

> ---
> 
> This patch is based on the master branch of linuxtv.org/media_tree.git.
> 
> v2 [Yoshihiro Kaneko]
> * As suggested by Laurent Pinchart
>   - remove the change to add a restriction to the left and top
>   - use round_down() to align the width and height
> * As suggested by Sergei Shtylyov
>   - use ALIGN() to align the left and top
>   - correct a misspelling of the commit message
> * Compile tested only
> 
>  drivers/media/platform/vsp1/vsp1_rwpf.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c
> b/drivers/media/platform/vsp1/vsp1_rwpf.c index fa71f46..32687c7 100644
> --- a/drivers/media/platform/vsp1/vsp1_rwpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_rwpf.c
> @@ -197,6 +197,14 @@ int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
> */
>  	format = vsp1_entity_get_pad_format(&rwpf->entity, cfg, RWPF_PAD_SINK,
>  					    sel->which);
> +
> +	if (format->code = MEDIA_BUS_FMT_AYUV8_1X32) {
> +		sel->r.left = ALIGN(sel->r.left, 2);
> +		sel->r.top = ALIGN(sel->r.top, 2);
> +		sel->r.width = round_down(sel->r.width, 2);
> +		sel->r.height = round_down(sel->r.height, 2);
> +	}
> +
>  	sel->r.left = min_t(unsigned int, sel->r.left, format->width - 2);
>  	sel->r.top = min_t(unsigned int, sel->r.top, format->height - 2);
>  	if (rwpf->entity.type = VSP1_ENTITY_WPF) {

-- 
Regards,

Laurent Pinchart


      reply	other threads:[~2015-06-18 20:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 12:59 [PATCH v2] v4l: vsp1: Align crop rectangle to even boundary for YUV formats Yoshihiro Kaneko
2015-06-18 20:21 ` Laurent Pinchart [this message]

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=14792550.FyoUCuzjPK@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=horms@verge.net.au \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --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;
as well as URLs for NNTP newsgroup(s).