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.

TDA2SX: the format of display bubffer ,can you explain?

Part Number: TDA2SX

displayLink_drv.c  

we dump the display buffers, and play the file ,we found that some buffer was RGB32,  some buffer was YUYV,   i don't know why?

the detail folows:

Int32 DisplayLink_drvProcessData(DisplayLink_Obj *pObj)

Vps_printf(" zhoule pFrame address 00 %p %p %d\n",pFrame->addr[0U][0U],pFrame->addr[1U][0U]);

then we used the address for dump, there were seiral buffers for display.

./devmsave  0xa0984000  0x1c2000 dump.txt

then play the dump.txt,  some address  the format was RGB32 ,some was YUYV,why?

specificly,  when pFrame->addr[0U][1U]  was null , the format was YUYV

 pFrame->addr[0U][1U]  was not null , the format was RGB

  • Hi,

    Display links gets the input frame format from the previous link.. so it all depends on the output format of the previous link and accordingly, it configures format in DSS.

    Also YUYV is single plane format, so addr[0][1] is null.  For RGB also, addr[0][1] will be null. But you need to check what previous link is outputting and if it is valid address..

    Rgds,

    Brijesh

  • i think a set of buffers(the log about addr[0][0] can show) use for display,

    i wonder why the set of buffers was different ,some was YUYV ,some was rgb at the same time.

  • i ask the question for solving a question.

    the display can show ok in dark situation  (RGB), but not right YUYV at the same situation.

    please help us check  the format config about display.  chains_c53f.c

    #include "../usecase.h"
    #include "chains_c53f_priv.h"
    /*******************************************************************************
     *  Constants
     *******************************************************************************
     */
    #define CAPTURE_SENSOR_WIDTH        (1280)
    #define CAPTURE_SENSOR_HEIGHT       (720)
    #define CAPTURE_OUT_WIDTH           (1280)
    #define CAPTURE_OUT_HEIGHT          (720)
    
    
    /**< CSI2 Clock Speed */
    #define CAPTURE_MX9286_CSI2_CLOCK_PHY_0  (288U)
    
    /**< Number of buffers to allocate per channel */
    #define CAPTURE_NUM_BUF_PER_CH          (5U)
    
    #define SYNC_DELTA_IN_MSEC                    (20)
    
    #define SYNC_DROP_THRESHOLD_IN_MSEC           (40)
    /**
     *******************************************************************************
     *
     *  \brief  CAL Multichannel Capture & Display Object
     *
     *        This structure contains all the LinksId's and create Params.
     *        The same is passed to all create, start, stop functions.
     *
     *******************************************************************************
    */
    typedef struct {
    
        Chains_C53F_Obj ucObj;
    
    } Chains_C53F_AppObj;
    
    
    /*******************************************************************************
     *  Local Functions
     *******************************************************************************
     */
    static Void Chains_C53F_SetCaptureParams(Chains_C53F_AppObj *pObj)
    {
        UInt32 idx;
        IssCaptureLink_CreateParams *pCaptPrm;
        IssCaptureLink_Csi2Params   *pCsi2Prm;
        IssCaptureLink_OutParams    *pOutPrm;
        System_VideoDataFormat      inOutDataFormat;
    
        pCaptPrm = &pObj->ucObj.IssCapturePrm;
        memset((void*) pCaptPrm, 0, sizeof(IssCaptureLink_CreateParams));
    
        pCaptPrm->videoIfMode            = SYSTEM_VIFM_SCH_CSI2;
    
        pCaptPrm->videoIfWidth           = SYSTEM_VIFW_4LANES;
        pCaptPrm->bufCaptMode            = SYSTEM_CAPT_BCM_LAST_FRM_REPEAT;
    
        for (idx = 0U; idx < ISSCAPT_LINK_MAX_CMPLXIO_INST; idx++)
        {
            pCsi2Prm = &pCaptPrm->csi2Params[idx];
    
            pCsi2Prm->isCmplxIoCfgValid = FALSE;
            pCsi2Prm->csi2PhyClk        = CAPTURE_MX9286_CSI2_CLOCK_PHY_0;
    
            pCsi2Prm->cmplxIoCfg.clockLane.pol      = FALSE;
            pCsi2Prm->cmplxIoCfg.clockLane.position = 1U;
            pCsi2Prm->cmplxIoCfg.data1Lane.pol      = FALSE;
            pCsi2Prm->cmplxIoCfg.data1Lane.position = 2U;
            pCsi2Prm->cmplxIoCfg.data2Lane.pol      = FALSE;
            pCsi2Prm->cmplxIoCfg.data2Lane.position = 3U;
            pCsi2Prm->cmplxIoCfg.data3Lane.pol      = FALSE;
            pCsi2Prm->cmplxIoCfg.data3Lane.position = 4U;
            pCsi2Prm->cmplxIoCfg.data4Lane.pol      = FALSE;
            pCsi2Prm->cmplxIoCfg.data4Lane.position = 5U;
        }
        /* UB964 Can support only 1 interface*/
        pCaptPrm->csi2Params[0U].isCmplxIoCfgValid = TRUE;
    
        pCaptPrm->numCh = 4;
    
        inOutDataFormat = SYSTEM_DF_YUV422I_UYVY;
    
        for (idx = 0U; idx < pCaptPrm->numCh; idx++)
        {
            pOutPrm = &pCaptPrm->outParams[idx];
            pOutPrm->phyInstance    = 0U;
            pOutPrm->width          = CAPTURE_SENSOR_WIDTH;
            pOutPrm->height         = CAPTURE_SENSOR_HEIGHT;
            pOutPrm->dataFormat     = inOutDataFormat;
            pOutPrm->inCsi2DataFormat       = SYSTEM_CSI2_YUV422_8B;
            pOutPrm->inCsi2VirtualChanNum   = idx;
            pOutPrm->maxWidth       = CAPTURE_SENSOR_WIDTH;
            pOutPrm->maxHeight      = CAPTURE_SENSOR_HEIGHT;
            pOutPrm->numOutBuf      = CAPTURE_NUM_BUF_PER_CH;
            pOutPrm->outDataFormat  = inOutDataFormat;
        }
        pCaptPrm->allocBufferForRawDump  = FALSE;
    
        return;
    }
    
    static Void Chains_C53f_SetVpePrm(VpeLink_CreateParams *pPrm)
    {
        UInt32 chId;
        VpeLink_ChannelParams *chPrms;
        UInt32 outId = 0;
    
        pPrm->enableOut[0] = TRUE;
        for (chId = 0; chId < 4; chId++)
        {
            chPrms = &pPrm->chParams[chId];
            chPrms->outParams[outId].numBufsPerCh = VPE_LINK_NUM_BUFS_PER_CH_DEFAULT;
    
            chPrms->outParams[outId].width = CAPTURE_OUT_WIDTH;
            chPrms->outParams[outId].height = CAPTURE_OUT_HEIGHT;
            chPrms->outParams[outId].dataFormat = SYSTEM_DF_YUV420SP_UV;
    
            chPrms->scCfg.bypass       = FALSE;
            chPrms->scCfg.nonLinear    = FALSE;
            chPrms->scCfg.stripSize    = 0;
    
            chPrms->scCropCfg.cropStartX = 0;
            chPrms->scCropCfg.cropStartY = 0;
            chPrms->scCropCfg.cropWidth  = CAPTURE_SENSOR_WIDTH;
            chPrms->scCropCfg.cropHeight = CAPTURE_SENSOR_HEIGHT;
        }
    }
    
    static Void Chains_C53F_SetSyncPrm(SyncLink_CreateParams *pPrm)
    {
        pPrm->syncDelta = SYNC_DELTA_IN_MSEC;
        pPrm->syncThreshold = SYNC_DROP_THRESHOLD_IN_MSEC;
    }
    
    #if defined(DSS_INCLUDE)
    static Void Chains_C53F_SetDssWbParams(CaptureLink_CreateParams *pPrm)
    {
        pPrm->numVipInst = 0;
        pPrm->numDssWbInst = 1;
        
        pPrm->dssWbInst[0].dssWbInstId = 33;
        System_VideoScanFormat scanFormat = SYSTEM_SF_PROGRESSIVE;
    
        pPrm->dssWbInst[0].dssWbInputPrms.inNode = SYSTEM_WB_IN_NODE_TV;
        pPrm->dssWbInst[0].dssWbInputPrms.wbInSourceWidth = HDMI_DISPLAY_WIDTH;
        pPrm->dssWbInst[0].dssWbInputPrms.wbInSourceHeight = HDMI_DISPLAY_HEIGHT;
        pPrm->dssWbInst[0].dssWbInputPrms.wbInWidth = HDMI_DISPLAY_WIDTH;
        pPrm->dssWbInst[0].dssWbInputPrms.wbInHeight = HDMI_DISPLAY_HEIGHT;
        pPrm->dssWbInst[0].dssWbInputPrms.wbPosx = 0;
        pPrm->dssWbInst[0].dssWbInputPrms.wbPosy = 0;
        pPrm->dssWbInst[0].dssWbInputPrms.wbInSourceDataFmt = SYSTEM_DF_RGBA32_8888;
        pPrm->dssWbInst[0].dssWbInputPrms.wbScanFormat = scanFormat;
    
        pPrm->dssWbInst[0].dssWbOutputPrms.wbWidth = HDMI_DISPLAY_WIDTH;
        pPrm->dssWbInst[0].dssWbOutputPrms.wbHeight = HDMI_DISPLAY_HEIGHT;
        pPrm->dssWbInst[0].dssWbOutputPrms.wbDataFmt = SYSTEM_DF_YUV422I_YUYV;
        pPrm->dssWbInst[0].dssWbOutputPrms.wbScanFormat = scanFormat;
    
        pPrm->dssWbInst[0].numBufs = 4U;
    }
    
    Void Chains_C53F_SetDisplayPrms(DisplayLink_CreateParams *pPrm_HDMI, DisplayLink_CreateParams *pPrm_FPD)
    {
        DisplayCtrlLink_ConfigParams    dctrlCfgPrms;
        DisplayCtrlLink_OvlyPipeParams  pipeParams[4];
        DisplayCtrlLink_OvlyParams      ovlyParams[2];
        DisplayCtrlLink_VencInfo *pVInfo;
        Int32 status=0;
        
        //设置显示参数
        dctrlCfgPrms.numVencs = 2;
        dctrlCfgPrms.tiedVencs = 0;
        dctrlCfgPrms.deviceId = DISPLAYCTRL_LINK_USE_HDMI;
        
        //指定显示设备video pipelin
        pPrm_HDMI->rtParams.tarWidth         = HDMI_DISPLAY_WIDTH;
        pPrm_HDMI->rtParams.tarHeight        = HDMI_DISPLAY_HEIGHT;
        pPrm_HDMI->displayId                 = DISPLAY_LINK_INST_DSS_VID1;
    
        pPrm_FPD->rtParams.tarWidth         = HDMI_DISPLAY_WIDTH;
        pPrm_FPD->rtParams.tarHeight        = HDMI_DISPLAY_HEIGHT;
        pPrm_FPD->displayId                 = DISPLAY_LINK_INST_DSS_VID2;
        
        pipeParams[0].pipeLine                 = SYSTEM_DSS_DISPC_PIPE_VID1;
        pipeParams[0].globalAlpha              = 0xFF;
        pipeParams[0].preMultiplyAlpha         = 0;
        pipeParams[0].zorderEnable             = TRUE;
        pipeParams[0].zorder                   = SYSTEM_DSS_DISPC_ZORDER1;
        pipeParams[1].pipeLine                 = SYSTEM_DSS_DISPC_PIPE_VID2;
        pipeParams[1].globalAlpha              = 0xFF;
        pipeParams[1].preMultiplyAlpha         = 0;
        pipeParams[1].zorderEnable             = TRUE;
        pipeParams[1].zorder                   = SYSTEM_DSS_DISPC_ZORDER0;
        pipeParams[2].pipeLine                 = SYSTEM_DSS_DISPC_PIPE_VID3;
        pipeParams[2].globalAlpha              = 0xFF;
        pipeParams[2].preMultiplyAlpha         = 0;
        pipeParams[2].zorderEnable             = TRUE;
        pipeParams[2].zorder                   = SYSTEM_DSS_DISPC_ZORDER2;
        pipeParams[3].pipeLine                 = SYSTEM_DSS_DISPC_PIPE_GFX1;
        pipeParams[3].globalAlpha              = 0xFF;
        pipeParams[3].preMultiplyAlpha         = 0;
        pipeParams[3].zorderEnable             = TRUE;
        pipeParams[3].zorder                   = SYSTEM_DSS_DISPC_ZORDER3;
            
        //HDMI 输出显示设置
        pVInfo = &dctrlCfgPrms.vencInfo[0];
        pVInfo->tdmMode = DISPLAYCTRL_LINK_TDM_DISABLE;
        pVInfo->mInfo.standard                  =   SYSTEM_STD_720P_60;
        pVInfo->vencId = SYSTEM_DCTRL_DSS_VENC_HDMI;
        pVInfo->outputPort = SYSTEM_DCTRL_DSS_HDMI_OUTPUT;
        pVInfo->vencOutputInfo.vsPolarity       =   SYSTEM_DCTRL_POLARITY_ACT_HIGH;
        pVInfo->vencOutputInfo.hsPolarity       =   SYSTEM_DCTRL_POLARITY_ACT_HIGH;    
        pVInfo->vencOutputInfo.fidPolarity      =   SYSTEM_DCTRL_POLARITY_ACT_LOW;
        pVInfo->vencOutputInfo.actVidPolarity   =   SYSTEM_DCTRL_POLARITY_ACT_HIGH;
        pVInfo->vencOutputInfo.dataFormat       =   SYSTEM_DF_BGR24_888;
        pVInfo->vencOutputInfo.dvoFormat        =   SYSTEM_DCTRL_DVOFMT_GENERIC_DISCSYNC;
        pVInfo->vencOutputInfo.videoIfWidth     =   SYSTEM_VIFW_24BIT;
        pVInfo->vencOutputInfo.pixelClkPolarity =   SYSTEM_DCTRL_POLARITY_ACT_HIGH;
        pVInfo->vencOutputInfo.aFmt             =   SYSTEM_DCTRL_A_OUTPUT_MAX;
        
        pVInfo->mode = 0;
        pVInfo->isInputPipeConnected[0] = TRUE;
        pVInfo->isInputPipeConnected[1] = FALSE;
        pVInfo->isInputPipeConnected[2] = TRUE;
        pVInfo->isInputPipeConnected[3] = TRUE;
        pVInfo->writeBackEnabledFlag = TRUE;
    
        ovlyParams[0].vencId                       = pVInfo->vencId;
        ovlyParams[0].deltaLinesPerPanel   = 0;
        ovlyParams[0].alphaBlenderEnable   = 0;
        ovlyParams[0].backGroundColor      = 0x10;
        ovlyParams[0].colorKeyEnable       = 1;
        ovlyParams[0].colorKeySel          = SYSTEM_DSS_DISPC_TRANS_COLOR_KEY_SRC;
        ovlyParams[0].ovlyOptimization     = SYSTEM_DSS_DISPC_OVLY_FETCH_ALLDATA;
        ovlyParams[0].transColorKey        = 0;
        /* Setting other overlay parameters common to both Venc */
    
        pVInfo                                  = &dctrlCfgPrms.vencInfo[1];
        pVInfo->tdmMode = DISPLAYCTRL_LINK_TDM_16BIT_TO_8BIT;                         /*输出为16it per pixel 8bit并行口输出*/
        pVInfo->mInfo.standard                  =  SYSTEM_STD_CUSTOM;
        pVInfo->mInfo.scanFormat                =  SYSTEM_SF_PROGRESSIVE;
        pVInfo->mInfo.width                     =  HDMI_DISPLAY_WIDTH;
        pVInfo->mInfo.height                    =  HDMI_DISPLAY_HEIGHT;
        pVInfo->mInfo.pixelClock                = 74520;
        pVInfo->mInfo.fps                       = 30;
        pVInfo->mInfo.hFrontPorch               = 84;
        pVInfo->mInfo.hBackPorch                = 84;
        pVInfo->mInfo.hSyncLen                  = 20;
        pVInfo->mInfo.vFrontPorch               = 20;
        pVInfo->mInfo.vBackPorch                = 5;
        pVInfo->mInfo.vSyncLen                  = 5;
        pVInfo->vencDivisorInfo.divisorLCD      = 1;
        pVInfo->vencDivisorInfo.divisorPCD      = 1;
        pVInfo->vencId                          = SYSTEM_DCTRL_DSS_VENC_LCD2;
        pVInfo->outputPort                      = SYSTEM_DCTRL_DSS_DPI2_OUTPUT;
        pVInfo->vencOutputInfo.vsPolarity       =   SYSTEM_DCTRL_POLARITY_ACT_LOW;
        pVInfo->vencOutputInfo.hsPolarity       =   SYSTEM_DCTRL_POLARITY_ACT_LOW;
        pVInfo->vencOutputInfo.fidPolarity      = SYSTEM_DCTRL_POLARITY_ACT_HIGH;
        pVInfo->vencOutputInfo.actVidPolarity   = SYSTEM_DCTRL_POLARITY_ACT_HIGH;    
        pVInfo->vencOutputInfo.dataFormat       = SYSTEM_DF_BGR16_565;                  /*RGB565输出*/
        pVInfo->vencOutputInfo.dvoFormat        = SYSTEM_DCTRL_DVOFMT_GENERIC_DISCSYNC;
        pVInfo->vencOutputInfo.videoIfWidth     = SYSTEM_VIFW_16BIT;                    /*设置成16bit模式*/
        pVInfo->vencOutputInfo.pixelClkPolarity = SYSTEM_DCTRL_POLARITY_ACT_LOW;
        pVInfo->vencOutputInfo.aFmt             = SYSTEM_DCTRL_A_OUTPUT_MAX;            
        
        pVInfo->mode = 0;
        pVInfo->isInputPipeConnected[0]         = FALSE;
        pVInfo->isInputPipeConnected[1]         = TRUE;
        pVInfo->isInputPipeConnected[2]         = FALSE;
        pVInfo->isInputPipeConnected[3]         = FALSE;
        pVInfo->writeBackEnabledFlag            = FALSE;    
        
        ovlyParams[1].vencId                       = pVInfo->vencId;
        ovlyParams[1].deltaLinesPerPanel   = 0;
        ovlyParams[1].alphaBlenderEnable   = 0;
        ovlyParams[1].backGroundColor      = 0x10;
        ovlyParams[1].colorKeyEnable       = 1;
        ovlyParams[1].colorKeySel          = SYSTEM_DSS_DISPC_TRANS_COLOR_KEY_SRC;
        ovlyParams[1].ovlyOptimization     = SYSTEM_DSS_DISPC_OVLY_FETCH_ALLDATA;
        ovlyParams[1].transColorKey        = 0;
        
        /* There are no createtime Params for display controller */
        status = System_linkCreate(SYSTEM_LINK_ID_DISPLAYCTRL, NULL, 0);
    
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_CONFIG, &dctrlCfgPrms, sizeof(DisplayCtrlLink_ConfigParams), TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
    
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_OVLY_PARAMS, &ovlyParams[0], sizeof(DisplayCtrlLink_OvlyParams), TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_OVLY_PARAMS, &ovlyParams[1], sizeof(DisplayCtrlLink_OvlyParams), TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
        
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_OVLY_PIPELINE_PARAMS, &pipeParams[0], sizeof(DisplayCtrlLink_OvlyPipeParams),TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_OVLY_PIPELINE_PARAMS, &pipeParams[1], sizeof(DisplayCtrlLink_OvlyPipeParams),TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_OVLY_PIPELINE_PARAMS, &pipeParams[2], sizeof(DisplayCtrlLink_OvlyPipeParams),TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
        status = System_linkControl(SYSTEM_LINK_ID_DISPLAYCTRL, DISPLAYCTRL_LINK_CMD_SET_OVLY_PIPELINE_PARAMS, &pipeParams[3], sizeof(DisplayCtrlLink_OvlyPipeParams),TRUE);
        UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
    }
    #endif
    /*******************************************************************************
     *  Function to apply Link configurations.
     *******************************************************************************
     */
    Void Chains_C53F_SetAppPrms(Chains_C53F_Obj *pObj, Void *appObj)
    {
        Chains_C53F_AppObj *pAppObj = (Chains_C53F_AppObj*) appObj;
    
        Chains_C53F_SetCaptureParams(pAppObj);
    
        Chains_C53f_SetVpePrm(&pObj->VPE_sv_cscPrm);
    
        Chains_C53F_SetSyncPrm(&pObj->SyncPrm);
    #if defined(DSS_INCLUDE)
        Chains_C53F_SetDssWbParams(&pObj->Capture_dsswbPrm);
        Chains_C53F_SetDisplayPrms(&pObj->DisplayPrm, &pObj->Fpd_DisplayPrm);
    #endif
    }
    
    /*******************************************************************************
     *  Local Functions
     *******************************************************************************
     */
    
    extern UInt32 gSyncFlag;
    static Void Chains_C53F_StartApp(Chains_C53F_AppObj *pObj)
    {
        Vps_printf("ipu wait start!\n");
    
        while(gSyncFlag != 0xAAA)
        {
            Task_sleep(100);
        }
    
        Vps_printf("ipu really start!\n");
        Chains_C53F_Start(&pObj->ucObj);    
        return;
    }
    
    static Chains_C53F_AppObj chainsObj;
    Void C53F_MAIN_WORK(struct OF_RemoteCore_Info* info)
    {
        Chains_C53F_Create(&chainsObj.ucObj, &chainsObj);
        
        Chains_C53F_StartApp(&chainsObj);
    	
    	//完善版本信息
    	
        return;
    }
    

  • Hi,

    Can you please help what is wrong in YUYV format? Can you share the picture?

    May be color order is not correct?

    Rgds,

    Brijesh

  • in dark situation,we can see some shadow and white noise in HDMI or dump RGB.

    but in dark situation,dump YUYV , first  the colour was not right , second white noise disppeared.

    please help me check the chain about the format (the engineer dismissed.  i don't know why)

  • Hi, 

    Please let us know which picture is correct.

    Please post your video stream flow chart and the exact checkpoint where you are dumping the data.

    Thanks.

  • the black pictures :right was ok;there was some shadow;

    the car picture: the colour should be yellow,but there was nothing show,should have some shadow;

    data capture:DisplayLink_drvProcessData(DisplayLink_Obj *pObj)

    Vps_printf(" zhoule pFrame address 00 %p %p %d\n",pFrame->addr[0U][0U],pFrame->addr[1U][0U]);

    then we used the address for dump, there were seiral buffers for display.

    ./devmsave  0xa0984000  0x1c2000 dump.txt

  • Hi,

    Can you please check the SGX output? it looks like SGX is not outputting the image correctly and not blending two images correctly..

    Rgds,

    Brijesh