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.

AM5728: SDK-RTOS - VPS Driver HDMI

Part Number: AM5728

Hi,

I'm looking for support, documentation or training to be able to use correctly VPS driver, focus on DSS, DISPC and HDMI.
I have used DisplayDSS project present in pdk (setup env, creatproject and also rebuild lib) thanks to scripts available.
But it's appears that this project is very huge and complex not useful to use.

I'm trying to setup a project just with parts that match with my use case (test case 11 of displayDSS project) .
Now I have an issue when I send IOCTL command to set DSS parameters (on validation VpsCore_dssValidateDssParams)  dues to the size and format. I don't understand why.
Do someone help me on this topics ?

Here my strait forward code:

    Vps_InitParams vpsInitPrms;
    Fvid2_Handle dctrlHandle;
    Bsp_PlatformSetPllFreq vPllCfg;
    Bsp_PlatformVencSrc    vencClkCfg;
    int32_t retVal = FVID2_SOK;
//    EDMA3_DRV_Handle   hEdma;
//    EDMA3_DRV_Result   edmaResult = 0;

    appPrint("\n hdmi dss task started...\r\n");
    appPrint(" configuration match with DisplayDSS project -> test case : 11\r\n");

    Fvid2_init(NULL);
    VpsInitParams_init(&vpsInitPrms);
    vpsInitPrms.irqParams.dssIrqNum = CSL_INTC_EVENTID_DSS_DISPC;
    Vps_init(&vpsInitPrms);

    //hEdma = edma3init(0, &edmaResult);

    /* Create DCTRL handle, used for common driver configuration */
    dctrlHandle = Fvid2_create(FVID2_VPS_DCTRL_DRV, VPS_DCTRL_INST_0, NULL, NULL, NULL);

    vPllCfg.videoPll = BSP_PLATFORM_PLL_HDMI;
    vPllCfg.pixelClk = 29232U * 4U;;
    vPllCfg.chooseMaxorMinMN = (uint32_t) BSP_PLATFORM_VIDEO_PLL_CALC_MAX_MN;
    retVal = Bsp_platformSetPllFreq(&vPllCfg);
    if (retVal != FVID2_SOK) appPrint("\nConfiguring Pll Failed!!!\r\n");

    vencClkCfg.outputVenc = BSP_PLATFORM_VENC_HDMI;
    vencClkCfg.vencClkSrc = BSP_PLATFORM_CLKSRC_DPLL_HDMI;
    retVal = Bsp_platformSetVencClkSrc(&vencClkCfg);
    if (retVal != FVID2_SOK) appPrint("Setting Venc clock source Failed!!!\r\n");

    retVal = Bsp_platformEnableHdmiPll(TRUE);
    if (retVal != FVID2_SOK) appPrint("Enabling HDMI PLL Failed!!!\r\n");

    appPrint(" hdmi vps/dctrl common configuration -> done...\r\n");

    /* [IN] DispApp_create() l.562 DSS_main.c ------------------------------- */

    /* [IN] DispApp_initParams() l.1414 DSS_main.c -------------------------- */
    Hdmi_InstObj hdmiObj;
    memset(&hdmiObj, 0x00, sizeof(Hdmi_InstObj));

    hdmiObj.inDataFmt                       = FVID2_DF_YUV422I_YUYV;
    hdmiObj.pitch[FVID2_YUV_INT_ADDR_IDX]   = VpsUtils_align(1920U * 2U, VPS_BUFFER_ALIGNMENT);
    hdmiObj.inWidth                         = 1920U;
    hdmiObj.inHeight                        = 1080U;
    hdmiObj.isFieldMerge                    = FALSE;
    hdmiObj.inScanFormat                    = FVID2_SF_PROGRESSIVE;
    hdmiObj.posx                            = 0U;
    hdmiObj.posy                            = 0U;
    hdmiObj.instId                          = VPS_DISP_INST_DSS_VID2;
    hdmiObj.drvHandle                       = NULL;

    Fvid2CbParams_init(&hdmiObj.cbPrms);
    hdmiObj.cbPrms.cbFxn                    = &vps_dss_hdmi_cbFxn;
    hdmiObj.cbPrms.appData                  = &hdmiObj;

    VpsDispCreateParams_init(&hdmiObj.createPrms);
    VpsDispDssParams_init(&hdmiObj.dssPrms);

    hdmiObj.dssPrms.inFmt.chNum             = 0U;
    hdmiObj.dssPrms.inFmt.width             = hdmiObj.inWidth;
    hdmiObj.dssPrms.inFmt.height            = hdmiObj.inHeight;
    hdmiObj.dssPrms.inFmt.pitch[0U]         = hdmiObj.pitch[0U];
    hdmiObj.dssPrms.inFmt.pitch[1U]         = hdmiObj.pitch[1U];
    hdmiObj.dssPrms.inFmt.pitch[2U]         = hdmiObj.pitch[2U];
    hdmiObj.dssPrms.inFmt.fieldMerged[0U]   = hdmiObj.isFieldMerge;
    hdmiObj.dssPrms.inFmt.fieldMerged[1U]   = FALSE;
    hdmiObj.dssPrms.inFmt.fieldMerged[2U]   = FALSE;
    hdmiObj.dssPrms.inFmt.dataFormat        = hdmiObj.inDataFmt;
    hdmiObj.dssPrms.inFmt.scanFormat        = hdmiObj.inScanFormat;
    hdmiObj.dssPrms.inFmt.bpp               = FVID2_BPP_BITS16;
    hdmiObj.dssPrms.inFmt.reserved          = NULL;
    hdmiObj.dssPrms.tarWidth                = hdmiObj.dssPrms.inFmt.width;
    hdmiObj.dssPrms.tarHeight               = hdmiObj.dssPrms.inFmt.height;
    hdmiObj.dssPrms.posX                    = hdmiObj.posx;
    hdmiObj.dssPrms.posY                    = hdmiObj.posy;

    VpsDssDispcVidConfig_init(&hdmiObj.vidCfg);
    hdmiObj.dssPrms.vidCfg = &hdmiObj.vidCfg;
    /* ]IN[ DispApp_initParams() l.1414 DSS_main.c -------------------------- */

    /* [IN] DispApp_configDctrl() l.889 DSS_main.c -------------------------- */
    Vps_DctrlConfig dctrlCfg;
    VpsDctrlConfig_init(&dctrlCfg);
    dctrlCfg.useCase  = VPS_DCTRL_USERSETTINGS;
    dctrlCfg.numEdges = 0U;

    /* Connect module video and gfx to hdmi */
//    dctrlCfg.edgeInfo[dctrlCfg.numEdges].startNode =
//        VPS_DCTRL_DSS_VID1_INPUT_PATH;
//    dctrlCfg.edgeInfo[dctrlCfg.numEdges].endNode =
//        VPS_DCTRL_DSS_HDMI_BLENDER;
//    dctrlCfg.numEdges++;

    dctrlCfg.edgeInfo[dctrlCfg.numEdges].startNode =
        VPS_DCTRL_DSS_VID2_INPUT_PATH;
    dctrlCfg.edgeInfo[dctrlCfg.numEdges].endNode =
        VPS_DCTRL_DSS_HDMI_BLENDER;
    dctrlCfg.numEdges++;

//    dctrlCfg.edgeInfo[dctrlCfg.numEdges].startNode =
//        VPS_DCTRL_DSS_VID3_INPUT_PATH;
//    dctrlCfg.edgeInfo[dctrlCfg.numEdges].endNode =
//        VPS_DCTRL_DSS_HDMI_BLENDER;
//    dctrlCfg.numEdges++;
//
//    dctrlCfg.edgeInfo[dctrlCfg.numEdges].startNode =
//        VPS_DCTRL_DSS_GFX1_INPUT_PATH;
//    dctrlCfg.edgeInfo[dctrlCfg.numEdges].endNode =
//        VPS_DCTRL_DSS_HDMI_BLENDER;
//    dctrlCfg.numEdges++;

    dctrlCfg.edgeInfo[dctrlCfg.numEdges].startNode =
        VPS_DCTRL_DSS_HDMI_BLENDER;
    dctrlCfg.edgeInfo[dctrlCfg.numEdges].endNode =
        VPS_DCTRL_DSS_HDMI_OUTPUT;
    dctrlCfg.numEdges++;

    dctrlCfg.vencInfo.modeInfo[0U].vencId = VPS_DCTRL_DSS_VENC_HDMI;
    Fvid2ModeInfo_init(&dctrlCfg.vencInfo.modeInfo[0U].mInfo);
    Fvid2_getModeInfo(&dctrlCfg.vencInfo.modeInfo[0U].mInfo);
    dctrlCfg.vencInfo.modeInfo[0U].mInfo.scanFormat = FVID2_SF_PROGRESSIVE;
    dctrlCfg.vencInfo.tiedVencs = 0U;

    appPrint(" hdmi dctrlCfg configuration -> done...\r\n");

    Vps_DssDispcOvlyPanelConfig panelCfg;

    panelCfg.alphaBlenderEnable = 0;
    panelCfg.backGroundColor    = 0x00;
    panelCfg.colorKeyEnable     = 1;
    /* Source transparency color key selected */
    panelCfg.colorKeySel        = VPS_DSS_DISPC_TRANS_COLOR_KEY_SRC;
    panelCfg.deltaLinesPerPanel = 0;
    panelCfg.transColorKey      = 0x00;
    panelCfg.vencId             = VPS_DCTRL_DSS_VENC_HDMI;

//    Vps_DctrlVencDivisorInfo vencDivisors;
//
//    vencDivisors.vencId     = VPS_DCTRL_DSS_VENC_HDMI;
//    vencDivisors.divisorLCD = 1;
//    vencDivisors.divisorPCD = 1;

    Vps_DctrlOutputInfo vencOutput;

    vencOutput.actVidPolarity   = VPS_DCTRL_POLARITY_ACT_HIGH;
    vencOutput.pixelClkPolarity = VPS_DCTRL_POLARITY_ACT_HIGH;
    vencOutput.dvoFormat        = VPS_DCTRL_DVOFMT_GENERIC_DISCSYNC;
    vencOutput.hsPolarity       = VPS_DCTRL_POLARITY_ACT_HIGH;
    vencOutput.vsPolarity       = VPS_DCTRL_POLARITY_ACT_HIGH;
    vencOutput.dataFormat       = FVID2_DF_RGB24_888;
    vencOutput.videoIfWidth     = FVID2_VIFW_24BIT;
    vencOutput.vencId           = VPS_DCTRL_DSS_VENC_HDMI;

    /* This IOCTL should be called before SET_CONFIG_IOCTL */
    retVal = Fvid2_control(dctrlHandle, IOCTL_VPS_DCTRL_SET_VENC_OUTPUT, &vencOutput, NULL);
    if (retVal != FVID2_SOK) appPrint(" DCTRL Set Venc Output IOCTL Failed!!!\r\n");

    retVal = Fvid2_control(dctrlHandle, IOCTL_VPS_DCTRL_SET_CONFIG, &dctrlCfg, NULL);
    if (retVal != FVID2_SOK) appPrint(" DCTRL Set Config IOCTL Failed!!!\r\n");

    retVal = Fvid2_control(dctrlHandle, IOCTL_VPS_DCTRL_SET_OVLY_PARAMS, &panelCfg, NULL);
    if (retVal != FVID2_SOK) appPrint(" DCTRL Set OVLY Params IOCTL Failed!!!\r\n");

    appPrint(" Send control commands (IOCTLs) to DCTRL for configuration -> done...\r\n");

    /* [IN] DispApp_configDctrlPipe() l.1414 DSS_main.c --------------------- */
    Vps_DssDispcOvlyPipeConfig *ovlpipecfg;

    ovlpipecfg                      = &hdmiObj.ovlpipeconfig;
    ovlpipecfg->pipeLine            = hdmiObj.instId;
    ovlpipecfg->globalAlpha         = 0xFF;
    /* Z-order is in order GFX - 3, VID3 -2 ,VID2 - 1 and VID1 - 0 */
    ovlpipecfg->zorder              = hdmiObj.instId;
    ovlpipecfg->zorderEnable        = 1;
    ovlpipecfg->preMultiplyAlpha    = 0;

    retVal = Fvid2_control( dctrlHandle, IOCTL_VPS_DCTRL_SET_PIPELINE_PARAMS, ovlpipecfg, NULL);
    if (retVal != FVID2_SOK) appPrint(" DCTRL Set Pipeline params IOCTL Failed!!!\r\n");

    appPrint(" Send control commands (IOCTLs) to DCTRL Set pipeline -> done...\r\n");
    /* ]IN[ DispApp_configDctrlPipe() l.1414 DSS_main.c --------------------- */

    /* ]IN[ DispApp_configDctrl() l.889 DSS_main.c -------------------------- */

    /* Create specific hdmi disp driver handler */
    hdmiObj.drvHandle = Fvid2_create(FVID2_VPS_DISP_DRV, hdmiObj.instId, &hdmiObj.createPrms, &hdmiObj.createStatus, &hdmiObj.cbPrms);
    retVal = hdmiObj.createStatus.retVal;
    if ((NULL == hdmiObj.drvHandle) || (retVal != FVID2_SOK)) appPrint(" DSS Create Failed!!!\r\n");

    vps_dss_hdmi_appPrintDispCreateStatus(&hdmiObj.createStatus);

    retVal = Fvid2_control(hdmiObj.drvHandle, IOCTL_VPS_DISP_SET_DSS_PARAMS, &hdmiObj.dssPrms, NULL);
    if (retVal != FVID2_SOK) appPrint(" DSS Set Params IOCTL Failed!!!\r\n");


Thanks in advance

Quentin

  • Hi Quentin,

    Do you mean you are getting some error when setting up control parameters? Could you please share the parameters that you are trying to set? 

    Regards,

    Brijesh

  • Hi Brijesh,

    Thanks for your response.
    I would like to set this parameters:

        VpsDispCreateParams_init(&hdmiObj.createPrms);
        VpsDispDssParams_init(&hdmiObj.dssPrms);
    
        hdmiObj.dssPrms.inFmt.chNum             = 0U;
        hdmiObj.dssPrms.inFmt.width             = 1920U;
        hdmiObj.dssPrms.inFmt.height            = 1080U;
        hdmiObj.dssPrms.inFmt.pitch[0U]         = hdmiObj.pitch[0U];
        hdmiObj.dssPrms.inFmt.pitch[1U]         = hdmiObj.pitch[1U];
        hdmiObj.dssPrms.inFmt.pitch[2U]         = hdmiObj.pitch[2U];
        hdmiObj.dssPrms.inFmt.fieldMerged[0U]   = FALSE;
        hdmiObj.dssPrms.inFmt.fieldMerged[1U]   = FALSE;
        hdmiObj.dssPrms.inFmt.fieldMerged[2U]   = FALSE;
        hdmiObj.dssPrms.inFmt.dataFormat        = FVID2_DF_YUV422I_YUYV;
        hdmiObj.dssPrms.inFmt.scanFormat        = FVID2_SF_PROGRESSIVE;
        hdmiObj.dssPrms.inFmt.bpp               = FVID2_BPP_BITS16;
        hdmiObj.dssPrms.inFmt.reserved          = NULL;
        hdmiObj.dssPrms.tarWidth                = 1920U;
        hdmiObj.dssPrms.tarHeight               = 1080U;
        hdmiObj.dssPrms.posX                    = 0U;
        hdmiObj.dssPrms.posY                    = 0U;


    But when I try to set with Fvid2_control command
        hdmiObj.drvHandle = Fvid2_create(FVID2_VPS_DISP_DRV, hdmiObj.instId, &hdmiObj.createPrms, &hdmiObj.createStatus, &hdmiObj.cbPrms);
        retVal = hdmiObj.createStatus.retVal;
        if ((NULL == hdmiObj.drvHandle) || (retVal != FVID2_SOK)) appPrint(" DSS Create Failed!!!\r\n");
    
        vps_dss_hdmi_appPrintDispCreateStatus(&hdmiObj.createStatus);
    
        retVal = Fvid2_control(hdmiObj.drvHandle, IOCTL_VPS_DISP_SET_DSS_PARAMS, &hdmiObj.dssPrms, NULL);
        if (retVal != FVID2_SOK) appPrint(" DSS Set Params IOCTL Failed!!!\r\n");

    I get an error on the VpsCore_dssValidateDssParams() ("Input width+posx/height+posy > display width /height \r\n") 

    Int32 VpsCore_dssValidateDssParams(const VpsCore_DispDssParams *pathCfg, const VpsCore_DssPathObj    *pathObj);

    Here are object fields value

    I don't understand why my pathObj have not the correct values ? 

    I hope it's more clear, thanks in advance.

    Quentin

  • Hi Quentin,

    Is your display on? Are you calling display controller to start venc output or HDMI output? Because display size is set to 0x0. This can be 0 only if display is not on. 

    So can you use display controller interface to start the venc output?

    Regards,

    Brijesh

  • Hi Brijesh,

    Thanks for your support, just a message to give a status.
    So now it's work !!!!

    Several issue that I had to solve but mainly.
    1. The error on dss validation parameter was dues to the fact that I forgot to set "dctrlCfg.vencInfo.numVencs = 1U;" without this pathObj based on dctrl driver configuration was bad and the check failed
    2. I had to change the display resolution thanks to this post https://e2e.ti.com/support/processors-group/processors/f/processors-forum/564147/rtos-tmdsevm572x-hdmi-driver-for-rtos 

    Now I'm ready to continue my project and make some test about resolution among other.

    Regards,

    Quentin