From 11665e0bd541483e4f245f5bd6607906297de3ef Mon Sep 17 00:00:00 2001 From: Austin Yuan Date: Thu, 17 Oct 2013 10:57:23 +0800 Subject: vatrace: make LIBVA_TRACE_SURFACE work even without LIBVA_TRACE Signed-off-by: Austin Yuan (cherry picked from commit e39ebdd95062995e4bdf082d50bd7d9005a3be6c) --- va/va.c | 8 ++++---- va/va_trace.c | 2 +- va/va_trace.h | 12 +++++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/va/va.c b/va/va.c index 171082a..612e8cd 100644 --- a/va/va.c +++ b/va/va.c @@ -641,7 +641,7 @@ VAStatus vaCreateConfig ( vaStatus = ctx->vtable->vaCreateConfig ( ctx, profile, entrypoint, attrib_list, num_attribs, config_id ); /* record the current entrypoint for further trace/fool determination */ - VA_TRACE_LOG(va_TraceCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id); + VA_TRACE_ALL(va_TraceCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id); VA_FOOL_FUNC(va_FoolCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id); return vaStatus; @@ -917,7 +917,7 @@ VAStatus vaCreateContext ( flag, render_targets, num_render_targets, context ); /* keep current encode/decode resoluton */ - VA_TRACE_LOG(va_TraceCreateContext, dpy, config_id, picture_width, picture_height, flag, render_targets, num_render_targets, context); + VA_TRACE_ALL(va_TraceCreateContext, dpy, config_id, picture_width, picture_height, flag, render_targets, num_render_targets, context); return vaStatus; } @@ -1099,7 +1099,7 @@ VAStatus vaBeginPicture ( CHECK_DISPLAY(dpy); ctx = CTX(dpy); - VA_TRACE_LOG(va_TraceBeginPicture, dpy, context, render_target); + VA_TRACE_ALL(va_TraceBeginPicture, dpy, context, render_target); VA_FOOL_RETURN(); va_status = ctx->vtable->vaBeginPicture( ctx, context, render_target ); @@ -1140,7 +1140,7 @@ VAStatus vaEndPicture ( va_status = ctx->vtable->vaEndPicture( ctx, context ); /* dump surface content */ - VA_TRACE_SURFACE(va_TraceEndPicture, dpy, context, 1); + VA_TRACE_ALL(va_TraceEndPicture, dpy, context, 1); return va_status; } diff --git a/va/va_trace.c b/va/va_trace.c index 6ee7bae..c2479cd 100644 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -2983,7 +2983,7 @@ void va_TraceEndPicture( /* trace encode source surface, can do it before HW completes rendering */ if ((encode && (trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE))|| - (jpeg && (trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) + (jpeg && (trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) va_TraceSurface(dpy); /* trace decoded surface, do it after HW completes rendering */ diff --git a/va/va_trace.h b/va/va_trace.h index 2a14fa6..d002e49 100644 --- a/va/va_trace.h +++ b/va/va_trace.h @@ -45,9 +45,9 @@ extern int trace_flag; if (trace_flag & VA_TRACE_FLAG_LOG) { \ trace_func(__VA_ARGS__); \ } -#define VA_TRACE_SURFACE(trace_func,...) \ - if (trace_flag & (VA_TRACE_FLAG_SURFACE | VA_TRACE_FLAG_CODEDBUF)) { \ - trace_func(__VA_ARGS__); \ +#define VA_TRACE_ALL(trace_func,...) \ + if (trace_flag) { \ + trace_func(__VA_ARGS__); \ } void va_TraceInit(VADisplay dpy); @@ -83,6 +83,12 @@ void va_TraceCreateSurfaces( unsigned int num_attribs ); +void va_TraceDestroySurfaces( + VADisplay dpy, + VASurfaceID *surface_list, + int num_surfaces +); + void va_TraceCreateContext( VADisplay dpy, VAConfigID config_id, -- cgit v1.2.1