Skip to content

RFC Move priority handling into the core

Hans Verkuil linux-media 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest16 patches 1 replyIn review
  2. v2 RFC10 patches 4 repliesSuperseded
  3. v1 RFC10 patches 4 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16v4l2_prio: move from v4l2-common to v4l2-dev.drivers/media/video/v4l2-common.c drivers/media/video/v4l2-dev.c include/media/v4l2-common.h +1 more+79 -780 replies
2/16v4l2: add v4l2_prio_state to v4l2_device and video_devicedrivers/media/video/v4l2-dev.c drivers/media/video/v4l2-device.c include/media/v4l2-dev.h +1 more+13 -00 replies
3/16v4l2-fh: implement v4l2_priority support.drivers/media/video/v4l2-fh.c include/media/v4l2-fh.h+5 -00 replies
4/16v4l2-fh: add v4l2_fh_open and v4l2_fh_release helper functionsdrivers/media/video/v4l2-fh.c include/media/v4l2-fh.h+43 -00 replies
5/16v4l2-ioctl: add priority handling support.drivers/media/radio/radio-si4713.c drivers/media/video/cx18/cx18-ioctl.c drivers/media/video/davinci/vpfe_capture.c +5 more+68 -141 reply
6/16v4l2-fh: add v4l2_fh_is_singulardrivers/media/video/v4l2-fh.c include/media/v4l2-fh.h+27 -00 replies
7/16ivtv: convert to core priority handling.drivers/media/video/ivtv/ivtv-driver.h drivers/media/video/ivtv/ivtv-fileops.c drivers/media/video/ivtv/ivtv-ioctl.c+15 -450 replies
8/16ivtv: use core-assisted locking.drivers/media/video/ivtv/ivtv-fileops.c drivers/media/video/ivtv/ivtv-ioctl.c drivers/media/video/ivtv/ivtv-streams.c+3 -310 replies
9/16radio_mr800: use video_drvdata instead of filp->private_datadrivers/media/radio/radio-mr800.c+8 -90 replies
10/16radio-mr800: remove autopm support.drivers/media/radio/radio-mr800.c+8 -590 replies
11/16radio-mr800: Add priority support.drivers/media/radio/radio-mr800.c+3 -00 replies
12/16radio-cadet: convert to core-assisted lockingdrivers/media/radio/radio-cadet.c+11 -400 replies
13/16radio-cadet: use v4l2_fh helper functionsdrivers/media/radio/radio-cadet.c+6 -70 replies
14/16radio-maxiradio: convert to core-assisted lockingdrivers/media/radio/radio-maxiradio.c+3 -120 replies
15/16radio-maxiradio: implement priority handlingdrivers/media/radio/radio-maxiradio.c+3 -00 replies
16/16v4l2-framework.txt: improve v4l2_fh/priority documentationDocumentation/video4linux/v4l2-framework.txt+87 -330 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [RFCv3 PATCH 0/16] Move priority handling into the core

This is the third attempt at moving priority handling into the core.

I have added two helper functions that allocate and free just a single v4l2_fh struct. This can be used by drivers that do not need to embed the struct v4l2_fh into a larger struct.

This is not longer called implicitly by the core. Drivers much explicitly use struct v4l2_fh in order to support priority handling.

Also added a new helper function to detect whether a file handle is the only open file handle for the associated device node. Many drivers need to do something on the first open or last close and they all do some use counting to keep track of that. With v4l2_fh we already have that information, so a simple function will make that available to the driver.

Finally some documentation was also added.

This patch series converts radio-mr800 (removing the bogus autopm support allows us to remove the open/release support), radio-cadet (typical first-time open and close code, shows how easy it is to use the helper functions) and radio-maxiradio.

ivtv is also converted as it is currently the only driver that embeds struct v4l2_fh.

Tested for all converted drivers except for radio-cadet due to lack of hardware.

Core support for priority handling is necessary in order to have consistent handling of priorities and to handle priorities and the control framework.

Comments are welcome!

Regards,

Hans