Skip to content

Commit 21ac866

Browse files
committed
trace:add vpp output surface dump support
use LIBVA_TRACE_SURFACE=vppout to dump vpp output surface Signed-off-by: Carl Zhang <carl.zhang@intel.com>
1 parent 4c8971c commit 21ac866

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

va/va_trace.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

va/va_trace.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ extern int va_trace_flag;
3737
#define VA_TRACE_FLAG_SURFACE_DECODE 0x8
3838
#define VA_TRACE_FLAG_SURFACE_ENCODE 0x10
3939
#define VA_TRACE_FLAG_SURFACE_JPEG 0x20
40+
#define VA_TRACE_FLAG_SURFACE_VPPOUT 0x80
41+
4042
#define VA_TRACE_FLAG_SURFACE (VA_TRACE_FLAG_SURFACE_DECODE | \
4143
VA_TRACE_FLAG_SURFACE_ENCODE | \
4244
VA_TRACE_FLAG_SURFACE_JPEG)
4345
#define VA_TRACE_FLAG_FTRACE 0x40
4446
#define VA_TRACE_FLAG_FTRACE_BUFDATA (VA_TRACE_FLAG_FTRACE | \
4547
VA_TRACE_FLAG_BUFDATA)
4648

49+
4750
#define VA_TRACE_LOG(trace_func,...) \
4851
if (va_trace_flag & VA_TRACE_FLAG_LOG) { \
4952
trace_func(__VA_ARGS__); \

0 commit comments

Comments
 (0)