OSDN Git Service

Add a new gpe function gen8_gpe_mi_conditional_batch_buffer_end() for GEN8
[android-x86/hardware-intel-common-vaapi.git] / src / i965_drv_video.h
1 /*
2  * Copyright ?2009 Intel Corporation
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  * Authors:
25  *    Xiang Haihao <haihao.xiang@intel.com>
26  *    Zou Nan hai <nanhai.zou@intel.com>
27  *
28  */
29
30 #ifndef _I965_DRV_VIDEO_H_
31 #define _I965_DRV_VIDEO_H_
32
33 #include <va/va.h>
34 #include <va/va_enc_h264.h>
35 #include <va/va_enc_mpeg2.h>
36 #include <va/va_enc_hevc.h>
37 #include <va/va_enc_jpeg.h>
38 #include <va/va_enc_vp8.h>
39 #include <va/va_vpp.h>
40 #include <va/va_backend.h>
41 #include <va/va_backend_vpp.h>
42
43 #include "i965_mutext.h"
44 #include "object_heap.h"
45 #include "intel_driver.h"
46 #include "i965_fourcc.h"
47
48 #define I965_MAX_PROFILES                       20
49 #define I965_MAX_ENTRYPOINTS                    5
50 #define I965_MAX_CONFIG_ATTRIBUTES              32
51 #define I965_MAX_IMAGE_FORMATS                  10
52 #define I965_MAX_SUBPIC_FORMATS                 6
53 #define I965_MAX_SUBPIC_SUM                     4
54 #define I965_MAX_SURFACE_ATTRIBUTES             16
55
56 #define INTEL_STR_DRIVER_VENDOR                 "Intel"
57 #define INTEL_STR_DRIVER_NAME                   "i965"
58
59 #define I965_SURFACE_TYPE_IMAGE                 0
60 #define I965_SURFACE_TYPE_SURFACE               1
61
62 #define I965_SURFACE_FLAG_FRAME                 0x00000000
63 #define I965_SURFACE_FLAG_TOP_FIELD_FIRST       0x00000001
64 #define I965_SURFACE_FLAG_BOTTOME_FIELD_FIRST   0x00000002
65
66 #define DEFAULT_BRIGHTNESS      0
67 #define DEFAULT_CONTRAST        50
68 #define DEFAULT_HUE             0
69 #define DEFAULT_SATURATION      50
70
71 #define ENCODER_QUALITY_RANGE     2
72 #define ENCODER_DEFAULT_QUALITY   1
73 #define ENCODER_HIGH_QUALITY      ENCODER_DEFAULT_QUALITY
74 #define ENCODER_LOW_QUALITY       2
75
76 #define I965_MAX_NUM_ROI_REGIONS                     8
77
78 #define ENCODER_LP_QUALITY_RANGE  8
79
80 #define HAS_MPEG2_DECODING(ctx)  ((ctx)->codec_info->has_mpeg2_decoding && \
81                                   (ctx)->intel.has_bsd)
82
83 #define HAS_MPEG2_ENCODING(ctx)  ((ctx)->codec_info->has_mpeg2_encoding && \
84                                   (ctx)->intel.has_bsd)
85
86 #define HAS_H264_DECODING(ctx)  ((ctx)->codec_info->has_h264_decoding && \
87                                  (ctx)->intel.has_bsd)
88
89 #define HAS_H264_ENCODING(ctx)  ((ctx)->codec_info->has_h264_encoding && \
90                                  (ctx)->intel.has_bsd)
91
92 #define HAS_LP_H264_ENCODING(ctx)  ((ctx)->codec_info->has_lp_h264_encoding && \
93                                     (ctx)->intel.has_bsd)
94
95 #define HAS_VC1_DECODING(ctx)   ((ctx)->codec_info->has_vc1_decoding && \
96                                  (ctx)->intel.has_bsd)
97
98 #define HAS_JPEG_DECODING(ctx)  ((ctx)->codec_info->has_jpeg_decoding && \
99                                  (ctx)->intel.has_bsd)
100
101 #define HAS_JPEG_ENCODING(ctx)  ((ctx)->codec_info->has_jpeg_encoding && \
102                                  (ctx)->intel.has_bsd)
103
104 #define HAS_VPP(ctx)    ((ctx)->codec_info->has_vpp)
105
106 #define HAS_ACCELERATED_GETIMAGE(ctx)   ((ctx)->codec_info->has_accelerated_getimage)
107
108 #define HAS_ACCELERATED_PUTIMAGE(ctx)   ((ctx)->codec_info->has_accelerated_putimage)
109
110 #define HAS_TILED_SURFACE(ctx) ((ctx)->codec_info->has_tiled_surface)
111
112 #define HAS_VP8_DECODING(ctx)   ((ctx)->codec_info->has_vp8_decoding && \
113                                  (ctx)->intel.has_bsd)
114
115 #define HAS_VP8_ENCODING(ctx)   ((ctx)->codec_info->has_vp8_encoding && \
116                                  (ctx)->intel.has_bsd)
117
118 #define HAS_H264_MVC_DECODING(ctx) \
119     (HAS_H264_DECODING(ctx) && (ctx)->codec_info->h264_mvc_dec_profiles)
120
121 #define HAS_H264_MVC_DECODING_PROFILE(ctx, profile)                     \
122     (HAS_H264_MVC_DECODING(ctx) &&                                      \
123      ((ctx)->codec_info->h264_mvc_dec_profiles & (1U << profile)))
124
125 #define HAS_H264_MVC_ENCODING(ctx)  ((ctx)->codec_info->has_h264_mvc_encoding && \
126                                      (ctx)->intel.has_bsd)
127
128 #define HAS_HEVC_DECODING(ctx)          ((ctx)->codec_info->has_hevc_decoding && \
129                                          (ctx)->intel.has_bsd)
130
131 #define HAS_HEVC_ENCODING(ctx)          ((ctx)->codec_info->has_hevc_encoding && \
132                                          (ctx)->intel.has_bsd)
133
134 #define HAS_VP9_DECODING(ctx)          ((ctx)->codec_info->has_vp9_decoding && \
135                                          (ctx)->intel.has_bsd)
136
137 #define HAS_VP9_DECODING_PROFILE(ctx, profile)                     \
138     (HAS_VP9_DECODING(ctx) &&                                      \
139      ((ctx)->codec_info->vp9_dec_profiles & (1U << (profile - VAProfileVP9Profile0))))
140
141 #define HAS_HEVC10_DECODING(ctx)        ((ctx)->codec_info->has_hevc10_decoding && \
142                                          (ctx)->intel.has_bsd)
143 #define HAS_HEVC10_ENCODING(ctx)        ((ctx)->codec_info->has_hevc10_encoding && \
144                                          (ctx)->intel.has_bsd)
145
146 #define HAS_VPP_P010(ctx)        ((ctx)->codec_info->has_vpp_p010 && \
147                                          (ctx)->intel.has_bsd)
148
149 #define HAS_VP9_ENCODING(ctx)          ((ctx)->codec_info->has_vp9_encoding && \
150                                          (ctx)->intel.has_bsd)
151
152 #define HAS_VP9_ENCODING_PROFILE(ctx, profile)                     \
153     (HAS_VP9_ENCODING(ctx) &&                                      \
154      ((ctx)->codec_info->vp9_enc_profiles & (1U << (profile - VAProfileVP9Profile0))))
155
156 struct i965_surface
157 {
158     struct object_base *base;
159     int type;
160     int flags;
161 };
162
163 struct i965_kernel 
164 {
165     char *name;
166     int interface;
167     const uint32_t (*bin)[4];
168     int size;
169     dri_bo *bo;
170     unsigned int kernel_offset;
171 };
172
173 struct buffer_store
174 {
175     unsigned char *buffer;
176     dri_bo *bo;
177     int ref_count;
178     int num_elements;
179 };
180     
181 struct object_config 
182 {
183     struct object_base base;
184     VAProfile profile;
185     VAEntrypoint entrypoint;
186     VAConfigAttrib attrib_list[I965_MAX_CONFIG_ATTRIBUTES];
187     int num_attribs;
188
189     VAGenericID wrapper_config;
190 };
191
192 #define NUM_SLICES     10
193
194 struct codec_state_base {
195     uint32_t chroma_formats;
196 };
197
198 struct decode_state
199 {
200     struct codec_state_base base;
201     struct buffer_store *pic_param;
202     struct buffer_store **slice_params;
203     struct buffer_store *iq_matrix;
204     struct buffer_store *bit_plane;
205     struct buffer_store *huffman_table;
206     struct buffer_store **slice_datas;
207     struct buffer_store *probability_data;
208     VASurfaceID current_render_target;
209     int max_slice_params;
210     int max_slice_datas;
211     int num_slice_params;
212     int num_slice_datas;
213
214     struct object_surface *render_object;
215     struct object_surface *reference_objects[16]; /* Up to 2 reference surfaces are valid for MPEG-2,*/
216 };
217
218 #define SLICE_PACKED_DATA_INDEX_TYPE    0x80000000
219 #define SLICE_PACKED_DATA_INDEX_MASK    0x00FFFFFF
220
221 struct encode_state
222 {
223     struct codec_state_base base;
224     struct buffer_store *iq_matrix;
225     struct buffer_store *q_matrix;
226     struct buffer_store *huffman_table;
227
228     /* for ext */
229     struct buffer_store *seq_param_ext;
230     struct buffer_store *pic_param_ext;
231     struct buffer_store *packed_header_param[5];
232     struct buffer_store *packed_header_data[5];
233     struct buffer_store **slice_params_ext;
234     struct buffer_store *encmb_map;
235     int max_slice_params_ext;
236     int num_slice_params_ext;
237
238     /* Check the user-configurable packed_header attribute.
239      * Currently it is mainly used to check whether the packed slice_header data
240      * is provided by user or the driver.
241      * TBD: It will check for the packed SPS/PPS/MISC/RAWDATA and so on.
242      */
243     unsigned int packed_header_flag;
244     /* For the packed data that needs to be inserted into video clip */
245     /* currently it is mainly to track packed raw data and packed slice_header data. */
246     struct buffer_store **packed_header_params_ext;
247     int max_packed_header_params_ext;
248     int num_packed_header_params_ext;
249     struct buffer_store **packed_header_data_ext;
250     int max_packed_header_data_ext;
251     int num_packed_header_data_ext;
252
253     /* the index of current vps and sps ,special for HEVC*/
254     int vps_sps_seq_index;
255     /* the index of current slice */
256     int slice_index;
257     /* the array is determined by max_slice_params_ext */
258     int max_slice_num;
259     /* This is to store the first index of packed data for one slice */
260     int *slice_rawdata_index;
261     /* This is to store the number of packed data for one slice.
262      * Both packed rawdata and slice_header data are tracked by this
263      * this variable. That is to say: When one packed slice_header is parsed,
264      * this variable will also be increased.
265      */
266     int *slice_rawdata_count;
267
268     /* This is to store the index of packed slice header for one slice */
269     int *slice_header_index;
270
271     int last_packed_header_type;
272
273     int has_layers;
274
275     struct buffer_store *misc_param[16][8];
276
277     VASurfaceID current_render_target;
278     struct object_surface *input_yuv_object;
279     struct object_surface *reconstructed_object;
280     struct object_buffer *coded_buf_object;
281     struct object_surface *reference_objects[16]; /* Up to 2 reference surfaces are valid for MPEG-2,*/
282 };
283
284 struct proc_state
285 {
286     struct codec_state_base base;
287     struct buffer_store *pipeline_param;
288
289     VASurfaceID current_render_target;
290 };
291
292 #define CODEC_DEC       0
293 #define CODEC_ENC       1
294 #define CODEC_PROC      2
295
296 union codec_state
297 {
298     struct codec_state_base base;
299     struct decode_state decode;
300     struct encode_state encode;
301     struct proc_state proc;
302 };
303
304 struct hw_context
305 {
306     VAStatus (*run)(VADriverContextP ctx, 
307                     VAProfile profile, 
308                     union codec_state *codec_state,
309                     struct hw_context *hw_context);
310     void (*destroy)(void *);
311     VAStatus (*get_status)(VADriverContextP ctx,
312                            struct hw_context *hw_context,
313                            void *buffer);
314     struct intel_batchbuffer *batch;
315 };
316
317 struct object_context 
318 {
319     struct object_base base;
320     VAContextID context_id;
321     struct object_config *obj_config;
322     VASurfaceID *render_targets;                //input->encode, output->decode
323     int num_render_targets;
324     int picture_width;
325     int picture_height;
326     int flags;
327     int codec_type;
328     union codec_state codec_state;
329     struct hw_context *hw_context;
330
331     VAGenericID       wrapper_context;
332 };
333
334 #define SURFACE_REFERENCED      (1 << 0)
335 #define SURFACE_DERIVED         (1 << 2)
336 #define SURFACE_ALL_MASK        ((SURFACE_REFERENCED) | \
337                                  (SURFACE_DERIVED))
338
339 struct object_surface 
340 {
341     struct object_base base;
342     VASurfaceStatus status;
343     VASubpictureID subpic[I965_MAX_SUBPIC_SUM];
344     struct object_subpic *obj_subpic[I965_MAX_SUBPIC_SUM];
345     unsigned int subpic_render_idx;
346
347     int width;          /* the pitch of plane 0 in bytes in horizontal direction */
348     int height;         /* the pitch of plane 0 in bytes in vertical direction */
349     int size;
350     int orig_width;     /* the width of plane 0 in pixels */
351     int orig_height;    /* the height of plane 0 in pixels */
352     int flags;
353     unsigned int fourcc;    
354     dri_bo *bo;
355     unsigned int expected_format;
356     VAImageID locked_image_id;
357     VAImageID derived_image_id;
358     void (*free_private_data)(void **data);
359     void *private_data;
360     unsigned int subsampling;
361     int x_cb_offset;
362     int y_cb_offset;
363     int x_cr_offset;
364     int y_cr_offset;
365     int cb_cr_width;
366     int cb_cr_height;
367     int cb_cr_pitch;
368     /* user specified attributes see: VASurfaceAttribExternalBuffers/VA_SURFACE_ATTRIB_MEM_TYPE_VA */
369     uint32_t user_disable_tiling : 1;
370     uint32_t user_h_stride_set   : 1;
371     uint32_t user_v_stride_set   : 1;
372     /* we need clear right and bottom border for NV12.
373      * to avoid encode run to run issue*/
374     uint32_t border_cleared      : 1;
375
376     VAGenericID wrapper_surface;
377
378     int exported_primefd;
379 };
380
381 struct object_buffer 
382 {
383     struct object_base base;
384     struct buffer_store *buffer_store;
385     int max_num_elements;
386     int num_elements;
387     int size_element;
388     VABufferType type;
389
390     /* Export state */
391     unsigned int export_refcount;
392     VABufferInfo export_state;
393
394     VAGenericID wrapper_buffer;
395     VAContextID context_id;
396 };
397
398 struct object_image 
399 {
400     struct object_base base;
401     VAImage image;
402     dri_bo *bo;
403     unsigned int *palette;
404     VASurfaceID derived_surface;
405 };
406
407 struct object_subpic 
408 {
409     struct object_base base;
410     VAImageID image;
411     struct object_image *obj_image;
412     VARectangle src_rect;
413     VARectangle dst_rect;
414     unsigned int format;
415     int width;
416     int height;
417     int pitch;
418     float global_alpha;
419     dri_bo *bo;
420     unsigned int flags;
421 };
422
423 #define I965_RING_NULL  0
424 #define I965_RING_BSD   1
425 #define I965_RING_BLT   2
426 #define I965_RING_VEBOX 3
427
428 struct i965_filter
429 {
430     VAProcFilterType type;
431     int ring;
432 };
433
434 struct i965_driver_data;
435
436 struct hw_codec_info
437 {
438     struct hw_context *(*dec_hw_context_init)(VADriverContextP, struct object_config *);
439     struct hw_context *(*enc_hw_context_init)(VADriverContextP, struct object_config *);
440     struct hw_context *(*proc_hw_context_init)(VADriverContextP, struct object_config *);
441     bool (*render_init)(VADriverContextP);
442     void (*post_processing_context_init)(VADriverContextP, void *, struct intel_batchbuffer *);
443     void (*preinit_hw_codec)(VADriverContextP, struct hw_codec_info *);
444
445     /**
446      * Allows HW info to support per-codec max resolution.  If this functor is
447      * not initialized, then @max_width and @max_height will be used as the
448      * default maximum resolution for all codecs on this HW info.
449      */
450     void (*max_resolution)(struct i965_driver_data *, struct object_config *, int *, int *);
451
452     int max_width;
453     int max_height;
454     int min_linear_wpitch;
455     int min_linear_hpitch;
456
457     unsigned int h264_mvc_dec_profiles;
458     unsigned int vp9_dec_profiles;
459     unsigned int vp9_enc_profiles;
460
461     unsigned int h264_dec_chroma_formats;
462     unsigned int jpeg_dec_chroma_formats;
463     unsigned int jpeg_enc_chroma_formats;
464     unsigned int hevc_dec_chroma_formats;
465     unsigned int vp9_dec_chroma_formats;
466
467     unsigned int has_mpeg2_decoding:1;
468     unsigned int has_mpeg2_encoding:1;
469     unsigned int has_h264_decoding:1;
470     unsigned int has_h264_encoding:1;
471     unsigned int has_vc1_decoding:1;
472     unsigned int has_vc1_encoding:1;
473     unsigned int has_jpeg_decoding:1;
474     unsigned int has_jpeg_encoding:1;
475     unsigned int has_vpp:1;
476     unsigned int has_accelerated_getimage:1;
477     unsigned int has_accelerated_putimage:1;
478     unsigned int has_tiled_surface:1;
479     unsigned int has_di_motion_adptive:1;
480     unsigned int has_di_motion_compensated:1;
481     unsigned int has_vp8_decoding:1;
482     unsigned int has_vp8_encoding:1;
483     unsigned int has_h264_mvc_encoding:1;
484     unsigned int has_hevc_decoding:1;
485     unsigned int has_hevc_encoding:1;
486     unsigned int has_hevc10_encoding:1;
487     unsigned int has_hevc10_decoding:1;
488     unsigned int has_vp9_decoding:1;
489     unsigned int has_vpp_p010:1;
490     unsigned int has_lp_h264_encoding:1;
491     unsigned int has_vp9_encoding:1;
492
493     unsigned int lp_h264_brc_mode;
494
495     unsigned int num_filters;
496     struct i965_filter filters[VAProcFilterCount];
497 };
498
499
500 #include "i965_render.h"
501
502 struct i965_driver_data 
503 {
504     struct intel_driver_data intel;
505     struct object_heap config_heap;
506     struct object_heap context_heap;
507     struct object_heap surface_heap;
508     struct object_heap buffer_heap;
509     struct object_heap image_heap;
510     struct object_heap subpic_heap;
511     struct hw_codec_info *codec_info;
512
513     _I965Mutex render_mutex;
514     _I965Mutex pp_mutex;
515     struct intel_batchbuffer *batch;
516     struct intel_batchbuffer *pp_batch;
517     struct i965_render_state render_state;
518     void *pp_context;
519     char va_vendor[256];
520  
521     VADisplayAttribute *display_attributes;
522     unsigned int num_display_attributes;
523     VADisplayAttribute *rotation_attrib;
524     VADisplayAttribute *brightness_attrib;
525     VADisplayAttribute *contrast_attrib;
526     VADisplayAttribute *hue_attrib;
527     VADisplayAttribute *saturation_attrib;
528     VAContextID current_context_id;
529
530     /* VA/DRI (X11) specific data */
531     struct va_dri_output *dri_output;
532
533     /* VA/Wayland specific data */
534     struct va_wl_output *wl_output;
535
536     VADriverContextP wrapper_pdrvctx;
537 };
538
539 #define NEW_CONFIG_ID() object_heap_allocate(&i965->config_heap);
540 #define NEW_CONTEXT_ID() object_heap_allocate(&i965->context_heap);
541 #define NEW_SURFACE_ID() object_heap_allocate(&i965->surface_heap);
542 #define NEW_BUFFER_ID() object_heap_allocate(&i965->buffer_heap);
543 #define NEW_IMAGE_ID() object_heap_allocate(&i965->image_heap);
544 #define NEW_SUBPIC_ID() object_heap_allocate(&i965->subpic_heap);
545
546 #define CONFIG(id) ((struct object_config *)object_heap_lookup(&i965->config_heap, id))
547 #define CONTEXT(id) ((struct object_context *)object_heap_lookup(&i965->context_heap, id))
548 #define SURFACE(id) ((struct object_surface *)object_heap_lookup(&i965->surface_heap, id))
549 #define BUFFER(id) ((struct object_buffer *)object_heap_lookup(&i965->buffer_heap, id))
550 #define IMAGE(id) ((struct object_image *)object_heap_lookup(&i965->image_heap, id))
551 #define SUBPIC(id) ((struct object_subpic *)object_heap_lookup(&i965->subpic_heap, id))
552
553 #define FOURCC_IA44 0x34344149
554 #define FOURCC_AI44 0x34344941
555
556 #define STRIDE(w)               (((w) + 0xf) & ~0xf)
557 #define SIZE_YUV420(w, h)       (h * (STRIDE(w) + STRIDE(w >> 1)))
558
559 static INLINE struct i965_driver_data *
560 i965_driver_data(VADriverContextP ctx)
561 {
562     return (struct i965_driver_data *)(ctx->pDriverData);
563 }
564
565 VAStatus
566 i965_check_alloc_surface_bo(VADriverContextP ctx,
567                             struct object_surface *obj_surface,
568                             int tiled,
569                             unsigned int fourcc,
570                             unsigned int subsampling);
571
572 int
573 va_enc_packed_type_to_idx(int packed_type);
574
575 /* reserve 2 byte for internal using */
576 #define CODEC_H264      0
577 #define CODEC_MPEG2     1
578 #define CODEC_H264_MVC  2
579 #define CODEC_JPEG      3
580 #define CODEC_VP8       4
581 #define CODEC_HEVC      5
582 #define CODEC_VP9       6
583
584 #define H264_DELIMITER0 0x00
585 #define H264_DELIMITER1 0x00
586 #define H264_DELIMITER2 0x00
587 #define H264_DELIMITER3 0x00
588 #define H264_DELIMITER4 0x00
589
590 #define MPEG2_DELIMITER0        0x00
591 #define MPEG2_DELIMITER1        0x00
592 #define MPEG2_DELIMITER2        0x00
593 #define MPEG2_DELIMITER3        0x00
594 #define MPEG2_DELIMITER4        0xb0
595
596 #define HEVC_DELIMITER0 0x00
597 #define HEVC_DELIMITER1 0x00
598 #define HEVC_DELIMITER2 0x00
599 #define HEVC_DELIMITER3 0x00
600 #define HEVC_DELIMITER4 0x00
601
602 struct i965_coded_buffer_segment
603 {
604     union {
605         VACodedBufferSegment base;
606         unsigned char pad0[64];                 /* change the size if sizeof(VACodedBufferSegment) > 64 */
607     };
608
609     unsigned int mapped;
610     unsigned int codec;
611     unsigned int status_support;
612     unsigned int pad1;
613
614     unsigned int codec_private_data[512];       /* Store codec private data, must be 16-bytes aligned */
615 };
616
617 #define I965_CODEDBUFFER_HEADER_SIZE   ALIGN(sizeof(struct i965_coded_buffer_segment), 0x1000)
618
619 extern VAStatus i965_MapBuffer(VADriverContextP ctx,
620                 VABufferID buf_id,       /* in */
621                 void **pbuf);            /* out */
622
623 extern VAStatus i965_UnmapBuffer(VADriverContextP ctx, VABufferID buf_id);
624
625 extern VAStatus i965_DestroySurfaces(VADriverContextP ctx,
626                      VASurfaceID *surface_list,
627                      int num_surfaces);
628
629 extern VAStatus i965_CreateSurfaces(VADriverContextP ctx,
630                     int width,
631                     int height,
632                     int format,
633                     int num_surfaces,
634                     VASurfaceID *surfaces);
635
636 #define I965_SURFACE_MEM_NATIVE             0
637 #define I965_SURFACE_MEM_GEM_FLINK          1
638 #define I965_SURFACE_MEM_DRM_PRIME          2
639
640 void
641 i965_destroy_surface_storage(struct object_surface *obj_surface);
642
643 #endif /* _I965_DRV_VIDEO_H_ */