AnsweredAssumed Answered

Imx7 ov5640 request buffer problem

Question asked by Ananthapadmanaban Gururajan on Sep 28, 2017

Hi All,


I am using imx7 saber board ov5640_mipi.c driver.

I have a problem in using the camera driver available at drivers/media/platform/mxc/subdev/ in linux-4.1.15 kernel.


On 1st time, i was able to get buffer from mxc_v4l2_capture.c (available in imx-test-5.7). But when i looped the following code in mxc_v4l2_capture application, i end up in REQ_BUF Failure from the driver.

    while (1) {
        fd_v4l = v4l_capture_setup();
        v4l_capture_test(fd_v4l, argv[argc-1]);
On debugging found that VIDIOC_REQBUFS ioctl  __buffers_in_use(q) more than 1 (2 active users).


On commenting drivers/media/v4l2-core/videobuf2-core.c __reqbufs function, i was able to run mxc_v4l2_capture.out multiple times with out error

#if 0
        if (q->memory == V4L2_MEMORY_MMAP && __buffers_in_use(q)) {
            dprintk(1, "memory in use, cannot free\n");
            printk("%s %s %d\n", __FILE__, __func__, __LINE__);
            return -EBUSY;


My Queries

1. buf->refcount is 2, when the buffers are trying to free at drivers/media/v4l2-core/videobuf2-dma-contig.c vb2_dc_put function and the complete freeing only done at vb2_queue_release drivers/media/v4l2-core/videobuf2-core.c called at the end of application execution. How come refcount becomes 2 (Please refer patch and logs) ?


2. Is there any other stable branch for imx7 saber board camera driver ?


Thanks and regards,


Original Attachment has been moved to:

Original Attachment has been moved to: