From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Cc: Helen Koike <helen.koike@collabora.com>,
linux-media@vger.kernel.org, ezequiel@collabora.com,
hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com,
sakari.ailus@linux.intel.com, linux-rockchip@lists.infradead.org,
mchehab@kernel.org
Subject: Re: [PATCH 2/3] media: staging: rkisp1: rsz: change (hv)div only if capture format is YUV
Date: Sun, 5 Apr 2020 20:29:52 +0300 [thread overview]
Message-ID: <20200405172952.GI5846@pendragon.ideasonboard.com> (raw)
In-Reply-To: <711657f5-005b-fafd-6063-f8c8b61905e7@collabora.com>
Hi Dafna,
On Sat, Apr 04, 2020 at 02:09:20PM +0200, Dafna Hirschfeld wrote:
> On 30.03.20 22:04, Helen Koike wrote:
> > On 3/28/20 7:56 AM, Dafna Hirschfeld wrote:
> >> RGB formats in selfpath should receive input format as YUV422.
> >> The resizer input format is always YUV422 and therefore
> >> if the capture format is RGB, the resizer should not change
> >> the YUV rations.
> >>
> >> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> >> ---
> >> drivers/staging/media/rkisp1/rkisp1-resizer.c | 14 ++++++++++++--
> >> 1 file changed, 12 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/staging/media/rkisp1/rkisp1-resizer.c b/drivers/staging/media/rkisp1/rkisp1-resizer.c
> >> index 8704267a066f..5721eee29ecb 100644
> >> --- a/drivers/staging/media/rkisp1/rkisp1-resizer.c
> >> +++ b/drivers/staging/media/rkisp1/rkisp1-resizer.c
> >> @@ -389,8 +389,18 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
> >> &rsz->rkisp1->capture_devs[rsz->id];
> >> const struct v4l2_format_info *pixfmt_info = cap->pix.info;
> >>
> >> - hdiv = pixfmt_info->hdiv;
> >> - vdiv = pixfmt_info->vdiv;
> >> + /*
> >> + * The resizer always get the input as YUV422
> >> + * If the capture encoding is also YUV, then the resizer should
> >> + * change the 4:2:2 sampling to the sampling of the capture
> >> + * format (4:2:2 -> 4:2:0 for example).
> >> + * If the capture format is RGB then the memory input should
> >> + * be YUV422 so we don't change the default hdiv, vdiv
> >> + */
> >> + if (v4l2_is_format_yuv(pixfmt_info)) {
> >
> > Can't this be moved with && in the outer if statement block?
>
> Actually the outer statement is not needed at all and can be removed
> since the code return if rsz->fmt_type is RKISP1_FMT_BAYER but
> the resizer format is either bayer or yuv so there is no
> need for the "if (rsz->fmt_type == RKISP1_FMT_YUV)"
This sounds reasonable.
> >> + hdiv = pixfmt_info->hdiv;
> >> + vdiv = pixfmt_info->vdiv;
> >> + }
> >> }
> >> src_c.width = src_y.width / hdiv;
> >> src_c.height = src_y.height / vdiv;
> >>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2020-04-05 17:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-28 10:56 [PATCH 0/3] media: staging: rkisp1: add support for RGB formats Dafna Hirschfeld
2020-03-28 10:56 ` [PATCH 1/3] media: staging: rkisp1: rsz: get the capture format info from the capture struct Dafna Hirschfeld
2020-03-30 20:00 ` Helen Koike
2020-04-05 17:24 ` Laurent Pinchart
2020-03-28 10:56 ` [PATCH 2/3] media: staging: rkisp1: rsz: change (hv)div only if capture format is YUV Dafna Hirschfeld
2020-03-30 20:04 ` Helen Koike
2020-04-04 12:09 ` Dafna Hirschfeld
2020-04-05 17:29 ` Laurent Pinchart [this message]
2020-03-28 10:56 ` [PATCH 3/3] media: staging: rkisp1: cap: enable RGB capture format with YUV media bus Dafna Hirschfeld
2020-04-05 17:37 ` 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=20200405172952.GI5846@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=dafna.hirschfeld@collabora.com \
--cc=dafna3@gmail.com \
--cc=ezequiel@collabora.com \
--cc=helen.koike@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=kernel@collabora.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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 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.