From: Laurent Pinchart <pinchart_laurent@projectara.com>
To: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Cc: linux-media@vger.kernel.org, linux-sh@vger.kernel.org,
magnus.damm@gmail.com, hans.verkuil@cisco.com,
ian.molton@codethink.co.uk, lars@metafoo.de,
william.towle@codethink.co.uk
Subject: Re: [PATCH 1/3] media: adv7604: implement g_crop
Date: Sun, 13 Dec 2015 18:18:31 +0000 [thread overview]
Message-ID: <3290325.ZSnHk6CZGE@avalon> (raw)
In-Reply-To: <1449849893-14865-2-git-send-email-ulrich.hecht+renesas@gmail.com>
Hi Ulrich,
Thank you for the patch.
On Friday 11 December 2015 17:04:51 Ulrich Hecht wrote:
> The rcar_vin driver relies on this.
>
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> ---
> drivers/media/i2c/adv7604.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 129009f..d30e7cc 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -1885,6 +1885,17 @@ static int adv76xx_get_format(struct v4l2_subdev *sd,
> return 0;
> }
>
> +static int adv76xx_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
> +{
> + struct adv76xx_state *state = to_state(sd);
> +
> + a->c.height = state->timings.bt.height;
> + a->c.width = state->timings.bt.width;
Shouldn't you set a->c.top and a->c.left to 0 ? There's no guarantee that the
caller will always zero the structure before calling you.
> + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
The type field is an input parameter, you should just return -EINVAL if the
value is not V4L2_BUF_TYPE_VIDEO_CAPTURE.
> +
> + return 0;
> +}
> +
> static int adv76xx_set_format(struct v4l2_subdev *sd,
> struct v4l2_subdev_pad_config *cfg,
> struct v4l2_subdev_format *format)
> @@ -2407,6 +2418,7 @@ static const struct v4l2_subdev_core_ops
> adv76xx_core_ops = {
>
> static const struct v4l2_subdev_video_ops adv76xx_video_ops = {
> .s_routing = adv76xx_s_routing,
> + .g_crop = adv76xx_g_crop,
> .g_input_status = adv76xx_g_input_status,
> .s_dv_timings = adv76xx_s_dv_timings,
> .g_dv_timings = adv76xx_g_dv_timings,
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <pinchart_laurent@projectara.com>
To: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Cc: linux-media@vger.kernel.org, linux-sh@vger.kernel.org,
magnus.damm@gmail.com, hans.verkuil@cisco.com,
ian.molton@codethink.co.uk, lars@metafoo.de,
william.towle@codethink.co.uk
Subject: Re: [PATCH 1/3] media: adv7604: implement g_crop
Date: Sun, 13 Dec 2015 20:18:31 +0200 [thread overview]
Message-ID: <3290325.ZSnHk6CZGE@avalon> (raw)
In-Reply-To: <1449849893-14865-2-git-send-email-ulrich.hecht+renesas@gmail.com>
Hi Ulrich,
Thank you for the patch.
On Friday 11 December 2015 17:04:51 Ulrich Hecht wrote:
> The rcar_vin driver relies on this.
>
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> ---
> drivers/media/i2c/adv7604.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 129009f..d30e7cc 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -1885,6 +1885,17 @@ static int adv76xx_get_format(struct v4l2_subdev *sd,
> return 0;
> }
>
> +static int adv76xx_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
> +{
> + struct adv76xx_state *state = to_state(sd);
> +
> + a->c.height = state->timings.bt.height;
> + a->c.width = state->timings.bt.width;
Shouldn't you set a->c.top and a->c.left to 0 ? There's no guarantee that the
caller will always zero the structure before calling you.
> + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
The type field is an input parameter, you should just return -EINVAL if the
value is not V4L2_BUF_TYPE_VIDEO_CAPTURE.
> +
> + return 0;
> +}
> +
> static int adv76xx_set_format(struct v4l2_subdev *sd,
> struct v4l2_subdev_pad_config *cfg,
> struct v4l2_subdev_format *format)
> @@ -2407,6 +2418,7 @@ static const struct v4l2_subdev_core_ops
> adv76xx_core_ops = {
>
> static const struct v4l2_subdev_video_ops adv76xx_video_ops = {
> .s_routing = adv76xx_s_routing,
> + .g_crop = adv76xx_g_crop,
> .g_input_status = adv76xx_g_input_status,
> .s_dv_timings = adv76xx_s_dv_timings,
> .g_dv_timings = adv76xx_g_dv_timings,
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-12-13 18:18 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-11 16:04 [PATCH 0/3] adv7604: .g_crop and .cropcap support Ulrich Hecht
2015-12-11 16:04 ` Ulrich Hecht
2015-12-11 16:04 ` [PATCH 1/3] media: adv7604: implement g_crop Ulrich Hecht
2015-12-11 16:04 ` Ulrich Hecht
2015-12-13 18:18 ` Laurent Pinchart [this message]
2015-12-13 18:18 ` Laurent Pinchart
2015-12-11 16:04 ` [PATCH 2/3] media: adv7604: implement cropcap Ulrich Hecht
2015-12-11 16:04 ` Ulrich Hecht
2015-12-13 18:22 ` Laurent Pinchart
2015-12-13 18:22 ` Laurent Pinchart
2015-12-11 16:04 ` [PATCH 3/3] media: adv7604: update timings on change of input signal Ulrich Hecht
2015-12-11 16:04 ` Ulrich Hecht
2015-12-11 18:15 ` Sergei Shtylyov
2015-12-11 18:15 ` Sergei Shtylyov
2015-12-13 18:30 ` Laurent Pinchart
2015-12-13 18:30 ` Laurent Pinchart
2015-12-11 16:25 ` [PATCH 0/3] adv7604: .g_crop and .cropcap support Hans Verkuil
2015-12-11 16:25 ` Hans Verkuil
2015-12-13 18:10 ` Laurent Pinchart
2015-12-13 18:10 ` Laurent Pinchart
2015-12-14 10:34 ` Hans Verkuil
2015-12-14 10:34 ` Hans Verkuil
2015-12-14 10:33 ` Hans Verkuil
2015-12-14 10:33 ` Hans Verkuil
2015-12-14 12:55 ` Ulrich Hecht
2015-12-14 12:55 ` Ulrich Hecht
2015-12-14 13:02 ` Hans Verkuil
2015-12-14 13:02 ` Hans Verkuil
2015-12-14 15:41 ` Ulrich Hecht
2015-12-14 15:41 ` Ulrich Hecht
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=3290325.ZSnHk6CZGE@avalon \
--to=pinchart_laurent@projectara.com \
--cc=hans.verkuil@cisco.com \
--cc=ian.molton@codethink.co.uk \
--cc=lars@metafoo.de \
--cc=linux-media@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=ulrich.hecht+renesas@gmail.com \
--cc=william.towle@codethink.co.uk \
/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.