Commit a4056c2f authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] solo6x10: convert the display node to vb2

As a consequence the ioctl op has been replaced by unlocked_ioctl.
Since we are now using the core lock the locking scheme has been
simplified as well.
The main reason for converting this driver to vb2 was that the locking
scheme in v4l2.c was hopeless. It was easier to just convert the driver
then to try and salvage a threading and videobuf nightmare.
The videobuf2 framework is far, far superior compared to the old videobuf.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 382c31a9
config SOLO6X10
tristate "Softlogic 6x10 MPEG codec cards"
depends on PCI && VIDEO_DEV && SND && I2C
select VIDEOBUF_DMA_SG
select VIDEOBUF2_DMA_SG
select VIDEOBUF2_DMA_CONTIG
select SND_PCM
---help---
This driver supports the Softlogic based MPEG-4 and h.264 codec
......
......@@ -39,7 +39,6 @@
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/videobuf-core.h>
#include <media/videobuf2-core.h>
#include "registers.h"
......@@ -259,8 +258,6 @@ struct solo_dev {
/* Ring thread */
struct task_struct *ring_thread;
wait_queue_head_t ring_thread_wait;
atomic_t enc_users;
atomic_t disp_users;
/* VOP_HEADER handling */
void *vh_buf;
......@@ -268,8 +265,10 @@ struct solo_dev {
int vh_size;
/* Buffer handling */
struct videobuf_queue vidq;
struct vb2_queue vidq;
struct vb2_alloc_ctx *alloc_ctx;
struct task_struct *kthread;
struct mutex lock;
spinlock_t slock;
int old_write;
struct list_head vidq_active;
......
......@@ -41,11 +41,6 @@
#define MP4_QS 16
#define DMA_ALIGN 4096
struct solo_videobuf {
struct videobuf_buffer vb;
unsigned int flags;
};
/* 6010 M4V */
static unsigned char vop_6010_ntsc_d1[] = {
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x20,
......@@ -672,9 +667,6 @@ static void solo_enc_buf_queue(struct vb2_buffer *vb)
static int solo_ring_start(struct solo_dev *solo_dev)
{
if (atomic_inc_return(&solo_dev->enc_users) > 1)
return 0;
solo_dev->ring_thread = kthread_run(solo_ring_thread, solo_dev,
SOLO6X10_NAME "_ring");
if (IS_ERR(solo_dev->ring_thread)) {
......@@ -690,9 +682,6 @@ static int solo_ring_start(struct solo_dev *solo_dev)
static void solo_ring_stop(struct solo_dev *solo_dev)
{
if (atomic_dec_return(&solo_dev->enc_users) > 0)
return;
if (solo_dev->ring_thread) {
kthread_stop(solo_dev->ring_thread);
solo_dev->ring_thread = NULL;
......@@ -1279,7 +1268,6 @@ int solo_enc_v4l2_init(struct solo_dev *solo_dev, unsigned nr)
{
int i;
atomic_set(&solo_dev->enc_users, 0);
init_waitqueue_head(&solo_dev->ring_thread_wait);
solo_dev->vh_size = sizeof(struct vop_header);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment