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

Commit 2914e726 authored by Prabhakar Lad's avatar Prabhakar Lad Committed by Mauro Carvalho Chehab
Browse files

[media] media: s3c-camif: 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: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 97bf6af1
Loading
Loading
Loading
Loading
+3 −14
Original line number Original line Diff line number Diff line
@@ -536,24 +536,12 @@ static void buffer_queue(struct vb2_buffer *vb)
	spin_unlock_irqrestore(&camif->slock, flags);
	spin_unlock_irqrestore(&camif->slock, flags);
}
}


static void camif_lock(struct vb2_queue *vq)
{
	struct camif_vp *vp = vb2_get_drv_priv(vq);
	mutex_lock(&vp->camif->lock);
}

static void camif_unlock(struct vb2_queue *vq)
{
	struct camif_vp *vp = vb2_get_drv_priv(vq);
	mutex_unlock(&vp->camif->lock);
}

static const struct vb2_ops s3c_camif_qops = {
static const struct vb2_ops s3c_camif_qops = {
	.queue_setup	 = queue_setup,
	.queue_setup	 = queue_setup,
	.buf_prepare	 = buffer_prepare,
	.buf_prepare	 = buffer_prepare,
	.buf_queue	 = buffer_queue,
	.buf_queue	 = buffer_queue,
	.wait_prepare	 = camif_unlock,
	.wait_prepare	 = vb2_ops_wait_prepare,
	.wait_finish	 = camif_lock,
	.wait_finish	 = vb2_ops_wait_finish,
	.start_streaming = start_streaming,
	.start_streaming = start_streaming,
	.stop_streaming	 = stop_streaming,
	.stop_streaming	 = stop_streaming,
};
};
@@ -1161,6 +1149,7 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
	q->buf_struct_size = sizeof(struct camif_buffer);
	q->buf_struct_size = sizeof(struct camif_buffer);
	q->drv_priv = vp;
	q->drv_priv = vp;
	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
	q->lock = &vp->camif->lock;


	ret = vb2_queue_init(q);
	ret = vb2_queue_init(q);
	if (ret)
	if (ret)