diff --git a/demos/mcfw_api_demos/mcfw_demo/demo.c b/demos/mcfw_api_demos/mcfw_demo/demo.c
index f635b73..12f4d89 100755
--- a/demos/mcfw_api_demos/mcfw_demo/demo.c
+++ b/demos/mcfw_api_demos/mcfw_demo/demo.c
@@ -8,7 +8,7 @@
 #include <unwind.h>
 #include <osa.h>
 
-// #define DEMO_ENABLE_SPL_USECASES             (FALSE)
+#define DEMO_ENABLE_SPL_USECASES             
 
 /* Forward Declarations */
 static int Demo_handleHdmiDviDisplays(void);
diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_display.c b/demos/mcfw_api_demos/mcfw_demo/demo_display.c
index 67c9ef5..4083d7f 100755
--- a/demos/mcfw_api_demos/mcfw_demo/demo_display.c
+++ b/demos/mcfw_api_demos/mcfw_demo/demo_display.c
@@ -675,6 +675,28 @@ UInt32 Demo_displayGetCurSeqId()
     return (gDemo_info.curDisplaySeqId);
 }
 
+Bool Demo_isLayoutPossible(Int32 demoId, Int32 layoutId)
+{
+    if (demoId == DEMO_HD_SD_5CH)
+    {
+		/* HD SD use case in interlace mode uses DEI driver for which there is restriction of 
+                 max windows (channels) supported (at vpss side). Hence restricting layouts.
+               */
+        if ((layoutId == DEMO_LAYOUT_MODE_1CH)
+            || (layoutId == DEMO_LAYOUT_MODE_4CH)
+            || (layoutId == DEMO_LAYOUT_MODE_9CH)
+            )
+        {
+            return TRUE;
+        }
+        else
+        {
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
 int Demo_displaySettings(int demoId)
 {
     Bool done = FALSE;
@@ -736,6 +758,11 @@ int Demo_displaySettings(int demoId)
 
                {
                     layoutId = Demo_displayGetLayoutId(demoId);
+                    if (Demo_isLayoutPossible(demoId, layoutId) == FALSE)
+                    {
+                        printf("\nDEMO: Layout not ALLOWED/POSSIBLE for this demo\n");
+                        break;
+                    }
 
                     /************* For devID = VDIS_DEV_HDMI *************/
                     devId = VDIS_DEV_HDMI;
diff --git a/mcfw/interfaces/link_api/swMsLink.h b/mcfw/interfaces/link_api/swMsLink.h
index 08210b8..d20e89f 100755
--- a/mcfw/interfaces/link_api/swMsLink.h
+++ b/mcfw/interfaces/link_api/swMsLink.h
@@ -94,7 +94,8 @@
 #define SYSTEM_SW_MS_SC_INST_VIP1_SC_NO_DEI  (8)
 /** \brief DEI VIP0 path Scalar with DEI in bypass mode */
 #define SYSTEM_SW_MS_SC_INST_VIP0_SC_NO_DEI  (9)
-
+/** \brief DEI VIP0 path Scalar with DEI */
+#define SYSTEM_SW_MS_SC_INST_VIP0_DEI_SC     (10)
 
 /* @} */
 
diff --git a/mcfw/interfaces/link_api/system_debug.h b/mcfw/interfaces/link_api/system_debug.h
index ef744ff..00b6691 100755
--- a/mcfw/interfaces/link_api/system_debug.h
+++ b/mcfw/interfaces/link_api/system_debug.h
@@ -125,6 +125,8 @@ extern "C" {
     #define SYSTEM_DEBUG_IPC_RT
     #define SYSTEM_DEBUG_ENC_RT
     #define SYSTEM_DEBUG_DEC_RT
+    #define SYSTEM_DEBUG_MERGE_RT
+    #define SYSTEM_DEBUG_DUP_RT
 #endif
 
 /*@}*/
diff --git a/mcfw/src_bios6/links_common/dup/dupLink_tsk.c b/mcfw/src_bios6/links_common/dup/dupLink_tsk.c
index 44862cb..806920a 100755
--- a/mcfw/src_bios6/links_common/dup/dupLink_tsk.c
+++ b/mcfw/src_bios6/links_common/dup/dupLink_tsk.c
@@ -56,6 +56,19 @@ Int32 DupLink_drvCreate(DupLink_Obj * pObj, DupLink_CreateParams * pPrm)
                &pObj->info.queInfo[0], sizeof(pObj->info.queInfo[0]));
     }
 
+    for (frameId = 0; frameId < pObj->info.queInfo[0].numCh; frameId++)
+    {
+#ifdef SYSTEM_DEBUG_DUP_RT
+        Vps_printf(" %d: DUP: %2d: Format: %s, %d x %d\n",
+                    Utils_getCurTimeInMsec(),
+                    frameId,
+                    gSystem_nameScanFormat[pObj->info.queInfo[0].chInfo[frameId].scanFormat],
+                    pObj->info.queInfo[0].chInfo[frameId].width, 
+                    pObj->info.queInfo[0].chInfo[frameId].height 
+                    );
+#endif
+    }
+
     Semaphore_Params_init(&semParams);
     semParams.mode = Semaphore_Mode_BINARY;
 
diff --git a/mcfw/src_bios6/links_common/merge/mergeLink_tsk.c b/mcfw/src_bios6/links_common/merge/mergeLink_tsk.c
index 033ba02..28bd510 100755
--- a/mcfw/src_bios6/links_common/merge/mergeLink_tsk.c
+++ b/mcfw/src_bios6/links_common/merge/mergeLink_tsk.c
@@ -70,6 +70,15 @@ Int32 MergeLink_drvCreate(MergeLink_Obj * pObj, MergeLink_CreateParams * pPrm)
             pObj->outQueChToInQueMap[numOutCh] = inQue;
             pObj->outQueChMap[numOutCh] = chId;
 
+#ifdef SYSTEM_DEBUG_MERGE_RT
+            Vps_printf(" %d: MERGE: %2d: Format: %s, %d x %d\n",
+                        Utils_getCurTimeInMsec(),
+                        numOutCh, 
+                        gSystem_nameScanFormat[pOutQueInfo->chInfo[numOutCh].scanFormat],
+                        pOutQueInfo->chInfo[numOutCh].width,
+                        pOutQueInfo->chInfo[numOutCh].height
+                        );
+#endif
             numOutCh++;
             UTILS_assert(numOutCh <= SYSTEM_MAX_CH_PER_OUT_QUE);
         }
diff --git a/mcfw/src_bios6/links_common/select/selectLink_priv.h b/mcfw/src_bios6/links_common/select/selectLink_priv.h
index 0bcea1f..b0cc015 100755
--- a/mcfw/src_bios6/links_common/select/selectLink_priv.h
+++ b/mcfw/src_bios6/links_common/select/selectLink_priv.h
@@ -29,6 +29,8 @@ typedef struct {
 typedef struct {
     UInt32 tskId;
 
+    char name[32];
+
     Utils_TskHndl tsk;
 
     SelectLink_CreateParams createArgs;
diff --git a/mcfw/src_bios6/links_common/select/selectLink_tsk.c b/mcfw/src_bios6/links_common/select/selectLink_tsk.c
index f12ec6d..6799551 100755
--- a/mcfw/src_bios6/links_common/select/selectLink_tsk.c
+++ b/mcfw/src_bios6/links_common/select/selectLink_tsk.c
@@ -180,9 +180,10 @@ Int32 SelectLink_drvSetOutQueChInfo(SelectLink_Obj * pObj, SelectLink_OutQueChIn
         pChInfo->rtChInfoUpdate = TRUE;
 
         #ifdef SYSTEM_DEBUG_SELECT
-        Vps_printf(" %d: SELECT: OUT QUE%d: OUT CH%d: IN CH%d: %d x %d, pitch = (%d, %d) [%s] [%s]\n",
+        Vps_printf(" %d: %s: OUT QUE%d: OUT CH%d: IN CH%d: %d x %d, pitch = (%d, %d) [%s] [%s]\n",
                 Utils_getCurTimeInMsec(),
-                pChInfo->queId ,
+                pObj->name,
+                pChInfo->queId,
                 outChNum,
                 inChNum,
                 pChInfo->rtChInfo.width,
@@ -318,6 +319,22 @@ Int32 SelectLink_drvProcessFrames(SelectLink_Obj * pObj)
                     pFrameInfo->rtChInfoUpdate = TRUE;
 
                     pFrameInfo->rtChInfo = pChInfo->rtChInfo;
+#ifdef SYSTEM_DEBUG_SELECT
+                    Vps_printf(" %d: %s (rtChInfoUpdate): OUT QUE%d: OUT CH%d: IN CH%d: %d x %d, pitch = (%d, %d) [%s] [%s], dataTypeChange = %d\n",
+                            Utils_getCurTimeInMsec(),
+                            pObj->name,
+                            pChInfo->queId,
+                            pChInfo->outChNum,
+                            pFrame->channelNum,
+                            pChInfo->rtChInfo.width,
+                            pChInfo->rtChInfo.height,
+                            pChInfo->rtChInfo.pitch[0],
+                            pChInfo->rtChInfo.pitch[1],
+                            gSystem_nameScanFormat[pChInfo->rtChInfo.scanFormat],
+                            gSystem_nameMemoryType[pChInfo->rtChInfo.memType],
+                            pFrameInfo->isDataTypeChange
+                        );
+#endif
                 }
 
                 /* save original channelNum so that we can restore it later while releasing the frame */
@@ -475,6 +492,8 @@ Int32 SelectLink_init()
 
         memset(pObj, 0, sizeof(*pObj));
 
+        UTILS_SNPRINTF(pObj->name, "SELECT_%d", selectId);
+
         pObj->tskId =
             SYSTEM_MAKE_LINK_ID(procId, SYSTEM_LINK_ID_SELECT_0) + selectId;
 
@@ -486,7 +505,7 @@ Int32 SelectLink_init()
 
         System_registerLink(pObj->tskId, &linkObj);
 
-        sprintf(tskName, "SELECT%d", selectId);
+        UTILS_SNPRINTF(tskName, "SELECT%d", selectId);
 
         status = Utils_tskCreate(&pObj->tsk,
                                  SelectLink_tskMain,
diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c b/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
index 68d68e6..669e252 100755
--- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
+++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
@@ -816,6 +816,7 @@ static Int32 declink_codec_init_outframe(DecLink_Obj * pObj,
     /* By Default, the output data type is 420 SP, update the rtparam,
         other link will use this when rtChInfoUpdate is set */
     pFrameInfo->rtChInfo.dataFormat = SYSTEM_DF_YUV420SP_UV;
+    pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[0].chInfo[chId].scanFormat;
 
     return DEC_LINK_S_SUCCESS;
 }
@@ -1104,7 +1105,7 @@ static Void DecLink_codecProcessTskFxn(UArg arg1, UArg arg2)
 
             if (UTILS_ISERROR(status))
             {
-                UTILS_warn("DEC : IVAHDID : %d ENCLINK:ERROR in "
+                UTILS_warn("DEC : IVAHDID : %d DECLINK:ERROR in "
                            "DecLink_SubmitBatch.Status[%d]", tskId, status);
             }
             else
@@ -1849,8 +1850,10 @@ static Int32 DecLink_codecGetProcessedData(DecLink_Obj * pObj)
     System_LinkInQueParams *pInQueParams;
     DecLink_ChObj *pChObj;
     DecLink_ReqObj *pReqObj;
-    Int32 status, j;
+    Int32 status, j, num;
     UInt32 curTime;
+    FVID2_FrameList actualOutList;
+    System_FrameInfo *pFrameInfo;
 
     sendCmd = FALSE;
     inBufList.numBufs = 0;
@@ -1887,8 +1890,6 @@ static Int32 DecLink_codecGetProcessedData(DecLink_Obj * pObj)
 
         pChObj->getProcessedBufCount++;
 
-        pChObj->outFrameCount++;
-
         if (pReqObj->InBuf->flushFrame)
         {
             DECLINK_INFO_LOG(pObj->linkId,pReqObj->InBuf->channelNum,"Freeing flush Frame");
@@ -1904,6 +1905,34 @@ static Int32 DecLink_codecGetProcessedData(DecLink_Obj * pObj)
                              pReqObj->OutFrameList.frames[j]->channelNum);
                 UTILS_assert(pChObj->allocPoolID < UTILS_BUF_MAX_ALLOC_POOLS);
 
+                actualOutList.numFrames = 1;
+                actualOutList.frames[0] = pReqObj->OutFrameList.frames[j];
+
+                if (pObj->createArgs.chCreateParams[chId].processCallLevel  
+                          == IH264VDEC_FIELDLEVELPROCESSCALL)
+                {
+                    status = DecLink_dupFrame(pObj, 
+                    actualOutList.frames[0], 
+                    &actualOutList.frames[1]);
+                    UTILS_assert(status == FVID2_SOK);
+                
+                    actualOutList.frames[0]->fid = FVID2_FID_TOP;
+                    pFrameInfo = (System_FrameInfo*) actualOutList.frames[0]->appData;
+
+                    actualOutList.frames[1]->fid = FVID2_FID_BOTTOM;
+                    actualOutList.frames[1]->addr[0][0]  
+                           = ((UInt8 *) actualOutList.frames[0]->addr[0][0] + 
+                              pFrameInfo->rtChInfo.pitch[0]);
+                    actualOutList.frames[1]->addr[0][1]  
+                           = ((UInt8 *) actualOutList.frames[0]->addr[0][1] + 
+                              pFrameInfo->rtChInfo.pitch[1]);
+
+                    actualOutList.numFrames++;
+                }
+
+                for (num = 0; num < actualOutList.numFrames; num++)
+                {
+                    pChObj->outFrameCount++;
                 pChObj->trickPlayObj.skipFrame = 
                     Utils_doSkipFrame(&(pChObj->trickPlayObj.frameSkipCtx));
 
@@ -1916,16 +1945,17 @@ static Int32 DecLink_codecGetProcessedData(DecLink_Obj * pObj)
                 {
                     /* Skip the output frame */
                     outFrameSkipList.frames[outFrameSkipList.numFrames] =
-                                        pReqObj->OutFrameList.frames[j];
+                        actualOutList.frames[num];
                     outFrameSkipList.numFrames++;
                 }
                 else
                 {
                     outFrameList.frames[outFrameList.numFrames] =
-                                        pReqObj->OutFrameList.frames[j];
+                            actualOutList.frames[num];
                     outFrameList.numFrames++;
                 }
             }
+             }
         }
         status = Utils_quePut(&pObj->reqQue, pReqObj, BIOS_NO_WAIT);
         UTILS_assert(status == FVID2_SOK);
diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c b/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
index dcefc84..08ce0be 100755
--- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
+++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
@@ -269,7 +269,7 @@ Int32 Declink_h264DecodeFrameBatch(DecLink_Obj * pObj,
 
             for (i = 0; i < inputBufDesc->numBufs; i++)
             {
-              /* Set proper buffer addresses for bitstreamn data */
+              /* Set proper buffer addresses for bitstream data */
               /*---------------------------------------------------------------*/
               inputBufDesc->descs[i].buf = (XDAS_Int8 *) pReqObj->InBuf->addr +
                                                          bytesConsumed;
@@ -577,6 +577,7 @@ Int32 Declink_h264DecodeFrameBatch(DecLink_Obj * pObj,
                             pFrameInfo->rtChInfo.memType = VPS_VPDMA_MT_NONTILEDMEM;
                         }
                         pFrameInfo->rtChInfoUpdate = TRUE;
+                        pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[0].chInfo[chId].scanFormat;
                     }
                     pReqObj->OutFrameList.frames[prosIdx]->fid =
                     Utils_encdecMapXDMContentType2FVID2FID(displayBufs->
diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_jpeg.c b/mcfw/src_bios6/links_m3video/iva_dec/decLink_jpeg.c
index 7c0d049..1fe3de9 100755
--- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_jpeg.c
+++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_jpeg.c
@@ -250,6 +250,7 @@ Int32 Declink_jpegDecodeFrameBatch(DecLink_Obj * pObj,
                         pFrameInfo->rtChInfo.memType = VPS_VPDMA_MT_NONTILEDMEM;
                     }
                     pFrameInfo->rtChInfoUpdate = TRUE;
+                    pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[0].chInfo[chId].scanFormat;
                 }
                 pReqObj->OutFrameList.frames[prosIdx]->fid =
                     Utils_encdecMapXDMContentType2FVID2FID(displayBufs->
diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c b/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c
index 0937153..dc3d999 100755
--- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c
+++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c
@@ -416,6 +416,7 @@ Int32 Declink_mpeg4DecodeFrameBatch(DecLink_Obj * pObj,
                             pFrameInfo->rtChInfo.memType = VPS_VPDMA_MT_NONTILEDMEM;
                         }
                         pFrameInfo->rtChInfoUpdate = TRUE;
+                        pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[0].chInfo[chId].scanFormat;
                     }
                     pReqObj->OutFrameList.frames[prosIdx]->fid =
                         Utils_encdecMapXDMContentType2FVID2FID(displayBufs->
diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h b/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
index 76c5986..4d302eb 100755
--- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
+++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
@@ -60,7 +60,7 @@
 
 #define DEC_LINK_MAX_DUP_PER_FRAME           (4)
 
-#define DEC_LINK_MAX_DUP_FRAMES              (DEC_LINK_MAX_OUT_FRAMES)
+#define DEC_LINK_MAX_DUP_FRAMES              (DEC_LINK_MAX_OUT_FRAMES*2)
 #define DEC_LINK_NUM_ALGPROCESS_PER_HDVICP_ACQUIRE             (8)
 
 #define DEC_LINK_FRAMESKIP_DUE2ACCUM_THRESHOLD                 (2)
diff --git a/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c b/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c
index 4d419f7..1c8ce24 100755
--- a/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c
+++ b/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c
@@ -234,12 +234,22 @@ Int32 DeiLink_drvCreateOutObj(DeiLink_Obj * pObj)
                 pFormat->fieldMerged[0] = FALSE;
                 pFormat->fieldMerged[1] = FALSE;
                 pFormat->fieldMerged[2] = FALSE;
-                pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
                 pFormat->bpp = FVID2_BPP_BITS16;
                 pFormat->reserved = NULL;
 
                 pInChInfo = &pObj->inQueInfo.chInfo[chId];
 
+                if (pInChInfo->scanFormat == FVID2_SF_INTERLACED && pObj->createArgs.enableDeiForceBypass == TRUE && pObj->createArgs.interlacedBypassMode == TRUE)
+                {
+                    Vps_printf ("DEI: Ch %d, Outformat is INTERLACED\n", chId);
+                    pFormat->scanFormat = FVID2_SF_INTERLACED;
+                }
+                else
+                {
+                    Vps_printf ("DEI: Ch %d, Outformat is PROGRESSIVE\n", chId);
+                    pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
+                }
+
                 pFormat->width = pInChInfo->width;
                 if (pInChInfo->scanFormat == FVID2_SF_INTERLACED && !pObj->createArgs.enableDeiForceBypass)
                 {
@@ -375,11 +385,13 @@ Int32 DeiLink_drvCreateOutObj(DeiLink_Obj * pObj)
                         UTILS_assert(status == FVID2_SOK);
                     }
 
-#ifdef SYSTEM_VERBOSE_PRINTS
-                    Vps_rprintf(" %d: DEI: OUT%d: %2d: 0x%08x, %d x %d, %d frames\n",
+#ifdef SYSTEM_DEBUG_DEI
+                    Vps_printf(" %d: DEI: OUT%d: %2d: Format: %s, 0x%08x, %d x %d, %d frames\n",
                                 Utils_getCurTimeInMsec(),
                                 outId,
-                                chId, pOutObj->outFrames[chId][0].addr[0][0],
+                                chId, 
+                                gSystem_nameScanFormat[pOutChInfo->scanFormat],
+                                pOutObj->outFrames[chId][0].addr[0][0],
                                 pOutChInfo->width,
                                 pOutChInfo->height,
                                 pOutObj->outNumFrames[chId]
@@ -1626,6 +1638,7 @@ Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj,
                                 pChObj->deiRtOutFrmPrm[outId].pitch[1];
                     pFrameInfo->rtChInfo.memType = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].memType;
                     pFrameInfo->rtChInfo.dataFormat = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].dataFormat;
+                    pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].scanFormat;
                     pFrameInfo->isDataTypeChange = TRUE;
                     pFrameInfo->rtChInfoUpdate = TRUE;
                     pFrameInfo->ts64  = pInFrameInfo->ts64;
@@ -1743,6 +1756,7 @@ Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj,
                                     pChObj->vipRtOutFrmPrm[outId].pitch[1];
                         pFrameInfo->rtChInfo.memType = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].memType;
                         pFrameInfo->rtChInfo.dataFormat = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].dataFormat;
+                        pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].scanFormat;
                         pFrameInfo->isDataTypeChange = TRUE;
                         pFrameInfo->rtChInfoUpdate = TRUE;
                         pFrameInfo->ts64  = pInFrameInfo->ts64;
@@ -1845,6 +1859,7 @@ Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj,
                                         pChObj->vipRtOutFrmPrm[outId].pitch[1];
                             pFrameInfo->rtChInfo.memType = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].memType;
                             pFrameInfo->rtChInfo.dataFormat = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].dataFormat;
+                            pFrameInfo->rtChInfo.scanFormat = pObj->info.queInfo[outId].chInfo[pInFrame->channelNum].scanFormat;
                             pFrameInfo->isDataTypeChange = TRUE;
                             pFrameInfo->rtChInfoUpdate = TRUE;
                             pFrameInfo->ts64  = pInFrameInfo->ts64;
diff --git a/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_drv.c b/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_drv.c
index be51252..db0188c 100755
--- a/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_drv.c
+++ b/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_drv.c
@@ -95,7 +95,6 @@ Int32 NsfLink_printBufferStatus(NsfLink_Obj * pObj)
         Utils_getCurTimeInMsec(), pObj->inFrameReceiveCount, pObj->inFrameGivenCount);
 
     for (i=0; i<pObj->createArgs.numOutQue; i++)
-//        for (i=0; i<NSF_LINK_MAX_OUT_QUE; i++)
     {
         sprintf ((char *)str, "NSF Out [%d]", i);
         Utils_bufPrintStatus(str, &pObj->bufOutQue[i]);
@@ -402,6 +401,11 @@ Int32 NsfLink_drvDoNsfFilter(NsfLink_Obj * pObj)
             rtParamDataFmt = &nsfChObj->nsfRtParamDataFormat;
             if ((pInFrameInfo != NULL) && (pInFrameInfo->rtChInfoUpdate == TRUE))
             {
+                if (pInFrameInfo->rtChInfo.scanFormat != nsfChObj->scanFormat)
+                {
+                    nsfChObj->scanFormat = pInFrameInfo->rtChInfo.scanFormat;
+                    rtParamUpdatePerFrame = TRUE;
+                }
                 if (pInFrameInfo->rtChInfo.height != rtParamDataFmt->inFrameHeight)
                 {
                     rtParamDataFmt->inFrameHeight = pInFrameInfo->rtChInfo.height;
@@ -432,7 +436,9 @@ Int32 NsfLink_drvDoNsfFilter(NsfLink_Obj * pObj)
             pOutFrameInfo->rtChInfo.pitch[1] = rtParamDataFmt->outPitch[1];
             pOutFrameInfo->rtChInfo.dataFormat = FVID2_DF_YUV420SP_UV;
             pOutFrameInfo->rtChInfo.memType    = rtParamDataFmt->outMemType;
+            pOutFrameInfo->rtChInfo.scanFormat = nsfChObj->scanFormat;
             pOutFrameInfo->rtChInfoUpdate    = TRUE;
+            pOutFrameInfo->isDataTypeChange = TRUE;
 
             outFrameList.frames[numFrames] = pEmptyFrame;
 
diff --git a/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_priv.h b/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_priv.h
index c30b737..824f56e 100755
--- a/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_priv.h
+++ b/mcfw/src_bios6/links_m3vpss/nsf/nsfLink_priv.h
@@ -86,6 +86,8 @@ typedef struct {
     Vps_NsfDataFormat nsfRtParamDataFormat;
     Vps_M2mNsfRtParams nsfRtParams;
 
+    /* Scanformat for each channel */
+    UInt32        scanFormat;
 } NsfLink_ChObj;
 
 typedef struct {
diff --git a/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_drv.c b/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_drv.c
index 884d4d9..72df87f 100755
--- a/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_drv.c
+++ b/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_drv.c
@@ -645,6 +645,43 @@ Int32 SwMsLink_drvPrintAvgStatistics(SwMsLink_Obj * pObj)
     return 0;
 }
 
+
+Int32 SwMsLink_drvPrintDriverStatistics(SwMsLink_Obj * pObj)
+{
+    Int32 i;
+
+    Vps_printf( " \n"
+            " *** [%s] Mosaic Driver Statistics *** \n",
+            pObj->name
+            );
+    for (i = 0; i < pObj->createArgs.numSwMsInst; i++)
+    {
+        Vps_printf(
+                "%d) *** Drv Inst [%d], handle %X, %s  %s  %s\n",
+                i,
+                pObj->DrvObj[i].drvInstId,
+                pObj->DrvObj[i].fvidHandle,
+                (pObj->DrvObj[i].isDeiDrv) ? "DEI_DRV" : "NON_DEI",
+                (pObj->DrvObj[i].bypassDei == TRUE) ? "bypassDei" : " ",
+                (pObj->DrvObj[i].forceBypassDei== TRUE) ? "forceBypassDei" : " "
+            );
+        if (pObj->DrvObj[i].isDeiDrv)
+        {
+            Vps_printf( 
+            "DualOut Inst [%d], %s  
%s  numVipStrms %d *** \n",
+                pObj->DrvObj[i + SYSTEM_SW_MS_MAX_INST].drvInstId,
+                (SwMsLink_drvIsVipOutputUsed(pObj->DrvObj[i].drvInstId) == TRUE)
+                        ? "VipOutputUsed" : " ",
+                (SwMsLink_drvIsVipScOnlyOutput(pObj->DrvObj[i].drvInstId) == TRUE)
+                    ? "VipScOnlyOutput" : " ",
+                pObj->DrvObj[i].cfg.dei.deiCreateParams.numVipOutStreams
+            );
+        }
+    }
+    return 0;
+}
+
+
 Int32 SwMsLink_drvPrintStatistics(SwMsLink_Obj * pObj, Bool resetAfterPrint)
 {
     UInt32 winId;
@@ -654,6 +691,8 @@ Int32 SwMsLink_drvPrintStatistics(SwMsLink_Obj * pObj, Bool resetAfterPrint)
     elaspedTime = Utils_getCurTimeInMsec() - pObj->statsStartTime; // in msecs
     elaspedTime /= 1000; // convert to secs
 
+    SwMsLink_drvPrintDriverStatistics(pObj);
+
     Vps_printf( " \n"
             " *** [%s] Mosaic Statistics *** \n"
             " \n"
@@ -935,9 +974,9 @@ Int32 SwMsLink_drvPrintLayoutParams(SwMsLink_Obj * pObj)
             " \n"
             " Output FPS: %d\n"
             " \n"
-            " Win | Ch  | Input      | Input          | Input         | Input       | Output     |  Output         | Output        | Output      | Low Cost | SWMS | Data  | Blank |\n"
-            " Num | Num | Start X, Y | Width x Height | Pitch Y / C   | Memory Type | Start X, Y |  Width x Height | Pitch Y / C   | Memory Type | ON / OFF | Inst | Format| Frame |\n"
-            " ----------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
+            " Win | Ch  | Input      | Input          | Input         | Input       | Output     |  Output         | Output        | Output      | Scan        | Low Cost | SWMS | Data  | Blank |\n"
+            " Num | Num | Start X, Y | Width x Height | Pitch Y / C   | Memory Type | Start X, Y |  Width x Height | Pitch Y / C   | Memory Type | Fmt         | ON / OFF | Inst | Format| Frame |\n"
+            " ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
             pObj->name,
             pObj->layoutParams.outputFPS
             );
@@ -958,7 +997,7 @@ Int32 SwMsLink_drvPrintLayoutParams(SwMsLink_Obj * pObj)
             strcpy(strDataFormat, "UNKNWN");
 
         Vps_printf
-            (" %3d | %3d | %4d, %4d | %5d x %6d | %5d / %5d | %s | %4d, %4d | %5d x %6d | %5d / %6d | %s | %8s | %4d | %6s | %5s |\n",
+            (" %3d | %3d | %4d, %4d | %5d x %6d | %5d / %5d | %s | %4d, %4d | %5d x %6d | %5d / %6d | %s | %11s | %8s | %4d | %6s | %5s |\n",
                 winId,
                 chNum,
                 pWinObj->scRtCropCfg.cropStartX,
@@ -975,6 +1014,8 @@ Int32 SwMsLink_drvPrintLayoutParams(SwMsLink_Obj * pObj)
                 pWinObj->scRtOutFrmPrm.pitch[0],
                 pWinObj->scRtOutFrmPrm.pitch[1],
                 gSystem_nameMemoryType[pWinObj->scRtOutFrmPrm.memType],
+                (pObj->rtChannelInfo[chNum].scanFormat == FVID2_SF_PROGRESSIVE)
+                        ? "PROGRESSIVE" : "INTERLACE  ",
                 gSystem_nameOnOff[pObj->layoutParams.winInfo[winId].bypass],
                 SwMsLink_getDrvInstFromWinId(pObj,winId),
                 strDataFormat,
@@ -1009,6 +1050,18 @@ Int32 SwMsLink_drvUpdateRtChannelInfo(SwMsLink_Obj * pObj)
        pObj->rtChannelInfo[chId].pitch[2] = pChInfo->pitch[2];
        pObj->rtChannelInfo[chId].memType = pChInfo->memType;
        pObj->rtChannelInfo[chId].dataFormat = pChInfo->dataFormat;
+       pObj->rtChannelInfo[chId].scanFormat = pChInfo->scanFormat;
+
+#ifdef SYSTEM_DEBUG_SWMS
+       Vps_printf(" %d: SWMS: %2d: Format: %s, %d x %d\n",
+                   Utils_getCurTimeInMsec(),
+                   chId, 
+                   gSystem_nameScanFormat[pObj->rtChannelInfo[chId].scanFormat],
+                   pObj->rtChannelInfo[chId].width,
+                   pObj->rtChannelInfo[chId].height
+                   );
+#endif
+
    }
 
    SwMsLink_drvUnlock(pObj);
@@ -1333,6 +1386,21 @@ Int32 SwMsLink_drvSwitchLayout(SwMsLink_Obj * pObj,
             pWinObj->scRtCropCfg.cropHeight =
                 VpsUtils_align(pChInfo->height, 2);
 
+            if (pObj->DrvObj[drvInst].isDeiDrv)
+            {
+                if((pObj->DrvObj[drvInst].forceBypassDei == FALSE) 
+                     &&
+                    (pObj->layoutParams.winInfo[winId].bypass == FALSE))
+                {
+                    if(FVID2_SF_INTERLACED == pChInfo->scanFormat)
+                    {
+                        pWinObj->scRtCropCfg.cropHeight *= 2;
+                        Vps_printf(" SWMS: CH %d -> Interlaced - Setting cropHeight to %d *******\n",
+                            chNum, pWinObj->scRtCropCfg.cropHeight);
+                    }
+                }
+            }
+
             #ifdef SWMS_ENABLE_MODIFY_FRAME_POINTER_ALWAYS
             pWinObj->scRtCropCfg.cropStartX = 0;
             pWinObj->scRtCropCfg.cropStartY = 0;
@@ -1369,6 +1437,7 @@ Int32 SwMsLink_drvSwitchLayout(SwMsLink_Obj * pObj,
             if (SwMsLink_drvIsVipOutputUsed(pObj->DrvObj[drvInst].drvInstId))
             {
                 pWinObj->deiRtPrm.vipOutFrmPrms[SWMS_LINK_DEI_DEF_VIP_STREAMID] = &pWinObj->scRtOutFrmPrm;
+                pWinObj->deiRtPrm.vipScCropCfg = &pWinObj->scRtCropCfg;
             }
             pWinObj->deiRtPrm.deiInFrmPrms = &pWinObj->scRtInFrmPrm;
             pWinObj->deiRtPrm.deiScCropCfg = &pWinObj->scRtCropCfg;
@@ -1661,7 +1730,7 @@ Int32 SwMsLink_drvQueueInputFrames(SwMsLink_Obj * pObj,
         if (frame->channelNum >= SYSTEM_SW_MS_MAX_CH_ID)
         {
             #ifdef SWMS_DEBUG_FRAME_REJECT
-              Vps_printf(" SWMS: Frame Reject: Invalid CH ID (%d)\n", chId);
+              Vps_printf(" SWMS: Frame Reject: Invalid CH ID (%d)\n", frame->channelNum);
             #endif
             /* invalid ch ID */
             SwMsLink_freeFrame(pInQueParams, &pObj->freeFrameList, frame);
@@ -1693,6 +1762,14 @@ Int32 SwMsLink_drvQueueInputFrames(SwMsLink_Obj * pObj,
             * i.e always expect even fields */
                 pWinObj->expectedFid = 0;
             }
+            /* Progressive frames handling if dei driver is enabled */
+            if ((pObj->DrvObj[drvInst].isDeiDrv)
+                    && 
+                (pFrameInfo->rtChInfo.scanFormat == FVID2_SF_PROGRESSIVE))
+            {
+                pWinObj->expectedFid = 0;
+            }
+
             if (frame->fid != pWinObj->expectedFid)
             {
                  pWinObj->framesFidInvalidCount++;
@@ -1927,7 +2004,7 @@ Int32 SwMsLink_drvUpdateChCurrentInFrame(SwMsLink_Obj * pObj)
                     #ifdef SWMS_DEBUG_FRAME_REJECT
                         Vps_printf
                         (" SWMS: Frame Reject: Win not mapped to this channel (%d)\n",
-                         chId);
+                         frame->channelNum);
                     #endif
                    UTILS_assert(pWinObj != NULL);
                    pWinObj->framesInvalidChCount++;
@@ -2950,6 +3027,8 @@ Int32 SwMsLink_drvCreate(SwMsLink_Obj * pObj, SwMsLink_CreateParams * pPrm)
                 break;
             case SYSTEM_SW_MS_SC_INST_VIP0_SC_NO_DEI:
                 pObj->DrvObj[i].forceBypassDei = TRUE;
+
+            case SYSTEM_SW_MS_SC_INST_VIP0_DEI_SC:
                 /* rest of DrvObj setup would be same as DEI SW MS setup, hence no 'break' */
                 pObj->DrvObj[i].isDeiDrv = TRUE;
                 pObj->DrvObj[i].bypassDei = FALSE;
@@ -3207,12 +3286,16 @@ Bool  SwMsLink_drvIsBlankFrameRtParamsApplied(SwMsLink_OutWinObj *pWinObj, SwMsL
 }
 
 static
-Void  SwMsLink_drvApplyBlankFrameRtParams(SwMsLink_OutWinObj *pWinObj, SwMsLink_Obj * pObj)
+Void  SwMsLink_drvApplyBlankFrameRtParams(UInt32 drvInst, SwMsLink_OutWinObj *pWinObj, SwMsLink_Obj * pObj)
 {
     pWinObj->deiRtPrm.deiInFrmPrms = &pObj->blankFrameScRtInFrmPrm;
     pWinObj->deiRtPrm.deiScCropCfg = &pObj->blankFrameScRtCropCfg;
     pWinObj->scRtPrm.inFrmPrms = &pObj->blankFrameScRtInFrmPrm;
     pWinObj->scRtPrm.srcCropCfg = &pObj->blankFrameScRtCropCfg;
+    if (SwMsLink_drvIsVipOutputUsed(pObj->DrvObj[drvInst].drvInstId))
+    {
+        pWinObj->deiRtPrm.vipScCropCfg = &pObj->blankFrameScRtCropCfg;
+    }
 }
 
 static
@@ -3236,7 +3319,7 @@ Void  SwMsLink_drvRestoreBlankFrameRtParams(SwMsLink_Obj * pObj)
             if (!SwMsLink_drvIsBlankFrameRtParamsApplied(pWinObj, pObj))
             {
                 Vps_printf("SWMS:Restoring blank frame params for winId:%d",winId);
-                SwMsLink_drvApplyBlankFrameRtParams(pWinObj, pObj);
+                SwMsLink_drvApplyBlankFrameRtParams(SwMsLink_getDrvInstFromWinId(pObj,winId), pWinObj, pObj);
             }
         }
     }
@@ -3315,7 +3398,7 @@ Int32 SwMsLink_drvMakeFrameLists(SwMsLink_Obj * pObj, FVID2_Frame * pOutFrame)
 
             if(!SwMsLink_drvIsBlankFrameRtParamsApplied(pWinObj, pObj))
             {
-                SwMsLink_drvApplyBlankFrameRtParams(pWinObj, pObj);
+                SwMsLink_drvApplyBlankFrameRtParams(drvInst, pWinObj, pObj);
                 pWinObj->applyRtPrm = TRUE;
             }
         }
@@ -3446,10 +3529,23 @@ Int32 SwMsLink_drvMakeFrameLists(SwMsLink_Obj * pObj, FVID2_Frame * pOutFrame)
                     pFrameInfo->rtChInfo.startY -= hmpCrop->cropStartY;
                 }
 #endif
+               
                 /* Right now, only MPSCLR link updates the dataformat, runtime
                     Ensure this */
                 if (pFrameInfo->isDataTypeChange)
                 {
+                    /* For switching between progressive and interlace frames */
+                    if (pFrameInfo->rtChInfo.scanFormat !=
+                        rtChannelInfo->scanFormat)
+                    {
+                        rtChannelInfo->scanFormat =
+                            pFrameInfo->rtChInfo.scanFormat;
+                        rtParamUpdatePerFrame = TRUE;
+                        Vps_printf(" SWMS: ch:%d ScanFormat changed to %s....***\n",
+                            pInFrame->channelNum, 
+                            gSystem_nameScanFormat[pFrameInfo->rtChInfo.scanFormat]);
+                    }
+
                     if (pFrameInfo->rtChInfo.dataFormat !=
                         rtChannelInfo->dataFormat)
                     {
@@ -3477,6 +3573,13 @@ Int32 SwMsLink_drvMakeFrameLists(SwMsLink_Obj * pObj, FVID2_Frame * pOutFrame)
                     rtParamUpdatePerFrame = TRUE;
                 }
                 pFrameInfo->rtChInfoUpdate = FALSE;
+                if (pObj->DrvObj[drvInst].isDeiDrv)
+                {
+                    if (pFrameInfo->rtChInfo.scanFormat == FVID2_SF_PROGRESSIVE )
+                    {
+                        pDrvObj = &pObj->DrvObj[drvInst + SYSTEM_SW_MS_MAX_INST];
+                    }
+                }
             }
         }
         else
diff --git a/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_priv.h b/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_priv.h
index 9f15360..be5e901 100755
--- a/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_priv.h
+++ b/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_priv.h
@@ -26,7 +26,7 @@
 
 #define SW_MS_LINK_TIMER_DEFAULT_PERIOD (15)
 
-#define SW_MS_MAX_DEI_CH                (8)
+#define SW_MS_MAX_DEI_CH                (10)
 
 #define SW_MS_SKIP_PROCESSING           (2)
 
diff --git a/mcfw/src_linux/mcfw_api/usecases/ti816x/multich_hd_sdi_dvr.c b/mcfw/src_linux/mcfw_api/usecases/ti816x/multich_hd_sdi_dvr.c
index 68a8a63..9aa134a 100755
--- a/mcfw/src_linux/mcfw_api/usecases/ti816x/multich_hd_sdi_dvr.c
+++ b/mcfw/src_linux/mcfw_api/usecases/ti816x/multich_hd_sdi_dvr.c
@@ -356,6 +356,8 @@ Int32 MultiCh_hdsdiDVRSetMosaicParams(VDIS_DEV vdDevId, VDIS_MOSAIC_S *psVdMosai
 static
 Void multich_hdsdidvr_select_all_progressive_encode();
 static
+Void multich_hdsdidvr_select_all_interlaced_encode();
+static
 Int32 multich_hdsdidvr_set_wrbk_capture_prms(UInt32 inW, UInt32 inH, UInt32 outW, UInt32 outH);
 static
 Int32 multich_hdsdidvr_start_wrbk_capture();
@@ -1060,7 +1062,15 @@ Void multich_hdsdidvr_set_swms_prm(SwMsLink_CreateParams *swMsPrm,
     UInt32 devId;
 
     swMsPrm->numSwMsInst = 1;
-    swMsPrm->swMsInstId[0] = SYSTEM_SW_MS_SC_INST_VIP1_SC;
+    if (swMsIdx == 1)
+    {
+        swMsPrm->swMsInstId[0] = SYSTEM_SW_MS_SC_INST_DEI_SC; 
+    }
+    else
+    {
+        swMsPrm->swMsInstId[0] = SYSTEM_SW_MS_SC_INST_VIP0_DEI_SC; 
+    }
+
     swMsPrm->maxInputQueLen            = SYSTEM_SW_MS_DEFAULT_INPUT_QUE_LEN + 6;
     swMsPrm->numOutBuf = NUM_BUFS_PER_CH_SWMS_HD;
     swMsPrm->enableProcessTieWithDisplay = TRUE;
@@ -1076,7 +1086,7 @@ Void multich_hdsdidvr_set_swms_prm(SwMsLink_CreateParams *swMsPrm,
         devId               = VDIS_DEV_DVO2;
     }
     swMsPrm->initOutRes = gVdisModuleContext.vdisConfig.deviceParams[devId].resolution;
-    swMsPrm->numOutBuf  = NUM_BUFS_PER_CH_SWMS_HD;
+    swMsPrm->numOutBuf  = NUM_BUFS_PER_CH_SWMS_HD + 2;
     swMsPrm->lineSkipMode = FALSE;
     swMsPrm->enableLayoutGridDraw = gVdisModuleContext.vdisConfig.enableLayoutGridDraw;
     multich_hdsdidvr_set_swms_singlewin_layoutprm(&swMsPrm->layoutPrm,swMsPrm->initOutRes);
@@ -1880,10 +1890,6 @@ Void MultiCh_createHDSDIDVR()
     multich_hdsdidvr_connect_links();
     multich_hdsdidvr_set_links_framerate();
     multich_hdsdidvr_set_dec2disp_chmap();
-    Vdis_getMosaicParams(VDIS_DEV_HDMI,&gHDSDIDVRUsecaseContext.vdisMosaicPrms[VDIS_DEV_HDMI]);
-    Vdis_getMosaicParams(VDIS_DEV_DVO2,&gHDSDIDVRUsecaseContext.vdisMosaicPrms[VDIS_DEV_DVO2]);
-    Vdis_setMosaicParams(VDIS_DEV_HDMI,&gHDSDIDVRUsecaseContext.vdisMosaicPrms[VDIS_DEV_HDMI]);
-    Vdis_setMosaicParams(VDIS_DEV_DVO2,&gHDSDIDVRUsecaseContext.vdisMosaicPrms[VDIS_DEV_DVO2]);
     multich_hdsdidvr_set_encswitchstartch();
     multich_hdsdidvr_select_all_progressive_encode();
 }
