OSDN Git Service

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