SPRADS6 March   2026 AM68A , AM69A , TDA4VM

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Data Movement within the TDA4VH
    1. 1.1 Common Bus Architecture Subsystem (CBASS)
    2. 1.2 Navigator Subsystems (NAVSS)
      1. 1.2.1 NAVSS North Bridge (NB)
    3. 1.3 Multicore Shared Memory Controller (MSMC)
  5. 2Quality of Service (QoS)
    1. 2.1 NAVSS0
      1. 2.1.1 NAVSS0 North Bridge
        1. 2.1.1.1 Normal vs Real-Time Traffic
    2. 2.2 Multicore Shared Memory Controller (MSMC)
    3. 2.3 DDR Subsystem (DDRSS)
      1. 2.3.1 MSMC2DDR Bridge
      2. 2.3.2 Class of Service (CoS)
    4. 2.4 QoS Summary
  6. 3Case Study: Display Sync Lost Issue
    1. 3.1 Problem Statement
    2. 3.2 Setup and Recreation
      1. 3.2.1 Requirements
        1. 3.2.1.1 RTOS Patches
          1. 3.2.1.1.1 0001-vision_apps-Remove-the-DSS-application-from-MCU2_0.patch
          2. 3.2.1.1.2 0002-vision_apps-Remove-display-use-from-the-AVP-demo.patch
        2. 3.2.1.2 Linux Patches
          1. 3.2.1.2.1 0001-arm64-dts-ti-k3-j784s4-vision-apps-Re-enable-DSS-for.patch
      2. 3.2.2 Host Setup
      3. 3.2.3 Target Setup
      4. 3.2.4 Recreation
    3. 3.3 Debugging QoS
      1. 3.3.1 CPTracer
        1. 3.3.1.1  Setup
        2. 3.3.1.2  Profiling Throughput
        3. 3.3.1.3  Profiling Latency
        4. 3.3.1.4  Profiling Transactions
        5. 3.3.1.5  Profiling Relevant Routes
        6. 3.3.1.6  Profiling DSS Throughput
          1. 3.3.1.6.1 Theoretical DSS Throughput
          2. 3.3.1.6.2 Normal DSS Throughput
          3. 3.3.1.6.3 DSS Throughput with the AVP Demo Running
        7. 3.3.1.7  Profiling DSS Latency
        8. 3.3.1.8  Profiling C7x Throughput
        9. 3.3.1.9  Profiling C7x Throughput vs DSS Latency
        10. 3.3.1.10 Profiling C7x_4 Core Transactions
      2. 3.3.2 Editing QoS Settings
        1. 3.3.2.1 Editing Order ID
          1. 3.3.2.1.1 DSS Order ID
          2. 3.3.2.1.2 C7x Order ID
        2. 3.3.2.2 NRT and RT Routing
          1. 3.3.2.2.1 NRT and RT Routing in U-Boot
        3. 3.3.2.3 Editing Priority
          1. 3.3.2.3.1 DSS Priority
          2. 3.3.2.3.2 C7x Priority
      3. 3.3.3 Editing CoS Mappings
        1. 3.3.3.1 CoS Mapping Registers
        2. 3.3.3.2 Checking CoS Mappings
    4. 3.4 Fixing the DSS Sync Losts
      1. 3.4.1 Remap C7x_4 Core Transactions
        1. 3.4.1.1 ti-u-boot-2023.04
        2. 3.4.1.2 ti-u-boot-2025.01
      2. 3.4.2 Honor All Priorities
        1. 3.4.2.1 ti-u-boot-2023.04
        2. 3.4.2.2 ti-u-boot-2025.01
  7. 4Summary
  8. 5References
0002-vision_apps-Remove-display-use-from-the-AVP-demo.patch
From c8059ede6e8a5cb38933f01b6c275a84539cd267 Mon Sep 17 00:00:00 2001
From: Jared McArthur <j-mcarthur@ti.com>
Date: Tue, 28 Jan 2025 11:29:07 -0600
Subject: [PATCH 2/2] vision_apps: Remove display use from the AVP demo

Remove display calls from the auto valey parking (AVP) demo. The demo
traditionally outputs to a display; remove this functionality so Linux
can own the display driver.

Disabling the display within the AVP demo allows for testing Linux's
display driver while the C7x cores are loaded.

Signed-off-by: Jared McArthur <j-mcarthur@ti.com>
---
 .../app_tidl_avp/avp_img_mosaic_module.c      |  73 ++++++++++-
 apps/dl_demos/app_tidl_avp/concerto.mak       |   2 +-
 apps/dl_demos/app_tidl_avp/main.c             | 119 ++++--------------
 3 files changed, 97 insertions(+), 97 deletions(-)

diff --git a/apps/dl_demos/app_tidl_avp/avp_img_mosaic_module.c b/apps/dl_demos/app_tidl_avp/avp_img_mosaic_module.c
index 21ace33..d43f7ad 100644
--- a/apps/dl_demos/app_tidl_avp/avp_img_mosaic_module.c
+++ b/apps/dl_demos/app_tidl_avp/avp_img_mosaic_module.c
@@ -61,7 +61,14 @@
  */
 
 #include "avp_img_mosaic_module.h"
-
+#include <fcntl.h>
+#include <linux/fb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
 
 vx_status app_init_img_mosaic(vx_context context, ImgMosaicObj *imgMosaicObj, vx_int32 bufq_depth)
 {
@@ -143,7 +150,68 @@ void app_create_graph_img_mosaic(vx_graph graph, ImgMosaicObj *imgMosaicObj, vx_
 
     return;
 }
+/*
+#include <fcntl.h>
+#include <linux/fb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[]) {
+int fb_fd = open("/dev/fb0", O_RDWR);
+if (fb_fd == -1) {
+perror("Error: cannot open framebuffer device");
+return 1;
+}
+
+struct fb_var_screeninfo vinfo;
+struct fb_fix_screeninfo finfo;
+
+// Get fixed screen information
+if (ioctl(fb_fd, FBIOGET_FSCREENINFO, &finfo)) {
+perror("Error reading fixed information");
+return 2;
+}
+
+// Get variable screen information
+if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &vinfo)) {
+perror("Error reading variable information");
+return 3;
+}
 
+int screensize = vinfo.yres_virtual * finfo.line_length;
+
+// Map framebuffer to user memory
+char *fbp = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fb_fd, 0);
+if ((intptr_t)fbp == -1) {
+perror("Error: failed to map framebuffer device to memory");
+return 4;
+}
+
+// Open the image file (raw RGB data)
+FILE *img = fopen("image.rgb", "rb");
+if (!img) {
+perror("Error: cannot open image file");
+munmap(fbp, screensize);
+close(fb_fd);
+return 5;
+}
+
+// Read image data into framebuffer memory
+fread(fbp, 1, screensize, img);
+
+// Cleanup
+fclose(img);
+munmap(fbp, screensize);
+close(fb_fd);
+
+return 0;
+
+} 
+*/
 vx_status writeMosaicOutput(char* file_name, vx_image out_img)
 {
     vx_status status;
@@ -194,6 +262,8 @@ vx_status writeMosaicOutput(char* file_name, vx_image out_img)
                 data_ptr += image_addr.stride_y;
             }
 
+
+
             if(num_bytes != (img_width*img_height))
             {
                 printf("Luma bytes written = %d, expected = %d\n", num_bytes, img_width*img_height);
@@ -224,6 +294,7 @@ vx_status writeMosaicOutput(char* file_name, vx_image out_img)
                 printf("CbCr bytes written = %d, expected = %d\n", num_bytes, img_width*img_height/2);
             }
 
+
             vxUnmapImagePatch(out_img, map_id);
 
         }
diff --git a/apps/dl_demos/app_tidl_avp/concerto.mak b/apps/dl_demos/app_tidl_avp/concerto.mak
index fab60bc..b4b4677 100644
--- a/apps/dl_demos/app_tidl_avp/concerto.mak
+++ b/apps/dl_demos/app_tidl_avp/concerto.mak
@@ -3,7 +3,7 @@ ifeq ($(TARGET_CPU),$(filter $(TARGET_CPU), x86_64 A72 A53))
 include $(PRELUDE)
 
 TARGET      := vx_app_tidl_avp
-CSOURCES    := main.c avp_scaler_module.c avp_pre_proc_module.c avp_tidl_module.c avp_post_proc_module.c fisheye_angle_table.c avp_img_mosaic_module.c avp_draw_detections_module.c avp_display_module.c
+CSOURCES    := main.c avp_scaler_module.c avp_pre_proc_module.c avp_tidl_module.c avp_post_proc_module.c fisheye_angle_table.c avp_img_mosaic_module.c avp_draw_detections_module.c 
 
 ifeq ($(HOST_COMPILER),GCC_LINUX)
 CFLAGS += -Wno-unused-function
diff --git a/apps/dl_demos/app_tidl_avp/main.c b/apps/dl_demos/app_tidl_avp/main.c
index 9d23faf..5b0a673 100644
--- a/apps/dl_demos/app_tidl_avp/main.c
+++ b/apps/dl_demos/app_tidl_avp/main.c
@@ -78,7 +78,6 @@
 #include "avp_post_proc_module.h"
 #include "avp_draw_detections_module.h"
 #include "avp_img_mosaic_module.h"
-#include "avp_display_module.h"
 #include "avp_test.h"
 
 #ifndef x86_64
@@ -108,8 +107,6 @@ typedef struct {
 
     ImgMosaicObj imgMosaicObj;
 
-    DisplayObj displayObj;
-
     vx_char input_file_path[APP_MAX_FILE_PATH];
     vx_char output_file_path[APP_MAX_FILE_PATH];
     vx_char input_file_list[APP_MAX_FILE_PATH];
@@ -188,9 +185,7 @@ static void app_update_param_set(AppObj *obj);
 static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_uint32 node_parameter_index);
 static void app_pipeline_params_defaults(AppObj *obj);
 static void app_find_object_array_index(vx_object_array object_array[], vx_reference ref, vx_int32 array_size, vx_int32 *array_idx);
-#ifndef x86_64
-static void app_draw_graphics(Draw2D_Handle *handle, Draw2D_BufInfo *draw2dBufInfo, uint32_t update_type);
-#endif
+
 #ifdef AVP_ENABLE_PIPELINE_FLOW
 static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id);
 #else
@@ -228,7 +223,7 @@ static void app_run_task(void *app_var)
     AppObj *obj = (AppObj *)app_var;
     vx_status status = VX_SUCCESS;
 
-    while(!obj->stop_task && (status == VX_SUCCESS))
+    while((status == VX_SUCCESS))
     {
         status = app_run_graph(obj);
     }
@@ -626,15 +621,6 @@ static void app_parse_cfg_file(AppObj *obj, vx_char *cfg_file_name)
                 }
             }
             else
-            if(strcmp(token, "display_option")==0)
-            {
-                token = strtok(NULL, s);
-                if(token != NULL)
-                {
-                    obj->displayObj.display_option = atoi(token);
-                }
-            }
-            else
             if(strcmp(token, "delay_in_msecs")==0)
             {
                 token = strtok(NULL, s);
@@ -718,7 +704,6 @@ static void app_parse_cfg_file(AppObj *obj, vx_char *cfg_file_name)
 
     if (obj->test_mode == 1)
     {
-        obj->displayObj.display_option = 1;
         obj->is_interactive = 0;
         obj->num_iterations = 1;
         /* if testing, just run the number of frames that are found in the expected
@@ -770,7 +755,6 @@ static void app_parse_cmd_line_args(AppObj *obj, vx_int32 argc, vx_char *argv[])
     if (set_test_mode == vx_true_e)
     {
         obj->test_mode = 1;
-        obj->displayObj.display_option = 1;
         obj->is_interactive = 0;
         obj->num_iterations = 1;
         /* if testing, just run the number of frames that are found in the expected
@@ -780,7 +764,6 @@ static void app_parse_cmd_line_args(AppObj *obj, vx_int32 argc, vx_char *argv[])
     }
 
     #ifdef x86_64
-    obj->displayObj.display_option = 0;
     obj->is_interactive = 0;
     #endif
 
@@ -876,7 +859,6 @@ static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_u
 static vx_status app_init(AppObj *obj)
 {
     vx_status status = VX_SUCCESS;
-    app_grpx_init_prms_t grpx_prms;
 
     /* Create OpenVx Context */
     obj->context = vxCreateContext();
@@ -994,21 +976,10 @@ static vx_status app_init(AppObj *obj)
     {
         status = app_init_img_mosaic(obj->context, &obj->imgMosaicObj, AVP_BUFFER_Q_DEPTH);
     }
-    if(status == VX_SUCCESS)
-    {
-        status = app_init_display(obj->context, &obj->displayObj, "display_obj");
-    }
+
     appPerfPointSetName(&obj->total_perf , "TOTAL");
     appPerfPointSetName(&obj->fileio_perf, "FILEIO");
 
-    #ifndef x86_64
-    if(obj->displayObj.display_option == 1)
-    {
-        appGrpxInitParamsInit(&grpx_prms, obj->context);
-        grpx_prms.draw_callback = app_draw_graphics;
-        appGrpxInit(&grpx_prms);
-    }
-    #endif
 
     return status;
 }
@@ -1041,14 +1012,6 @@ static void app_deinit(AppObj *obj)
 
     app_deinit_img_mosaic(&obj->imgMosaicObj, AVP_BUFFER_Q_DEPTH);
 
-    app_deinit_display(&obj->displayObj);
-
-    #ifndef x86_64
-    if(obj->displayObj.display_option == 1)
-    {
-        appGrpxDeInit();
-    }
-    #endif
 
     tivxTIDLUnLoadKernels(obj->context);
     tivxImgProcUnLoadKernels(obj->context);
@@ -1086,7 +1049,6 @@ static void app_delete_graph(AppObj *obj)
 
     app_delete_img_mosaic(&obj->imgMosaicObj);
 
-    app_delete_display(&obj->displayObj);
 
     vxReleaseGraph(&obj->graph);
 }
@@ -1180,10 +1142,6 @@ static vx_status app_create_graph(AppObj *obj)
 
     app_create_graph_img_mosaic(obj->graph, &obj->imgMosaicObj, NULL);
 
-    if(status == VX_SUCCESS)
-    {
-        status = app_create_graph_display(obj->graph, &obj->displayObj, obj->imgMosaicObj.output_image[0]);
-    }
 
 #ifdef AVP_ENABLE_PIPELINE_FLOW
     /* Scalar Node - input is in Index 0 */
@@ -1547,8 +1505,11 @@ static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 fram
                 APP_PRINTF("App Writing Outputs Start...\n");
 
                 snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/mosaic_output_%010d_1920x1080.yuv", obj->output_file_path, (frame_id - AVP_BUFFER_Q_DEPTH));
+                // printf("output_file_name=%s\n",output_file_name);
                 status = writeMosaicOutput(output_file_name, mosaic_output_image);
-
+                /*Kangjia get perception algorithm result*/
+                // printf("--------------------------------------\n");
+                
                 APP_PRINTF("App Writing Outputs Done!\n");
             }
             /* Enqueue output */
@@ -1629,10 +1590,10 @@ static vx_status app_run_graph(AppObj *obj)
             APP_PRINTF("app_avp: Frame ID %d of %d ... Done.\n", frame_id, obj->start_frame + obj->num_frames);
 
             /* user asked to stop processing */
-            if((obj->stop_task) || (status == VX_FAILURE))
-            {
-                break;
-            }
+            //if((obj->stop_task) || (status == VX_FAILURE))
+            //{
+            //    break;
+            //}
         }
         printf("app_avp: Iteration %d of %d ... Done.\n", x, obj->num_iterations);
         appPerfPointPrintFPS(&obj->total_perf);
@@ -1644,17 +1605,17 @@ static vx_status app_run_graph(AppObj *obj)
         }
 
         /* user asked to stop processing */
-        if((obj->stop_task) || (status == VX_FAILURE))
-        {
-          break;
-        }
+        //if((obj->stop_task) || (status == VX_FAILURE))
+        //{
+        //  break;
+        //}
     }
 
 #ifdef AVP_ENABLE_PIPELINE_FLOW
     vxWaitGraph(obj->graph);
 #endif
 
-    obj->stop_task = 1;
+    //obj->stop_task = 1;
 
     return status;
 }
@@ -1838,8 +1799,8 @@ static void set_img_mosaic_defaults(AppObj *obj, ImgMosaicObj *imgMosaicObj)
 {
     vx_int32 idx = 0;
     vx_int32 in = 0;
-    imgMosaicObj->out_width    = 1920;
-    imgMosaicObj->out_height   = 1080;
+    imgMosaicObj->out_width    = 800;
+    imgMosaicObj->out_height   = 600;
     imgMosaicObj->num_inputs   = obj->enable_psd + obj->enable_vd + obj->enable_sem_seg;
 
     tivxImgMosaicParamsSetDefaults(&imgMosaicObj->params);
@@ -1848,8 +1809,8 @@ static void set_img_mosaic_defaults(AppObj *obj, ImgMosaicObj *imgMosaicObj)
     /* Right camera - PSD output */
     if(obj->enable_psd == 1)
     {
-        imgMosaicObj->params.windows[idx].startX  = 840;
-        imgMosaicObj->params.windows[idx].startY  = 200;
+        imgMosaicObj->params.windows[idx].startX  = 100;
+        imgMosaicObj->params.windows[idx].startY  = 50;
         imgMosaicObj->params.windows[idx].width   = 512;
         imgMosaicObj->params.windows[idx].height  = 512;
         imgMosaicObj->params.windows[idx].input_select   = in++;
@@ -1860,8 +1821,8 @@ static void set_img_mosaic_defaults(AppObj *obj, ImgMosaicObj *imgMosaicObj)
     /* Right camera - PSD output */
     if(obj->enable_vd == 1)
     {
-        imgMosaicObj->params.windows[idx].startX  = 1380;
-        imgMosaicObj->params.windows[idx].startY  = 200;
+        imgMosaicObj->params.windows[idx].startX  = 100;
+        imgMosaicObj->params.windows[idx].startY  = 50;
         imgMosaicObj->params.windows[idx].width   = 512;
         imgMosaicObj->params.windows[idx].height  = 512;
         imgMosaicObj->params.windows[idx].input_select   = in++;
@@ -1872,8 +1833,8 @@ static void set_img_mosaic_defaults(AppObj *obj, ImgMosaicObj *imgMosaicObj)
     /* Front camera - semantic segmentation output */
     if(obj->enable_sem_seg == 1)
     {
-        imgMosaicObj->params.windows[idx].startX  = 40;
-        imgMosaicObj->params.windows[idx].startY  = 250;
+        imgMosaicObj->params.windows[idx].startX  =20;
+        imgMosaicObj->params.windows[idx].startY  = 100;
         imgMosaicObj->params.windows[idx].width   = 768;
         imgMosaicObj->params.windows[idx].height  = 384;
         imgMosaicObj->params.windows[idx].input_select   = in++;
@@ -1887,10 +1848,6 @@ static void set_img_mosaic_defaults(AppObj *obj, ImgMosaicObj *imgMosaicObj)
     imgMosaicObj->params.clear_count  = 4;
 }
 
-static void set_display_defaults(DisplayObj *displayObj)
-{
-    displayObj->display_option = 0;
-}
 
 static void app_pipeline_params_defaults(AppObj *obj)
 {
@@ -1918,7 +1875,6 @@ static void app_default_param_set(AppObj *obj)
     obj->vdDrawDetectionsObj.params.num_classes = 1;
     obj->vdDrawDetectionsObj.params.class_id[0] = 1;
 
-    set_display_defaults(&obj->displayObj);
 
     app_pipeline_params_defaults(obj);
 
@@ -1972,31 +1928,4 @@ static void app_find_object_array_index(vx_object_array object_array[], vx_refer
         vxReleaseImage(&img_ref);
     }
 }
-#ifndef x86_64
-static void app_draw_graphics(Draw2D_Handle *handle, Draw2D_BufInfo *draw2dBufInfo, uint32_t update_type)
-{
-    appGrpxDrawDefault(handle, draw2dBufInfo, update_type);
-
-    if(update_type == 0)
-    {
-        Draw2D_FontPrm sHeading;
-        Draw2D_FontPrm sAlgo1;
-        Draw2D_FontPrm sAlgo2;
-        Draw2D_FontPrm sAlgo3;
-
-        sHeading.fontIdx = 0;
-        Draw2D_drawString(handle, 560, 5, "Analytics for Auto Valet Parking", &sHeading);
-
-        sAlgo1.fontIdx = 2;
-        Draw2D_drawString(handle, 270, 640, "Semantic Segmentation", &sAlgo1);
 
-        sAlgo2.fontIdx = 2;
-        Draw2D_drawString(handle, 920, 720, "Parking Spot Detection", &sAlgo2);
-
-        sAlgo3.fontIdx = 2;
-        Draw2D_drawString(handle, 1490, 720, "Vehicle Detection", &sAlgo3);
-    }
-
-  return;
-}
-#endif
-- 
2.34.1