From 4cd95cd953cf9f33e0a2246c9555c49825183b97 Mon Sep 17 00:00:00 2001
From: Shyam Jagannathan <a0393891@ti.com>
Date: Tue, 8 Dec 2020 12:39:09 +0530
Subject: [PATCH] [DL_APPS] Corrected error flow logic for display node

- This makes the demos run in PC mode without throwing errors

Signed-off-by: Shyam Jagannathan <a0393891@ti.com>
---
 .../app_tidl_avp/avp_display_module.c         | 39 +++++++------
 .../app_tidl_avp2/avp_display_module.c        | 39 +++++++------
 .../app_tidl_avp3/avp_display_module.c        | 39 +++++++------
 .../app_tidl_avp4/app_display_module.c        | 55 ++++++++++---------
 .../app_tidl_cam/app_display_module.c         | 40 +++++++-------
 .../dl_demos/app_tidl_od/app_display_module.c | 39 +++++++------
 .../app_tidl_seg/app_display_module.c         | 39 +++++++------
 .../dl_demos/app_tidl_vl/app_display_module.c | 40 +++++++-------
 8 files changed, 177 insertions(+), 153 deletions(-)

diff --git a/apps/dl_demos/app_tidl_avp/avp_display_module.c b/apps/dl_demos/app_tidl_avp/avp_display_module.c
index 970c6c42..7ea53573 100644
--- a/apps/dl_demos/app_tidl_avp/avp_display_module.c
+++ b/apps/dl_demos/app_tidl_avp/avp_display_module.c
@@ -65,28 +65,31 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 0;
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 0;
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
 
     return status;
diff --git a/apps/dl_demos/app_tidl_avp2/avp_display_module.c b/apps/dl_demos/app_tidl_avp2/avp_display_module.c
index 843c927f..4c4338f7 100644
--- a/apps/dl_demos/app_tidl_avp2/avp_display_module.c
+++ b/apps/dl_demos/app_tidl_avp2/avp_display_module.c
@@ -65,28 +65,31 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = displayObj->display_pipe_id;
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = displayObj->display_pipe_id;
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
 
     return status;
diff --git a/apps/dl_demos/app_tidl_avp3/avp_display_module.c b/apps/dl_demos/app_tidl_avp3/avp_display_module.c
index 446e9ed4..0e90070b 100644
--- a/apps/dl_demos/app_tidl_avp3/avp_display_module.c
+++ b/apps/dl_demos/app_tidl_avp3/avp_display_module.c
@@ -65,28 +65,31 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 0;
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 0;
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
 
     return status;
diff --git a/apps/dl_demos/app_tidl_avp4/app_display_module.c b/apps/dl_demos/app_tidl_avp4/app_display_module.c
index f8b946db..9be6ab74 100644
--- a/apps/dl_demos/app_tidl_avp4/app_display_module.c
+++ b/apps/dl_demos/app_tidl_avp4/app_display_module.c
@@ -65,36 +65,41 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
-
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 0;
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
-    }
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 0;
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-    displayObj->input_img = vxCreateImage(context, DISPLAY_WIDTH, DISPLAY_HEIGHT, VX_DF_IMAGE_NV12);
-    status = vxGetStatus((vx_reference)displayObj->input_img);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
 
-    if(status == VX_FAILURE)
-    {
-        APP_PRINTF("Display module: Unable to create input image of width = %d, height = %d\n", DISPLAY_WIDTH, DISPLAY_HEIGHT);
+        if(VX_SUCCESS == status)
+        {
+            displayObj->input_img = vxCreateImage(context, DISPLAY_WIDTH, DISPLAY_HEIGHT, VX_DF_IMAGE_NV12);
+            status = vxGetStatus((vx_reference)displayObj->input_img);
+            if(status == VX_FAILURE)
+            {
+                APP_PRINTF("Display module: Unable to create input image of width = %d, height = %d\n", DISPLAY_WIDTH, DISPLAY_HEIGHT);
+            }
+        }
     }
     return status;
 }
diff --git a/apps/dl_demos/app_tidl_cam/app_display_module.c b/apps/dl_demos/app_tidl_cam/app_display_module.c
index 64747831..cbf9e0be 100644
--- a/apps/dl_demos/app_tidl_cam/app_display_module.c
+++ b/apps/dl_demos/app_tidl_cam/app_display_module.c
@@ -65,30 +65,32 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 0;
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 0;
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
-
     return status;
 }
 
diff --git a/apps/dl_demos/app_tidl_od/app_display_module.c b/apps/dl_demos/app_tidl_od/app_display_module.c
index 8f0f9feb..efbc5f32 100644
--- a/apps/dl_demos/app_tidl_od/app_display_module.c
+++ b/apps/dl_demos/app_tidl_od/app_display_module.c
@@ -65,28 +65,31 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 2; /* pipe ID = 2 */
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 2; /* pipe ID = 2 */
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
 
     return status;
diff --git a/apps/dl_demos/app_tidl_seg/app_display_module.c b/apps/dl_demos/app_tidl_seg/app_display_module.c
index 8f0f9feb..efbc5f32 100644
--- a/apps/dl_demos/app_tidl_seg/app_display_module.c
+++ b/apps/dl_demos/app_tidl_seg/app_display_module.c
@@ -65,28 +65,31 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 2; /* pipe ID = 2 */
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 2; /* pipe ID = 2 */
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
 
     return status;
diff --git a/apps/dl_demos/app_tidl_vl/app_display_module.c b/apps/dl_demos/app_tidl_vl/app_display_module.c
index 8f0f9feb..5219ddaf 100644
--- a/apps/dl_demos/app_tidl_vl/app_display_module.c
+++ b/apps/dl_demos/app_tidl_vl/app_display_module.c
@@ -65,30 +65,32 @@ vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *obj
 {
     vx_status status = VX_SUCCESS;
 
-    if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
-    {
-        status = VX_SUCCESS;
-    }
-    else
+    if (displayObj->display_option == 1)
     {
-        status = VX_FAILURE;
-    }
+        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1))
+        {
+            status = VX_SUCCESS;
+        }
+        else
+        {
+            status = VX_FAILURE;
+        }
 
-    if(VX_SUCCESS == status)
-    {
-        memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
+        if(VX_SUCCESS == status)
+        {
+            memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
 
-        displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
-        displayObj->disp_params.pipeId = 2; /* pipe ID = 2 */
-        displayObj->disp_params.outWidth = DISPLAY_WIDTH;
-        displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
-        displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
-        displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
+            displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
+            displayObj->disp_params.pipeId = 2; /* pipe ID = 2 */
+            displayObj->disp_params.outWidth = DISPLAY_WIDTH;
+            displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
+            displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
+            displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
 
-        displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
-        status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+            displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
+            status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
+        }
     }
-
     return status;
 }
 
-- 
2.17.1

