linux/drivers/media/dvb-core
Satendra Singh Thakur 57868acc36 media: videobuf2: Add new uAPI for DVB streaming I/O
Adds a new uAPI for DVB to use streaming I/O which is implemented
based on videobuf2, using those new ioctls:

- DMX_REQBUFS:  Request kernel to allocate buffers which count and size
	        are dedicated by user.
- DMX_QUERYBUF: Get the buffer information like a memory offset which
		will mmap() and be shared with user-space.
- DMX_EXPBUF:   Just for testing whether buffer-exporting success or not.
- DMX_QBUF:     Pass the buffer to kernel-space.
- DMX_DQBUF:    Get back the buffer which may contain TS data.

Originally developed by: Junghak Sung <jh1009.sung@samsung.com>, as
seen at:
	https://patchwork.linuxtv.org/patch/31613/
	https://patchwork.kernel.org/patch/7334301/

The original patch was written before merging VB2-core functionalities
upstream. When such series was added, several adjustments were made,
fixing some issues with	V4L2, causing the original patch to be
non-trivially rebased.

After rebased, a few bugs in the patch were fixed. The patch was
also enhanced it and polling functionality got added.

The main changes over the original patch are:

dvb_vb2_fill_buffer():
	- Set the size of the outgoing buffer after while loop using
	  vb2_set_plane_payload;

	- Added NULL check for source buffer as per normal convention
	  of demux driver, this is called twice, first time with valid
	  buffer second time with NULL pointer, if its not handled,
	  it will result in  crash

	- Restricted spinlock for only list_* operations

dvb_vb2_init():
	- Restricted q->io_modes to only VB2_MMAP as its the only
	  supported mode

dvb_vb2_release():
	- Replaced the && in if condiion with &, because otherwise
	  it was always getting satisfied.

dvb_vb2_stream_off():
	- Added list_del code for enqueud buffers upon stream off

dvb_vb2_poll():
	- Added this new function in order to support polling

dvb_demux_poll() and dvb_dvr_poll()
	- dvb_vb2_poll() is now called from these functions

- Ported this patch and latest videobuf2 to lower kernel versions and
  tested auto scan.

Co-developed-by: Junghak Sung <jh1009.sung@samsung.com>

[mchehab@s-opensource.com: checkpatch fixes]
Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Satendra Singh Thakur <satendra.t@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-28 10:59:02 -05:00
..
demux.h media: dvb-core/demux.h: fix kernel-doc warning 2017-07-21 08:01:08 -04:00
dmxdev.c media: videobuf2: Add new uAPI for DVB streaming I/O 2017-12-28 10:59:02 -05:00
dmxdev.h media: videobuf2: Add new uAPI for DVB streaming I/O 2017-12-28 10:59:02 -05:00
dvb_ca_en50221.c media: dvb_ca_en50221: sanity check slot number from userspace 2017-12-14 09:51:17 -05:00
dvb_ca_en50221.h media: dvb_ca_en50221.h: fix checkpatch strict warnings 2017-07-20 15:47:07 -04:00
dvb_demux.c media: dvb_demux.h: document structs defined on it 2017-10-11 13:18:33 -04:00
dvb_demux.h media: dvb_demux: describe nested structs 2017-12-18 09:05:04 -05:00
dvb_frontend.c media: dvb_frontend: add physical layer scrambling support 2017-12-19 07:08:12 -05:00
dvb_frontend.h media: dvb_frontend: add physical layer scrambling support 2017-12-19 07:08:12 -05:00
dvb_math.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
dvb_math.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
dvb_net.c media: dvb_net: let dynamic debug enable some DVB net handling 2017-12-19 06:30:22 -05:00
dvb_net.h media: dvb-net.rst: document DVB network kAPI interface 2017-10-11 13:22:09 -04:00
dvb_ringbuffer.c locking/atomics, media/dvb_ringbuffer: Convert ACCESS_ONCE() to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:00:58 +02:00
dvb_ringbuffer.h scripts/spelling.txt: add "an user" pattern and fix typo instances 2017-02-27 18:43:46 -08:00
dvb_vb2.c media: videobuf2: Add new uAPI for DVB streaming I/O 2017-12-28 10:59:02 -05:00
dvb_vb2.h media: videobuf2: Add new uAPI for DVB streaming I/O 2017-12-28 10:59:02 -05:00
dvb-usb-ids.h media: dvbsky: MyGica T230C support 2017-12-14 06:35:18 -05:00
dvbdev.c Simplify major/minor non-dynamic logic 2017-10-11 15:32:11 -04:00
dvbdev.h media: dvbdev: fully document its functions 2017-10-11 13:01:13 -04:00
Kconfig media: dvb-core: allow users to enable DVB net ULE debug 2017-12-19 06:29:27 -05:00
Makefile media: videobuf2: Add new uAPI for DVB streaming I/O 2017-12-28 10:59:02 -05:00