[media] s5p-mfc: Add handling of buffer freeing reqbufs request
authorayaka <ayaka@soulik.info>
Sat, 7 May 2016 05:05:24 +0000 (02:05 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 7 Jun 2016 16:02:47 +0000 (13:02 -0300)
The encoder forget the work to call hardware to release its buffers.
This patch came from chromium project. I just change its code
style and make the API match with new kernel.

Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

index 034b5c1d35a13e4aa8c2142e8355ae15a0879635..a66a9f906b046b810cb7dc83fea554ac04b2b22a 100644 (file)
@@ -1144,7 +1144,10 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                return -EINVAL;
        if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
                if (reqbufs->count == 0) {
+                       mfc_debug(2, "Freeing buffers\n");
                        ret = vb2_reqbufs(&ctx->vq_dst, reqbufs);
+                       s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers,
+                                       ctx);
                        ctx->capture_state = QUEUE_FREE;
                        return ret;
                }