@@ -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 ;
@@ -1440,7 +1445,7 @@ void va_TraceCreateContext(
14401445 struct va_trace * pva_trace = NULL ;
14411446 struct trace_context * trace_ctx = NULL ;
14421447 int tra_ctx_id = 0 ;
1443- int encode = 0 , decode = 0 , jpeg = 0 ;
1448+ int encode = 0 , decode = 0 , jpeg = 0 , vpp = 0 ;
14441449 int i ;
14451450
14461451 pva_trace = (struct va_trace * )(((VADisplayContextP )dpy )-> vatrace );
@@ -1525,9 +1530,12 @@ void va_TraceCreateContext(
15251530 encode = (trace_ctx -> trace_entrypoint == VAEntrypointEncSlice );
15261531 decode = (trace_ctx -> trace_entrypoint == VAEntrypointVLD );
15271532 jpeg = (trace_ctx -> trace_entrypoint == VAEntrypointEncPicture );
1533+ vpp = (trace_ctx -> trace_entrypoint == VAEntrypointVideoProc );
1534+
15281535 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE )) ||
15291536 (decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE )) ||
1530- (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG ))) {
1537+ (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG )) ||
1538+ (vpp && (va_trace_flag & VA_TRACE_FLAG_SURFACE_VPPOUT ))) {
15311539 if (open_tracing_specil_file (pva_trace , trace_ctx , 1 ) < 0 ) {
15321540 va_errorMessage (dpy , "Open surface fail failed for ctx 0x%08x\n" , * context );
15331541
@@ -6871,20 +6879,22 @@ void va_TraceEndPictureExt(
68716879 int endpic_done
68726880)
68736881{
6874- int encode , decode , jpeg ;
6882+ int encode , decode , jpeg , vpp ;
68756883 DPY2TRACECTX (dpy , context , VA_INVALID_ID );
68766884 /* avoid to create so many empty files */
68776885 encode = (trace_ctx -> trace_entrypoint == VAEntrypointEncSlice );
68786886 decode = (trace_ctx -> trace_entrypoint == VAEntrypointVLD );
68796887 jpeg = (trace_ctx -> trace_entrypoint == VAEntrypointEncPicture );
6888+ vpp = (trace_ctx -> trace_entrypoint == VAEntrypointVideoProc );
68806889
68816890 /* trace encode source surface, can do it before HW completes rendering */
68826891 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE )) ||
68836892 (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG )))
68846893 va_TraceSurface (dpy , context );
68856894
68866895 /* trace decoded surface, do it after HW completes rendering */
6887- if (decode && ((va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE ))) {
6896+ if ((decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE )) ||
6897+ (vpp && (va_trace_flag & VA_TRACE_FLAG_SURFACE_VPPOUT ))) {
68886898 vaSyncSurface (dpy , trace_ctx -> trace_rendertarget );
68896899 va_TraceSurface (dpy , context );
68906900 }
0 commit comments