media: s5p_mfc: Mark buffer as requested after it is indeed allocated 97/25897/2
authorZhaowei Yuan <zhaowei.yuan@samsung.com>
Tue, 12 Aug 2014 09:08:18 +0000 (17:08 +0800)
committerSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 25 Aug 2014 10:03:54 +0000 (03:03 -0700)
Ctx->capture_state should be set as QUEUE_BUFS_REQUESTED after the buffer is
indeed allocated successfully.

Change-Id: I6498733e49adc1186a6007e9f6b4d8953af1dcbe
Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c

index c6d18d0..7b18a50 100644 (file)
@@ -534,7 +534,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                        mfc_err("Bufs have already been requested\n");
                        return -EINVAL;
                }
-               ctx->capture_state = QUEUE_BUFS_REQUESTED;
+
                s5p_mfc_clock_on();
                ret = vb2_reqbufs(&ctx->vq_dst, reqbufs);
                s5p_mfc_clock_off();
@@ -543,6 +543,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                        return ret;
                }
 
+               ctx->capture_state = QUEUE_BUFS_REQUESTED;
                ctx->total_dpb_count = reqbufs->count;
                ret = s5p_mfc_hw_call(dev->mfc_ops, alloc_codec_buffers, ctx);
                if (ret) {