hardware/intel/libva
Revision | d9f693c6cfd0fed0ef3ecd6ae268ed01d4e250d3 (tree) |
---|---|
Time | 2013-06-19 15:47:44 |
Author | Austin Yuan <shengquan.yuan@inte...> |
Commiter | Xiang, Haihao |
vatrace: trace coded buffer create/destroy
Change-Id: If0388cd5e2e141184d88ff5de5612d15e51e3d20
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
(cherry picked from commit 880c916092c6d68096c95e49405714d8a21f9322)
@@ -929,15 +929,22 @@ VAStatus vaCreateBuffer ( | ||
929 | 929 | ) |
930 | 930 | { |
931 | 931 | VADriverContextP ctx; |
932 | + VAStatus vaStatus; | |
933 | + int ret = 0; | |
934 | + | |
932 | 935 | CHECK_DISPLAY(dpy); |
933 | 936 | ctx = CTX(dpy); |
934 | - int ret = 0; | |
935 | 937 | |
936 | 938 | VA_FOOL_FUNC(va_FoolCreateBuffer, dpy, context, type, size, num_elements, data, buf_id); |
937 | 939 | if (ret) |
938 | 940 | return VA_STATUS_SUCCESS; |
939 | 941 | |
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; | |
941 | 948 | } |
942 | 949 | |
943 | 950 | VAStatus vaBufferSetNumElements ( |
@@ -1007,6 +1014,9 @@ VAStatus vaDestroyBuffer ( | ||
1007 | 1014 | ctx = CTX(dpy); |
1008 | 1015 | |
1009 | 1016 | VA_FOOL_RETURN(); |
1017 | + | |
1018 | + VA_TRACE_LOG(va_TraceDestroyBuffer, | |
1019 | + dpy, buffer_id); | |
1010 | 1020 | |
1011 | 1021 | return ctx->vtable->vaDestroyBuffer( ctx, buffer_id ); |
1012 | 1022 | } |
@@ -619,6 +619,61 @@ static char * buffer_type_to_string(int type) | ||
619 | 619 | } |
620 | 620 | } |
621 | 621 | |
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 | + | |
622 | 677 | void va_TraceMapBuffer ( |
623 | 678 | VADisplay dpy, |
624 | 679 | VABufferID buf_id, /* in */ |
@@ -96,6 +96,20 @@ void va_TraceCreateContext( | ||
96 | 96 | VAContextID *context /* out */ |
97 | 97 | ); |
98 | 98 | |
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 | +); | |
99 | 113 | |
100 | 114 | void va_TraceMapBuffer ( |
101 | 115 | VADisplay dpy, |