diff options
author | Prabhakar Lad <prabhakar.csengg@gmail.com> | 2014-11-26 17:42:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-22 11:36:21 -0500 |
commit | 654a731be1a0b6f606f3f3d12b50db08f2ae3c34 (patch) | |
tree | 622c70f8f42970731759e756aac18c6d7b16a17c /drivers | |
parent | c747404dbf2dcc0d8cb5d2e8aee5810b6ebba496 (diff) |
[media] media: s5p-mfc: 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: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Kamil Debski <k.debski@samsung.com>
Cc: Jeongtae Park <jtp.park@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 | ||||
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 20 | ||||
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 20 |
3 files changed, 5 insertions, 36 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index fbfdf03b9054..8e44a59d8ec2 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c | |||
@@ -810,6 +810,7 @@ static int s5p_mfc_open(struct file *file) | |||
810 | q = &ctx->vq_dst; | 810 | q = &ctx->vq_dst; |
811 | q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 811 | q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
812 | q->drv_priv = &ctx->fh; | 812 | q->drv_priv = &ctx->fh; |
813 | q->lock = &dev->mfc_mutex; | ||
813 | if (vdev == dev->vfd_dec) { | 814 | if (vdev == dev->vfd_dec) { |
814 | q->io_modes = VB2_MMAP; | 815 | q->io_modes = VB2_MMAP; |
815 | q->ops = get_dec_queue_ops(); | 816 | q->ops = get_dec_queue_ops(); |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index c6c3452ccca1..9b14827ef4b9 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | |||
@@ -944,22 +944,6 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, | |||
944 | return 0; | 944 | return 0; |
945 | } | 945 | } |
946 | 946 | ||
947 | static void s5p_mfc_unlock(struct vb2_queue *q) | ||
948 | { | ||
949 | struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); | ||
950 | struct s5p_mfc_dev *dev = ctx->dev; | ||
951 | |||
952 | mutex_unlock(&dev->mfc_mutex); | ||
953 | } | ||
954 | |||
955 | static void s5p_mfc_lock(struct vb2_queue *q) | ||
956 | { | ||
957 | struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); | ||
958 | struct s5p_mfc_dev *dev = ctx->dev; | ||
959 | |||
960 | mutex_lock(&dev->mfc_mutex); | ||
961 | } | ||
962 | |||
963 | static int s5p_mfc_buf_init(struct vb2_buffer *vb) | 947 | static int s5p_mfc_buf_init(struct vb2_buffer *vb) |
964 | { | 948 | { |
965 | struct vb2_queue *vq = vb->vb2_queue; | 949 | struct vb2_queue *vq = vb->vb2_queue; |
@@ -1107,8 +1091,8 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) | |||
1107 | 1091 | ||
1108 | static struct vb2_ops s5p_mfc_dec_qops = { | 1092 | static struct vb2_ops s5p_mfc_dec_qops = { |
1109 | .queue_setup = s5p_mfc_queue_setup, | 1093 | .queue_setup = s5p_mfc_queue_setup, |
1110 | .wait_prepare = s5p_mfc_unlock, | 1094 | .wait_prepare = vb2_ops_wait_prepare, |
1111 | .wait_finish = s5p_mfc_lock, | 1095 | .wait_finish = vb2_ops_wait_finish, |
1112 | .buf_init = s5p_mfc_buf_init, | 1096 | .buf_init = s5p_mfc_buf_init, |
1113 | .start_streaming = s5p_mfc_start_streaming, | 1097 | .start_streaming = s5p_mfc_start_streaming, |
1114 | .stop_streaming = s5p_mfc_stop_streaming, | 1098 | .stop_streaming = s5p_mfc_stop_streaming, |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index bd64f1dcbdb5..ac12f653ddce 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | |||
@@ -1867,22 +1867,6 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, | |||
1867 | return 0; | 1867 | return 0; |
1868 | } | 1868 | } |
1869 | 1869 | ||
1870 | static void s5p_mfc_unlock(struct vb2_queue *q) | ||
1871 | { | ||
1872 | struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); | ||
1873 | struct s5p_mfc_dev *dev = ctx->dev; | ||
1874 | |||
1875 | mutex_unlock(&dev->mfc_mutex); | ||
1876 | } | ||
1877 | |||
1878 | static void s5p_mfc_lock(struct vb2_queue *q) | ||
1879 | { | ||
1880 | struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); | ||
1881 | struct s5p_mfc_dev *dev = ctx->dev; | ||
1882 | |||
1883 | mutex_lock(&dev->mfc_mutex); | ||
1884 | } | ||
1885 | |||
1886 | static int s5p_mfc_buf_init(struct vb2_buffer *vb) | 1870 | static int s5p_mfc_buf_init(struct vb2_buffer *vb) |
1887 | { | 1871 | { |
1888 | struct vb2_queue *vq = vb->vb2_queue; | 1872 | struct vb2_queue *vq = vb->vb2_queue; |
@@ -2052,8 +2036,8 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) | |||
2052 | 2036 | ||
2053 | static struct vb2_ops s5p_mfc_enc_qops = { | 2037 | static struct vb2_ops s5p_mfc_enc_qops = { |
2054 | .queue_setup = s5p_mfc_queue_setup, | 2038 | .queue_setup = s5p_mfc_queue_setup, |
2055 | .wait_prepare = s5p_mfc_unlock, | 2039 | .wait_prepare = vb2_ops_wait_prepare, |
2056 | .wait_finish = s5p_mfc_lock, | 2040 | .wait_finish = vb2_ops_wait_finish, |
2057 | .buf_init = s5p_mfc_buf_init, | 2041 | .buf_init = s5p_mfc_buf_init, |
2058 | .buf_prepare = s5p_mfc_buf_prepare, | 2042 | .buf_prepare = s5p_mfc_buf_prepare, |
2059 | .start_streaming = s5p_mfc_start_streaming, | 2043 | .start_streaming = s5p_mfc_start_streaming, |