• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » DaVinci™ Video Processors » DM816x, C6A816x and AM389x Processors Forum » How to make shared region 2 cachable for cortex A8?
Share
DaVinci™ Video Processors
  • Forums
  • Announcements
Options
  • Subscribe via RSS

How to make shared region 2 cachable for cortex A8?

How to make shared region 2 cachable for cortex A8?

This question is not answered
Gabi Gvili
Posted by Gabi Gvili
on Aug 09 2012 08:43 AM
Genius3795 points

Hi all,

I am working with TI8168 with EZSDK ver 5.03, My code is based on the OMX example capture_encode, i need the A8 to perform some minor calculations on the HD buffer, these calculations are perfomed in a frame rate of 1fps, and this is because shared memory region 2 where video frames are allocated is not cachable by A8.
How can i make shared region 2 cacheable for the cortex A8 ?

Thanks,
Gabi 

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • _Ralph_
    Posted by _Ralph_
    on Aug 10 2012 04:15 AM
    Mastermind7955 points

    Hi Gabi,

    Have you tried digging into the OpenMAX code? If you follow the OMX_AllocateBuffer call in the user application, you see that this calls omxproxy_alloc_buffer which is defined in ti-ezsdk_dm816x-evm_5_04_00_11\component-sources\omx_05_02_00_38\src\ti\omx\domx\OmxProxy.c.

    This calls OmxRpc_stubAllocBuffer (pComponentPrivate->rpcHandle,
                                           (OmxCore_OMX_BUFFERHEADERTYPE *)
                                           pBufferHeader, nPortIndex, pAppPrivate,
                                           nSizeBytes,
                                           (OmxTypes_OMX_U8 **) & pBuffer,
                                           (OmxTypes_OMX_U32 *) & pBufferMapped,
                                           (OmxCore_OMX_BUFFERHEADERTYPE **) &
                                           pBufHeaderRemote,
                                           (OmxCore_OMX_ERRORTYPE *) & eError);

    Which calls:

    OMXRPC_STUB_TEMPLATE (pRpcHndl,
                            pRpcMsg,
                            retVal,
                            OmxRpc_cmdAllocBuffer,
                            allocbuffer,
                            (&pRpcMsg->api.allocBuffer, nPortIndex, pAppPrivate,
                             nSizeBytes),
                            (&pRpcMsg->api.allocBufferResponse, ppBufHeaderRemote,
                             pBufferHdr, &nBufferMapped, *nCmdStatus), nCmdStatus);

    Which calls:

    omxrpc_msg_marshall_allocbuffer(&pRpcMsg->api.allocBuffer, nPortIndex, pAppPrivate, nSizeBytes)

    &pRpcMsg->api.allocBuffer->nSizeBytes = nSizeBytes

    pRpcMsg = &rcmMsg->data

    OmxRpc_rcmExec ((RcmClient_Handle)pRpcHndl->client.handle,        \
                                 rcmMsg,                                           \
                                 fxnId);

    This calls RcmClient_exec (rcmHndl, rcmMsg, &rcmMsg);

    and then we get into the magical work of IPC. Presumably the media controller reserves the memory over IPC/Syslink. If you can find out the way in which this memory is reserved you might be sorted, but this would involve tapping into the IPC messages from the media controller.

    Ultimately, I think you'd have to create a mapping in Linux such that you can mark the reserved memory as cached. I think CMEM might be able to do this so it might be worth looking at its source code to see how you can mark Shared Region 2 as cached.

    This probably doesn't help you much, but I thought some response was better than none... :-/


    Ralph

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vimal Jain
    Posted by Vimal Jain
    on Aug 10 2012 23:07 PM
    Expert6535 points

    Hi,

    A8 buffers from SR2 can be made cacheable by modifying board-support/media-controller-utils_2_05_00_17/src/firmware_loader/memsegdef_default.c 

    /* Segment 3 */

      {

       1,                           /* valid */

       "IPC_SR_FRAME_BUFFERS",      /* name */

       0x0BC00000,                  /* size */

       LDR_SEGMENT_TYPE_DYNAMIC_SHARED_HEAP,        /* seg_type */

       0,                           /* flags */

       0xB3D00000,                  /* system_addr */

       0xB3D00000,                  /* slave_virtual_addr */

       1,                           /* master_core_id */

       (1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3) | (1 << LDR_CORE_ID_A8),

       /* core_id_mask */

       (1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3),     /* cache_enable_mask */

     

    You can change the cache enable mask to add cache enable on A8  (1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3) | (1 << LDR_CORE_ID_A8),

    After this you need to build firware_loader. { make media-controller-utils }. Use this firmware loader in filesystem /usr/bin folder. This should enable the cache for buffers on A8 side.

    Please note cache invalidations are not done in A8 side in DOMX, so if cache gets enabled data might not look fine. DOMX needs to be modified to take care of cache invalidation.

    Regards

    Vimal

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Gabi Gvili
    Posted by Gabi Gvili
    on Aug 12 2012 10:34 AM
    Genius3795 points

    Hi Vimal,

    Thank you very much for your answer.
    I am doing a loopback via A8 buffer, based on capture_encode example cap->DEI->display, i am allocating a buffer in shared region 2 as explained in that thread:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/203642/734670.aspx#734670 

    Now i copy from DEI output buffer to A8 buffer and from A8 buffer to Display input buffer, the copyng is done using EDMA thus frame rate remain 60 fps, Now instead of just
    loop-back i perform some minor processing on the video frame, the frame rate drops to 1 fps. After i am making shared region 2 cache-able to A8 the way you have described, the frame rate remain 1 fps, how can it be? Is this the only thing need to be done? Is there another way to speed up the A8?

    Thanks,
    Gabi 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vimal Jain
    Posted by Vimal Jain
    on Aug 12 2012 23:45 PM
    Expert6535 points

    Gabi,

    Have you profiles the minor processing, may be that is not able to give buffers ontime to next component, you can try providing more buffers, and do not operate on immediate buffer, but keep pipeline running, so no component spend time on waiting for buffer. May be you are aready taking care of that.

    Regards

    Vimal

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Gabi Gvili
    Posted by Gabi Gvili
    on Aug 14 2012 05:20 AM
    Genius3795 points

    Hi Vimal,

    Thank for your answer, I am using 5 buffers (similar to what i have used with all OMX examples), i have cancelled for the polling on EDMA transfers before using the buffers copied by EDMA risking in problems with video frames, therefore nothing stops the pipeline but still 1 fps.
    If insted of processing 1080 rows and (1920<<1) coloumns i process 1080 rows and (200<<1) coloumns frame rate is 6 fps.


    Gabi 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use