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.

Copy YUV FrameBufs from PhyAddr to Linux user memery in DM8127 RDK 3.2

Dear All,

Where is the DMA Funs can Copy Phyaddr to Viraddr In the RDK 3.2 for Linux Demo AP.

It is not for Dsp or Iss and Vpss. It is for Linux AP Layer.

Thanks. 

  • Which RDK are you using .Is it IPNC RDK or DVR RDK or some other RDK ?

  • Dear Sir,

    Sorry about I forgot to mention which of RDK I use.

    I use IPNC-RDK 3.2 and I want copy yuv data (1920x1080) form framebufs to my malloc memory via DMA on Linux AP layer. 

    Thank you.

  • If source and destination buffers are physically contiguous you can use the OSA_dma APIs from linux user space to do DMA copy.

    Pls refer APIs at mcfw/src_linux/osa/inc/osa_dma.h

    The yuv frame buffer is already physically contiguous.

    Howvever as you are aware malloc buffer will not be physically contiguous and you cannot use this method.

    Doing DMA to non-physically contiguous memory will not be efficient and is tricky as you will have to split it into a series of 4K xfers and chain them.We dont have any reference code to do this.

    One option is to use cmem to allocate physically contiguous buffer for the destination buffer as well.

    Below link provides good intro to usage of DMA in linux kernel if you want to use scatter-gather list.

    http://www.linuxjournal.com/article/7104

  • Dear Sir,

    Thank you so much.

    I ask this question because I want to send 1920x1080 yuv data via UDP net port to Computer.

    But I can not get that in Full feature mode so I use capture display mode now.

    (1).

    After this fun: 

    status =  Vcam_getFullVideoFrames(&bufList,0);

    I will get a PhyAddr: pBuf->phyAddr[0][0] (Size is 1920x1080)

    (2).

    Then I will split it to each 51200 bytes(malloc on AP layer) so I use mmap fun to get a VirAddr and 81 times memcpy.

    App_mMap( (UInt32)(pBuf->phyAddr[0][0]), frameSize, &pMemVirtAddr );

    for( i=0; i<81; i++ )
    memcpy(t,(Ptr)pMemVirtAddr,UDP_MAX);

    (3).

    Those funs will cost 300ms. It is too long.

    Now I will follow your offer advise to use cmem malloc buf for split YUV data 

    Would you mind tell me again.

    Where is the reference for cmem.

    Thank you.

  • When doing App_memMap are you mapping it as cached or non-cached buffer ? Making it non-cached will siginificantly affect performance. Anyhow using EDMA is the best option for large copies. 

    CMEM is part of IPNC RDK. Pls refer IPNC RDK documentation.CMEM overview: http://processors.wiki.ti.com/index.php/CMEM_Overview

     

  • Dear Sir,

    Thank you for your Link, I will study it.

    But when I doing App_memMap fun I don't know it is cached or non-cached and I also don't know what is cached or not means.

    This fun is from RDK 3.2 and I just use it and try.

    Sorry about that.

    I thank I will use DMA only, because I need 30 YUV data per second to PC. ( I hope)...orz

    anyway thank you again.