add VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM_BO in va_drmcommon.h
[platform/upstream/libva.git] / va / va_trace.h
1 /*
2  * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24
25 #ifndef VA_TRACE_H
26 #define VA_TRACE_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 extern int trace_flag;
33
34 #define VA_TRACE_FLAG_LOG             0x1
35 #define VA_TRACE_FLAG_BUFDATA         0x2
36 #define VA_TRACE_FLAG_CODEDBUF        0x4
37 #define VA_TRACE_FLAG_SURFACE_DECODE  0x8
38 #define VA_TRACE_FLAG_SURFACE_ENCODE  0x10
39 #define VA_TRACE_FLAG_SURFACE_JPEG    0x20
40 #define VA_TRACE_FLAG_SURFACE         (VA_TRACE_FLAG_SURFACE_DECODE | \
41                                        VA_TRACE_FLAG_SURFACE_ENCODE | \
42                                        VA_TRACE_FLAG_SURFACE_JPEG)
43
44 #define VA_TRACE_LOG(trace_func,...)            \
45     if (trace_flag & VA_TRACE_FLAG_LOG) {       \
46         trace_func(__VA_ARGS__);                \
47     }
48 #define VA_TRACE_ALL(trace_func,...)            \
49     if (trace_flag) {                           \
50         trace_func(__VA_ARGS__);                \
51     }
52
53 void va_TraceInit(VADisplay dpy);
54 void va_TraceEnd(VADisplay dpy);
55
56 void va_TraceInitialize (
57     VADisplay dpy,
58     int *major_version,  /* out */
59     int *minor_version   /* out */
60 );
61
62 void va_TraceTerminate (
63     VADisplay dpy
64 );
65
66 void va_TraceCreateConfig(
67     VADisplay dpy,
68     VAProfile profile, 
69     VAEntrypoint entrypoint, 
70     VAConfigAttrib *attrib_list,
71     int num_attribs,
72     VAConfigID *config_id /* out */
73 );
74
75 void va_TraceCreateSurfaces(
76     VADisplay dpy,
77     int width,
78     int height,
79     int format,
80     int num_surfaces,
81     VASurfaceID *surfaces,      /* out */
82     VASurfaceAttrib    *attrib_list,
83     unsigned int        num_attribs
84 );
85
86 void va_TraceDestroySurfaces(
87     VADisplay dpy,
88     VASurfaceID *surface_list,
89     int num_surfaces
90 );
91     
92 void va_TraceCreateContext(
93     VADisplay dpy,
94     VAConfigID config_id,
95     int picture_width,
96     int picture_height,
97     int flag,
98     VASurfaceID *render_targets,
99     int num_render_targets,
100     VAContextID *context                /* out */
101 );
102
103 void va_TraceCreateBuffer (
104     VADisplay dpy,
105     VAContextID context,        /* in */
106     VABufferType type,          /* in */
107     unsigned int size,          /* in */
108     unsigned int num_elements,  /* in */
109     void *data,                 /* in */
110     VABufferID *buf_id          /* out */
111 );
112     
113 void va_TraceDestroyBuffer (
114     VADisplay dpy,
115     VABufferID buf_id    /* in */
116 );
117
118 void va_TraceMapBuffer (
119     VADisplay dpy,
120     VABufferID buf_id,  /* in */
121     void **pbuf         /* out */
122 );
123
124
125 void va_TraceBeginPicture(
126     VADisplay dpy,
127     VAContextID context,
128     VASurfaceID render_target
129 );
130
131 void va_TraceRenderPicture(
132     VADisplay dpy,
133     VAContextID context,
134     VABufferID *buffers,
135     int num_buffers
136 );
137
138 void va_TraceEndPicture(
139     VADisplay dpy,
140     VAContextID context,
141     int endpic_done
142 );
143
144 void va_TraceSyncSurface(
145     VADisplay dpy,
146     VASurfaceID render_target
147 );
148
149 void va_TraceQuerySurfaceAttributes(
150     VADisplay           dpy,
151     VAConfigID          config,
152     VASurfaceAttrib    *attrib_list,
153     unsigned int       *num_attribs
154 );
155
156 void va_TraceQuerySurfaceStatus(
157     VADisplay dpy,
158     VASurfaceID render_target,
159     VASurfaceStatus *status     /* out */
160 );
161
162 void va_TraceQuerySurfaceError(
163         VADisplay dpy,
164         VASurfaceID surface,
165         VAStatus error_status,
166         void **error_info /*out*/
167 );
168
169
170 void va_TraceMaxNumDisplayAttributes (
171     VADisplay dpy,
172     int number
173 );
174
175 void va_TraceQueryDisplayAttributes (
176     VADisplay dpy,
177     VADisplayAttribute *attr_list,      /* out */
178     int *num_attributes                 /* out */
179 );
180
181 void va_TraceGetDisplayAttributes (
182     VADisplay dpy,
183     VADisplayAttribute *attr_list,
184     int num_attributes
185 );
186
187 void va_TraceSetDisplayAttributes (
188     VADisplay dpy,
189     VADisplayAttribute *attr_list,
190     int num_attributes
191 );
192
193 /* extern function called by display side */
194 void va_TracePutSurface (
195     VADisplay dpy,
196     VASurfaceID surface,
197     void *draw, /* the target Drawable */
198     short srcx,
199     short srcy,
200     unsigned short srcw,
201     unsigned short srch,
202     short destx,
203     short desty,
204     unsigned short destw,
205     unsigned short desth,
206     VARectangle *cliprects, /* client supplied clip list */
207     unsigned int number_cliprects, /* number of clip rects in the clip list */
208     unsigned int flags /* de-interlacing flags */
209 );
210
211 #ifdef __cplusplus
212 }
213 #endif
214     
215
216 #endif /* VA_TRACE_H */