Linux Media Controller development
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: Re: [PATCH] media: v4l2-subdev: Fix stream handling for crop API
Date: Wed, 3 Apr 2024 09:51:01 +0300	[thread overview]
Message-ID: <86075433-94d7-422c-bef2-65875faeaedb@ideasonboard.com> (raw)
In-Reply-To: <20240402201137.GB32172@pendragon.ideasonboard.com>

On 02/04/2024 23:11, Laurent Pinchart wrote:
> On Tue, Apr 02, 2024 at 03:23:03PM +0000, Sakari Ailus wrote:
>> On Tue, Apr 02, 2024 at 12:11:30PM +0300, Tomi Valkeinen wrote:
>>> On 02/04/2024 11:46, Sakari Ailus wrote:
>>>> On Tue, Apr 02, 2024 at 11:44:07AM +0300, Laurent Pinchart wrote:
>>>>> On Tue, Apr 02, 2024 at 08:20:22AM +0000, Sakari Ailus wrote:
>>>>>> Moi,
>>>>>>
>>>>>> On Tue, Apr 02, 2024 at 02:37:25AM +0300, Laurent Pinchart wrote:
>>>>>>> When support for streams was added to the V4L2 subdev API, the
>>>>>>> v4l2_subdev_crop structure was extended with a stream field, but the
>>>>>>> field was not handled in the core code that translates the
>>>>>>> VIDIOC_SUBDEV_[GS]_CROP ioctls to the selection API. Fix it.
>>>>>>
>>>>>> The field is indeed in the UAPI headers. But do we want to support the CROP
>>>>>> IOCTL for streams? Shouldn't the callers be using the [GS]_SELECTION
>>>>>> instead?
>>>>>
>>>>> They should, but if the field is there, we should support it :-) The
>>>>> alternative is to remove it. It will cause failures in v4l2-compliance
>>>>> that we'll need to handle though.
>>>>
>>>> I'd prefer to stick to selections here, this is new functionality so
>>>> [GS]_CROP support isn't required. I don't have a strong opinion on the
>>>> matter though.
>>>
>>> Maybe it's easier to just support the stream field, instead of making
>>> [GS]_CROP the odd case which looks like it should support streams, but then
>>> doesn't...
>>
>> It's an old IOCTL already replaced by the [GS]_SELECTION. I mainly write
>> kernel space software but overall I think it's better if we can provide a
>> single API for controlling cropping instead of two with similar
>> functionality, of which the user then should choose from.
>>
>> It should be also documented in this context if we choose support
>> [GS]_CROP.
>>
>> So I believe we have less work to do and have a better result if we just
>> drop the stream field there. :-)
> 
> I tend to agree, even if that's only a slight preference. Tomi, if
> you're fine with this, I'll update the patch.

I'm fine with it. So we now should move the 'stream' field back to 
reserved, and add documentation saying that [GS]_CROP works differently 
than the other ioctls?

  Tomi


  reply	other threads:[~2024-04-03  6:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 23:37 [PATCH] media: v4l2-subdev: Fix stream handling for crop API Laurent Pinchart
2024-04-02  6:04 ` Tomi Valkeinen
2024-04-02  8:20 ` Sakari Ailus
2024-04-02  8:44   ` Laurent Pinchart
2024-04-02  8:46     ` Sakari Ailus
2024-04-02  9:11       ` Tomi Valkeinen
2024-04-02  9:22         ` Laurent Pinchart
2024-04-02 15:23         ` Sakari Ailus
2024-04-02 20:11           ` Laurent Pinchart
2024-04-03  6:51             ` Tomi Valkeinen [this message]
2024-04-03  7:01               ` 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=86075433-94d7-422c-bef2-65875faeaedb@ideasonboard.com \
    --to=tomi.valkeinen@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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