TDA4VM: How to enable dual DSS DPI

Part Number: TDA4VM


Tool/software:

Hi experts,

We have previously successfully used one DPI to output a set of camera data.

Now we intend to use dual DPI to output two sets of camera data.

I enabled ENABLE_DSS_DUAL in the app_cfg_mcu2_0.h file.

However, from the comments in ENABLE_DSS_DUAL definition, it is known that HDMI and EDP are enabled by default.

I made the following modifications to adapt to the dual DPI.

diff --git a/platform/j721e/rtos/common/app_cfg_mcu2_0.h b/platform/j721e/rtos/common/app_cfg_mcu2_0.h
index 0b6ac38..d9b2154 100755
--- a/platform/j721e/rtos/common/app_cfg_mcu2_0.h
+++ b/platform/j721e/rtos/common/app_cfg_mcu2_0.h
@@ -83,8 +83,8 @@
      * - When ENABLE_DSS_SINGLE is defined, only one of ENABLE_DSS_HDMI or ENABLE_DSS_EDP should be defined
      * - When ENABLE_DSS_DUAL is defined, ENABLE_DSS_HDMI and ENABLE_DSS_EDP are not used, both EDP and HDMI are enabled unconditionally
      */
-    #define ENABLE_DSS_SINGLE
-    #undef  ENABLE_DSS_DUAL
+    #undef ENABLE_DSS_SINGLE
+    #define  ENABLE_DSS_DUAL
 
     /* define below to enable eDP display,
        make sure to undef ENABLE_DSS_HDMI & ENABLE_DSS_DSI as well */
diff --git a/platform/j721e/rtos/common/app_init.c b/platform/j721e/rtos/common/app_init.c
index e9589e0..219165b 100755
--- a/platform/j721e/rtos/common/app_init.c
+++ b/platform/j721e/rtos/common/app_init.c
@@ -656,15 +656,15 @@ int32_t appInit()
         /* Do not rely on "init". Always provide known good tmings */
         for(i=0; i<2; i++)
         {
-            prm.display[i].timings.width        = 1920U;
-            prm.display[i].timings.height       = 1080U;
-            prm.display[i].timings.hFrontPorch  = 88U;
-            prm.display[i].timings.hBackPorch   = 148U;
-            prm.display[i].timings.hSyncLen     = 44U;
-            prm.display[i].timings.vFrontPorch  = 4U;
-            prm.display[i].timings.vBackPorch   = 36U;
+            prm.display[i].timings.width        = 1280U;
+            prm.display[i].timings.height       = 720U;
+            prm.display[i].timings.hFrontPorch  = 640U;
+            prm.display[i].timings.hBackPorch   = 0U;
+            prm.display[i].timings.hSyncLen     = 0U;
+            prm.display[i].timings.vFrontPorch  = 5U;
+            prm.display[i].timings.vBackPorch   = 20U;
             prm.display[i].timings.vSyncLen     = 5U;
-            prm.display[i].timings.pixelClock   = 148500000ULL;
+            prm.display[i].timings.pixelClock   = 72000000ULL;
         }
 
         status = appDssDualDisplayDefaultInit(&prm);
diff --git a/utils/dss/include/app_dss_defaults.h b/utils/dss/include/app_dss_defaults.h
index a0f0220..25c7a72 100755
--- a/utils/dss/include/app_dss_defaults.h
+++ b/utils/dss/include/app_dss_defaults.h
@@ -93,6 +93,8 @@ extern "C" {
 /** \brief Enables DSI output on AOU LCD Display */
 #define APP_DSS_DEFAULT_DISPLAY_TYPE_DSI         (2u)
 
+#define APP_DSS_DEFAULT_DISPLAY_TYPE_DPI1_HDMI   (3u)
+
 /* ========================================================================== */
 /*                         Structure Declarations                             */
 /* ========================================================================== */
diff --git a/utils/dss/src/app_dss_dual_display_defaults.c b/utils/dss/src/app_dss_dual_display_defaults.c
index 2d890d0..1c35f24 100755
--- a/utils/dss/src/app_dss_dual_display_defaults.c
+++ b/utils/dss/src/app_dss_dual_display_defaults.c
@@ -80,7 +80,7 @@ void appDssDualDisplayDefaultSetDefaultPrm(app_dss_dual_display_default_prm_t *d
 
         if(i==0)
         {
-            prm->display_type = APP_DSS_DEFAULT_DISPLAY_TYPE_EDP;
+            prm->display_type = APP_DSS_DEFAULT_DISPLAY_TYPE_DPI1_HDMI;
         }
         else
         {
@@ -136,15 +136,15 @@ int32_t appDssDualDisplayDefaultInit(app_dss_dual_display_default_prm_t *dual_di
 
         memcpy(&obj->initPrm, prm, sizeof(*prm));
 
-        if(prm->display_type==APP_DSS_DEFAULT_DISPLAY_TYPE_EDP)
+        if(prm->display_type==APP_DSS_DEFAULT_DISPLAY_TYPE_DPI1_HDMI)
         {
-            appLogPrintf("DSS DUAL DISPLAY: Display %d type is eDP !!!\n", i);
+            appLogPrintf("DSS DUAL DISPLAY: Display %d type is HDMI1 !!!\n", i);
             obj->nodeOverlayId = APP_DCTRL_NODE_OVERLAY1;
             obj->nodeVpId      = APP_DCTRL_NODE_VP1;
-            obj->nodeDpiId     = APP_DCTRL_NODE_EDP_DPI0;
+            obj->nodeDpiId     = APP_DCTRL_NODE_DPI_DPI1;
             obj->overlayId     = APP_DSS_OVERLAY_ID_1;
             obj->vpId          = APP_DSS_VP_ID_1;
-            obj->videoIfWidth  = APP_DCTRL_VIFW_36BIT;
+            obj->videoIfWidth  = APP_DCTRL_VIFW_10BIT;
         }
         else
         {
@@ -154,7 +154,7 @@ int32_t appDssDualDisplayDefaultInit(app_dss_dual_display_default_prm_t *dual_di
             obj->nodeDpiId     = APP_DCTRL_NODE_DPI_DPI0;
             obj->overlayId     = APP_DSS_OVERLAY_ID_2;
             obj->vpId          = APP_DSS_VP_ID_2;
-            obj->videoIfWidth  = APP_DCTRL_VIFW_24BIT;
+            obj->videoIfWidth  = APP_DCTRL_VIFW_10BIT;
         }
 
         appDssConfigurePm(prm);
diff --git a/utils/dss/src/app_dss_soc.c b/utils/dss/src/app_dss_soc.c
index 4d4b383..536a2c8 100755
--- a/utils/dss/src/app_dss_soc.c
+++ b/utils/dss/src/app_dss_soc.c
@@ -232,6 +232,14 @@ void appDssConfigurePm(app_dss_default_prm_t *prm)
         SET_CLOCK_STATE(TISCI_DEV_DSS0, TISCI_DEV_DSS0_DSS_INST0_DPI_1_IN_2X_CLK, 0, TISCI_MSG_VALUE_CLOCK_SW_STATE_REQ);
         SET_DEVICE_STATE_ON(TISCI_DEV_DSS0);
     }
+    else if(prm->display_type==APP_DSS_DEFAULT_DISPLAY_TYPE_DPI1_HDMI)
+    {
+        SET_DEVICE_STATE_OFF(TISCI_DEV_DSS0);
+        SET_CLOCK_PARENT(TISCI_DEV_DSS0, TISCI_DEV_DSS0_DSS_INST0_DPI_1_IN_2X_CLK, TISCI_DEV_DSS0_DSS_INST0_DPI_1_IN_2X_CLK_PARENT_DPI1_EXT_CLKSEL_OUT0);
+        SET_CLOCK_FREQ (TISCI_DEV_DSS0, TISCI_DEV_DSS0_DSS_INST0_DPI_1_IN_2X_CLK, prm->timings.pixelClock);
+        SET_CLOCK_STATE(TISCI_DEV_DSS0, TISCI_DEV_DSS0_DSS_INST0_DPI_1_IN_2X_CLK, 0, TISCI_MSG_VALUE_CLOCK_SW_STATE_REQ);
+        SET_DEVICE_STATE_ON(TISCI_DEV_DSS0);
+    }
     else if (prm->display_type==APP_DSS_DEFAULT_DISPLAY_TYPE_DSI)
     {
         #if defined (SOC_J721E) 

 However, when running the application,  it was found that the vxVerifyGraph interface was stuck, and there are no error logs.

Before running the application, I first run "source ./vision_apps_init.sh", and there were the following errors.

Could you please help me check if there are any problems or omissions in my modifications?

Thank you!

  • Hello,

    Assigned to expert , please wait for the response.

    Thanks

    Regards

    Tarun

  • Hi Cheng,

    The supported combination of vp and dpi output is listed below,

    static const Fvid2_GraphEdgeInfo gDctrlGraphEdgeInfoDefaults[DSS_DCTRL_MAX_EDGES] =
    {
        {DSS_DCTRL_NODE_VID1,     DSS_DCTRL_NODE_OVERLAY1},
        {DSS_DCTRL_NODE_VIDL1,    DSS_DCTRL_NODE_OVERLAY1},
        {DSS_DCTRL_NODE_VID2,     DSS_DCTRL_NODE_OVERLAY1},
        {DSS_DCTRL_NODE_VIDL2,    DSS_DCTRL_NODE_OVERLAY1},
        {DSS_DCTRL_NODE_VID1,     DSS_DCTRL_NODE_OVERLAY2},
        {DSS_DCTRL_NODE_VIDL1,    DSS_DCTRL_NODE_OVERLAY2},
        {DSS_DCTRL_NODE_VID2,     DSS_DCTRL_NODE_OVERLAY2},
        {DSS_DCTRL_NODE_VIDL2,    DSS_DCTRL_NODE_OVERLAY2},
        {DSS_DCTRL_NODE_VID1,     DSS_DCTRL_NODE_OVERLAY3},
        {DSS_DCTRL_NODE_VIDL1,    DSS_DCTRL_NODE_OVERLAY3},
        {DSS_DCTRL_NODE_VID2,     DSS_DCTRL_NODE_OVERLAY3},
        {DSS_DCTRL_NODE_VIDL2,    DSS_DCTRL_NODE_OVERLAY3},
        {DSS_DCTRL_NODE_VID1,     DSS_DCTRL_NODE_OVERLAY4},
        {DSS_DCTRL_NODE_VIDL1,    DSS_DCTRL_NODE_OVERLAY4},
        {DSS_DCTRL_NODE_VID2,     DSS_DCTRL_NODE_OVERLAY4},
        {DSS_DCTRL_NODE_VIDL2,    DSS_DCTRL_NODE_OVERLAY4},
        {DSS_DCTRL_NODE_OVERLAY1, DSS_DCTRL_NODE_VP1},
        {DSS_DCTRL_NODE_OVERLAY2, DSS_DCTRL_NODE_VP2},
        {DSS_DCTRL_NODE_OVERLAY3, DSS_DCTRL_NODE_VP3},
        {DSS_DCTRL_NODE_OVERLAY4, DSS_DCTRL_NODE_VP4},
        {DSS_DCTRL_NODE_VP1,      DSS_DCTRL_NODE_EDP_DPI0},
        {DSS_DCTRL_NODE_VP1,      DSS_DCTRL_NODE_DISCSYNC0},
        {DSS_DCTRL_NODE_VP1,      DSS_DCTRL_NODE_DISCSYNC1},
        {DSS_DCTRL_NODE_VP2,      DSS_DCTRL_NODE_DPI_DPI0},
        {DSS_DCTRL_NODE_VP2,      DSS_DCTRL_NODE_DPI_DPI1},
        {DSS_DCTRL_NODE_VP2,      DSS_DCTRL_NODE_EDP_DPI1},
        {DSS_DCTRL_NODE_VP3,      DSS_DCTRL_NODE_DSI_DPI2},
        {DSS_DCTRL_NODE_VP3,      DSS_DCTRL_NODE_EDP_DPI2},
        {DSS_DCTRL_NODE_VP3,      DSS_DCTRL_NODE_DISCSYNC0},
        {DSS_DCTRL_NODE_VP4,      DSS_DCTRL_NODE_DPI_DPI0},
        {DSS_DCTRL_NODE_VP4,      DSS_DCTRL_NODE_DPI_DPI1},
        {DSS_DCTRL_NODE_VP4,      DSS_DCTRL_NODE_EDP_DPI3},
        {DSS_DCTRL_NODE_VIDL2,    DSS_DCTRL_NODE_WB},
        {DSS_DCTRL_NODE_OVERLAY1, DSS_DCTRL_NODE_WB},
        {DSS_DCTRL_NODE_OVERLAY2, DSS_DCTRL_NODE_WB},
        {DSS_DCTRL_NODE_OVERLAY3, DSS_DCTRL_NODE_WB},
        {DSS_DCTRL_NODE_OVERLAY4, DSS_DCTRL_NODE_WB}
    };

    So VP_1 cannot be used with DPI1. Use VP_4 with DPI1 and  VP_2  with DPI0.

    Regards,
    Gokul

  • Hi Gokul,

    The DisplayM2M node also uses VP_4.

    Does this mean that the DisplayM2M node cannot be used? Or is it possible that the DisplayM2M node can use other VP?

    Thank you!

  • Hi Cheng,

    If you require two DPI outputs and both for outputting BT601 format, then yes, display m2m cannot be used.. 

    Regards,

    Brijesh

  • Hi Brijesh and Gokul,

    Use VP_4 with DPI1 and  VP_2  with DPI0

    Based on the above suggestion, I have made the following additional modifications.

    diff --git a/platform/j721e/rtos/common/app_init.c b/platform/j721e/rtos/common/app_init.c
    index 219165b..85e61c5 100755
    --- a/platform/j721e/rtos/common/app_init.c
    +++ b/platform/j721e/rtos/common/app_init.c
    @@ -652,7 +652,7 @@ int32_t appInit()
             /* default parameters are enough to enable both EDP and HDMI */
             appDssDualDisplayDefaultSetDefaultPrm(&prm);
    
    -        prm.enableM2m                           = true;
    +        prm.enableM2m                           = false;
             /* Do not rely on "init". Always provide known good tmings */
             for(i=0; i<2; i++)
             {
    diff --git a/utils/dss/src/app_dss_dual_display_defaults.c b/utils/dss/src/app_dss_dual_display_defaults.c
    index 1c35f24..1c4221b 100755
    --- a/utils/dss/src/app_dss_dual_display_defaults.c
    +++ b/utils/dss/src/app_dss_dual_display_defaults.c
    @@ -119,7 +119,7 @@ int32_t appDssDualDisplayDefaultInit(app_dss_dual_display_default_prm_t *dual_di
         dssParams.isPipeAvailable[APP_DSS_VID_PIPE_ID_VID1] = true;
         dssParams.isPipeAvailable[APP_DSS_VID_PIPE_ID_VID2] = true;
         dssParams.isPipeAvailable[APP_DSS_VID_PIPE_ID_VIDL1] = true;
    -    dssParams.isPipeAvailable[APP_DSS_VID_PIPE_ID_VIDL2] = false;
    +    dssParams.isPipeAvailable[APP_DSS_VID_PIPE_ID_VIDL2] = true;
    
         for(i=0; i<APP_DSS_VID_PIPE_ID_MAX; i++)
         {
    @@ -139,11 +139,11 @@ int32_t appDssDualDisplayDefaultInit(app_dss_dual_display_default_prm_t *dual_di
             if(prm->display_type==APP_DSS_DEFAULT_DISPLAY_TYPE_DPI1_HDMI)
             {
                 appLogPrintf("DSS DUAL DISPLAY: Display %d type is HDMI1 !!!\n", i);
    -            obj->nodeOverlayId = APP_DCTRL_NODE_OVERLAY1;
    -            obj->nodeVpId      = APP_DCTRL_NODE_VP1;
    +            obj->nodeOverlayId = APP_DCTRL_NODE_OVERLAY4;
    +            obj->nodeVpId      = APP_DCTRL_NODE_VP4;
                 obj->nodeDpiId     = APP_DCTRL_NODE_DPI_DPI1;
    -            obj->overlayId     = APP_DSS_OVERLAY_ID_1;
    -            obj->vpId          = APP_DSS_VP_ID_1;
    +            obj->overlayId     = APP_DSS_OVERLAY_ID_4;
    +            obj->vpId          = APP_DSS_VP_ID_4;
                 obj->videoIfWidth  = APP_DCTRL_VIFW_10BIT;
             }
             else
    

    In the graph I created, when the "pipeId" parameter of the display node is set to defalut value of 2 (VP2), the image data can be successfully transmitted.

    When I changed the "pipeid" parameter of the display node to 3 (VP4), the following error occurred at the vxVerifyGraph interface.

    root@Linux:/opt/vision_apps/test_hw# ./capture_hw.out
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=5) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
       129.643864 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    appCommonInit  success  !
       129.644072 s:  VX_ZONE_INIT:Enabled
       129.644085 s:  VX_ZONE_ERROR:Enabled
       129.644090 s:  VX_ZONE_WARNING:Enabled
       129.646070 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
       129.646172 s:  VX_ZONE_INIT:[tivxHostInitLocal:101] Initialization Done for HOST !!!
    [CAPTURE_MODULE]: errorframe_Y: data_ptr=0xffff95bdc000, size = 657920, dim_y = 514, stride_y = 1280
    captureObj init done!
    displayObj init done!
    graph Set Reference Name  Success !!
    captureObj node graph done  !
    displayObj node graph done !
    vxSetGraphScheduleConfig done !
    tivxSetGraphPipelineDepth done !
       129.654545 s:  VX_ZONE_ERROR:[ownContextSendCmd:822] Command ack message returned failure cmd_status: -1
       129.654566 s:  VX_ZONE_ERROR:[ownContextSendCmd:862] tivxEventWait() failed.
       129.654573 s:  VX_ZONE_ERROR:[ownNodeKernelInit:584] Target kernel, TIVX_CMD_NODE_CREATE failed for node DisplayNode
       129.654579 s:  VX_ZONE_ERROR:[ownNodeKernelInit:585] Please be sure the target callbacks have been registered for this core
       129.654585 s:  VX_ZONE_ERROR:[ownNodeKernelInit:586] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
       129.654592 s:  VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 1, kernel com.ti.display ... failed !!!
       129.654606 s:  VX_ZONE_ERROR:[vxVerifyGraph:2059] Node kernel init failed
       129.654612 s:  VX_ZONE_ERROR:[vxVerifyGraph:2113] Graph verify failed
    capture_hw: Verifying graph failed!
    app_create_graph exiting
    deinit app...
    app_deinit_capture done
    app_deinit_display done
    tivxHwaUnLoadKernels done
    tivxVideoIOUnLoadKernels done
    tivxImagingUnLoadKernels done
    tivxImgProcUnLoadKernels done
    tivxFileIOUnLoadKernels done
       129.657088 s:  VX_ZONE_WARNING:[vxReleaseContext:1099] A kernel with name com.ti.display has not been removed, possibly due to a kernel module not being unloaded.
       129.657099 s:  VX_ZONE_WARNING:[vxReleaseContext:1100] Removing as a part of garbage collection
       129.657107 s:  VX_ZONE_WARNING:[ownDecrementReference:486] #### EXTERNAL REF COUNT IS ALREADY ZERO!!! 0xffffa14a8120 type:00000804 #####
       129.657114 s:  VX_ZONE_WARNING:[vxReleaseContext:1099] A kernel with name com.ti.capture has not been removed, possibly due to a kernel module not being unloaded.
       129.657120 s:  VX_ZONE_WARNING:[vxReleaseContext:1100] Removing as a part of garbage collection
       129.657126 s:  VX_ZONE_WARNING:[ownDecrementReference:486] #### EXTERNAL REF COUNT IS ALREADY ZERO!!! 0xffffa14a9810 type:00000804 #####
       129.657133 s:  VX_ZONE_WARNING:[vxReleaseContext:1088] Found a reference 0xffffa1520988 of type 0000080f at external count 1, internal count 2, releasing it
       129.657139 s:  VX_ZONE_WARNING:[vxReleaseContext:1090] Releasing reference (name=image_107) now as a part of garbage collection
       129.657146 s:  VX_ZONE_WARNING:[vxReleaseContext:1088] Found a reference 0xffffa0b720d0 of type 00000802 at external count 1, internal count 0, releasing it
       129.657152 s:  VX_ZONE_WARNING:[vxReleaseContext:1090] Releasing reference (name=capture_hw) now as a part of garbage collection
       129.657232 s:  VX_ZONE_WARNING:[ownDecrementReference:486] #### EXTERNAL REF COUNT IS ALREADY ZERO!!! 0xffffa1520988 type:0000080f #####
    vxReleaseContext  done
       129.657468 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:115] De-Initialization Done for HOST !!!
       129.661890 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    [MCU2_0]    129.654239 s: src/drv/disp/dss_dispApi.c @ Line 273:
    [MCU2_0]    129.654286 s: Driver instance already created!!
    [MCU2_0]    129.654321 s: src/fvid2_drvMgr.c @ Line 759:
    [MCU2_0]    129.654344 s: Driver create failed!!
    [MCU2_0]    129.654378 s:  VX_ZONE_ERROR:[tivxDisplayCreate:555] DISPLAY: ERROR: Display Create Failed!
    [MCU2_0]    129.654774 s: ==========================================================
    [MCU2_0]    129.654862 s:  Capture Status: Instance|1
    [MCU2_0]    129.654896 s: ==========================================================
    [MCU2_0]    129.654936 s:  overflowCount: 0
    [MCU2_0]    129.654981 s:  spuriousUdmaIntrCount: 0
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    [MCU2_0]    129.655009 s:  frontFIFOOvflCount: 0
    [MCU2_0]    129.655033 s:  crcCount: 0
    [MCU2_0]    129.655052 s:  eccCount: 0
    [MCU2_0]    129.655073 s:  correctedEccCount: 0
    [MCU2_0]    129.655097 s:  dataIdErrorCount: 0
    [MCU2_0]    129.655120 s:  invalidAccessCount: 0
    [MCU2_0]    129.655143 s:  invalidSpCount: 0
    [MCU2_0]    129.655168 s:  strmFIFOOvflCount[0]: 0
    [MCU2_0]    129.655194 s:  strmFIFOOvflCount[1]: 0
    [MCU2_0]    129.655218 s:  Channel Num | Frame Queue Count | Frame De-queue Count | Frame Drop Count | Error Frame Count |
    [MCU2_0]    129.655269 s:            0 |                 0 |                    0 |                0 |                 0 |
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    DDR_SHARED_MEM: Alloc's: 7 alloc's of 3289860 bytes
    DDR_SHARED_MEM: Free's : 7 free's  of 3289860 bytes
    DDR_SHARED_MEM: Open's : 0 allocs  of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!
    

    Could you please help me analyze what the problem is?

    Thank you!

  • Hi Cheng,

    This error will come if the driver is already created with the same pipe_id can you check if you are creating the display node with the same pipeId already,
    Can you check this after rebooting the device.

    Regards,
    Gokul