This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Memory issue under continous mode on DM365

Hi all:

        We will request buffer from capture driver for save raw data, I had print out the buffer size under continous mode on DM365:

                                 ...

                                ioctl(capt_fd, VIDIOC_REQBUFS, &req)

                                 ...

                                 ioctl(capt_fd, VIDIOC_QUERYBUF, &buf)

                                 ...

                                 buf.length=4763648

       Anyone who can help explain why we need allocate so BIG buffer? what is it used for?

       PS: The capture input is 720P, pixel format is YUV420SP

       Thanks.

  • Hi Tracy,

    The VPFE driver for DM365 allocates a pre-defined buffer size of 4763648 bytes for each capture buffer. This is to accomodate a max size of 1080P YUV422 data along with a VGA YUV422 data. Because you are using MMAP buffers, the driver has to allocate some kerrnel memory for these buffers and provide it to application. You can refer to davinci_vpfe.c file to know the buffer allocation sizes. For your particular use, you can reduce the size to a 720P YUV420 if you are sure that you will not need buffers more than this.

    In davinci_vpfe.c

    static u32 channel0_bufsize = (1920 * 1080 * 2) + (640 * 480 * 2);

    Regards,

    Anshuman