Commit c747404d authored by Prabhakar Lad's avatar Prabhakar Lad Committed by Mauro Carvalho Chehab

[media] media: s5p-tv: use vb2_ops_wait_prepare/finish helper

This patch drops driver specific wait_prepare() and
wait_finish() callbacks from vb2_ops and instead uses
the the helpers vb2_ops_wait_prepare/finish() provided
by the vb2 core, the lock member of the queue needs
to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.
Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 8776ff65
...@@ -926,22 +926,6 @@ static void buf_queue(struct vb2_buffer *vb) ...@@ -926,22 +926,6 @@ static void buf_queue(struct vb2_buffer *vb)
mxr_dbg(mdev, "queuing buffer\n"); mxr_dbg(mdev, "queuing buffer\n");
} }
static void wait_lock(struct vb2_queue *vq)
{
struct mxr_layer *layer = vb2_get_drv_priv(vq);
mxr_dbg(layer->mdev, "%s\n", __func__);
mutex_lock(&layer->mutex);
}
static void wait_unlock(struct vb2_queue *vq)
{
struct mxr_layer *layer = vb2_get_drv_priv(vq);
mxr_dbg(layer->mdev, "%s\n", __func__);
mutex_unlock(&layer->mutex);
}
static int start_streaming(struct vb2_queue *vq, unsigned int count) static int start_streaming(struct vb2_queue *vq, unsigned int count)
{ {
struct mxr_layer *layer = vb2_get_drv_priv(vq); struct mxr_layer *layer = vb2_get_drv_priv(vq);
...@@ -1040,8 +1024,8 @@ static void stop_streaming(struct vb2_queue *vq) ...@@ -1040,8 +1024,8 @@ static void stop_streaming(struct vb2_queue *vq)
static struct vb2_ops mxr_video_qops = { static struct vb2_ops mxr_video_qops = {
.queue_setup = queue_setup, .queue_setup = queue_setup,
.buf_queue = buf_queue, .buf_queue = buf_queue,
.wait_prepare = wait_unlock, .wait_prepare = vb2_ops_wait_prepare,
.wait_finish = wait_lock, .wait_finish = vb2_ops_wait_finish,
.start_streaming = start_streaming, .start_streaming = start_streaming,
.stop_streaming = stop_streaming, .stop_streaming = stop_streaming,
}; };
...@@ -1122,6 +1106,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev, ...@@ -1122,6 +1106,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev,
.ops = &mxr_video_qops, .ops = &mxr_video_qops,
.min_buffers_needed = 1, .min_buffers_needed = 1,
.mem_ops = &vb2_dma_contig_memops, .mem_ops = &vb2_dma_contig_memops,
.lock = &layer->mutex,
}; };
return layer; return layer;
......
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