linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt
Date: Wed, 28 Aug 2019 12:25:34 +0200	[thread overview]
Message-ID: <e461d293-a021-37f1-a5b9-9923caf93c26@xs4all.nl> (raw)
In-Reply-To: <20190808133523.GA24385@bigcity.dyn.berto.se>

On 8/8/19 3:35 PM, Niklas Söderlund wrote:
> Hi Laurent,
> 
> Thanks for your feedback.
> 
> On 2019-08-08 11:37:51 +0300, Laurent Pinchart wrote:
>> Hi Niklas,
>>
>> Thank you for the patch.
>>
>> On Thu, Aug 08, 2019 at 03:18:48AM +0200, Niklas Söderlund wrote:
>>> The crop and compose rectangles are reset when s_fmt is called
>>> resulting in potentially valid rectangles being lost when updating the
>>> format.
>>
>> Isn't this the expected behaviour ?
> 
> I though so to at first but I had a nagging feeling as I was not sure.  
> So I went and looked at vivid and it does do map the old crop/compose 
> rectangles inside the new limits vivid_s_fmt_vid_cap().
> 
> Please note that the variable names in this patch are horrible and are 
> fixed later in this series. In essence the current crop rectangle is 
> mapped inside the size of the video coming from the sensor and the 
> compose rectangle is mapped inside the new format set on the VIN video 
> device.

The only ioctls that completely reset everything are S_STD and S_DV_TIMINGS.

Ioctls such as S_FMT and S_SELECTION will try to keep as much of the
pre-existing configuration as possible.

So this patch is correct.

Regards,

	Hans

> 
> I'm open to dropping this patch, I just want this driver to get this 
> part right so I mimic vivid.
> 
>>
>>> Fix this by mapping the rectangles inside the new format.
>>>
>>> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
>>> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>>> ---
>>>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> index 8b30267f1636aaf1..5dcd787a9cf96ac9 100644
>>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> @@ -279,8 +279,8 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv,
>>>  		return ret;
>>>  
>>>  	vin->format = f->fmt.pix;
>>> -	vin->crop = crop;
>>> -	vin->compose = compose;
>>> +	v4l2_rect_map_inside(&vin->crop, &crop);
>>> +	v4l2_rect_map_inside(&vin->compose, &compose);
>>>  	vin->src_rect = crop;
>>>  
>>>  	return 0;
>>
>> -- 
>> Regards,
>>
>> Laurent Pinchart
> 


  reply	other threads:[~2019-08-28 10:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08  1:18 [PATCH v2 0/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
2019-08-08  1:18 ` [PATCH v2 1/6] rcar-vin: Fix incorrect return statement in rvin_try_format() Niklas Söderlund
2019-08-08  8:25   ` Laurent Pinchart
2019-08-08  1:18 ` [PATCH v2 2/6] rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro Niklas Söderlund
2019-08-08  8:27   ` Laurent Pinchart
2019-08-08  1:18 ` [PATCH v2 3/6] rcar-vin: Rename rectangle holding the video source information Niklas Söderlund
2019-08-08  8:30   ` Laurent Pinchart
2019-09-04 12:52     ` Niklas Söderlund
2019-08-08  1:18 ` [PATCH v2 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt Niklas Söderlund
2019-08-08  8:37   ` Laurent Pinchart
2019-08-08 13:35     ` Niklas Söderlund
2019-08-28 10:25       ` Hans Verkuil [this message]
2019-08-08  1:18 ` [PATCH v2 5/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
2019-08-08  1:18 ` [PATCH v2 6/6] rcar-vin: Clean up how format is set on subdevice Niklas Söderlund

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=e461d293-a021-37f1-a5b9-9923caf93c26@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    /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).