• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revisiond9f693c6cfd0fed0ef3ecd6ae268ed01d4e250d3 (tree)
Time2013-06-19 15:47:44
AuthorAustin Yuan <shengquan.yuan@inte...>
CommiterXiang, Haihao

Log Message

vatrace: trace coded buffer create/destroy

Change-Id: If0388cd5e2e141184d88ff5de5612d15e51e3d20
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
(cherry picked from commit 880c916092c6d68096c95e49405714d8a21f9322)

Change Summary

Incremental Difference

--- a/va/va.c
+++ b/va/va.c
@@ -929,15 +929,22 @@ VAStatus vaCreateBuffer (
929929 )
930930 {
931931 VADriverContextP ctx;
932+ VAStatus vaStatus;
933+ int ret = 0;
934+
932935 CHECK_DISPLAY(dpy);
933936 ctx = CTX(dpy);
934- int ret = 0;
935937
936938 VA_FOOL_FUNC(va_FoolCreateBuffer, dpy, context, type, size, num_elements, data, buf_id);
937939 if (ret)
938940 return VA_STATUS_SUCCESS;
939941
940- return ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
942+ vaStatus = ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
943+
944+ VA_TRACE_LOG(va_TraceCreateBuffer,
945+ dpy, context, type, size, num_elements, data, buf_id);
946+
947+ return vaStatus;
941948 }
942949
943950 VAStatus vaBufferSetNumElements (
@@ -1007,6 +1014,9 @@ VAStatus vaDestroyBuffer (
10071014 ctx = CTX(dpy);
10081015
10091016 VA_FOOL_RETURN();
1017+
1018+ VA_TRACE_LOG(va_TraceDestroyBuffer,
1019+ dpy, buffer_id);
10101020
10111021 return ctx->vtable->vaDestroyBuffer( ctx, buffer_id );
10121022 }
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -619,6 +619,61 @@ static char * buffer_type_to_string(int type)
619619 }
620620 }
621621
622+void va_TraceCreateBuffer (
623+ VADisplay dpy,
624+ VAContextID context, /* in */
625+ VABufferType type, /* in */
626+ unsigned int size, /* in */
627+ unsigned int num_elements, /* in */
628+ void *data, /* in */
629+ VABufferID *buf_id /* out */
630+)
631+{
632+ DPY2INDEX(dpy);
633+
634+ /* only trace CodedBuffer */
635+ if (type != VAEncCodedBufferType)
636+ return;
637+
638+ TRACE_FUNCNAME(idx);
639+ va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type));
640+ va_TraceMsg(idx, "\tbuf_id=0x%x\n", *buf_id);
641+ va_TraceMsg(idx, "\tsize=%d\n", size);
642+ va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements);
643+
644+ va_TraceMsg(idx, NULL);
645+}
646+
647+void va_TraceDestroyBuffer (
648+ VADisplay dpy,
649+ VABufferID buf_id /* in */
650+)
651+{
652+ VABufferType type;
653+ unsigned int size;
654+ unsigned int num_elements;
655+
656+ VACodedBufferSegment *buf_list;
657+ int i = 0;
658+
659+ DPY2INDEX(dpy);
660+
661+ vaBufferInfo(dpy, trace_context[idx].trace_context, buf_id, &type, &size, &num_elements);
662+
663+ /* only trace CodedBuffer */
664+ if (type != VAEncCodedBufferType)
665+ return;
666+
667+ TRACE_FUNCNAME(idx);
668+ va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type));
669+ va_TraceMsg(idx, "\tbuf_id=0x%x\n", buf_id);
670+ va_TraceMsg(idx, "\tsize=%d\n", size);
671+ va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements);
672+
673+ va_TraceMsg(idx, NULL);
674+}
675+
676+
622677 void va_TraceMapBuffer (
623678 VADisplay dpy,
624679 VABufferID buf_id, /* in */
--- a/va/va_trace.h
+++ b/va/va_trace.h
@@ -96,6 +96,20 @@ void va_TraceCreateContext(
9696 VAContextID *context /* out */
9797 );
9898
99+void va_TraceCreateBuffer (
100+ VADisplay dpy,
101+ VAContextID context, /* in */
102+ VABufferType type, /* in */
103+ unsigned int size, /* in */
104+ unsigned int num_elements, /* in */
105+ void *data, /* in */
106+ VABufferID *buf_id /* out */
107+);
108+
109+void va_TraceDestroyBuffer (
110+ VADisplay dpy,
111+ VABufferID buf_id /* in */
112+);
99113
100114 void va_TraceMapBuffer (
101115 VADisplay dpy,