* V4L2_SUBDEV_FL_HAS_EVENTS and (un)subscribe_event for subdevice drivers
@ 2022-10-31 12:27 Dave Stevenson
2022-10-31 12:36 ` Hans Verkuil
0 siblings, 1 reply; 4+ messages in thread
From: Dave Stevenson @ 2022-10-31 12:27 UTC (permalink / raw)
To: Hans Verkuil, Sakari Ailus; +Cc: Linux Media Mailing List, Jacopo Mondi
Hi Hans & Sakari
A question raised from review of [1]:
Is it correct that any subdevice driver that supports any controls
should advertise V4L2_SUBDEV_FL_HAS_EVENTS and have
subscribe_event/unsubscribe_event core_ops?
I added that patch for ov9282 to resolve a v4l2-compliance failure:
fail: v4l2-test-controls.cpp(835): subscribe event for control 'User
Controls' failed
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
but it surprised Jacopo, and he has observed that many of the current
drivers with controls don't meet this requirement.
I just wanted confirmation from those in the know.
Thanks
Dave
[1] https://patchwork.linuxtv.org/project/linux-media/patch/20221005152809.3785786-17-dave.stevenson@raspberrypi.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: V4L2_SUBDEV_FL_HAS_EVENTS and (un)subscribe_event for subdevice drivers
2022-10-31 12:27 V4L2_SUBDEV_FL_HAS_EVENTS and (un)subscribe_event for subdevice drivers Dave Stevenson
@ 2022-10-31 12:36 ` Hans Verkuil
2022-10-31 12:40 ` Dave Stevenson
2022-10-31 13:42 ` Jacopo Mondi
0 siblings, 2 replies; 4+ messages in thread
From: Hans Verkuil @ 2022-10-31 12:36 UTC (permalink / raw)
To: Dave Stevenson, Sakari Ailus; +Cc: Linux Media Mailing List, Jacopo Mondi
Hi Dave,
On 31/10/2022 13:27, Dave Stevenson wrote:
> Hi Hans & Sakari
>
> A question raised from review of [1]:
>
> Is it correct that any subdevice driver that supports any controls
> should advertise V4L2_SUBDEV_FL_HAS_EVENTS and have
> subscribe_event/unsubscribe_event core_ops?
>
> I added that patch for ov9282 to resolve a v4l2-compliance failure:
> fail: v4l2-test-controls.cpp(835): subscribe event for control 'User
> Controls' failed
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> but it surprised Jacopo, and he has observed that many of the current
> drivers with controls don't meet this requirement.
>
> I just wanted confirmation from those in the know.
It should only be needed if V4L2_SUBDEV_FL_HAS_DEVNODE is also set in the
subdev driver. If HAS_DEVNODE is set, and there are controls, then HAS_EVENTS
must be set and you have to be able to (un)subscribe to events.
Because the controls can be exposed to userspace via a v4l-subdevX device, and
userspace has to be able to subscribe to control events so that it is
notified when the control changes value.
The compliance testing of v4l-subdev devices isn't that old, so a lot of older
subdev drivers where never checked for compliance.
Regards,
Hans
>
> Thanks
> Dave
>
> [1] https://patchwork.linuxtv.org/project/linux-media/patch/20221005152809.3785786-17-dave.stevenson@raspberrypi.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: V4L2_SUBDEV_FL_HAS_EVENTS and (un)subscribe_event for subdevice drivers
2022-10-31 12:36 ` Hans Verkuil
@ 2022-10-31 12:40 ` Dave Stevenson
2022-10-31 13:42 ` Jacopo Mondi
1 sibling, 0 replies; 4+ messages in thread
From: Dave Stevenson @ 2022-10-31 12:40 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Sakari Ailus, Linux Media Mailing List, Jacopo Mondi
Hi Hans
On Mon, 31 Oct 2022 at 12:36, Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
>
> Hi Dave,
>
> On 31/10/2022 13:27, Dave Stevenson wrote:
> > Hi Hans & Sakari
> >
> > A question raised from review of [1]:
> >
> > Is it correct that any subdevice driver that supports any controls
> > should advertise V4L2_SUBDEV_FL_HAS_EVENTS and have
> > subscribe_event/unsubscribe_event core_ops?
> >
> > I added that patch for ov9282 to resolve a v4l2-compliance failure:
> > fail: v4l2-test-controls.cpp(835): subscribe event for control 'User
> > Controls' failed
> > test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> > but it surprised Jacopo, and he has observed that many of the current
> > drivers with controls don't meet this requirement.
> >
> > I just wanted confirmation from those in the know.
>
> It should only be needed if V4L2_SUBDEV_FL_HAS_DEVNODE is also set in the
> subdev driver. If HAS_DEVNODE is set, and there are controls, then HAS_EVENTS
> must be set and you have to be able to (un)subscribe to events.
>
> Because the controls can be exposed to userspace via a v4l-subdevX device, and
> userspace has to be able to subscribe to control events so that it is
> notified when the control changes value.
>
> The compliance testing of v4l-subdev devices isn't that old, so a lot of older
> subdev drivers where never checked for compliance.
Thanks for the swift response - I'm glad I'm not going crazy then :-)
Dave.
> Regards,
>
> Hans
>
> >
> > Thanks
> > Dave
> >
> > [1] https://patchwork.linuxtv.org/project/linux-media/patch/20221005152809.3785786-17-dave.stevenson@raspberrypi.com/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: V4L2_SUBDEV_FL_HAS_EVENTS and (un)subscribe_event for subdevice drivers
2022-10-31 12:36 ` Hans Verkuil
2022-10-31 12:40 ` Dave Stevenson
@ 2022-10-31 13:42 ` Jacopo Mondi
1 sibling, 0 replies; 4+ messages in thread
From: Jacopo Mondi @ 2022-10-31 13:42 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Dave Stevenson, Sakari Ailus, Linux Media Mailing List
Hi Hans,
On Mon, Oct 31, 2022 at 01:36:27PM +0100, Hans Verkuil wrote:
> Hi Dave,
>
> On 31/10/2022 13:27, Dave Stevenson wrote:
> > Hi Hans & Sakari
> >
> > A question raised from review of [1]:
> >
> > Is it correct that any subdevice driver that supports any controls
> > should advertise V4L2_SUBDEV_FL_HAS_EVENTS and have
> > subscribe_event/unsubscribe_event core_ops?
> >
> > I added that patch for ov9282 to resolve a v4l2-compliance failure:
> > fail: v4l2-test-controls.cpp(835): subscribe event for control 'User
> > Controls' failed
> > test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> > but it surprised Jacopo, and he has observed that many of the current
> > drivers with controls don't meet this requirement.
> >
> > I just wanted confirmation from those in the know.
>
> It should only be needed if V4L2_SUBDEV_FL_HAS_DEVNODE is also set in the
> subdev driver. If HAS_DEVNODE is set, and there are controls, then HAS_EVENTS
> must be set and you have to be able to (un)subscribe to events.
Most relatively recent sensor drivers have a devnode and register
controls. I wonder if the core could detect this and install the
callback handlers if the two flags are set, as relying on drivers
doing that clearly is not working well :)
>
> Because the controls can be exposed to userspace via a v4l-subdevX device, and
> userspace has to be able to subscribe to control events so that it is
> notified when the control changes value.
>
> The compliance testing of v4l-subdev devices isn't that old, so a lot of older
> subdev drivers where never checked for compliance.
>
> Regards,
>
> Hans
>
> >
> > Thanks
> > Dave
> >
> > [1] https://patchwork.linuxtv.org/project/linux-media/patch/20221005152809.3785786-17-dave.stevenson@raspberrypi.com/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-31 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 12:27 V4L2_SUBDEV_FL_HAS_EVENTS and (un)subscribe_event for subdevice drivers Dave Stevenson
2022-10-31 12:36 ` Hans Verkuil
2022-10-31 12:40 ` Dave Stevenson
2022-10-31 13:42 ` Jacopo Mondi
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.