]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/commitdiff
[PDK-6682][DSS APP]Display sample application is printing wrong number of frames...
authorVivek Dhande <a0132295@ti.com>
Fri, 4 Sep 2020 12:39:03 +0000 (18:09 +0530)
committerVivek Dhande <a0132295@ti.com>
Fri, 4 Sep 2020 12:44:59 +0000 (18:14 +0530)
- Reduced test time from 120 seconds to 30 seconds
- Issue:
    - Sample application was printing wrong number of frames displayed
- Root-cause
    - App has an additional layer on top of normal UART/CIO print statements
    - Argument parsing done in this function was incorrect
- Resolution:
    - Add 'vsnprintf()' along with 'va_start()' and 'va_end()' for argument parsing

Signed-off-by: Vivek Dhande <a0132295@ti.com>
packages/ti/drv/dss/examples/dss_display_test/dss_display_test.c
packages/ti/drv/dss/examples/dss_display_test/dss_display_test.h

index 66dc1b6443713bfd28674625a6484297afeec9ed..da5d6035cc826024dc9d20dac874af925f52a51d 100755 (executable)
@@ -162,10 +162,10 @@ int32_t Dss_displayTest(void)
     Utils_prfLoadPrintAll(TRUE, 0);
     Utils_prfLoadCalcReset();
     Utils_prfLoadUnRegister(TaskP_self());
-    App_print("Number of frames = %d, elapsed msec = %d, fps = %d\n",
+    App_print("Number of frames = %d, elapsed msec = %d, fps = %0.2f\n",
             DISP_APP_RUN_COUNT,
             gTestStopTime - gTestStartTime,
-            (uint32_t)((float)DISP_APP_RUN_COUNT / ((gTestStopTime - gTestStartTime)/1000.0)));
+            (float)((float)DISP_APP_RUN_COUNT / ((gTestStopTime - gTestStartTime)/1000.0)));
 
 #endif
 
@@ -1079,12 +1079,14 @@ static int32_t DispApp_pipeCbFxn(Fvid2_Handle handle, void *appData)
 
 void App_print(const char *format, ...)
 {
-    va_list     vaArgPtr;
-    va_start(vaArgPtr, format);
-
-    DSS_log(format, vaArgPtr);
-    va_end(vaArgPtr);
-
-    return;
+    char printBuffer[DISP_APP_PRINT_BUFFER_SIZE];
+    va_list arguments;
+
+    /* Start the var args processing. */
+    va_start(arguments, format);
+    vsnprintf (printBuffer, sizeof(printBuffer), format, arguments);
+    DSS_log(printBuffer);
+    /* End the var args processing. */
+    va_end(arguments);
 }
 
index f51c4cb2242de54c308787902328cc26d002da11..36b2fb962130f6e5538964947b5868a471d1971a 100755 (executable)
@@ -56,7 +56,7 @@ extern "C" {
 #if defined (SIMULATOR)
 #define DISP_APP_RUN_COUNT              (0x10U)
 #else
-#define DISP_APP_RUN_COUNT              (0x1000U)
+#define DISP_APP_RUN_COUNT              ((uint32_t)2000U)
 #endif
 
 /* Worst case frames per handle */
@@ -141,6 +141,8 @@ extern "C" {
 #define DSS_log                printf
 #endif
 
+/* Print buffer character limit for prints- UART or CCS Console */
+#define DISP_APP_PRINT_BUFFER_SIZE                   ((uint32_t)4000)
 /* ========================================================================== */
 /*                         Structure Declarations                             */
 /* ========================================================================== */