summaryrefslogtreecommitdiff
path: root/va
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2013-05-16 16:41:03 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-06-19 14:47:44 +0800
commitd9f693c6cfd0fed0ef3ecd6ae268ed01d4e250d3 (patch)
treef66c0c70e39f737770bba576455037b0175ad93d /va
parent416d64f4c1b0d760ea3c426446a84d329e15c6e5 (diff)
vatrace: trace coded buffer create/destroy
Change-Id: If0388cd5e2e141184d88ff5de5612d15e51e3d20 Signed-off-by: Austin Yuan <shengquan.yuan@intel.com> (cherry picked from commit 880c916092c6d68096c95e49405714d8a21f9322)
Diffstat (limited to 'va')
-rw-r--r--va/va.c14
-rw-r--r--va/va_trace.c55
-rw-r--r--va/va_trace.h14
3 files changed, 81 insertions, 2 deletions
diff --git a/va/va.c b/va/va.c
index 3358119..ca332ec 100644
--- a/va/va.c
+++ b/va/va.c
@@ -929,15 +929,22 @@ VAStatus vaCreateBuffer (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus;
+ int ret = 0;
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- int ret = 0;
VA_FOOL_FUNC(va_FoolCreateBuffer, dpy, context, type, size, num_elements, data, buf_id);
if (ret)
return VA_STATUS_SUCCESS;
- return ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
+ vaStatus = ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
+
+ VA_TRACE_LOG(va_TraceCreateBuffer,
+ dpy, context, type, size, num_elements, data, buf_id);
+
+ return vaStatus;
}
VAStatus vaBufferSetNumElements (
@@ -1007,6 +1014,9 @@ VAStatus vaDestroyBuffer (
ctx = CTX(dpy);
VA_FOOL_RETURN();
+
+ VA_TRACE_LOG(va_TraceDestroyBuffer,
+ dpy, buffer_id);
return ctx->vtable->vaDestroyBuffer( ctx, buffer_id );
}
diff --git a/va/va_trace.c b/va/va_trace.c
index 887e24d..b546fe6 100644
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -619,6 +619,61 @@ static char * buffer_type_to_string(int type)
}
}
+void va_TraceCreateBuffer (
+ VADisplay dpy,
+ VAContextID context, /* in */
+ VABufferType type, /* in */
+ unsigned int size, /* in */
+ unsigned int num_elements, /* in */
+ void *data, /* in */
+ VABufferID *buf_id /* out */
+)
+{
+ DPY2INDEX(dpy);
+
+ /* only trace CodedBuffer */
+ if (type != VAEncCodedBufferType)
+ return;
+
+ TRACE_FUNCNAME(idx);
+ va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type));
+ va_TraceMsg(idx, "\tbuf_id=0x%x\n", *buf_id);
+ va_TraceMsg(idx, "\tsize=%d\n", size);
+ va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements);
+
+ va_TraceMsg(idx, NULL);
+}
+
+void va_TraceDestroyBuffer (
+ VADisplay dpy,
+ VABufferID buf_id /* in */
+)
+{
+ VABufferType type;
+ unsigned int size;
+ unsigned int num_elements;
+
+ VACodedBufferSegment *buf_list;
+ int i = 0;
+
+ DPY2INDEX(dpy);
+
+ vaBufferInfo(dpy, trace_context[idx].trace_context, buf_id, &type, &size, &num_elements);
+
+ /* only trace CodedBuffer */
+ if (type != VAEncCodedBufferType)
+ return;
+
+ TRACE_FUNCNAME(idx);
+ va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type));
+ va_TraceMsg(idx, "\tbuf_id=0x%x\n", buf_id);
+ va_TraceMsg(idx, "\tsize=%d\n", size);
+ va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements);
+
+ va_TraceMsg(idx, NULL);
+}
+
+
void va_TraceMapBuffer (
VADisplay dpy,
VABufferID buf_id, /* in */
diff --git a/va/va_trace.h b/va/va_trace.h
index 29599ea..70c3847 100644
--- a/va/va_trace.h
+++ b/va/va_trace.h
@@ -96,6 +96,20 @@ void va_TraceCreateContext(
VAContextID *context /* out */
);
+void va_TraceCreateBuffer (
+ VADisplay dpy,
+ VAContextID context, /* in */
+ VABufferType type, /* in */
+ unsigned int size, /* in */
+ unsigned int num_elements, /* in */
+ void *data, /* in */
+ VABufferID *buf_id /* out */
+);
+
+void va_TraceDestroyBuffer (
+ VADisplay dpy,
+ VABufferID buf_id /* in */
+);
void va_TraceMapBuffer (
VADisplay dpy,