lkml.org 
[lkml]   [2021]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control
On Wed, Mar 24, 2021 at 11:52 AM Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> On (21/03/24 11:34), Tomasz Figa wrote:
> > On Wed, Mar 24, 2021 at 11:31 AM Sergey Senozhatsky
> > <senozhatsky@chromium.org> wrote:
> [..]
> > > > Adjusting the rectangle to something supported by the hardware is
> > > > mentioned explicitly in the V4L2 API documentation and is what drivers
> > > > have to implement. Returning an error on invalid value is not a
> > > > correct behavior here (and similarly for many other operations, e.g.
> > > > S_FMT).
> > >
> > > Well, in this particular case we are talking about user-space that wants
> > > to set ROI rectangle that is knowingly violates device's GET_MAX and
> > > overflows UVC ROI rectangle u16 value range. That's a clear bug in user-space.
> > > Do we want to pretend that user-space does the correct thing and fixup
> > > stuff behind the scenes?
> > >
> >
> > That's how the API is defined. There is a valid use case for this -
> > you don't need to run QUERY_CTRL if all you need is setting the
> > biggest possible rectangle, just set it to (0, 0), (INT_MAX, INT_MAX).
>
> I guess in our case we need to talk about rectangle,auto-controls tuple
> that we send to firmware
>
> rect {
> (0, 0), (INT_MAX, INT_MAX)
> }
> auto-controls {
> INT_MAX
> }
>
> For ROI user-space also must provide valid auto-controls value, which
> normally requires GET_MIN/GET_MAX discovery.
>
> v4l2 selection API mentions only rectangle adjustments and errnos like
> -ERANGE also mention "It is not possible to adjust struct v4l2_rect r
> rectangle to satisfy all constraints given in the flags argument".
>
> So in case when auto-controls is out of supported range (out of
> GET_MIN, GET_MAX range) there is no way for us to tell user-space that
> auto-controls is wrong. We probably need silently pick up the first
> supported value, but not sure how well this will work out in the end.

Shouldn't the autocontrol selection be done via a separate bitmask
control rather than some custom flags in the selection API?

Best regards,
Tomasz

\
 
 \ /
  Last update: 2021-03-24 04:02    [W:0.108 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site