Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions va/va_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,11 @@ void va_TraceInit(VADisplay dpy)
va_trace_flag |= VA_TRACE_FLAG_SURFACE_ENCODE;
if (strstr(env_value, "jpeg") || strstr(env_value, "jpg"))
va_trace_flag |= VA_TRACE_FLAG_SURFACE_JPEG;
/* now one context only support 1 surface dump file
* may add vpp input in future
*/
if (strstr(env_value, "vppout"))
va_trace_flag |= VA_TRACE_FLAG_SURFACE_VPPOUT;

if (va_parseConfig("LIBVA_TRACE_SURFACE_GEOMETRY", &env_value[0]) == 0) {
char *p = env_value, *q;
Expand Down Expand Up @@ -1440,7 +1445,7 @@ void va_TraceCreateContext(
struct va_trace *pva_trace = NULL;
struct trace_context *trace_ctx = NULL;
int tra_ctx_id = 0;
int encode = 0, decode = 0, jpeg = 0;
int encode = 0, decode = 0, jpeg = 0, vpp = 0;
int i;

pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace);
Expand Down Expand Up @@ -1525,9 +1530,12 @@ void va_TraceCreateContext(
encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
vpp = (trace_ctx->trace_entrypoint == VAEntrypointVideoProc);

if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE)) ||
(decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE)) ||
(jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) {
(jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG)) ||
(vpp && (va_trace_flag & VA_TRACE_FLAG_SURFACE_VPPOUT))) {
if (open_tracing_specil_file(pva_trace, trace_ctx, 1) < 0) {
va_errorMessage(dpy, "Open surface fail failed for ctx 0x%08x\n", *context);

Expand Down Expand Up @@ -6871,20 +6879,22 @@ void va_TraceEndPictureExt(
int endpic_done
)
{
int encode, decode, jpeg;
int encode, decode, jpeg, vpp;
DPY2TRACECTX(dpy, context, VA_INVALID_ID);
/* avoid to create so many empty files */
encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
vpp = (trace_ctx->trace_entrypoint == VAEntrypointVideoProc);

/* trace encode source surface, can do it before HW completes rendering */
if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE)) ||
(jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG)))
va_TraceSurface(dpy, context);

/* trace decoded surface, do it after HW completes rendering */
if (decode && ((va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE))) {
if ((decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE)) ||
(vpp && (va_trace_flag & VA_TRACE_FLAG_SURFACE_VPPOUT))) {
vaSyncSurface(dpy, trace_ctx->trace_rendertarget);
va_TraceSurface(dpy, context);
}
Expand Down
3 changes: 3 additions & 0 deletions va/va_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ extern int va_trace_flag;
#define VA_TRACE_FLAG_SURFACE_DECODE 0x8
#define VA_TRACE_FLAG_SURFACE_ENCODE 0x10
#define VA_TRACE_FLAG_SURFACE_JPEG 0x20
#define VA_TRACE_FLAG_SURFACE_VPPOUT 0x80

#define VA_TRACE_FLAG_SURFACE (VA_TRACE_FLAG_SURFACE_DECODE | \
VA_TRACE_FLAG_SURFACE_ENCODE | \
VA_TRACE_FLAG_SURFACE_JPEG)
#define VA_TRACE_FLAG_FTRACE 0x40
#define VA_TRACE_FLAG_FTRACE_BUFDATA (VA_TRACE_FLAG_FTRACE | \
VA_TRACE_FLAG_BUFDATA)


#define VA_TRACE_LOG(trace_func,...) \
if (va_trace_flag & VA_TRACE_FLAG_LOG) { \
trace_func(__VA_ARGS__); \
Expand Down