@@ -846,6 +846,11 @@ void va_TraceInit(VADisplay dpy)
846846 va_trace_flag |= VA_TRACE_FLAG_SURFACE_ENCODE ;
847847 if (strstr (env_value , "jpeg" ) || strstr (env_value , "jpg" ))
848848 va_trace_flag |= VA_TRACE_FLAG_SURFACE_JPEG ;
849+ /* now one context only support 1 surface dump file
850+ * may add vpp input in future
851+ */
852+ if (strstr (env_value , "vppout" ))
853+ va_trace_flag |= VA_TRACE_FLAG_SURFACE_VPPOUT ;
849854
850855 if (va_parseConfig ("LIBVA_TRACE_SURFACE_GEOMETRY" , & env_value [0 ]) == 0 ) {
851856 char * p = env_value , * q ;
@@ -1438,7 +1443,7 @@ void va_TraceCreateContext(
14381443 struct va_trace * pva_trace = NULL ;
14391444 struct trace_context * trace_ctx = NULL ;
14401445 int tra_ctx_id = 0 ;
1441- int encode = 0 , decode = 0 , jpeg = 0 ;
1446+ int encode = 0 , decode = 0 , jpeg = 0 , vpp = 0 ;
14421447 int i ;
14431448
14441449 pva_trace = (struct va_trace * )(((VADisplayContextP )dpy )-> vatrace );
@@ -1523,9 +1528,12 @@ void va_TraceCreateContext(
15231528 encode = (trace_ctx -> trace_entrypoint == VAEntrypointEncSlice );
15241529 decode = (trace_ctx -> trace_entrypoint == VAEntrypointVLD );
15251530 jpeg = (trace_ctx -> trace_entrypoint == VAEntrypointEncPicture );
1531+ vpp = (trace_ctx -> trace_entrypoint == VAEntrypointVideoProc );
1532+
15261533 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE )) ||
15271534 (decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE )) ||
1528- (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG ))) {
1535+ (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG )) ||
1536+ (vpp && (va_trace_flag & VA_TRACE_FLAG_SURFACE_VPPOUT ))) {
15291537 if (open_tracing_specil_file (pva_trace , trace_ctx , 1 ) < 0 ) {
15301538 va_errorMessage (dpy , "Open surface fail failed for ctx 0x%08x\n" , * context );
15311539
@@ -6869,20 +6877,22 @@ void va_TraceEndPictureExt(
68696877 int endpic_done
68706878)
68716879{
6872- int encode , decode , jpeg ;
6880+ int encode , decode , jpeg , vpp ;
68736881 DPY2TRACECTX (dpy , context , VA_INVALID_ID );
68746882 /* avoid to create so many empty files */
68756883 encode = (trace_ctx -> trace_entrypoint == VAEntrypointEncSlice );
68766884 decode = (trace_ctx -> trace_entrypoint == VAEntrypointVLD );
68776885 jpeg = (trace_ctx -> trace_entrypoint == VAEntrypointEncPicture );
6886+ vpp = (trace_ctx -> trace_entrypoint == VAEntrypointVideoProc );
68786887
68796888 /* trace encode source surface, can do it before HW completes rendering */
68806889 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE )) ||
68816890 (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG )))
68826891 va_TraceSurface (dpy , context );
68836892
68846893 /* trace decoded surface, do it after HW completes rendering */
6885- if (decode && ((va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE ))) {
6894+ if ((decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE )) ||
6895+ (vpp && (va_trace_flag & VA_TRACE_FLAG_SURFACE_VPPOUT ))) {
68866896 vaSyncSurface (dpy , trace_ctx -> trace_rendertarget );
68876897 va_TraceSurface (dpy , context );
68886898 }
0 commit comments