diff options
author | Pawel Osciak <posciak@chromium.org> | 2014-10-21 07:06:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-28 13:42:21 -0400 |
commit | 53c51492d6e800fad07cb0fdaf68a5515ebf3058 (patch) | |
tree | d2d1eb65ee39ebf674305b1c57e5ab15a129484d | |
parent | c4b1ce051e1f5c1e82cf25f35e24460a9ece993c (diff) |
[media] s5p-mfc: Fix REQBUFS(0) for encoder
Handle REQBUFS(0) for CAPTURE queue as well. Also use the proper queue to call
it on for OUTPUT.
Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index 4816f31acf68..6a1c890a390d 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | |||
@@ -1147,6 +1147,11 @@ static int vidioc_reqbufs(struct file *file, void *priv, | |||
1147 | (reqbufs->memory != V4L2_MEMORY_USERPTR)) | 1147 | (reqbufs->memory != V4L2_MEMORY_USERPTR)) |
1148 | return -EINVAL; | 1148 | return -EINVAL; |
1149 | if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { | 1149 | if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { |
1150 | if (reqbufs->count == 0) { | ||
1151 | ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); | ||
1152 | ctx->capture_state = QUEUE_FREE; | ||
1153 | return ret; | ||
1154 | } | ||
1150 | if (ctx->capture_state != QUEUE_FREE) { | 1155 | if (ctx->capture_state != QUEUE_FREE) { |
1151 | mfc_err("invalid capture state: %d\n", | 1156 | mfc_err("invalid capture state: %d\n", |
1152 | ctx->capture_state); | 1157 | ctx->capture_state); |
@@ -1168,6 +1173,14 @@ static int vidioc_reqbufs(struct file *file, void *priv, | |||
1168 | return -ENOMEM; | 1173 | return -ENOMEM; |
1169 | } | 1174 | } |
1170 | } else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { | 1175 | } else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { |
1176 | if (reqbufs->count == 0) { | ||
1177 | mfc_debug(2, "Freeing buffers\n"); | ||
1178 | ret = vb2_reqbufs(&ctx->vq_src, reqbufs); | ||
1179 | s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, | ||
1180 | ctx); | ||
1181 | ctx->output_state = QUEUE_FREE; | ||
1182 | return ret; | ||
1183 | } | ||
1171 | if (ctx->output_state != QUEUE_FREE) { | 1184 | if (ctx->output_state != QUEUE_FREE) { |
1172 | mfc_err("invalid output state: %d\n", | 1185 | mfc_err("invalid output state: %d\n", |
1173 | ctx->output_state); | 1186 | ctx->output_state); |