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 allocation for v4l2



Hello,
I am working with dm8168evm and ezsdk5.05.And we are trying to capture 720p picture and pass the streams to the codec engine.

But I am not sure how to get continous memory for v4l2.

Do I have to memmap the cmem pool memory to the user space?And how the frameQ manage video frames?
I am not quite understand how the captured frames are sent to the codec engine.

Any help is appreciated!

Regards,

yang

  • Hi Yang,

    I can provide you some pointers below, which are discussing the V4L2 memory allocation, hope these will help:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_VIDEO_CAPTURE_Driver_User_Guide#Buffer_Management

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_VPSS_Video_Driver_User_Guide#V4L2_Driver_2

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/230748/810151.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/154472/597334.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/156831/570815.aspx

    Best regards,
    Pavel

  • Thanks,

    Pavel.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/154472.aspx?pi239031349=2

    This link helps me a lot. It mentioned "Best way is to use memroy using cmem kernel module provided by TI, details could be found at http://processors.wiki.ti.com/index.php/CMEM_OverviewSecond method is to allocate buffers from display driver and use it as userPtr for capture driver. But first method of using cmem is best."

    So cmem is recommanded to allocate buffers for v4l2.

    But I don't understand why frame buffer has no restricts.

    http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map .Does the frame buffers allocate in

    IPC_SR_FRAME_BUFFERS 188 MB 0xB3D00000 Shared Region between Host and MC-HDVICP2 and MC-HDVPSS, used to allocate all video buffers

    ?

    And when I use frame buffer for v4l2, could I still use dma to do video data transfer to dsp?

    Best Regards,

    yang

  • Yang,

    User pointer buffers are supported by V4L2 capture driver. Memory mapped buffers are not supported by driver because its almost impossible to get HD size buffers from the kernel.

    Yes, the frame buffers are allocated in IPC_SR_FRAME_BUFFERS.

    Regards,
    Pavel