Skip to content

RFC Move VIDIOC_G/S_PRIORITY handling to the V4L core

Hans Verkuil linux-media 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7v4l2_prio: move from v4l2-common to v4l2-device.drivers/media/video/cpia2/cpia2.h drivers/media/video/pvrusb2/pvrusb2-v4l2.c drivers/media/video/v4l2-common.c +3 more+78 -740 replies
2/7v4l2-device: add v4l2_prio_state to v4l2_device.drivers/media/video/v4l2-device.c include/media/v4l2-device.h+3 -00 replies
3/7v4l2-fh: implement v4l2_priority support.drivers/media/video/v4l2-fh.c include/media/v4l2-fh.h+5 -00 replies
4/7v4l2-dev: add and support flag V4L2_FH_USE_PRIO.drivers/media/video/v4l2-dev.c include/media/v4l2-dev.h+27 -20 replies
5/7v4l2-ioctl: add priority handling support.drivers/media/video/v4l2-ioctl.c+58 -60 replies
6/7ivtv: drop priority handling, use core framework for this.drivers/media/video/ivtv/ivtv-driver.h drivers/media/video/ivtv/ivtv-fileops.c drivers/media/video/ivtv/ivtv-ioctl.c+0 -450 replies
7/7ivtv: add priority checks for the non-standard commands.drivers/media/video/ivtv/ivtv-ioctl.c+19 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] [RFC] Move VIDIOC_G/S_PRIORITY handling to the V4L core

Few drivers implement VIDIOC_G/S_PRIORITY and those that do often implement it incorrectly.

Now that we have a v4l2_fh struct it is easy to add support for priority handling to the v4l core framework.

There are three types of drivers:

1) Those that use v4l2_fh. There the local priority can be stored in the v4l2_fh struct.

2) Those that do not have an open or release function defined in v4l2_file_ops. That means that file->private_data will never be filled and so we can use that to store the local priority in.

3) Others. In all other cases we leave it to the driver. Of course, the goal is to eventually move the 'others' into type 1 or 2.

This patch series shows how it is done and converts ivtv to rely on the core framework instead of doing it manually.

Comments?

Regards,

Hans

Hans Verkuil (7):
v4l2_prio: move from v4l2-common to v4l2-device.
v4l2-device: add v4l2_prio_state to v4l2_device.
v4l2-fh: implement v4l2_priority support.
v4l2-dev: add and support flag V4L2_FH_USE_PRIO.
v4l2-ioctl: add priority handling support.
ivtv: drop priority handling, use core framework for this.
ivtv: add priority checks for the non-standard commands.

 drivers/media/video/cpia2/cpia2.h          |    1 +
 drivers/media/video/ivtv/ivtv-driver.h     |    2 -
 drivers/media/video/ivtv/ivtv-fileops.c    |    2 -
 drivers/media/video/ivtv/ivtv-ioctl.c      |   61 ++++++++------------------
 drivers/media/video/pvrusb2/pvrusb2-v4l2.c |    1 +
 drivers/media/video/v4l2-common.c          |   59 -------------------------
 drivers/media/video/v4l2-dev.c             |   23 +++++++++-
 drivers/media/video/v4l2-device.c          |   62 +++++++++++++++++++++++++++
 drivers/media/video/v4l2-fh.c              |    4 ++
 drivers/media/video/v4l2-ioctl.c           |   64 +++++++++++++++++++++++++---
 include/media/v4l2-common.h                |   15 -------
 include/media/v4l2-dev.h                   |    6 +++
 include/media/v4l2-device.h                |   17 +++++++
 include/media/v4l2-fh.h                    |    1 +
 14 files changed, 190 insertions(+), 128 deletions(-)