commit a75023cd2838671097f9e3492a31cf8f7094c750
Author: Nikhil Dasan <n-dasan@ti.com>
Date:   Mon Jan 17 17:09:24 2022 +0530

    SDK 8.1 RTOS changes
    
    Signed-off-by: Nikhil Dasan <n-dasan@ti.com>

diff --git a/build_flags.mak b/build_flags.mak
index f8dc41c..cb6e2ba 100755
--- a/build_flags.mak
+++ b/build_flags.mak
@@ -37,6 +37,9 @@ BUILD_QNX_A72?=no
 # Applied to target mode only
 BUILD_VLAB?=no
 
+# Enable R5F as TIOVX Host
+TIOVX_HOST_R5F?=yes
+
 # RTOS selection for R5F - SYSBIOS or FREERTOS
 RTOS?=FREERTOS
 
diff --git a/tutorial/ch01_common/vx_tutorial.c b/tutorial/ch01_common/vx_tutorial.c
index ec9a80e..c602b62 100644
--- a/tutorial/ch01_common/vx_tutorial.c
+++ b/tutorial/ch01_common/vx_tutorial.c
@@ -63,6 +63,7 @@
 
 #include <vx_tutorial.h>
 
+#ifdef _DISABLE_R5F_HOST
 static char menu[] = {
     "\n"
     "\n ==============="
@@ -82,6 +83,7 @@ static char menu[] = {
     "\n"
     "\n Enter Choice: "
 };
+#endif
 
 char vx_tutorial_get_char()
 {
@@ -97,6 +99,7 @@ void vx_tutorial_run_all()
 
 void vx_tutorial_run_interactive()
 {
+#ifdef _DISABLE_R5F_HOST
     char ch;
     vx_bool done = (vx_bool)vx_false_e;
 
@@ -137,4 +140,8 @@ void vx_tutorial_run_interactive()
                 break;
         }
     }
+#else
+    vx_tutorial_openVX_r5_demo();
+#endif
+
 }
diff --git a/tutorial/ch01_common/vx_tutorial.h b/tutorial/ch01_common/vx_tutorial.h
index 36f9481..9d459de 100755
--- a/tutorial/ch01_common/vx_tutorial.h
+++ b/tutorial/ch01_common/vx_tutorial.h
@@ -71,6 +71,9 @@
 #include <ch03_graph/vx_tutorial_graph.h>
 #include <ch04_graph_pipeline/vx_tutorial_graph_pipeline.h>
 #include <ch05_tidl/vx_tutorial_tidl.h>
+#ifndef _DISABLE_R5F_HOST
+	#include <ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.h>
+#endif
 
 char vx_tutorial_get_char();
 
diff --git a/tutorial/ch06_openVX_r5_demo/vx_tutorial_basic_openvx_kernels.c b/tutorial/ch06_openVX_r5_demo/vx_tutorial_basic_openvx_kernels.c
new file mode 100644
index 0000000..9b31403
--- /dev/null
+++ b/tutorial/ch06_openVX_r5_demo/vx_tutorial_basic_openvx_kernels.c
@@ -0,0 +1,440 @@
+/*
+*
+* Copyright (c) 2017 Texas Instruments Incorporated
+*
+* All rights reserved not granted herein.
+*
+* Limited License.
+*
+* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
+* license under copyrights and patents it now or hereafter owns or controls to make,
+* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
+* terms herein.  With respect to the foregoing patent license, such license is granted
+* solely to the extent that any such patent is necessary to Utilize the software alone.
+* The patent license shall not apply to any combinations which include this software,
+* other than combinations with devices manufactured by or for TI ("TI Devices").
+* No hardware patent is licensed hereunder.
+*
+* Redistributions must preserve existing copyright notices and reproduce this license
+* (including the above copyright notice and the disclaimer and (if applicable) source
+* code license limitations below) in the documentation and/or other materials provided
+* with the distribution
+*
+* Redistribution and use in binary form, without modification, are permitted provided
+* that the following conditions are met:
+*
+* *       No reverse engineering, decompilation, or disassembly of this software is
+* permitted with respect to any software provided in binary form.
+*
+* *       any redistribution and use are licensed by TI for use only with TI Devices.
+*
+* *       Nothing shall obligate TI to provide you with source code for the software
+* licensed and provided to you in object code.
+*
+* If software source code is provided to you, modification and redistribution of the
+* source code are permitted provided that the following conditions are met:
+*
+* *       any redistribution and use of the source code, including any resulting derivative
+* works, are licensed by TI for use only with TI Devices.
+*
+* *       any redistribution and use of any object code compiled from the source code
+* and any resulting derivative works, are licensed by TI for use only with TI Devices.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
+*
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* DISCLAIMER.
+*
+* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+* OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+/**
+ * \file vx_tutorial_basic_openvx_kernels.c Test basic openVX nodes on R5F
+ *
+ * In this tutorial we test the nodes of OpenVX on R5F,
+ *
+ *
+ * To include OpenVX interfaces include below file
+ * \code
+ * #include <VX/vx.h>
+ * \endcode
+ *
+ * Follow the comments in the function vx_tutorial_basic_openvx_kernels()
+ * to understand this tutorial
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <VX/vx.h>
+#include <TI/tivx.h>
+#include <utility.h>
+
+#define IMAGE_WIDTH  128
+#define IMAGE_HEIGHT 128
+
+/**
+ * - Expected output = (((INPUT1 + INPUT2) - INPUT3) * INPUT4)
+ * */
+#define INPUT1         7
+#define INPUT2         4
+#define INPUT3         3
+#define INPUT4         2
+#define FINAL_OUTPUT   (((INPUT1 + INPUT2) - INPUT3) * INPUT4)
+
+/**
+ * \brief Tutorial Entry Point
+ */
+void vx_tutorial_basic_openvx_kernels()
+{
+    /**
+     * - Define objects that we wish to create in the OpenVX application.
+     *
+     * A vx_context object is defined which is used as input parameter for all subesquent
+     * OpenVX object create APIs
+     * \code
+     */
+    vx_context context;
+    vx_image in_image1 = NULL;
+    vx_image in_image2 = NULL;
+    vx_image in_image3 = NULL;
+    vx_image in_image4 = NULL;
+    vx_image out_addimage = NULL;
+    vx_image out_subimage = NULL;
+    vx_image out_mulimage = NULL;
+    vx_graph graph = NULL;
+    vx_node node1 = NULL;
+    vx_node node2 = NULL;
+    vx_node node3 = NULL;
+    vx_scalar scale = NULL;
+    /** \endcode */
+    /**
+     * - Parameters required to map Image patch
+     * \code
+     * */
+    vx_rectangle_t rect = {0,0,IMAGE_WIDTH,IMAGE_HEIGHT};
+    vx_map_id in_map_id1 = (vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS;
+    vx_map_id in_map_id2 = (vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS;
+    vx_map_id in_map_id3 = (vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS;
+    vx_map_id in_map_id4 = (vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS;
+    vx_map_id out_map_id = (vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS;
+    vx_imagepatch_addressing_t in_image_addr1, in_image_addr2, in_image_addr3, in_image_addr4, out_image_addr;
+    void *in_data_ptr1,*in_data_ptr2,*in_data_ptr3,*in_data_ptr4, *out_data_ptr;
+    /** \endcode */
+    vx_uint32 x, y;
+    vx_float32 scale_val = 1.0f;
+    vx_status status;
+    vx_uint32 done = 0U;
+
+    printf(" 1. vx_tutorial_basic_openvx_kernels: Tutorial Started !!! \n");
+    /**
+     * - Create OpenVX context.
+     *
+     * This MUST be done first before any OpenVX API call.
+     * The context that is returned is used as input for subsequent OpenVX APIs
+     * \code
+     */
+    context = vxCreateContext();
+    /** \endcode */
+
+    /**
+     * - Create input image object and access the rectangular patch on the image object plane
+     * \code
+     */
+    in_image1 = vxCreateImage(context, IMAGE_WIDTH, IMAGE_HEIGHT, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)in_image1, "INPUT1");
+    status = vxMapImagePatch(in_image1,
+                &rect,
+                0,
+                &in_map_id1,
+                &in_image_addr1,
+                (void**)&in_data_ptr1,
+                (vx_enum)VX_WRITE_ONLY, (vx_enum)VX_MEMORY_TYPE_HOST, (vx_enum)VX_NOGAP_X);
+    in_image2 = vxCreateImage(context, IMAGE_WIDTH, IMAGE_HEIGHT, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)in_image2, "INPUT2");
+    status = vxMapImagePatch(in_image2,
+                &rect,
+                0,
+                &in_map_id2,
+                &in_image_addr2,
+                (void**)&in_data_ptr2,
+                (vx_enum)VX_WRITE_ONLY, (vx_enum)VX_MEMORY_TYPE_HOST, (vx_enum)VX_NOGAP_X);
+    in_image3 = vxCreateImage(context, IMAGE_WIDTH, IMAGE_HEIGHT, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)in_image3, "INPUT3");
+    status = vxMapImagePatch(in_image3,
+                &rect,
+                0,
+                &in_map_id3,
+                &in_image_addr3,
+                (void**)&in_data_ptr3,
+                (vx_enum)VX_WRITE_ONLY, (vx_enum)VX_MEMORY_TYPE_HOST, (vx_enum)VX_NOGAP_X);
+    in_image4 = vxCreateImage(context, IMAGE_WIDTH, IMAGE_HEIGHT, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)in_image4, "INPUT4");
+    status = vxMapImagePatch(in_image4,
+                &rect,
+                0,
+                &in_map_id4,
+                &in_image_addr4,
+                (void**)&in_data_ptr4,
+                (vx_enum)VX_WRITE_ONLY, (vx_enum)VX_MEMORY_TYPE_HOST, (vx_enum)VX_NOGAP_X);
+    /** \endcode */
+
+    /**
+     * - Populate the pixel values with a known value
+     *
+     * \code
+     */
+    for(y=0; y<in_image_addr1.dim_y; y++)
+    {
+        for(x=0; x<in_image_addr1.dim_x; x++)
+        {
+            vx_uint8 *in_pixel1 = (vx_uint8 *)vxFormatImagePatchAddress2d(in_data_ptr1, x, y, &in_image_addr1);
+            vx_uint8 *in_pixel2 = (vx_uint8 *)vxFormatImagePatchAddress2d(in_data_ptr2, x, y, &in_image_addr2);
+            vx_uint8 *in_pixel3 = (vx_uint8 *)vxFormatImagePatchAddress2d(in_data_ptr3, x, y, &in_image_addr3);
+            vx_uint8 *in_pixel4 = (vx_uint8 *)vxFormatImagePatchAddress2d(in_data_ptr4, x, y, &in_image_addr4);
+            *in_pixel1 = INPUT1;
+            *in_pixel2 = INPUT2;
+            *in_pixel3 = INPUT3;
+            *in_pixel4 = INPUT4;
+        }
+    }
+    /** \endcode */
+    if(in_map_id1!=(vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS)
+    {
+        vxUnmapImagePatch(in_image1, in_map_id1);
+    }
+    if(in_map_id2!=(vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS)
+    {
+        vxUnmapImagePatch(in_image2, in_map_id2);
+    }
+    if(in_map_id3!=(vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS)
+    {
+        vxUnmapImagePatch(in_image3, in_map_id3);
+    }
+    if(in_map_id4!=(vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS)
+    {
+        vxUnmapImagePatch(in_image4, in_map_id4);
+    }
+
+    /**
+     * - Create output image object
+     * \code
+     */
+    out_addimage = vxCreateImage(context, IMAGE_WIDTH, 128, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)out_addimage, "ADD_OUTPUT");
+    out_subimage = vxCreateImage(context, IMAGE_WIDTH, 128, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)out_subimage, "SUB_OUTPUT");
+    out_mulimage = vxCreateImage(context, IMAGE_WIDTH, 128, VX_DF_IMAGE_U8);
+    vxSetReferenceName((vx_reference)out_mulimage, "MUL_OUTPUT");
+
+    /**
+     * - Show image attributes.
+     *
+     * Follow the comments in show_image_attributes() to see
+     * how image attributes are queried and displayed.
+     * \code
+     */
+    show_image_attributes(in_image1);
+    show_image_attributes(in_image2);
+    show_image_attributes(in_image3);
+    show_image_attributes(in_image4);
+    show_image_attributes(out_addimage);
+    show_image_attributes(out_subimage);
+    show_image_attributes(out_mulimage);
+    /** \endcode */
+
+    /**
+     * - Create OpenVX graph.
+     *
+     * \code
+     */
+    graph = vxCreateGraph(context);
+    /** \endcode */
+
+    /**
+     * - Create OpenVX node object.
+     *
+     * Creates an OpenVX Add node with in_image1 and in_image2 input
+     * and out_addimage output.
+     * Creates an OpenVX Subtract node with out_addimage and in_image3 input
+     * and out_subimage output.
+     * Creates an OpenVX Multiply node with out_subimage and in_image4 input
+     * and out_mulimage output.
+     *
+     * \code
+     */
+    node1 = vxAddNode(graph, in_image1, in_image2, VX_CONVERT_POLICY_SATURATE, out_addimage);
+    vxSetReferenceName((vx_reference)node1, "ADD");
+    vxSetNodeTarget(node1, (vx_enum)VX_TARGET_STRING, TIVX_TARGET_DSP1);
+    node2 = vxSubtractNode(graph, out_addimage, in_image3, VX_CONVERT_POLICY_SATURATE, out_subimage);
+    vxSetReferenceName((vx_reference)node2, "SUB");
+    vxSetNodeTarget(node2, (vx_enum)VX_TARGET_STRING, TIVX_TARGET_DSP2);
+    scale = vxCreateScalar(context, VX_TYPE_FLOAT32, &scale_val);
+    node3 = vxMultiplyNode(graph, out_subimage, in_image4, scale, VX_CONVERT_POLICY_SATURATE, VX_ROUND_POLICY_TO_ZERO, out_mulimage);
+    vxSetReferenceName((vx_reference)node3, "MUL");
+    vxSetNodeTarget(node3, (vx_enum)VX_TARGET_STRING, TIVX_TARGET_DSP1);
+    /** \endcode */
+    /**
+     * - Verify graph object.
+     *
+     * Verifies that all parameters of graph object are valid.
+     *
+     * \code
+     */
+    status = vxVerifyGraph(graph);
+    /** \endcode */
+
+    /**
+     * - Show graph attributes.
+     *
+     * Follow the comments in show_graph_attributes() to see
+     * how graph attributes are queried and displayed.
+     * \code
+     */
+    show_graph_attributes(graph);
+    /** \endcode */
+
+    /**
+     * - Show node attributes.
+     *
+     * Follow the comments in show_node_attributes() to see
+     * how node attributes are queried and displayed.
+     * \code
+     */
+    show_node_attributes(node1);
+    show_node_attributes(node2);
+    show_node_attributes(node3);
+    /** \endcode */
+    if(status==(vx_status)VX_SUCCESS)
+    {
+        printf(" Executing graph ...\n");
+        status = vxProcessGraph(graph);
+        if(status==(vx_status)VX_SUCCESS)
+        {
+            printf(" Executing graph ... Done !!!\n");
+        }
+
+        /**
+         * - Show graph attributes.
+         *
+         * Follow the comments in show_graph_attributes() to see
+         * how graph attributes are queried and displayed.
+         * \code
+         */
+        show_graph_attributes(graph);
+        /** \endcode */
+
+        /**
+         * - Show node attributes.
+         *
+         * Follow the comments in show_node_attributes() to see
+         * how node attributes are queried and displayed.
+         * \code
+         */
+        show_node_attributes(node1);
+        show_node_attributes(node2);
+        show_node_attributes(node3);
+        /** \endcode */
+
+        status = vxMapImagePatch(out_mulimage,
+                &rect,
+                0,
+                &out_map_id,
+                &out_image_addr,
+                (void**)&out_data_ptr,
+                (vx_enum)VX_READ_AND_WRITE, (vx_enum)VX_MEMORY_TYPE_HOST, (vx_enum)VX_NOGAP_X);
+
+        for(y=0; y<out_image_addr.dim_y; y++)
+        {
+            for(x=0; x<out_image_addr.dim_x; x++)
+            {
+                vx_uint8 *out_pixel = (vx_uint8 *)vxFormatImagePatchAddress2d(out_data_ptr, x, y, &out_image_addr);
+                if(*out_pixel != FINAL_OUTPUT)
+                {
+                    printf("[ERR] Current Value = %d, Expected Value = %d\n", *out_pixel, FINAL_OUTPUT);
+                    done = 1U;
+                }
+            }
+        }
+        if (done == 0U)
+        {
+            printf("Arithmetic Operation Success!! Final Output = %d\n", FINAL_OUTPUT);
+        }
+
+        if(out_map_id!=(vx_map_id)(vx_status)VX_ERROR_INVALID_PARAMETERS)
+        {
+            vxUnmapImagePatch(out_mulimage, out_map_id);
+        }
+    }
+
+    /**
+     * - Release image object.
+     *
+     * Since we are done with using this image object, release it
+     * \code
+     */
+    vxReleaseImage(&out_mulimage);
+    vxReleaseImage(&out_subimage);
+    vxReleaseImage(&out_addimage);
+    vxReleaseImage(&in_image4);
+    vxReleaseImage(&in_image3);
+    vxReleaseImage(&in_image2);
+    vxReleaseImage(&in_image1);
+    /** \endcode */
+
+    /**
+     * - Release scalar object.
+     *
+     * Since we are done with using this scalar object, release it
+     * \code
+     */
+    vxReleaseScalar(&scale);
+    /** \endcode */
+
+    /**
+     * - Release node object.
+     *
+     * Since we are done with using this node object, release it
+     * \code
+     */
+    vxReleaseNode(&node1);
+    vxReleaseNode(&node2);
+    vxReleaseNode(&node3);
+    /** \endcode */
+
+    /**
+     * - Release graph object.
+     *
+     * Since we are done with using this graph object, release it
+     * \code
+     */
+    vxReleaseGraph(&graph);
+    /** \endcode */
+
+    /**
+     * - Release context object.
+     *
+     * Since we are done using OpenVX context, release it.
+     * No further OpenVX API calls should be done, until a context is again created using
+     * vxCreateContext()
+     * \code
+     */
+    vxReleaseContext(&context);
+    /** \endcode */
+
+    printf(" 1. vx_tutorial_basic_openvx_kernels: Tutorial Done !!! \n");
+    printf(" \n");
+}
diff --git a/tutorial/ch06_openVX_r5_demo/vx_tutorial_capture_display_usecase.c b/tutorial/ch06_openVX_r5_demo/vx_tutorial_capture_display_usecase.c
new file mode 100644
index 0000000..937eaf3
--- /dev/null
+++ b/tutorial/ch06_openVX_r5_demo/vx_tutorial_capture_display_usecase.c
@@ -0,0 +1,481 @@
+/*
+*
+* Copyright (c) 2017 Texas Instruments Incorporated
+*
+* All rights reserved not granted herein.
+*
+* Limited License.
+*
+* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
+* license under copyrights and patents it now or hereafter owns or controls to make,
+* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
+* terms herein.  With respect to the foregoing patent license, such license is granted
+* solely to the extent that any such patent is necessary to Utilize the software alone.
+* The patent license shall not apply to any combinations which include this software,
+* other than combinations with devices manufactured by or for TI ("TI Devices").
+* No hardware patent is licensed hereunder.
+*
+* Redistributions must preserve existing copyright notices and reproduce this license
+* (including the above copyright notice and the disclaimer and (if applicable) source
+* code license limitations below) in the documentation and/or other materials provided
+* with the distribution
+*
+* Redistribution and use in binary form, without modification, are permitted provided
+* that the following conditions are met:
+*
+* *       No reverse engineering, decompilation, or disassembly of this software is
+* permitted with respect to any software provided in binary form.
+*
+* *       any redistribution and use are licensed by TI for use only with TI Devices.
+*
+* *       Nothing shall obligate TI to provide you with source code for the software
+* licensed and provided to you in object code.
+*
+* If software source code is provided to you, modification and redistribution of the
+* source code are permitted provided that the following conditions are met:
+*
+* *       any redistribution and use of the source code, including any resulting derivative
+* works, are licensed by TI for use only with TI Devices.
+*
+* *       any redistribution and use of any object code compiled from the source code
+* and any resulting derivative works, are licensed by TI for use only with TI Devices.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
+*
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* DISCLAIMER.
+*
+* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+* OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+/**
+ * \file vx_tutorial_capture_display_usecase.c Test Capture-Display usecase on R5F
+ *
+ *
+ * To include OpenVX graph pipeline include below files
+ * \code
+ * #include <VX/vx_khr_pipelining.h>
+ * #include <TI/tivx.h>
+ * \endcode
+ *
+ * Follow the comments in the function vx_tutorial_capture_display_usecase()
+ * to understand this tutorial
+ *
+ */
+
+#include <VX/vx_khr_pipelining.h>
+#include <TI/tivx.h>
+#include <utility.h>
+#include <utils/iss/include/app_iss.h>
+#include <utils/sensors/include/app_sensors.h>
+#include <TI/j7.h>
+
+#define MAX_NUM_BUF         (8u)
+#define MIN_NUM_BUF         (4u)
+
+#define IMAGE_WIDTH         (1936U)
+#define IMAGE_HEIGHT        (1100U)
+
+/*Display Params*/
+#define OUT_WIDTH           (1920U)
+#define OUT_HEIGHT          (1080U)
+#define PIPE_ID             (2U)
+
+#define NUM_CHANNELS        (4U)
+#define LOOP                (1000U)
+
+#define CHANNEL_SWITCH_FRAME_COUNT          (150u)
+
+static const vx_char user_data_object_name[] = "tivx_capture_params_t";
+/*
+ * Utility API used to add a graph parameter from a node, node parameter index
+ */
+static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_uint32 node_parameter_index)
+{
+    vx_parameter parameter = vxGetParameterByIndex(node, node_parameter_index);
+
+    vxAddParameterToGraph(graph, parameter);
+    vxReleaseParameter(&parameter);
+}
+
+static uint32_t initSensorParams(uint32_t sensor_features_supported)
+{
+    uint32_t sensor_features_enabled = 0;
+
+    if(ISS_SENSOR_FEATURE_COMB_COMP_WDR_MODE == (sensor_features_supported & ISS_SENSOR_FEATURE_COMB_COMP_WDR_MODE))
+    {
+        sensor_features_enabled |= ISS_SENSOR_FEATURE_COMB_COMP_WDR_MODE;
+    }else
+    {
+        sensor_features_enabled |= ISS_SENSOR_FEATURE_LINEAR_MODE;
+    }
+
+    if(ISS_SENSOR_FEATURE_MANUAL_EXPOSURE == (sensor_features_supported & ISS_SENSOR_FEATURE_MANUAL_EXPOSURE))
+    {
+        sensor_features_enabled |= ISS_SENSOR_FEATURE_MANUAL_EXPOSURE;
+    }
+
+    if(ISS_SENSOR_FEATURE_MANUAL_GAIN == (sensor_features_supported & ISS_SENSOR_FEATURE_MANUAL_GAIN))
+    {
+        sensor_features_enabled |= ISS_SENSOR_FEATURE_MANUAL_GAIN;
+    }
+
+    if(ISS_SENSOR_FEATURE_DCC_SUPPORTED == (sensor_features_supported & ISS_SENSOR_FEATURE_DCC_SUPPORTED))
+    {
+        sensor_features_enabled |= ISS_SENSOR_FEATURE_DCC_SUPPORTED;
+    }
+
+    return sensor_features_enabled;
+}
+
+/**
+ * \brief Tutorial Entry Point
+ */
+void vx_tutorial_capture_display_usecase()
+{
+    /**
+     * - Define objects that we wish to create in the OpenVX application.
+     *
+     */
+    vx_context context;
+    vx_graph graph;
+    vx_node capture_node, displayNode;
+
+    /* Data objects for graph */
+    vx_object_array capture_frames[MAX_NUM_BUF];
+    vx_user_data_object capture_config, display_param_obj;
+    vx_image image = 0, display_image = 0;
+    vx_status status = 0;
+    vx_user_data_object switch_ch_obj;
+    tivx_display_select_channel_params_t channel_prms;
+
+    /* Local objects */
+    vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[1];
+    tivx_capture_params_t local_capture_config;
+    tivx_display_params_t display_params;
+    uint32_t num_capture_channels = NUM_CHANNELS;
+    uint32_t buf_id, loop_id, num_buf, instIdx, chIdx, loop_cnt;
+    uint32_t exe_time;
+
+    /* Image objects */
+    vx_reference refs[1];
+    vx_user_data_object capture_stats_obj;
+    tivx_capture_statistics_t *capture_stats_struct;
+    vx_map_id capture_stats_map_id;
+    uint32_t *data_ptr;
+
+    /* Sensor Parameters */
+    char* sensor_list[ISS_SENSORS_MAX_SUPPORTED_SENSOR];
+    vx_uint8 num_sensors_found, count = 0;
+    IssSensor_CreateParams sensorParams;
+    char availableSensorNames[ISS_SENSORS_MAX_SUPPORTED_SENSOR][ISS_SENSORS_MAX_NAME];
+    char *sensor_name;
+    uint32_t sensor_features_enabled = 0, sensor_features_supported = 0;
+
+    /* Setting to num buf of capture node */
+    num_buf = MIN_NUM_BUF;
+    loop_cnt = LOOP;
+
+    printf("2. vx_tutorial_capture_display_usecase: Tutorial Started !!! \n");
+    /**
+     * - Create OpenVX context.
+     *
+     * This MUST be done first before any OpenVX API call.
+     * The context that is returned is used as input for subsequent OpenVX APIs
+     * \code
+     */
+    context = vxCreateContext();
+    /** \endcode */
+
+    /* Init for test case */
+    tivxHwaLoadKernels(context);
+
+    /* Imaging Initialization */
+    {
+        memset(availableSensorNames, 0, ISS_SENSORS_MAX_SUPPORTED_SENSOR*ISS_SENSORS_MAX_NAME);
+        for(count=0;count<ISS_SENSORS_MAX_SUPPORTED_SENSOR;count++)
+        {
+            sensor_list[count] = availableSensorNames[count];
+        }
+        appEnumerateImageSensor(sensor_list, &num_sensors_found);
+
+        sensor_name = sensor_list[0]; /* Note: hardcoding to IMX390 */
+
+        memset(&sensorParams, 0, sizeof(sensorParams));
+        appQueryImageSensor(sensor_name, &sensorParams);
+
+        sensor_features_supported = sensorParams.sensorInfo.features;
+
+        sensor_features_enabled = initSensorParams(sensor_features_supported);
+
+        appInitImageSensor(sensor_name, sensor_features_enabled, (1<<(num_capture_channels))-1); /*Mask = 0xF for 4 cameras*/
+    }
+
+    /**
+     * - Create OpenVX graph.
+     *
+     * \code
+     */
+    graph = vxCreateGraph(context);
+    /** \endcode */
+
+    if(status == VX_SUCCESS)
+    {
+        status = vxGetStatus((vx_reference) graph);
+    }
+
+    /* Creating objects for graph */
+    {
+        image = vxCreateImage(context, IMAGE_WIDTH, IMAGE_HEIGHT, VX_DF_IMAGE_U16);
+        show_image_attributes(image);
+
+        /* allocate Input and Output refs, multiple refs created to allow pipelining of graph */
+        for(buf_id=0; buf_id<num_buf; buf_id++)
+        {
+            capture_frames[buf_id] = vxCreateObjectArray(context, (vx_reference)image, num_capture_channels);
+            status = vxGetStatus((vx_reference) capture_frames[buf_id]);
+        }
+        vxReleaseImage(&image);
+
+        /* Config initialization */
+        tivx_capture_params_init(&local_capture_config);
+        local_capture_config.numInst = 1;
+        local_capture_config.numCh   = num_capture_channels;
+        chIdx = 0U;
+        for (instIdx = 0U ; instIdx < local_capture_config.numInst ; instIdx++)
+        {
+            local_capture_config.instId[instIdx] = instIdx;
+            local_capture_config.instCfg[instIdx].enableCsiv2p0Support = (uint32_t)vx_true_e;
+            local_capture_config.instCfg[instIdx].numDataLanes         =  4;
+
+            for (loop_id = 0U; loop_id < local_capture_config.instCfg[instIdx].numDataLanes ; loop_id++)
+            {
+                local_capture_config.instCfg[instIdx].dataLanesMap[loop_id] = (loop_id + 1u);
+            }
+            for (loop_id = 0U; loop_id < num_capture_channels; loop_id++)
+            {
+                local_capture_config.chVcNum[chIdx]   = loop_id;
+                local_capture_config.chInstMap[chIdx] = instIdx;
+                chIdx++;
+            }
+        }
+
+        capture_config = vxCreateUserDataObject(context, user_data_object_name, sizeof(tivx_capture_params_t), &local_capture_config);
+
+        capture_node = tivxCaptureNode(graph, capture_config, capture_frames[0]);
+
+        if(status == VX_SUCCESS)
+        {
+            status = vxReleaseUserDataObject(&capture_config);
+        }
+        if(status == VX_SUCCESS)
+        {
+            status = vxSetNodeTarget(capture_node, VX_TARGET_STRING, TIVX_TARGET_CAPTURE1);
+        }
+
+        /**
+         * - Display parameter initialization
+         */
+        memset(&display_params, 0, sizeof(tivx_display_params_t));
+        display_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;
+        display_params.pipeId = PIPE_ID;
+        display_params.outHeight = OUT_HEIGHT;
+        display_params.outWidth = OUT_WIDTH;
+        display_params.posX = 0;
+        display_params.posY = 0;
+
+        display_image = (vx_image) vxGetObjectArrayItem(capture_frames[0], 0);
+        show_image_attributes(display_image);
+        display_param_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &display_params);
+        displayNode = tivxDisplayNode(graph, display_param_obj, display_image);
+
+        if(status == VX_SUCCESS)
+        {
+            status = vxReleaseUserDataObject(&display_param_obj);
+            vxReleaseImage(&display_image);
+        }
+        if(status == VX_SUCCESS)
+        {
+            status = vxSetNodeTarget(displayNode, VX_TARGET_STRING, TIVX_TARGET_DISPLAY1);
+            printf("Display Set Target done\n");
+        }
+
+        /* Create User Data object for channel switching */
+        channel_prms.active_channel_id = 0;
+        switch_ch_obj = vxCreateUserDataObject(context, "tivx_display_select_channel_params_t", sizeof(tivx_display_select_channel_params_t), &channel_prms);
+        refs[0] = (vx_reference)switch_ch_obj;
+    }
+
+    /* Pipelining and graph verification */
+    {
+        /* input @ node index 0, becomes graph parameter 1 */
+        add_graph_parameter_by_node_index(graph, capture_node, 1);
+
+        /* set graph schedule config such that graph parameter @ index 0 and 1 are enqueuable */
+        graph_parameters_queue_params_list[0].graph_parameter_index = 0;
+        graph_parameters_queue_params_list[0].refs_list_size = num_buf;
+        graph_parameters_queue_params_list[0].refs_list = (vx_reference*)&capture_frames[0];
+
+        /* Schedule mode auto is used, here we dont need to call vxScheduleGraph
+         * Graph gets scheduled automatically as refs are enqueued to it
+         */
+        status = vxSetGraphScheduleConfig(graph,
+                VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO,
+                1,
+                graph_parameters_queue_params_list
+                );
+
+        /**
+         * - Verify graph object.
+         *
+         * Verifies that all parameters of graph object are valid.
+         *
+         * \code
+         */
+        status = vxVerifyGraph(graph);
+        /** \endcode */
+
+        show_graph_attributes(graph);
+        show_node_attributes(capture_node);
+        show_node_attributes(displayNode);
+    }
+
+    /* iniitalizing sensor */
+    appStartImageSensor(sensor_name, (1<<(num_capture_channels))-1);/*Mask for 4 cameras*/
+
+    exe_time = (uint32_t)tivxPlatformGetTimeInUsecs();
+
+    /* enqueue buf for pipeup but dont trigger graph execution */
+    for(buf_id=0; buf_id<num_buf-2; buf_id++)
+    {
+        tivxGraphParameterEnqueueReadyRef(graph, 0, (vx_reference*)&capture_frames[buf_id], 1, TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP);
+    }
+
+    // /* after pipeup, now enqueue a buffer to trigger graph scheduling */
+    vxGraphParameterEnqueueReadyRef(graph, 0, (vx_reference*)&capture_frames[num_buf-2], 1);
+
+    // /* Need to trigger again since display holds on to a buffer */
+    vxGraphParameterEnqueueReadyRef(graph, 0, (vx_reference*)&capture_frames[num_buf-1], 1);
+
+    /* wait for graph instances to complete, compare output and recycle data buffers, schedule again */
+    for(loop_id=0; loop_id<(loop_cnt+num_buf); loop_id++)
+    {
+        uint32_t num_refs;
+        vx_object_array out_capture_frames;
+
+        /* Get output reference, waits until a reference is available */
+        vxGraphParameterDequeueDoneRef(graph, 0, (vx_reference*)&out_capture_frames, 1, &num_refs);
+        vxGraphParameterEnqueueReadyRef(graph, 0, (vx_reference*)&out_capture_frames, 1);
+
+        if (0 == (loop_id % CHANNEL_SWITCH_FRAME_COUNT))
+        {
+            channel_prms.active_channel_id = (channel_prms.active_channel_id + 1) % num_capture_channels;
+            vxCopyUserDataObject(switch_ch_obj, 0, sizeof(tivx_display_select_channel_params_t), &channel_prms, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST);
+            tivxNodeSendCommand(displayNode, 0, TIVX_DISPLAY_SELECT_CHANNEL, refs, 1u);
+        }
+    }
+
+    /* ensure all graph processing is complete */
+    vxWaitGraph(graph);
+
+    show_graph_attributes(graph);
+    show_node_attributes(capture_node);
+    show_node_attributes(displayNode);
+    exe_time = (uint32_t)tivxPlatformGetTimeInUsecs() - exe_time;
+
+    printf("exe_time = %d",exe_time);
+
+    appStopImageSensor(sensor_name, (1<<(num_capture_channels))-1); /*Mask for 4 cameras*/
+
+    /* Querying node for sensor stats */
+    {
+        capture_stats_obj =
+            vxCreateUserDataObject(context, "tivx_capture_statistics_t" ,
+            sizeof(tivx_capture_statistics_t), NULL);
+
+        refs[0] = (vx_reference)capture_stats_obj;
+        tivxNodeSendCommand(capture_node, 0,
+            TIVX_CAPTURE_GET_STATISTICS, refs, 1u);
+
+        vxMapUserDataObject(
+                (vx_user_data_object)refs[0],
+                0,
+                sizeof(tivx_capture_statistics_t),
+                &capture_stats_map_id,
+                (void **)&data_ptr,
+                VX_READ_ONLY,
+                VX_MEMORY_TYPE_HOST,
+                0
+            );
+
+        capture_stats_struct = (tivx_capture_statistics_t*)data_ptr;
+
+        /* As this is single instance app, array index to access status will be always '0U' */
+        printf("\n\r==========================================================\r\n");
+        printf(": Capture Status:\r\n");
+        printf("==========================================================\r\n");
+        printf(": FIFO Overflow Count: %d\r\n",
+                  capture_stats_struct->overflowCount[0U]);
+        printf(": Spurious UDMA interrupt count: %d\r\n",
+                  capture_stats_struct->spuriousUdmaIntrCount[0U]);
+        printf("  [Channel No] | Frame Queue Count |"
+            " Frame De-queue Count | Frame Drop Count |\n");
+        for(chIdx = 0U ; chIdx < num_capture_channels ; chIdx ++)
+        {
+            printf("\t\t%d|\t\t%d|\t\t%d|\t\t%d|\n",
+                  chIdx,
+                  capture_stats_struct->queueCount[0U][chIdx],
+                  capture_stats_struct->dequeueCount[0U][chIdx],
+                  capture_stats_struct->dropCount[0U][chIdx]);
+        }
+        vxUnmapUserDataObject((vx_user_data_object)refs[0], capture_stats_map_id);
+    }
+
+    vxReleaseNode(&displayNode);
+    vxReleaseNode(&capture_node);
+
+    for(buf_id=0; buf_id<num_buf; buf_id++)
+    {
+        vxReleaseObjectArray(&capture_frames[buf_id]);
+    }
+    vxReleaseUserDataObject(&capture_stats_obj);
+
+    vxReleaseUserDataObject(&switch_ch_obj);
+    tivxHwaUnLoadKernels(context);
+
+    /**
+     * - Release graph object.
+     *
+     * Since we are done with using this graph object, release it
+     * \code
+     */
+    vxReleaseGraph(&graph);
+    /** \endcode */
+
+    /**
+     * - Release context object.
+     *
+     * Since we are done using OpenVX context, release it.
+     * No further OpenVX API calls should be done, until a context is again created using
+     * vxCreateContext()
+     * \code
+     */
+    vxReleaseContext(&context);
+    /** \endcode */
+
+    appDeInitImageSensor(sensor_name);
+    printf("2. vx_tutorial_capture_display_usecase: Tutorial Done !!! \n");
+    printf(" \n");
+}
diff --git a/tutorial/ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.c b/tutorial/ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.c
new file mode 100644
index 0000000..41bcf7c
--- /dev/null
+++ b/tutorial/ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.c
@@ -0,0 +1,81 @@
+/*
+*
+* Copyright (c) 2017 Texas Instruments Incorporated
+*
+* All rights reserved not granted herein.
+*
+* Limited License.
+*
+* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
+* license under copyrights and patents it now or hereafter owns or controls to make,
+* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
+* terms herein.  With respect to the foregoing patent license, such license is granted
+* solely to the extent that any such patent is necessary to Utilize the software alone.
+* The patent license shall not apply to any combinations which include this software,
+* other than combinations with devices manufactured by or for TI ("TI Devices").
+* No hardware patent is licensed hereunder.
+*
+* Redistributions must preserve existing copyright notices and reproduce this license
+* (including the above copyright notice and the disclaimer and (if applicable) source
+* code license limitations below) in the documentation and/or other materials provided
+* with the distribution
+*
+* Redistribution and use in binary form, without modification, are permitted provided
+* that the following conditions are met:
+*
+* *       No reverse engineering, decompilation, or disassembly of this software is
+* permitted with respect to any software provided in binary form.
+*
+* *       any redistribution and use are licensed by TI for use only with TI Devices.
+*
+* *       Nothing shall obligate TI to provide you with source code for the software
+* licensed and provided to you in object code.
+*
+* If software source code is provided to you, modification and redistribution of the
+* source code are permitted provided that the following conditions are met:
+*
+* *       any redistribution and use of the source code, including any resulting derivative
+* works, are licensed by TI for use only with TI Devices.
+*
+* *       any redistribution and use of any object code compiled from the source code
+* and any resulting derivative works, are licensed by TI for use only with TI Devices.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
+*
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* DISCLAIMER.
+*
+* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+* OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+#include <vx_tutorial.h>
+
+void vx_tutorial_openVX_r5_demo()
+{
+
+    printf(" vx_tutorial_openVX_r5_demo: Tutorial Started !!! \n");
+
+    /**
+     * UseCase 1 : Run basic OpenVX Kernels on R5F host
+     */
+    vx_tutorial_basic_openvx_kernels();
+
+    /**
+     * UseCase 2 : Run Capture - Display usecase on R5F host
+     */
+    vx_tutorial_capture_display_usecase();
+
+    printf(" vx_tutorial_openVX_r5_demo: Tutorial Done !!! \n");
+}
diff --git a/tutorial/ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.h b/tutorial/ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.h
new file mode 100644
index 0000000..69c86c3
--- /dev/null
+++ b/tutorial/ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.h
@@ -0,0 +1,87 @@
+/*
+*
+* Copyright (c) 2017 Texas Instruments Incorporated
+*
+* All rights reserved not granted herein.
+*
+* Limited License.
+*
+* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
+* license under copyrights and patents it now or hereafter owns or controls to make,
+* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
+* terms herein.  With respect to the foregoing patent license, such license is granted
+* solely to the extent that any such patent is necessary to Utilize the software alone.
+* The patent license shall not apply to any combinations which include this software,
+* other than combinations with devices manufactured by or for TI ("TI Devices").
+* No hardware patent is licensed hereunder.
+*
+* Redistributions must preserve existing copyright notices and reproduce this license
+* (including the above copyright notice and the disclaimer and (if applicable) source
+* code license limitations below) in the documentation and/or other materials provided
+* with the distribution
+*
+* Redistribution and use in binary form, without modification, are permitted provided
+* that the following conditions are met:
+*
+* *       No reverse engineering, decompilation, or disassembly of this software is
+* permitted with respect to any software provided in binary form.
+*
+* *       any redistribution and use are licensed by TI for use only with TI Devices.
+*
+* *       Nothing shall obligate TI to provide you with source code for the software
+* licensed and provided to you in object code.
+*
+* If software source code is provided to you, modification and redistribution of the
+* source code are permitted provided that the following conditions are met:
+*
+* *       any redistribution and use of the source code, including any resulting derivative
+* works, are licensed by TI for use only with TI Devices.
+*
+* *       any redistribution and use of any object code compiled from the source code
+* and any resulting derivative works, are licensed by TI for use only with TI Devices.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
+*
+* may be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* DISCLAIMER.
+*
+* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+* OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+
+
+#ifndef VX_TUTORIAL_OPENVX_R5_DEMO_H
+#define VX_TUTORIAL_OPENVX_R5_DEMO_H
+
+#include <stdio.h>
+#include <VX/vx.h>
+
+/*
+ * \brief Test basic openVX nodes on R5F
+ *
+ */
+void vx_tutorial_basic_openvx_kernels();
+
+/*
+ * \brief Test Capture-Display usecase on R5F
+ */
+void vx_tutorial_capture_display_usecase();
+
+/*
+ * \brief Interactive execution of tutorials
+ */
+void vx_tutorial_openVX_r5_demo();
+
+#endif
diff --git a/tutorial/concerto.mak b/tutorial/concerto.mak
index 15f7a64..7ee17e3 100644
--- a/tutorial/concerto.mak
+++ b/tutorial/concerto.mak
@@ -8,6 +8,8 @@ TARGETTYPE  := library
 IDIRS       += $(TIOVX_PATH)/utils/include
 IDIRS       += $(TIOVX_PATH)/tutorial
 IDIRS       += $(TIOVX_PATH)/tutorial/ch01_common
+IDIRS       += $(VISION_APPS_PATH)/
+IDIRS       += $(IMAGING_PATH)/
 
 CH01_SOURCES := \
     ch01_common/vx_tutorial.c \
@@ -45,6 +47,11 @@ CH05_SOURCES := \
 	ch05_tidl/vx_tutorial_tidl.c \
 	ch05_tidl/imagenet_class_labels.c \
 
+CH06_SOURCES := \
+	ch06_openVX_r5_demo/vx_tutorial_openVX_r5_demo.c \
+	ch06_openVX_r5_demo/vx_tutorial_basic_openvx_kernels.c \
+	ch06_openVX_r5_demo/vx_tutorial_capture_display_usecase.c \
+
 ifeq ($(TARGET_PLATFORM),PC)
 CFLAGS += -DHOST_EMULATION
 endif
@@ -61,6 +68,12 @@ else
 DEFS += _DISABLE_TIDL
 endif
 
+ifeq ($(TIOVX_HOST_R5F),yes)
+CSOURCES += $(CH06_SOURCES)
+else
+DEFS += _DISABLE_R5F_HOST
+endif
+
 include $(FINALE)
 
 endif
