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.

TI81xx Frame buffer - ARM load

Hi,

      In our application using QT, (/dev/fb), at times of increased load we are observing it difficult do any mouse movements, This we suspect as linux frame buffer update is taking time as cpu is engaged with other activities. We are using DVR RDK (UDWorks design). Please see a similar issue posted for EZSDK

http://processors.wiki.ti.com/index.php/EZ_SDK_FAQ#Why_do_I_see_jerky_mouse_movements.3F

Is there any option to make the activities light weight to get a smooth mouse movement? Is this fixed in EZSDK?

Faizel

  • Hi,

          Anybody? Any Solution?

    Faizel

  • Hi,

          Anybody from TI, has some suggestions or pointers?.

    Faizel

  • Hi All,

               Waiting for your inputs?.

    Faizel

  • Hi,

          Somebody have some suggestion to ease out Qt operations over frame buffer to make the mouse movements smooth?.

    Faizel

  • Hi,

    Which version of RDK are you using?

    Regards,

    Reshma

  • Hi,

         Thanks for the reply. We are using RDK4.0. Even we have ported some application modules from RDK 4 for arm side optmization say

    1. memcpy to neon memcpy

    2. Avoiding multiple memcpy to for network streaming.

    Please suggest on what else we can try.

  •       "Correcting the previous reply"

    Hi,

         Thanks for the reply. We are using RDK3.0. Even we have ported some application modules from RDK 4 for arm side optmization say

    1. memcpy to neon memcpy

    2. Avoiding multiple memcpy to for network streaming.

    Please suggest on what else we can try.

  • Hi Faizel,

    Attached is the hdvpss patch 

    6136.grpx_change.diff.txt
    diff --git a/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpxPriv.c b/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpxPriv.c
    index 7430ad2..a9b517d 100755
    --- a/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpxPriv.c
    +++ b/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpxPriv.c
    @@ -1013,12 +1013,12 @@ Int vpsDdrvGrpxAllocDescMem(VpsDdrv_GrpxInstObj *instObj,
                     descParams->abortDesc[descSet] = tempPtr;
                     for (abCnt = 0; abCnt < descParams->numAbortCh; abCnt++)
                     {
    -                    if (descSet == 0)
    +                    /*if (descSet == 0)
                         {
                             VpsHal_vpdmaCreateAbortCtrlDesc(tempPtr,
                                                     descParams->abortCh[abCnt]);
                         }
    -                    else
    +                    else*/
                         {
                             VpsHal_vpdmaCreateDummyDesc(tempPtr);
                         }
    

    The patch addresses a similar issue and is for test purpose only. Please test it at your end and let us know the results.

    Regards,

    Reshma

  • Hi,

         Thanks for the support. We tried the patch and seems like there is an improvement of approximately 20% of user experience in handling the mouse. So still its not smooth, means we will feel the mouse stuck proportional to ARM load and difficult to operate mouse even on slightly loaded conditions. So how should we proceed here?. Waiting for your reply.

    Regards

    Faizel

  • Hi Faizel,

    Attached is another hdvpss patch 

    6507.grpx_issue_fix.patch.txt
    diff --git a/packages/ti/psp/vps/core/src/vpscore_graphics.c b/packages/ti/psp/vps/core/src/vpscore_graphics.c
    index 6264b1c..020629b 100755
    --- a/packages/ti/psp/vps/core/src/vpscore_graphics.c
    +++ b/packages/ti/psp/vps/core/src/vpscore_graphics.c
    @@ -137,6 +137,11 @@ static Int32 vcoreGrpxRtProgramOvlyMem(Vcore_GrpxHandleObj *hObj,
                                            const Vcore_DescMem *descMem,
                                            UInt32 regId);
     
    +static Int32 vcoreGrpxRtUpdateDataDesc(Vcore_GrpxHandleObj *hObj,
    +                                        Vcore_GrpxChObj *chObj,
    +                                        const Vcore_DescMem *descMem,
    +                                        UInt32 regId);
    +
     /* ========================================================================== */
     /*                            Global Variables                                */
     /* ========================================================================== */
    @@ -1607,8 +1612,8 @@ static Int32 Vcore_grpxUpdateRtMem(Vcore_Handle handle,
         }
         if (VPS_SOK == retVal)
         {
    -        /*program the data descriptor if applicable*/
    -        retVal = vcoreGrpxRtProgramDataDesc(hObj,
    +        /*Update the data descriptor if applicable*/
    +        retVal = vcoreGrpxRtUpdateDataDesc(hObj,
                                                 chObj,
                                                 descMem,
                                                 regIdx);
    @@ -2107,3 +2112,82 @@ static Int32 vcoreGrpxRtProgramOvlyMem(Vcore_GrpxHandleObj *hObj,
         return (retVal);
     }
     
    +/**
    + *  vcoreGrpxRtUpdateDataDesc
    + *  runtime program the data descriptor
    + *  return VPS_SOK on success else return error value
    + */
    +static Int32 vcoreGrpxRtUpdateDataDesc(Vcore_GrpxHandleObj *hObj,
    +                                        Vcore_GrpxChObj *chObj,
    +                                        const Vcore_DescMem *descMem,
    +                                        UInt32 regId)
    +
    +{
    +    Int32                    retVal = VPS_SOK;
    +    UInt32                   descSet;
    +    Ptr                      dataDesc;
    +    Vps_GrpxRegionParams     *regParams;
    +    Vcore_GrpxInstObj        *instObj;
    +    VpsHal_VpdmaRegionDataDescParams  regDesc;
    +    VpsHal_VpdmaInDescParams stenDescParam;
    +
    +
    +    GT_assert(GrpxCoreTrace, (NULL != descMem));
    +    instObj = hObj->instObj;
    +    GT_assert(GrpxCoreTrace, (NULL != instObj));
    +
    +    if (TRUE == chObj->state.isMultiWinMode)
    +    {
    +        regParams = &chObj->mInfo.regParam[regId];
    +    }
    +    else
    +    {
    +        regParams = &chObj->regParam;
    +    }
    +
    +
    +    /* For first region, totally three data descriptors CLUT, Stenciling and
    +     * Data. For the rest regions, only two data descriptors: stenciling and Data.
    +     */
    +    for (descSet = 0u; descSet < instObj->numDescPerReg; descSet++)
    +    {
    +        /*Get the right descriptor memory based on the region num*/
    +        if (0u == regId)
    +        {
    +            dataDesc =(Ptr)descMem->inDataDesc[1u + descSet];
    +        }
    +        else
    +        {
    +            dataDesc =(Ptr)descMem->multiWinDataDesc[VCORE_GRPX_DESCS_PER_REGION *
    +                                        (regId - 1u)  + descSet];
    +        }
    +        /*stenciling descriptor comes first */
    +        if (descSet == 0u)
    +        {
    +            if (TRUE == regParams->stencilingEnable)
    +            {
    +                retVal = vcoreGrpxCreateStenDataDesc(hObj, chObj,
    +                     regParams, &stenDescParam, dataDesc,regId);
    +            }
    +            else
    +            {
    +                /*create dummy to replace the real descriptor one*/
    +                VpsHal_vpdmaCreateDummyDesc(dataDesc);
    +                VpsHal_vpdmaCreateDummyDesc(
    +                               (Ptr)((UInt32)dataDesc +
    +                               VPSHAL_VPDMA_CONFIG_DESC_SIZE));
    +            }
    +        }
    +        else
    +        {
    +            /*Update grpx data descriptor*/
    +            retVal = vcoreGrpxUpdateGrpxDataDesc(hObj,
    +                                         chObj,
    +                                         regParams,
    +                                         &regDesc,
    +                                         dataDesc,
    +                                         regId);
    +        }
    +    }
    +    return (retVal);
    +}
    diff --git a/packages/ti/psp/vps/core/src/vpscore_grpxPriv.c b/packages/ti/psp/vps/core/src/vpscore_grpxPriv.c
    index cc68389..6104f7a 100755
    --- a/packages/ti/psp/vps/core/src/vpscore_grpxPriv.c
    +++ b/packages/ti/psp/vps/core/src/vpscore_grpxPriv.c
    @@ -978,4 +978,74 @@ Int32 vcoreGrpxCreateGrpxDataDesc(const Vcore_GrpxHandleObj *hObj,
         return (retVal);
     }
     
    +/**
    + * vcoreGrpxUpdateGrpxDataDesc
    + *  function to updates a graphics data descriptor
    + */
    +Int32 vcoreGrpxUpdateGrpxDataDesc(const Vcore_GrpxHandleObj *hObj,
    +                                  Vcore_GrpxChObj *chObj,
    +                                  Vps_GrpxRegionParams  *regParams,
    +                                  VpsHal_VpdmaRegionDataDescParams*regD,
    +                                  Ptr descPtr,
    +                                  UInt32 regId)
    +{
    +    Int32                    retVal = VPS_SOK;
    +    Vcore_GrpxInstObj        *instObj;
    +
    +    instObj = hObj->instObj;
    +    GT_assert(GrpxCoreTrace, (NULL != instObj));
    +
    +    regD->channel = instObj->chGrpx;
    +    regD->nextChannel = instObj->chGrpx;
    +    if (FVID2_SF_INTERLACED == chObj->coreFmt.fmt.scanFormat)
    +    {
    +        if (TRUE == chObj->coreFmt.fmt.fieldMerged[FVID2_RGB_ADDR_IDX])
    +        {
    +            regD->lineSkip = VPSHAL_VPDMA_LS_2;
    +        }
    +        else
    +        {
    +            regD->lineSkip = VPSHAL_VPDMA_LS_1;
    +        }
    +    }
    +    else
    +    {
    +        regD->lineSkip = VPSHAL_VPDMA_LS_1;
    +    }
    +    if (TRUE == chObj->state.isMultiWinMode)
    +    {
    +        regD->lineStride =
    +                (UInt16)chObj->mInfo.regFmt[regId].pitch[FVID2_RGB_ADDR_IDX];
    +        regD->dataType = vcoreGrpxGetVpdmaChanDataType(
    +                                    chObj->mInfo.regFmt[regId].dataFormat);
    +    }
    +    else
    +    {
    +        regD->dataType =
    +            vcoreGrpxGetVpdmaChanDataType(chObj->coreFmt.fmt.dataFormat);
    +
    +        regD->lineStride =
    +                (UInt16)chObj->coreFmt.fmt.pitch[FVID2_RGB_ADDR_IDX];
    +    }
    +    regD->memType = (VpsHal_VpdmaMemoryType)chObj->coreFmt.memType;
    +    regD->notify = FALSE;
    +    if (VCORE_OPMODE_DISPLAY == instObj->curMode)
    +    {
    +        regD->priority = VPS_CFG_DISP_VPDMA_PRIORITY;
    +    }
    +    else
    +    {
    +        regD->priority = VPS_CFG_M2M_VPDMA_PRIORITY_RD;
    +    }
    +
    +    retVal = VpsHal_grpxRegionDispAttrSet(instObj->grpxHandle, regParams, regD);
    +    if (VPS_SOK == retVal)
    +    {
    +        retVal = VpsHal_vpdmaUpdateRegionDataDesc(descPtr, regD);
    +        GT_1trace(GrpxCoreTrace, GT_DEBUG,
    +              "---------REGION DATA at 0x%0.8x-------------\n",(UInt32)descPtr);
    +        VpsHal_vpdmaPrintDesc(descPtr, GrpxCoreTrace);
    +    }
    +    return (retVal);
    +}
     
    diff --git a/packages/ti/psp/vps/core/src/vpscore_grpxPriv.h b/packages/ti/psp/vps/core/src/vpscore_grpxPriv.h
    index 611a338..5fb92f1 100755
    --- a/packages/ti/psp/vps/core/src/vpscore_grpxPriv.h
    +++ b/packages/ti/psp/vps/core/src/vpscore_grpxPriv.h
    @@ -538,6 +538,12 @@ Int32 vcoreGrpxCreateGrpxDataDesc(const Vcore_GrpxHandleObj *hObj,
                                       Ptr descPtr,
                                       UInt32 regId);
     
    +Int32 vcoreGrpxUpdateGrpxDataDesc(const Vcore_GrpxHandleObj *hObj,
    +                                  Vcore_GrpxChObj *chObj,
    +                                  Vps_GrpxRegionParams  *regParams,
    +                                  VpsHal_VpdmaRegionDataDescParams*regD,
    +                                  Ptr descPtr,
    +                                  UInt32 regId);
     
     
     #ifdef __cplusplus
    diff --git a/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpx.c b/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpx.c
    index 52cca4f..a0de999 100755
    --- a/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpx.c
    +++ b/packages/ti/psp/vps/drivers/display/src/vpsdrv_dispGrpx.c
    @@ -978,19 +978,7 @@ static Int32 VpsDdrvGrpxUpdateDesc(VpsDdrv_GrpxInstObj * instObj,
     
         for (set = 0; set < DC_NUM_DESC_SET; set++)
         {
    -
    -        /*update the RT parameters to core*/
    -        retVal = vpsDdrvGrpxUpdateRtParams(instObj,
    -                                           frameList,
    -                                           set);
    -
    -        if (FVID2_SOK != retVal)
    -        {
    -            GT_0trace(VpsDdrvGrpxTrace, GT_ERR,
    -                    "Update RT parameters failed.\n");
    -            return retVal;
    -        }
    -
    +	
             /* Program the next buffer if required */
             if (TRUE == instObj->state.isMultiRegion)
             {
    @@ -1142,6 +1130,28 @@ static Int32 vpsDdrvGrpxFbUpdateBufIsr(UInt32 curSet,
             instObj->clutSet[nextSet] = FALSE;
     
         }
    +
    +    /* Update the rtparams during vsync interval instead of while rtparams 
    +       update queue in order avoid driver accessing the descriptors 
    +       which are used by VPDMA which can lead to hang . 
    +       Only Last queued rtparams are updated to core during vsync 
    +       interval others are discarded*/
    +    if(instObj->bmObj.fbQObj != NULL)
    +    {
    +        /*update the RT parameters to core*/
    +        retVal = vpsDdrvGrpxUpdateRtParams(instObj,
    +                                           &instObj->bmObj.fbQObj->frameList,
    +                                           nextSet);
    +
    +        if (FVID2_SOK != retVal)
    +        {
    +            GT_0trace(VpsDdrvGrpxTrace, GT_ERR,
    +                    "Update RT parameters failed.\n");
    +            return retVal;
    +        }
    +    
    +    }
    +
         /* Intimate the application that a buffer is ready to be dequeued */
         if (instObj->bmObj.expectedSet >= (DC_NUM_DESC_SET - 1u))
         {
    diff --git a/packages/ti/psp/vps/hal/src/vpshal_vpdma.c b/packages/ti/psp/vps/hal/src/vpshal_vpdma.c
    index 57a1683..f163efd 100755
    --- a/packages/ti/psp/vps/hal/src/vpshal_vpdma.c
    +++ b/packages/ti/psp/vps/hal/src/vpshal_vpdma.c
    @@ -2230,3 +2230,59 @@ VpsHal_VpdmaClient VpsHal_vpdmaGetClientNo(VpsHal_VpdmaChannel chan)
     
         return (clientNo);
     }
    +
    +/**
    + *  VpsHal_vpdmaUpdateRegionDataDesc
    + *  \brief This function is used to update the Region data descriptor in
    + *  the given memory. Upper layer passes the parameters need to be set
    + *  in second argument and this function makes data descriptor in
    + *  the memory given in the first argument. Memory pointer given must
    + *  contain physically contiguous memory because VPDMA works with that only.
    + *
    + *  \param memPtr           Pointer to physically contiguous memory into
    + *                          which descriptor will be created
    + *  \param descInfo         Pointer to structure containing region data
    + *                          descriptor parameters
    + *  \return                 Returns 0 on success else returns error value
    + */
    +Int VpsHal_vpdmaUpdateRegionDataDesc(Ptr memPtr,
    +                                     VpsHal_VpdmaRegionDataDescParams *descInfo)
    +{
    +    volatile VpsHal_VpdmaRegionDataDesc *dataDesc = NULL;
    +    Int32 ptr;
    +    Int32 *testPtr;
    +
    +    GT_assert(VpsHalTrace, (NULL != memPtr));
    +    GT_assert(VpsHalTrace, (NULL != descInfo));
    +    GT_assert(VpsHalTrace, (0u == ((UInt32)(descInfo->lineStride) &
    +                  (VPSHAL_VPDMA_LINE_STRIDE_ALIGN - 1u))));
    +
    +    dataDesc = (volatile VpsHal_VpdmaRegionDataDesc *)memPtr;
    +    dataDesc->descType = VPSHAL_VPDMA_PT_DATA;
    +    dataDesc->channel = descInfo->channel;
    +    dataDesc->dataType = descInfo->dataType;
    +    dataDesc->transferHeight = dataDesc->regionHeight = descInfo->regionHeight;
    +    dataDesc->transferWidth = dataDesc->regionWidth = descInfo->regionWidth;
    +    dataDesc->horizontalStart = descInfo->startX;
    +    dataDesc->verticalStart = descInfo->startY;
    +    dataDesc->lineStride = descInfo->lineStride;
    +    dataDesc->evenSkip = dataDesc->oddSkip = descInfo->lineSkip;
    +    dataDesc->nextChannel = descInfo->nextChannel;
    +    dataDesc->memType = descInfo->memType;
    +    dataDesc->direction = VPSHAL_VPDMA_INBOUND_DATA_DESC;
    +    dataDesc->regionPriority = descInfo->regionPriority;
    +    dataDesc->regionAttr = descInfo->regionAttr &
    +                                        VPSHAL_VPDMA_GRPX_REGION_ATTR_MASK;
    +    dataDesc->bbAlpha = descInfo->bbAlpha;
    +    dataDesc->blendAlpha = descInfo->blendAlpha;
    +    dataDesc->blendType = descInfo->blendType;
    +    if(0 != (descInfo->regionAttr & VPSHAL_VPDMA_GRPX_TRANSPARENCY))
    +    {
    +        dataDesc->enableTransparency = 1u;
    +    }
    +    dataDesc->transMask = descInfo->transMask;
    +    dataDesc->transColor = descInfo->transColor;
    +    dataDesc->notify = descInfo->notify;
    +    dataDesc->priority = descInfo->priority;
    +    return (0);
    +}
    diff --git a/packages/ti/psp/vps/hal/vpshal_vpdma.h b/packages/ti/psp/vps/hal/vpshal_vpdma.h
    index 489c716..3948d74 100755
    --- a/packages/ti/psp/vps/hal/vpshal_vpdma.h
    +++ b/packages/ti/psp/vps/hal/vpshal_vpdma.h
    @@ -37,6 +37,23 @@
     #endif
     
     
    +/**
    + *  VpsHal_vpdmaUpdateRegionDataDesc
    + *  \brief This function is used to update the Region data descriptor in
    + *  the given memory. Upper layer passes the parameters need to be set
    + *  in second argument and this function makes data descriptor in
    + *  the memory given in the first argument. Memory pointer given must
    + *  contain physically contiguous memory because VPDMA works with that only.
    + *
    + *  \param memPtr           Pointer to physically contiguous memory into
    + *                          which descriptor will be created
    + *  \param descInfo         Pointer to structure containing region data
    + *                          descriptor parameters
    + *  \return                 Returns 0 on success else returns error value
    + */
    +Int VpsHal_vpdmaUpdateRegionDataDesc(Ptr memPtr,
    +                                     VpsHal_VpdmaRegionDataDescParams *descInfo);
    +
     #ifdef __cplusplus
     extern "C"
     {
    
    , which needs to be applied along with the previously shared patch.

    Please test this at your end and let us know if it is helpful. The patch is for test purposes only.

    Regards,

    Reshma

  • Hi,

         Thanks again for the support. It got improved a bit also. But still its not in usable form from the user perspective. Kindly suggest.

  • Hi,

         How should we proceed here? Waiting for your inputs for any test case to be executed.

    Regards

    Faizel K B

  • Hi Faizel,

    In your hdvpss package,

    can you disable below macro in this file: packages/ti/psp/vps/common/vps_config.h

    #define VPS_CFG_VPDMA_MOSAIC_ENABLE_WORKAROUNDS

    Lets us know the outcome

    Regards,
    Vivek

  • Hi Vivek,

                     Thanks for the reply. The user experience got improved to one more level. But not as pleasing when we use 4 channel use case. Can you update.  

    Regards

    Faizel

  • Faizel,

    This is the last piece of suggestion from the HDVPSS side for improvements.

    I have two quick points to share,

    1. The load has to be at about 80% for the A8, for mouse to work properly reason being as below,

    2. Qt is not able to provide updated coordinates to the display sub system in the correct time frame, and hence you see the issue. QT not able to perform in the speed as expected due to a constraint of high load.

    Changing priorities of the QT thread might help but it might affect other file write operations.

    Beyond this I don't think we will be able to help from the RDK side.

    Regards,

    Vivek

  • Hi Vivek,

                   Thanks for the reply. I have seen a similar issue in the below thread?. Any fix has happened or anything from this layer.

    http://processors.wiki.ti.com/index.php/EZ_SDK_FAQ#Why_do_I_see_jerky_mouse_movements.3F

    Regards

    Faizel

  • Faizel,

    This issue description seems to be specific to EZSDK.

    EZSDK is a old software framework, post which all the best fixes have been done and the HDVPSS is most robust and well tested component in the RDK.

    Regards,
    Vivek

  • Hi Vivek,

                   Thanks for the update. Let me explore some options from linux process level. Will update this soon.

    Regards

    Faizel

  • Hi Vivek,

                    We have tried with QT thread priority but didn't make any difference. Afterwards we tried changing the linux process priority (for qt application) to high which made a good difference in the mouse usage. Now the User experience is good with our 16 channel use case. Thank you very much for the help.

    Regards

    Faizel

  • Hi Faizel,

    Can you please share guideliness as to QT development with dvrrdk ?
    Did you use some app note ? Is it based on udworks example or did you just started doing some QT and just use /dev/fb without any other concerns ?

    Thanks for the time,

    Ran

  • Hi Ran,

                  There is not any app note other than installing QT with DVR RDK. We did both (UD as well as our test application). This will run on /dev/fb without any concerns. You can start developing the programs in Qt creator or through any other methods.

    Faizel