diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_vdec_vdis.c b/demos/mcfw_api_demos/mcfw_demo/demo_vdec_vdis.c index 2e18e12..d940f4c 100755 --- a/demos/mcfw_api_demos/mcfw_demo/demo_vdec_vdis.c +++ b/demos/mcfw_api_demos/mcfw_demo/demo_vdec_vdis.c @@ -91,7 +91,7 @@ Void VdecVdis_start() vsysParams.numDisplays = 2; #else vsysParams.numSwMs = 2; - vsysParams.numDisplays = 2; + vsysParams.numDisplays = 1; #endif printf ("--------------- CHANNEL DETAILS-------------\n"); @@ -173,7 +173,7 @@ Void VdecVdis_start() /* Override the context here as needed */ vdisParams.numChannels = gVdecVdis_config.fileNum; - vdisParams.deviceParams[VDIS_DEV_HDMI].resolution = DEMO_HD_DISPLAY_DEFAULT_STD; + vdisParams.deviceParams[VDIS_DEV_HDMI].resolution = VSYS_STD_1080I_60; /* Since HDCOMP and DVO2 are tied together they must have same resolution */ vdisParams.deviceParams[VDIS_DEV_HDCOMP].resolution = DEMO_HD_DISPLAY_DEFAULT_STD; vdisParams.deviceParams[VDIS_DEV_DVO2].resolution = @@ -227,6 +227,7 @@ Void VdecVdis_start() vdisParams.mosaicParams[i].userSetDefaultSWMLayout = TRUE; #endif + vdisParams.enableHdmiControl = FALSE; Vdis_init(&vdisParams); wallTimeBase = get_current_time_to_msec(); diff --git a/mcfw/src_linux/mcfw_api/usecases/ti81xx/multich_vdec_vdis.c b/mcfw/src_linux/mcfw_api/usecases/ti81xx/multich_vdec_vdis.c index 0f96999..bc9b8e6 100755 --- a/mcfw/src_linux/mcfw_api/usecases/ti81xx/multich_vdec_vdis.c +++ b/mcfw/src_linux/mcfw_api/usecases/ti81xx/multich_vdec_vdis.c @@ -83,7 +83,6 @@ */ - #define MAX_DEC_OUT_FRAMES_PER_CH (5) #define MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_NUM_CHANNELS (16) #define MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_FRAME_WIDTH (720) @@ -171,8 +170,8 @@ typedef struct { UInt32 ipcInVpssId; UInt32 mergeId; Bool enableVideoFrameExport; + UInt32 deiId; AvsyncLink_LinkSynchConfigParams avsyncCfg[VDIS_DEV_MAX]; - UInt32 mpSclrId; } MultiCh_VdecVdisObj; @@ -202,73 +201,6 @@ static Void MultiCh_setIpcFramesOutInQueInfo(System_LinkQueInfo *inQueInfo) } } -static -Void mulich_vdec_vdis_set_avsync_vidque_prm(Avsync_SynchConfigParams *queCfg, - Int chnum, - UInt32 avsStartChNum, - UInt32 avsEndChNum, - VDIS_DEV vdDevId) -{ - queCfg->chNum = chnum; - queCfg->audioPresent = FALSE; - if ((queCfg->chNum >= avsStartChNum) - && - (queCfg->chNum <= avsEndChNum) - && - (gVsysModuleContext.vsysConfig.enableAVsync)) - { - queCfg->avsyncEnable = TRUE; - } - else - { - queCfg->avsyncEnable = FALSE; - } - - queCfg->clkAdjustPolicy.refClkType = AVSYNC_REFCLKADJUST_NONE; - queCfg->clkAdjustPolicy.clkAdjustLead = AVSYNC_VIDEO_TIMEBASESHIFT_MAX_LEAD_MS; - queCfg->clkAdjustPolicy.clkAdjustLag = AVSYNC_VIDEO_TIMEBASESHIFT_MAX_LAG_MS; - queCfg->vidSynchPolicy.maxReplayLead = AVSYNC_VIDEO_FUTURE_FRAME_DROP_THRESHOLD_MS; - queCfg->vidSynchPolicy.playMaxLag = 180; - queCfg->vidSynchPolicy.playMaxLead = 0; - queCfg->vidSynchPolicy.doMarginScaling = FALSE; - queCfg->playTimerStartTimeout = 0; - queCfg->playStartMode = AVSYNC_PLAYBACK_START_MODE_WAITSYNCH; - queCfg->ptsInitMode = AVSYNC_PTS_INIT_MODE_APP; -} - -static -Void mulich_vdec_vdis_set_avsync_prm(AvsyncLink_LinkSynchConfigParams *avsyncPrm, - UInt32 swMsIdx, - VDIS_DEV vdDevId) -{ - Int i; - Int32 status; - - Vdis_getAvsyncConfig(vdDevId,avsyncPrm); - avsyncPrm->displayLinkID = Vdis_getDisplayId(vdDevId); - avsyncPrm->videoSynchLinkID = gVdisModuleContext.swMsId[swMsIdx]; - avsyncPrm->numCh = gVdecModuleContext.vdecConfig.numChn; - avsyncPrm->syncMasterChnum = AVSYNC_INVALID_CHNUM; - for (i = 0; i < avsyncPrm->numCh;i++) - { - mulich_vdec_vdis_set_avsync_vidque_prm(&avsyncPrm->queCfg[i], - i, - 0, - (0 + gVdecModuleContext.vdecConfig.numChn), - vdDevId); - } - if (0 == swMsIdx) - { - Vdis_setAvsyncConfig(VDIS_DEV_HDMI,avsyncPrm); - } - else - { - Vdis_setAvsyncConfig(VDIS_DEV_SD,avsyncPrm); - } - - status = Avsync_configSyncConfigInfo(avsyncPrm); - OSA_assert(status == 0); -} Void MultiCh_createVdecVdis() { @@ -278,12 +210,11 @@ Void MultiCh_createVdecVdis() IpcLink_CreateParams ipcOutVideoPrm; IpcLink_CreateParams ipcInVpssPrm; DupLink_CreateParams dupPrm; - static SwMsLink_CreateParams swMsPrm[VDIS_DEV_MAX]; DisplayLink_CreateParams displayPrm[VDIS_DEV_MAX]; IpcFramesOutLinkHLOS_CreateParams ipcFramesOutHostPrm; IpcFramesInLinkRTOS_CreateParams ipcFramesInVpssFromHostPrm; MergeLink_CreateParams mergePrm; - MpSclrLink_CreateParams mpSclrPrm; + DeiLink_CreateParams deiPrm; UInt32 i; UInt32 enableGrpx; @@ -300,10 +231,9 @@ Void MultiCh_createVdecVdis() for (i = 0; i < VDIS_DEV_MAX;i++) { MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm[i]); - MULTICH_INIT_STRUCT(SwMsLink_CreateParams ,swMsPrm[i]); } + MULTICH_INIT_STRUCT(DeiLink_CreateParams,deiPrm); - MULTICH_INIT_STRUCT(MpSclrLink_CreateParams, mpSclrPrm); MultiCh_detectBoard(); @@ -358,15 +288,13 @@ Void MultiCh_createVdecVdis() gMultiCh_VdecVdisObj.ipcOutVideoId = SYSTEM_VIDEO_LINK_ID_IPC_OUT_M3_0; gMultiCh_VdecVdisObj.ipcInVpssId = SYSTEM_VPSS_LINK_ID_IPC_IN_M3_0; gMultiCh_VdecVdisObj.dupId = SYSTEM_VPSS_LINK_ID_DUP_0; - gMultiCh_VdecVdisObj.mpSclrId = SYSTEM_LINK_ID_MP_SCLR_INST_0; - gVdisModuleContext.mpSclrId = SYSTEM_LINK_ID_MP_SCLR_INST_0; - gVdisModuleContext.swMsId[0] = SYSTEM_LINK_ID_SW_MS_MULTI_INST_0; gVdisModuleContext.displayId[0] = SYSTEM_LINK_ID_DISPLAY_0; // ON AND OFF CHIP HDMI + gMultiCh_VdecVdisObj.deiId = SYSTEM_LINK_ID_DEI_HQ_0; + gVcapModuleContext.deiId[0] = gMultiCh_VdecVdisObj.deiId; if (gVsysModuleContext.vsysConfig.numDisplays > 1) { - gVdisModuleContext.swMsId[1] = SYSTEM_LINK_ID_SW_MS_MULTI_INST_1; #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD) gVdisModuleContext.displayId[1] = SYSTEM_LINK_ID_DISPLAY_2; // SDTV #else @@ -406,9 +334,16 @@ Void MultiCh_createVdecVdis() ipcBitsOutHostPrm.inQueInfo.chInfo[i].height = gVdecModuleContext.vdecConfig.decChannelParams[i].maxVideoHeight; - + if(gVdecModuleContext.vdecConfig.decChannelParams[i].fieldPicture) + { ipcBitsOutHostPrm.inQueInfo.chInfo[i].scanFormat = + SYSTEM_SF_INTERLACED; + } + else + { + ipcBitsOutHostPrm.inQueInfo.chInfo[i].scanFormat = SYSTEM_SF_PROGRESSIVE; + } ipcBitsOutHostPrm.inQueInfo.chInfo[i].bufType = 0; // NOT USED ipcBitsOutHostPrm.inQueInfo.chInfo[i].codingformat = 0; // NOT USED @@ -530,124 +465,43 @@ Void MultiCh_createVdecVdis() mergePrm.inQueParams[1].prevLinkId = gVdisModuleContext.ipcFramesInVpssFromHostId; mergePrm.inQueParams[1].prevLinkQueId = 0; - mergePrm.outQueParams.nextLink = gMultiCh_VdecVdisObj.mpSclrId; + mergePrm.outQueParams.nextLink = gMultiCh_VdecVdisObj.dupId; mergePrm.notifyNextLink = TRUE; - mpSclrPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.mergeId; } else { - mpSclrPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.ipcInVpssId; - ipcInVpssPrm.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.mpSclrId; + ipcInVpssPrm.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.dupId; } -#if defined(TI_814X_BUILD) || defined(TI_8107_BUILD) - mpSclrPrm.pathId = MP_SCLR_LINK_SEC0_SC3_VIP0; -#else - mpSclrPrm.pathId = MP_SCLR_LINK_SEC1_SC4_VIP1; -#endif - - mpSclrPrm.numCh = 4; - mpSclrPrm.enableLineSkip = FALSE; - mpSclrPrm.outQueParams.nextLink = gMultiCh_VdecVdisObj.dupId; - dupPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.mpSclrId; + dupPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.ipcInVpssId; + ipcInVpssPrm.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.deiId; + deiPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.ipcInVpssId; + deiPrm.inQueParams.prevLinkQueId = 0; + deiPrm.outQueParams[DEI_LINK_OUT_QUE_DEI_SC].nextLink = gMultiCh_VdecVdisObj.dupId; + deiPrm.enableOut[DEI_LINK_OUT_QUE_DEI_SC] = 1; + deiPrm.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].scaleMode = DEI_SCALE_MODE_ABSOLUTE; + deiPrm.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].absoluteResolution.outWidth = 1920; + deiPrm.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].absoluteResolution.outHeight = 540; + deiPrm.enableDeiForceBypass = TRUE; + deiPrm.interlacedBypassMode = TRUE; + deiPrm.inputFrameRate[DEI_LINK_OUT_QUE_DEI_SC] = 30; + deiPrm.outputFrameRate[DEI_LINK_OUT_QUE_DEI_SC] = 30; + deiPrm.disableInBufferSkip = TRUE; + + dupPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.deiId; dupPrm.inQueParams.prevLinkQueId = 0; dupPrm.numOutQue = gVsysModuleContext.vsysConfig.numDisplays; - dupPrm.outQueParams[0].nextLink = gVdisModuleContext.swMsId[0]; - dupPrm.outQueParams[1].nextLink = gVdisModuleContext.swMsId[1]; + dupPrm.outQueParams[0].nextLink = gVdisModuleContext.displayId[0]; dupPrm.notifyNextLink = TRUE; -#if defined(TI_814X_BUILD) || defined(TI_8107_BUILD) - - swMsPrm[0].numSwMsInst = 1; - swMsPrm[0].swMsInstId[0] = SYSTEM_SW_MS_SC_INST_DEIHQ_SC_NO_DEI; - - swMsPrm[0].swMsInstStartWin[0] = 0; - swMsPrm[0].swMsInstStartWin[1] = 10; - - swMsPrm[1].numSwMsInst = 1; - swMsPrm[1].swMsInstId[0] = SYSTEM_SW_MS_SC_INST_DEI_SC_NO_DEI; - - swMsPrm[1].swMsInstStartWin[0] = 0; - swMsPrm[1].swMsInstStartWin[1] = 10; - - swMsPrm[0].enableProcessTieWithDisplay = TRUE; - swMsPrm[1].enableProcessTieWithDisplay = FALSE; - - /* We do not require dual output, this free up SC3 scalar */ - swMsPrm[0].includeVipScInDrvPath = FALSE; - swMsPrm[1].includeVipScInDrvPath = FALSE; -#else - swMsPrm[0].swMsInstId[0] = SYSTEM_SW_MS_SC_INST_DEI_SC_NO_DEI; - swMsPrm[0].swMsInstId[1] = SYSTEM_SW_MS_SC_INST_VIP1_SC; - - swMsPrm[1].swMsInstId[0] = SYSTEM_SW_MS_SC_INST_DEIHQ_SC_NO_DEI; - swMsPrm[1].swMsInstId[1] = SYSTEM_SW_MS_SC_INST_VIP0_SC; - - swMsPrm[0].numSwMsInst = 2; - - swMsPrm[0].swMsInstStartWin[0] = 0; - swMsPrm[0].swMsInstStartWin[1] = 16; - - swMsPrm[1].numSwMsInst = swMsPrm[0].numSwMsInst; - swMsPrm[1].swMsInstStartWin[0] = swMsPrm[0].swMsInstStartWin[0]; - swMsPrm[1].swMsInstStartWin[1] = swMsPrm[0].swMsInstStartWin[1]; - - swMsPrm[0].enableProcessTieWithDisplay = TRUE; - swMsPrm[1].enableProcessTieWithDisplay = TRUE; - -#endif for(i=0; iVDIS use case */ - swMsPrm[i].maxInputQueLen = SYSTEM_SW_MS_INVALID_INPUT_QUE_LEN; - if (i == 0) - { - vdDevId = VDIS_DEV_HDMI; - swMsPrm[i].maxOutRes = VSYS_STD_1080P_60; - swMsPrm[i].initOutRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_HDMI].resolution; - } - else if (i == 1) - { -#if defined(TI_814X_BUILD) || defined(TI_8107_BUILD) - vdDevId = VDIS_DEV_SD; - swMsPrm[i].maxOutRes = VSYS_STD_PAL; - swMsPrm[i].outQueParams.nextLink = SYSTEM_LINK_ID_DISPLAY_2; - swMsPrm[i].initOutRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_SD].resolution; - -#else - vdDevId = VDIS_DEV_DVO2; - swMsPrm[i].maxOutRes = VSYS_STD_1080P_60; - swMsPrm[i].initOutRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_DVO2].resolution; -#endif - } - /* low cost line skip mode of scaling can be used, when tiler is off */ - if(tilerEnable) - swMsPrm[i].lineSkipMode = FALSE; - else - swMsPrm[i].lineSkipMode = TRUE; - - swMsPrm[i].enableLayoutGridDraw = gVdisModuleContext.vdisConfig.enableLayoutGridDraw; - - MultiCh_swMsGetDefaultLayoutPrm(vdDevId, &swMsPrm[i], FALSE); /* both from 0-16 chnl */ - - displayPrm[i].inQueParams[0].prevLinkId = gVdisModuleContext.swMsId[i]; + displayPrm[i].inQueParams[0].prevLinkId = gMultiCh_VdecVdisObj.dupId; displayPrm[i].inQueParams[0].prevLinkQueId = 0; - displayPrm[i].displayRes = swMsPrm[i].initOutRes; - if (i == 1) -#if defined(TI_814X_BUILD) || defined(TI_8107_BUILD) - displayPrm[i].displayRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_SD].resolution; -#else - displayPrm[i].displayRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_DVO2].resolution; -#endif - mulich_vdec_vdis_set_avsync_prm(&gMultiCh_VdecVdisObj.avsyncCfg[i],i,vdDevId); + displayPrm[i].displayRes = VSYS_STD_1080I_60; + displayPrm[i].forceFieldSeparatedInputMode = FALSE; + displayPrm[i].queueInISRFlag = TRUE; } System_linkCreate(gVdecModuleContext.ipcBitsOutHLOSId,&ipcBitsOutHostPrm,sizeof(ipcBitsOutHostPrm)); @@ -664,13 +518,10 @@ Void MultiCh_createVdecVdis() System_linkCreate(gMultiCh_VdecVdisObj.mergeId,&mergePrm,sizeof(mergePrm)); } - System_linkCreate(gMultiCh_VdecVdisObj.mpSclrId, &mpSclrPrm, sizeof(mpSclrPrm)); + System_linkCreate(gMultiCh_VdecVdisObj.deiId, &deiPrm, sizeof(deiPrm)); System_linkCreate(gMultiCh_VdecVdisObj.dupId , &dupPrm , sizeof(dupPrm)); for(i=0; i