Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ded351a authored by Marin Mitov's avatar Marin Mitov Committed by Greg Kroah-Hartman
Browse files

staging: use videobuf2 framework for drivers/staging/dt3155v4l driver



This patch transforms drivers/staging/dt3155v4l driver to use videobuf2 framework.
Tested and works with "xawtv -f".

Either streaming API or read method should be selected during kernel configuration.

If both are selected into the driver (not possible without another patching),
either due to my misunderstanding or problems in xawtv (or both), I get kernel panic
after some start/stop of xawtv (not strictly reproducible).

Signed-off-by: default avatarMarin Mitov <mitov@issp.bas.bg>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7a176332
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
config VIDEO_DT3155
	tristate "DT3155 frame grabber, Video4Linux interface"
	depends on PCI && VIDEO_DEV && VIDEO_V4L2
	select VIDEOBUF_DMA_CONTIG
	select VIDEOBUF2_DMA_CONTIG
	default n
	---help---
	  Enables dt3155 device driver for the DataTranslation DT3155 frame grabber.
@@ -18,3 +18,11 @@ config DT3155_CCIR
	---help---
	  Select it for CCIR/50Hz (European region),
	  or leave it unselected for RS-170/60Hz (North America).

config DT3155_STREAMING
	bool "Selects streaming capture method"
	depends on VIDEO_DT3155
	default y
	---help---
	  Select it if you want to use streaming of memory mapped buffers
	  or leave it unselected if you want to use read method (one copy more).
+169 −317

File changed.

Preview size limit exceeded, changes collapsed.

+6 −16
Original line number Diff line number Diff line
@@ -179,18 +179,13 @@ struct dt3155_stats {
 * struct dt3155_priv - private data structure
 *
 * @vdev:		pointer to video_device structure
 * @acq_fp		pointer to filp that starts acquisition
 * @streaming		streaming is negotiated
 * @pdev:		pointer to pci_dev structure
 * @vidq		pointer to videobuf_queue structure
 * @q			pointer to vb2_queue structure
 * @curr_buf:		pointer to curren buffer
 * @thread		pointer to worker thraed
 * @mux:		mutex to protect the instance
 * @irq_handler:	irq handler for the driver
 * @qt_ops		local copy of dma-contig qtype_ops
 * @dmaq		queue for dma buffers
 * @do_dma		wait queue of the kernel thread
 * @mux:		mutex to protect the instance
 * @lock		spinlock for videobuf queues
 * @lock		spinlock for dma queue
 * @field_count		fields counter
 * @stats:		statistics structure
 * @users		open count
@@ -200,17 +195,12 @@ struct dt3155_stats {
 */
struct dt3155_priv {
	struct video_device *vdev;
	struct file *acq_fp;
	int streaming;
	struct pci_dev *pdev;
	struct videobuf_queue *vidq;
	struct videobuf_buffer *curr_buf;
	struct task_struct *thread;
	struct vb2_queue *q;
	struct vb2_buffer *curr_buf;
	struct mutex mux;
	irq_handler_t irq_handler;
	struct videobuf_qtype_ops qt_ops;
	struct list_head dmaq;
	wait_queue_head_t do_dma;
	struct mutex mux;
	spinlock_t lock;
	unsigned int field_count;
	struct dt3155_stats stats;