Commit 53c51492 authored by Pawel Osciak's avatar Pawel Osciak Committed by Mauro Carvalho Chehab

[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: default avatarPawel Osciak <posciak@chromium.org>
Signed-off-by: default avatarKiran AVND <avnd.kiran@samsung.com>
Signed-off-by: default avatarArun Kumar K <arun.kk@samsung.com>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent c4b1ce05
...@@ -1147,6 +1147,11 @@ static int vidioc_reqbufs(struct file *file, void *priv, ...@@ -1147,6 +1147,11 @@ static int vidioc_reqbufs(struct file *file, void *priv,
(reqbufs->memory != V4L2_MEMORY_USERPTR)) (reqbufs->memory != V4L2_MEMORY_USERPTR))
return -EINVAL; return -EINVAL;
if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
if (reqbufs->count == 0) {
ret = vb2_reqbufs(&ctx->vq_dst, reqbufs);
ctx->capture_state = QUEUE_FREE;
return ret;
}
if (ctx->capture_state != QUEUE_FREE) { if (ctx->capture_state != QUEUE_FREE) {
mfc_err("invalid capture state: %d\n", mfc_err("invalid capture state: %d\n",
ctx->capture_state); ctx->capture_state);
...@@ -1168,6 +1173,14 @@ static int vidioc_reqbufs(struct file *file, void *priv, ...@@ -1168,6 +1173,14 @@ static int vidioc_reqbufs(struct file *file, void *priv,
return -ENOMEM; return -ENOMEM;
} }
} else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { } else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
if (reqbufs->count == 0) {
mfc_debug(2, "Freeing buffers\n");
ret = vb2_reqbufs(&ctx->vq_src, reqbufs);
s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers,
ctx);
ctx->output_state = QUEUE_FREE;
return ret;
}
if (ctx->output_state != QUEUE_FREE) { if (ctx->output_state != QUEUE_FREE) {
mfc_err("invalid output state: %d\n", mfc_err("invalid output state: %d\n",
ctx->output_state); ctx->output_state);
......
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