OSDN Git Service

i965_drv: fix building with --enable-static
[android-x86/hardware-intel-common-vaapi.git] / src / i965_structs.h
1 #ifndef _I965_STRUCTS_H_
2 #define _I965_STRUCTS_H_
3
4 struct i965_vfe_state 
5 {
6     struct {
7         unsigned int per_thread_scratch_space:4;
8         unsigned int pad3:3;
9         unsigned int extend_vfe_state_present:1;
10         unsigned int pad2:2;
11         unsigned int scratch_base:22;
12     } vfe0;
13
14     struct {
15         unsigned int debug_counter_control:2;
16         unsigned int children_present:1;
17         unsigned int vfe_mode:4;
18         unsigned int pad2:2;
19         unsigned int num_urb_entries:7;
20         unsigned int urb_entry_alloc_size:9;
21         unsigned int max_threads:7;
22     } vfe1;
23
24     struct {
25         unsigned int pad4:4;
26         unsigned int interface_descriptor_base:28;
27     } vfe2;
28 };
29
30 struct i965_vfe_state_ex 
31 {
32     struct {
33         unsigned int pad:8;
34         unsigned int obj_id:24;
35     } vfex0;
36
37     union {
38         struct {
39             unsigned int residual_grf_offset:5;
40             unsigned int pad0:3;
41             unsigned int weight_grf_offset:5;
42             unsigned int pad1:3;
43             unsigned int residual_data_offset:8;
44             unsigned int sub_field_present_flag:2;
45             unsigned int residual_data_fix_offset_flag:1;
46             unsigned int pad2:5;
47         } avc;
48         
49         unsigned int vc1;
50     } vfex1;
51
52     struct {
53         unsigned int remap_index_0:4;
54         unsigned int remap_index_1:4;
55         unsigned int remap_index_2:4;
56         unsigned int remap_index_3:4;
57         unsigned int remap_index_4:4;
58         unsigned int remap_index_5:4;
59         unsigned int remap_index_6:4;
60         unsigned int remap_index_7:4;
61     }remap_table0;
62
63     struct {
64         unsigned int remap_index_8:4;
65         unsigned int remap_index_9:4;
66         unsigned int remap_index_10:4;
67         unsigned int remap_index_11:4;
68         unsigned int remap_index_12:4;
69         unsigned int remap_index_13:4;
70         unsigned int remap_index_14:4;
71         unsigned int remap_index_15:4;
72     } remap_table1;
73
74     struct {
75         unsigned int mask:8;
76         unsigned int pad:22;
77         unsigned int type:1;
78         unsigned int enable:1;
79     } scoreboard0;
80
81     struct {
82         int delta_x0:4;
83         int delta_y0:4;
84         int delta_x1:4;
85         int delta_y1:4;
86         int delta_x2:4;
87         int delta_y2:4;
88         int delta_x3:4;
89         int delta_y3:4;
90     } scoreboard1;
91
92     struct {
93         int delta_x4:4;
94         int delta_y4:4;
95         int delta_x5:4;
96         int delta_y5:4;
97         int delta_x6:4;
98         int delta_y6:4;
99         int delta_x7:4;
100         int delta_y7:4;
101     } scoreboard2;
102
103     unsigned int pad;
104 };
105
106 struct i965_vld_state 
107 {
108     struct {
109         unsigned int pad6:6;
110         unsigned int scan_order:1;
111         unsigned int intra_vlc_format:1;
112         unsigned int quantizer_scale_type:1;
113         unsigned int concealment_motion_vector:1;
114         unsigned int frame_predict_frame_dct:1;
115         unsigned int top_field_first:1;
116         unsigned int picture_structure:2;
117         unsigned int intra_dc_precision:2;
118         unsigned int f_code_0_0:4;
119         unsigned int f_code_0_1:4;
120         unsigned int f_code_1_0:4;
121         unsigned int f_code_1_1:4;
122     } vld0;
123
124     struct {
125         unsigned int pad2:9;
126         unsigned int picture_coding_type:2;
127         unsigned int pad:21;
128     } vld1;
129
130     struct {
131         unsigned int index_0:4;
132         unsigned int index_1:4;
133         unsigned int index_2:4;
134         unsigned int index_3:4;
135         unsigned int index_4:4;
136         unsigned int index_5:4;
137         unsigned int index_6:4;
138         unsigned int index_7:4;
139     } desc_remap_table0;
140
141     struct {
142         unsigned int index_8:4;
143         unsigned int index_9:4;
144         unsigned int index_10:4;
145         unsigned int index_11:4;
146         unsigned int index_12:4;
147         unsigned int index_13:4;
148         unsigned int index_14:4;
149         unsigned int index_15:4;
150     } desc_remap_table1;
151 };
152
153 struct i965_interface_descriptor 
154 {
155     struct {
156         unsigned int grf_reg_blocks:4;
157         unsigned int pad:2;
158         unsigned int kernel_start_pointer:26;
159     } desc0;
160
161     struct {
162         unsigned int pad:7;
163         unsigned int software_exception:1;
164         unsigned int pad2:3;
165         unsigned int maskstack_exception:1;
166         unsigned int pad3:1;
167         unsigned int illegal_opcode_exception:1;
168         unsigned int pad4:2;
169         unsigned int floating_point_mode:1;
170         unsigned int thread_priority:1;
171         unsigned int single_program_flow:1;
172         unsigned int pad5:1;
173         unsigned int const_urb_entry_read_offset:6;
174         unsigned int const_urb_entry_read_len:6;
175     } desc1;
176
177     struct {
178         unsigned int pad:2;
179         unsigned int sampler_count:3;
180         unsigned int sampler_state_pointer:27;
181     } desc2;
182
183     struct {
184         unsigned int binding_table_entry_count:5;
185         unsigned int binding_table_pointer:27;
186     } desc3;
187 };
188
189 struct i965_surface_state 
190 {
191     struct {
192         unsigned int cube_pos_z:1;
193         unsigned int cube_neg_z:1;
194         unsigned int cube_pos_y:1;
195         unsigned int cube_neg_y:1;
196         unsigned int cube_pos_x:1;
197         unsigned int cube_neg_x:1;
198         unsigned int pad:2;
199         unsigned int render_cache_read_mode:1;
200         unsigned int cube_map_corner_mode:1;
201         unsigned int mipmap_layout_mode:1;
202         unsigned int vert_line_stride_ofs:1;
203         unsigned int vert_line_stride:1;
204         unsigned int color_blend:1;
205         unsigned int writedisable_blue:1;
206         unsigned int writedisable_green:1;
207         unsigned int writedisable_red:1;
208         unsigned int writedisable_alpha:1;
209         unsigned int surface_format:9;
210         unsigned int data_return_format:1;
211         unsigned int pad0:1;
212         unsigned int surface_type:3;
213     } ss0;
214
215     struct {
216         unsigned int base_addr;
217     } ss1;
218
219     struct {
220         unsigned int render_target_rotation:2;
221         unsigned int mip_count:4;
222         unsigned int width:13;
223         unsigned int height:13;
224     } ss2;
225
226     struct {
227         unsigned int tile_walk:1;
228         unsigned int tiled_surface:1;
229         unsigned int pad:1;
230         unsigned int pitch:18;
231         unsigned int depth:11;
232     } ss3;
233
234     struct {
235         unsigned int pad:19;
236         unsigned int min_array_elt:9;
237         unsigned int min_lod:4;
238     } ss4;
239
240     struct {
241         unsigned int pad:20;
242         unsigned int y_offset:4;
243         unsigned int pad2:1;
244         unsigned int x_offset:7;
245     } ss5;
246 };
247
248 struct thread0
249 {
250     unsigned int pad0:1;
251     unsigned int grf_reg_count:3; 
252     unsigned int pad1:2;
253     unsigned int kernel_start_pointer:26; 
254 };
255
256 struct thread1
257 {
258     unsigned int ext_halt_exception_enable:1; 
259     unsigned int sw_exception_enable:1; 
260     unsigned int mask_stack_exception_enable:1; 
261     unsigned int timeout_exception_enable:1; 
262     unsigned int illegal_op_exception_enable:1; 
263     unsigned int pad0:3;
264     unsigned int depth_coef_urb_read_offset:6;  /* WM only */
265     unsigned int pad1:2;
266     unsigned int floating_point_mode:1; 
267     unsigned int thread_priority:1; 
268     unsigned int binding_table_entry_count:8; 
269     unsigned int pad3:5;
270     unsigned int single_program_flow:1; 
271 };
272
273 struct thread2
274 {
275     unsigned int per_thread_scratch_space:4; 
276     unsigned int pad0:6;
277     unsigned int scratch_space_base_pointer:22; 
278 };
279
280    
281 struct thread3
282 {
283     unsigned int dispatch_grf_start_reg:4; 
284     unsigned int urb_entry_read_offset:6; 
285     unsigned int pad0:1;
286     unsigned int urb_entry_read_length:6; 
287     unsigned int pad1:1;
288     unsigned int const_urb_entry_read_offset:6; 
289     unsigned int pad2:1;
290     unsigned int const_urb_entry_read_length:6; 
291     unsigned int pad3:1;
292 };
293
294 struct i965_vs_unit_state
295 {
296     struct thread0 thread0;
297     struct thread1 thread1;
298     struct thread2 thread2;
299     struct thread3 thread3;
300    
301     struct {
302         unsigned int pad0:10;
303         unsigned int stats_enable:1; 
304         unsigned int nr_urb_entries:7; 
305         unsigned int pad1:1;
306         unsigned int urb_entry_allocation_size:5; 
307         unsigned int pad2:1;
308         unsigned int max_threads:4; 
309         unsigned int pad3:3;
310     } thread4;   
311
312     struct {
313         unsigned int sampler_count:3; 
314         unsigned int pad0:2;
315         unsigned int sampler_state_pointer:27; 
316     } vs5;
317
318     struct {
319         unsigned int vs_enable:1; 
320         unsigned int vert_cache_disable:1; 
321         unsigned int pad0:30;
322     } vs6;
323 };
324
325 struct i965_gs_unit_state
326 {
327    struct thread0 thread0;
328    struct thread1 thread1;
329    struct thread2 thread2;
330    struct thread3 thread3;
331
332    struct {
333       unsigned int pad0:10;
334       unsigned int stats_enable:1; 
335       unsigned int nr_urb_entries:7; 
336       unsigned int pad1:1;
337       unsigned int urb_entry_allocation_size:5; 
338       unsigned int pad2:1;
339       unsigned int max_threads:1; 
340       unsigned int pad3:6;
341    } thread4;   
342       
343    struct {
344       unsigned int sampler_count:3; 
345       unsigned int pad0:2;
346       unsigned int sampler_state_pointer:27; 
347    } gs5;
348
349    
350    struct {
351       unsigned int max_vp_index:4; 
352       unsigned int pad0:26;
353       unsigned int reorder_enable:1; 
354       unsigned int pad1:1;
355    } gs6;
356 };
357
358 struct i965_clip_unit_state
359 {
360    struct thread0 thread0;
361    struct thread1 thread1;
362    struct thread2 thread2;
363    struct thread3 thread3;
364
365    struct {
366       unsigned int pad0:9;
367       unsigned int gs_output_stats:1; /* not always */
368       unsigned int stats_enable:1; 
369       unsigned int nr_urb_entries:7; 
370       unsigned int pad1:1;
371       unsigned int urb_entry_allocation_size:5; 
372       unsigned int pad2:1;
373       unsigned int max_threads:6;       /* may be less */
374       unsigned int pad3:1;
375    } thread4;   
376       
377    struct {
378       unsigned int pad0:13;
379       unsigned int clip_mode:3; 
380       unsigned int userclip_enable_flags:8; 
381       unsigned int userclip_must_clip:1; 
382       unsigned int pad1:1;
383       unsigned int guard_band_enable:1; 
384       unsigned int viewport_z_clip_enable:1; 
385       unsigned int viewport_xy_clip_enable:1; 
386       unsigned int vertex_position_space:1; 
387       unsigned int api_mode:1; 
388       unsigned int pad2:1;
389    } clip5;
390    
391    struct {
392       unsigned int pad0:5;
393       unsigned int clipper_viewport_state_ptr:27; 
394    } clip6;
395
396    
397    float viewport_xmin;  
398    float viewport_xmax;  
399    float viewport_ymin;  
400    float viewport_ymax;  
401 };
402
403 struct i965_sf_unit_state
404 {
405    struct thread0 thread0;
406    struct {
407       unsigned int pad0:7;
408       unsigned int sw_exception_enable:1; 
409       unsigned int pad1:3;
410       unsigned int mask_stack_exception_enable:1; 
411       unsigned int pad2:1;
412       unsigned int illegal_op_exception_enable:1; 
413       unsigned int pad3:2;
414       unsigned int floating_point_mode:1; 
415       unsigned int thread_priority:1; 
416       unsigned int binding_table_entry_count:8; 
417       unsigned int pad4:5;
418       unsigned int single_program_flow:1; 
419    } sf1;
420    
421    struct thread2 thread2;
422    struct thread3 thread3;
423
424    struct {
425       unsigned int pad0:10;
426       unsigned int stats_enable:1; 
427       unsigned int nr_urb_entries:7; 
428       unsigned int pad1:1;
429       unsigned int urb_entry_allocation_size:5; 
430       unsigned int pad2:1;
431       unsigned int max_threads:6; 
432       unsigned int pad3:1;
433    } thread4;   
434
435    struct {
436       unsigned int front_winding:1; 
437       unsigned int viewport_transform:1; 
438       unsigned int pad0:3;
439       unsigned int sf_viewport_state_offset:27; 
440    } sf5;
441    
442    struct {
443       unsigned int pad0:9;
444       unsigned int dest_org_vbias:4; 
445       unsigned int dest_org_hbias:4; 
446       unsigned int scissor:1; 
447       unsigned int disable_2x2_trifilter:1; 
448       unsigned int disable_zero_pix_trifilter:1; 
449       unsigned int point_rast_rule:2; 
450       unsigned int line_endcap_aa_region_width:2; 
451       unsigned int line_width:4; 
452       unsigned int fast_scissor_disable:1; 
453       unsigned int cull_mode:2; 
454       unsigned int aa_enable:1; 
455    } sf6;
456
457    struct {
458       unsigned int point_size:11; 
459       unsigned int use_point_size_state:1; 
460       unsigned int subpixel_precision:1; 
461       unsigned int sprite_point:1; 
462       unsigned int pad0:11;
463       unsigned int trifan_pv:2; 
464       unsigned int linestrip_pv:2; 
465       unsigned int tristrip_pv:2; 
466       unsigned int line_last_pixel_enable:1; 
467    } sf7;
468 };
469
470 struct i965_sampler_state
471 {
472    struct {
473       unsigned int shadow_function:3; 
474       unsigned int lod_bias:11; 
475       unsigned int min_filter:3; 
476       unsigned int mag_filter:3; 
477       unsigned int mip_filter:2; 
478       unsigned int base_level:5; 
479       unsigned int pad:1;
480       unsigned int lod_preclamp:1; 
481       unsigned int border_color_mode:1; 
482       unsigned int pad0:1;
483       unsigned int disable:1; 
484    } ss0;
485
486    struct {
487       unsigned int r_wrap_mode:3; 
488       unsigned int t_wrap_mode:3; 
489       unsigned int s_wrap_mode:3; 
490       unsigned int pad:3;
491       unsigned int max_lod:10; 
492       unsigned int min_lod:10; 
493    } ss1;
494
495    
496    struct {
497       unsigned int pad:5;
498       unsigned int border_color_pointer:27; 
499    } ss2;
500    
501    struct {
502       unsigned int pad:19;
503       unsigned int max_aniso:3; 
504       unsigned int chroma_key_mode:1; 
505       unsigned int chroma_key_index:2; 
506       unsigned int chroma_key_enable:1; 
507       unsigned int monochrome_filter_width:3; 
508       unsigned int monochrome_filter_height:3; 
509    } ss3;
510 };
511
512 struct i965_wm_unit_state
513 {
514    struct thread0 thread0;
515    struct thread1 thread1;
516    struct thread2 thread2;
517    struct thread3 thread3;
518    
519    struct {
520       unsigned int stats_enable:1; 
521       unsigned int pad0:1;
522       unsigned int sampler_count:3; 
523       unsigned int sampler_state_pointer:27; 
524    } wm4;
525    
526    struct {
527       unsigned int enable_8_pix:1; 
528       unsigned int enable_16_pix:1; 
529       unsigned int enable_32_pix:1; 
530       unsigned int pad0:7;
531       unsigned int legacy_global_depth_bias:1; 
532       unsigned int line_stipple:1; 
533       unsigned int depth_offset:1; 
534       unsigned int polygon_stipple:1; 
535       unsigned int line_aa_region_width:2; 
536       unsigned int line_endcap_aa_region_width:2; 
537       unsigned int early_depth_test:1; 
538       unsigned int thread_dispatch_enable:1; 
539       unsigned int program_uses_depth:1; 
540       unsigned int program_computes_depth:1; 
541       unsigned int program_uses_killpixel:1; 
542       unsigned int legacy_line_rast: 1; 
543       unsigned int transposed_urb_read:1; 
544       unsigned int max_threads:7; 
545    } wm5;
546    
547    float global_depth_offset_constant;  
548    float global_depth_offset_scale;   
549 };
550
551 struct i965_cc_viewport
552 {
553    float min_depth;  
554    float max_depth;  
555 };
556
557 struct i965_cc_unit_state
558 {
559    struct {
560       unsigned int pad0:3;
561       unsigned int bf_stencil_pass_depth_pass_op:3; 
562       unsigned int bf_stencil_pass_depth_fail_op:3; 
563       unsigned int bf_stencil_fail_op:3; 
564       unsigned int bf_stencil_func:3; 
565       unsigned int bf_stencil_enable:1; 
566       unsigned int pad1:2;
567       unsigned int stencil_write_enable:1; 
568       unsigned int stencil_pass_depth_pass_op:3; 
569       unsigned int stencil_pass_depth_fail_op:3; 
570       unsigned int stencil_fail_op:3; 
571       unsigned int stencil_func:3; 
572       unsigned int stencil_enable:1; 
573    } cc0;
574
575    
576    struct {
577       unsigned int bf_stencil_ref:8; 
578       unsigned int stencil_write_mask:8; 
579       unsigned int stencil_test_mask:8; 
580       unsigned int stencil_ref:8; 
581    } cc1;
582
583    
584    struct {
585       unsigned int logicop_enable:1; 
586       unsigned int pad0:10;
587       unsigned int depth_write_enable:1; 
588       unsigned int depth_test_function:3; 
589       unsigned int depth_test:1; 
590       unsigned int bf_stencil_write_mask:8; 
591       unsigned int bf_stencil_test_mask:8; 
592    } cc2;
593
594    
595    struct {
596       unsigned int pad0:8;
597       unsigned int alpha_test_func:3; 
598       unsigned int alpha_test:1; 
599       unsigned int blend_enable:1; 
600       unsigned int ia_blend_enable:1; 
601       unsigned int pad1:1;
602       unsigned int alpha_test_format:1;
603       unsigned int pad2:16;
604    } cc3;
605    
606    struct {
607       unsigned int pad0:5; 
608       unsigned int cc_viewport_state_offset:27; 
609    } cc4;
610    
611    struct {
612       unsigned int pad0:2;
613       unsigned int ia_dest_blend_factor:5; 
614       unsigned int ia_src_blend_factor:5; 
615       unsigned int ia_blend_function:3; 
616       unsigned int statistics_enable:1; 
617       unsigned int logicop_func:4; 
618       unsigned int pad1:11;
619       unsigned int dither_enable:1; 
620    } cc5;
621
622    struct {
623       unsigned int clamp_post_alpha_blend:1; 
624       unsigned int clamp_pre_alpha_blend:1; 
625       unsigned int clamp_range:2; 
626       unsigned int pad0:11;
627       unsigned int y_dither_offset:2; 
628       unsigned int x_dither_offset:2; 
629       unsigned int dest_blend_factor:5; 
630       unsigned int src_blend_factor:5; 
631       unsigned int blend_function:3; 
632    } cc6;
633
634    struct {
635       union {
636          float f;  
637          unsigned char ub[4];
638       } alpha_ref;
639    } cc7;
640 };
641
642 struct i965_sampler_8x8
643 {
644     struct {
645         unsigned int pad0:16;
646         unsigned int chroma_key_index:2;
647         unsigned int chroma_key_enable:1;
648         unsigned int pad1:8;
649         unsigned int ief_filter_size:1;
650         unsigned int ief_filter_type:1;
651         unsigned int ief_bypass:1;
652         unsigned int pad2:1;
653         unsigned int avs_filter_type:1;
654     } dw0;
655
656     struct {
657         unsigned int pad0:5;
658         unsigned int sampler_8x8_state_pointer:27;
659     } dw1;
660     
661     struct {
662         unsigned int weak_edge_threshold:4;
663         unsigned int strong_edge_threshold:4;
664         unsigned int global_noise_estimation:8;
665         unsigned int pad0:16;
666     } dw2;
667
668     struct {
669         unsigned int r3x_coefficient:5;
670         unsigned int pad0:1;
671         unsigned int r3c_coefficient:5;
672         unsigned int pad1:3;
673         unsigned int gain_factor:6;
674         unsigned int non_edge_weight:3;
675         unsigned int pad2:1;
676         unsigned int regular_weight:3;
677         unsigned int pad3:1;
678         unsigned int strong_edge_weight:3;
679         unsigned int pad4:1;
680     } dw3;
681
682     struct {
683         unsigned int pad0:2;
684         unsigned int mr_boost:1;
685         unsigned int mr_threshold:4;
686         unsigned int steepness_boost:1;
687         unsigned int steepness_threshold:4;
688         unsigned int pad1:2;
689         unsigned int r5x_coefficient:5;
690         unsigned int pad2:1;
691         unsigned int r5cx_coefficient:5;
692         unsigned int pad3:1;
693         unsigned int r5c_coefficient:5;
694         unsigned int pad4:1;
695     } dw4;
696
697     struct {
698         unsigned int pwl1_point_1:8;
699         unsigned int pwl1_point_2:8;
700         unsigned int pwl1_point_3:8;
701         unsigned int pwl1_point_4:8;
702     } dw5;
703
704     struct {
705         unsigned int pwl1_point_5:8;
706         unsigned int pwl1_point_6:8;
707         unsigned int pwl1_r3_bias_0:8;
708         unsigned int pwl1_r3_bias_1:8;
709     } dw6;
710
711     struct {
712         unsigned int pwl1_r3_bias_2:8;
713         unsigned int pwl1_r3_bias_3:8;
714         unsigned int pwl1_r3_bias_4:8;
715         unsigned int pwl1_r3_bias_5:8;
716     } dw7;
717
718     struct {
719         unsigned int pwl1_r3_bias_6:8;
720         unsigned int pwl1_r5_bias_0:8;
721         unsigned int pwl1_r5_bias_1:8;
722         unsigned int pwl1_r5_bias_2:8;
723     } dw8;
724
725     struct {
726         unsigned int pwl1_r5_bias_3:8;
727         unsigned int pwl1_r5_bias_4:8;
728         unsigned int pwl1_r5_bias_5:8;
729         unsigned int pwl1_r5_bias_6:8;
730     } dw9;
731
732     struct {
733         int pwl1_r3_slope_0:8;
734         int pwl1_r3_slope_1:8;
735         int pwl1_r3_slope_2:8;
736         int pwl1_r3_slope_3:8;
737     } dw10;
738
739     struct {
740         int pwl1_r3_slope_4:8;
741         int pwl1_r3_slope_5:8;
742         int pwl1_r3_slope_6:8;
743         int pwl1_r5_slope_0:8;
744     } dw11;
745
746     struct {
747         int pwl1_r5_slope_1:8;
748         int pwl1_r5_slope_2:8;
749         int pwl1_r5_slope_3:8;
750         int pwl1_r5_slope_4:8;
751     } dw12;
752
753     struct {
754         int pwl1_r5_slope_5:8;
755         int pwl1_r5_slope_6:8;
756         unsigned int limiter_boost:4;
757         unsigned int pad0:4;
758         unsigned int minimum_limiter:4;
759         unsigned int maximum_limiter:4;
760     } dw13;
761
762     struct {
763         unsigned int pad0:8;
764         unsigned int clip_limiter:10;
765         unsigned int pad1:14;
766     } dw14;
767
768     unsigned int dw15; /* Just a pad */
769 };
770
771 struct i965_sampler_8x8_coefficient
772 {
773     struct {
774         int table_0x_filter_c0:8;
775         int table_0x_filter_c1:8;
776         int table_0x_filter_c2:8;
777         int table_0x_filter_c3:8;
778     } dw0;
779
780     struct {
781         int table_0x_filter_c4:8;
782         int table_0x_filter_c5:8;
783         int table_0x_filter_c6:8;
784         int table_0x_filter_c7:8;
785     } dw1;
786
787     struct {
788         int table_0y_filter_c0:8;
789         int table_0y_filter_c1:8;
790         int table_0y_filter_c2:8;
791         int table_0y_filter_c3:8;
792     } dw2;
793
794     struct {
795         int table_0y_filter_c4:8;
796         int table_0y_filter_c5:8;
797         int table_0y_filter_c6:8;
798         int table_0y_filter_c7:8;
799     } dw3;
800
801     struct {
802         int table_1x_filter_c0:8;
803         int table_1x_filter_c1:8;
804         int table_1x_filter_c2:8;
805         int table_1x_filter_c3:8;
806     } dw4;
807
808     struct {
809         int table_1x_filter_c4:8;
810         int table_1x_filter_c5:8;
811         int table_1x_filter_c6:8;
812         int table_1x_filter_c7:8;
813     } dw5;
814
815     struct {
816         int table_1y_filter_c0:8;
817         int table_1y_filter_c1:8;
818         int table_1y_filter_c2:8;
819         int table_1y_filter_c3:8;
820     } dw6;
821
822     struct {
823         int table_1y_filter_c4:8;
824         int table_1y_filter_c5:8;
825         int table_1y_filter_c6:8;
826         int table_1y_filter_c7:8;
827     } dw7;
828 };
829
830 struct i965_sampler_8x8_state
831 {
832     struct i965_sampler_8x8_coefficient coefficients[17];
833
834     struct {
835         unsigned int transition_area_with_8_pixels:3;
836         unsigned int pad0:1;
837         unsigned int transition_area_with_4_pixels:3;
838         unsigned int pad1:1;
839         unsigned int max_derivative_8_pixels:8;
840         unsigned int max_derivative_4_pixels:8;
841         unsigned int default_sharpness_level:8;
842     } dw136;
843
844     union {
845         /* Ironlake, Sandybridge, Ivybridge (Gen5+) */
846         struct {
847             unsigned int pad0:21;
848             unsigned int bypass_y_adaptive_filtering:1;
849             unsigned int bypass_x_adaptive_filtering:1;
850             unsigned int pad1:9;
851         } ilk;
852
853         /* Haswell (Gen7.5+) */
854         struct {
855             unsigned int rgb_adaptive:1;
856             unsigned int adaptive_filter_for_all_channel:1;
857             unsigned int pad0:19;
858             unsigned int bypass_y_adaptive_filtering:1;
859             unsigned int bypass_x_adaptive_filtering:1;
860             unsigned int pad1:9;
861         } hsw;
862     } dw137;
863 };
864
865 struct i965_surface_state2
866 {
867     struct {
868         unsigned int surface_base_address;
869     } ss0;
870
871     struct {
872         unsigned int cbcr_pixel_offset_v_direction:2;
873         unsigned int pad0:4;
874         unsigned int width:13;
875         unsigned int height:13;
876     } ss1;
877
878     struct {
879         unsigned int tile_walk:1;
880         unsigned int tiled_surface:1;
881         unsigned int half_pitch_for_chroma:1;
882         unsigned int pitch:17;
883         unsigned int pad0:2;
884         unsigned int surface_object_control_data:4;
885         unsigned int pad1:1;
886         unsigned int interleave_chroma:1;
887         unsigned int surface_format:4;
888     } ss2;
889
890     struct {
891         unsigned int y_offset_for_cb:13;
892         unsigned int pad0:3;
893         unsigned int x_offset_for_cb:13;
894         unsigned int pad1:3;
895     } ss3;
896
897     struct {
898         unsigned int y_offset_for_cr:13;
899         unsigned int pad0:3;
900         unsigned int x_offset_for_cr:13;
901         unsigned int pad1:3;
902     } ss4;
903 };
904
905 struct i965_sampler_dndi
906 {
907     struct {
908         unsigned int denoise_asd_threshold:8;
909         unsigned int denoise_history_delta:8;
910         unsigned int denoise_maximum_history:8;
911         unsigned int denoise_stad_threshold:8;
912     } dw0;
913
914     struct {
915         unsigned int denoise_threshold_for_sum_of_complexity_measure:8;
916         unsigned int denoise_moving_pixel_threshold:5;
917         unsigned int stmm_c2:3;
918         unsigned int low_temporal_difference_threshold:6;
919         unsigned int pad0:2;
920         unsigned int temporal_difference_threshold:6;
921         unsigned int pad1:2;
922     } dw1;
923
924     struct {
925         unsigned int block_noise_estimate_noise_threshold:8;
926         unsigned int block_noise_estimate_edge_threshold:8; 
927         unsigned int denoise_edge_threshold:8;
928         unsigned int good_neighbor_threshold:8;
929    } dw2;
930
931     struct {
932         unsigned int maximum_stmm:8;
933         unsigned int multipler_for_vecm:6;
934         unsigned int pad0:2;
935         unsigned int blending_constant_across_time_for_small_values_of_stmm:8;
936         unsigned int blending_constant_across_time_for_large_values_of_stmm:7;
937         unsigned int stmm_blending_constant_select:1;
938     } dw3;
939
940     struct {
941         unsigned int sdi_delta:8;
942         unsigned int sdi_threshold:8;
943         unsigned int stmm_output_shift:4;
944         unsigned int stmm_shift_up:2;
945         unsigned int stmm_shift_down:2;
946         unsigned int minimum_stmm:8;
947     } dw4;
948
949     struct {
950         unsigned int fmd_temporal_difference_threshold:8;
951         unsigned int sdi_fallback_mode_2_constant:8;
952         unsigned int sdi_fallback_mode_1_t2_constant:8;
953         unsigned int sdi_fallback_mode_1_t1_constant:8;
954     } dw5;
955
956     struct {
957         unsigned int dn_enable:1;
958         unsigned int di_enable:1;
959         unsigned int di_partial:1;
960         unsigned int dndi_top_first:1;
961         unsigned int dndi_stream_id:1;
962         unsigned int dndi_first_frame:1;
963         unsigned int progressive_dn:1;
964         unsigned int pad0:1;
965         unsigned int fmd_tear_threshold:6;
966         unsigned int pad1:2;
967         unsigned int fmd2_vertical_difference_threshold:8;
968         unsigned int fmd1_vertical_difference_threshold:8;
969     } dw6;
970
971     struct {
972         unsigned int pad0:8;
973         unsigned int fmd_for_1st_field_of_current_frame:2;
974         unsigned int pad1:6;
975         unsigned int fmd_for_2nd_field_of_previous_frame:2;
976         unsigned int vdi_walker_enable:1;
977         unsigned int pad2:4;
978         unsigned int column_width_minus1:9;
979     } dw7;
980 };
981
982 struct gen8_interface_descriptor_data
983 {
984     struct {
985         unsigned int pad0:6;
986         unsigned int kernel_start_pointer:26;
987     } desc0;
988     
989     struct {
990         unsigned int kernel_start_pointer_high:16;
991         unsigned int pad0:16;
992     } desc1;
993
994     struct {
995         unsigned int pad0:7;
996         unsigned int software_exception_enable:1;
997         unsigned int pad1:3;
998         unsigned int maskstack_exception_enable:1;
999         unsigned int pad2:1;
1000         unsigned int illegal_opcode_exception_enable:1;
1001         unsigned int pad3:2;
1002         unsigned int floating_point_mode:1;
1003         unsigned int thread_priority:1;
1004         unsigned int single_program_flow:1;
1005         unsigned int denorm_mode:1;
1006         unsigned int pad4:12;
1007     } desc2;
1008
1009     struct {
1010         unsigned int pad0:2;
1011         unsigned int sampler_count:3;
1012         unsigned int sampler_state_pointer:27;
1013     } desc3;
1014
1015     struct {
1016         unsigned int binding_table_entry_count:5;
1017         unsigned int binding_table_pointer:11;
1018         unsigned int pad0: 16;
1019     } desc4;
1020
1021     struct {
1022         unsigned int constant_urb_entry_read_offset:16;
1023         unsigned int constant_urb_entry_read_length:16;
1024     } desc5;
1025
1026     struct {
1027         unsigned int num_threads_in_tg:10;
1028         unsigned int pad0:5;
1029         unsigned int global_barrier_enable:1;
1030         unsigned int shared_local_memory_size:5;
1031         unsigned int barrier_enable:1;
1032         unsigned int rounding_mode:2;
1033         unsigned int pad1:8;
1034     } desc6;
1035
1036     struct {
1037         unsigned int cross_thread_constant_data_read_length:8;
1038         unsigned int pad0:24;
1039     } desc7;
1040 };
1041  
1042 struct gen8_surface_state
1043 {
1044     struct {
1045         unsigned int cube_pos_z:1;
1046         unsigned int cube_neg_z:1;
1047         unsigned int cube_pos_y:1;
1048         unsigned int cube_neg_y:1;
1049         unsigned int cube_pos_x:1;
1050         unsigned int cube_neg_x:1;
1051         unsigned int media_boundary_pixel_mode:2;
1052         unsigned int render_cache_read_write:1;
1053         unsigned int sampler_l2bypass_disable:1;
1054         unsigned int vert_line_stride_ofs:1;
1055         unsigned int vert_line_stride:1;
1056         unsigned int tile_walk:1;
1057         unsigned int tiled_surface:1;
1058         unsigned int horizontal_alignment:2;
1059         /* Field 16 */
1060         unsigned int vertical_alignment:2;
1061         unsigned int surface_format:9;     /**< BRW_SURFACEFORMAT_x */
1062         unsigned int pad0:1;
1063         unsigned int is_array:1;
1064         unsigned int surface_type:3;       /**< BRW_SURFACE_1D/2D/3D/CUBE */
1065     } ss0;
1066
1067     struct {
1068         unsigned int surface_qpitch:15;
1069         unsigned int pad0:4;
1070         unsigned int base_mip_level:5;
1071         unsigned int surface_mocs:7;
1072         unsigned int pad1:1;
1073     } ss1;
1074
1075     struct {
1076         unsigned int width:14;
1077         unsigned int pad0:2;
1078         unsigned int height:14;
1079         unsigned int pad1:2;
1080     } ss2;
1081
1082     struct {
1083         unsigned int pitch:18;
1084         unsigned int pad:3;
1085         unsigned int depth:11;
1086     } ss3;
1087
1088     struct {
1089         unsigned int multisample_position_palette_index:3;
1090         unsigned int num_multisamples:3;
1091         unsigned int multisampled_surface_storage_format:1;
1092         unsigned int render_target_view_extent:11;
1093         unsigned int min_array_elt:11;
1094         unsigned int rotation:2;
1095         unsigned int force_ncmp_reduce_type:1;
1096     } ss4;
1097
1098     struct {
1099         unsigned int mip_count:4;
1100         unsigned int min_lod:4;
1101         unsigned int pad0:4;
1102         unsigned int pad1:2;
1103         unsigned int coherence_type:1;
1104         unsigned int pad2:3;
1105         unsigned int pad3:2;
1106         unsigned int ewa_disable_cube:1;
1107         unsigned int y_offset:3;
1108         unsigned int pad4:1;
1109         unsigned int x_offset:7;
1110     } ss5;
1111
1112     struct {
1113         unsigned int y_offset_uv_plane:14;
1114         unsigned int pad0:2;
1115         unsigned int x_offset_uv_plane:14;
1116         unsigned int pad1:1;
1117         unsigned int separate_uv_plane:1;
1118     } ss6;
1119
1120     struct {
1121         unsigned int resource_min_lod:12;
1122         unsigned int pad0:4;
1123         unsigned int shader_chanel_select_a:3;
1124         unsigned int shader_chanel_select_b:3;
1125         unsigned int shader_chanel_select_g:3;
1126         unsigned int shader_chanel_select_r:3;
1127         unsigned int alpha_clear_color:1;
1128         unsigned int blue_clear_color:1;
1129         unsigned int green_clear_color:1;
1130         unsigned int red_clear_color:1;
1131     } ss7;
1132     struct {
1133         unsigned int base_addr;
1134     } ss8;
1135
1136     struct {
1137         unsigned int base_addr_high:16;
1138         unsigned int pad0:16;
1139     } ss9;
1140
1141     struct {
1142         unsigned int pad0:12;
1143         unsigned int aux_base_addr:20;
1144     } ss10;
1145  
1146     union {
1147         struct {
1148                 unsigned int y_offset_v_plane:14;
1149                 unsigned int pad0:2;
1150                 unsigned int x_offset_v_plane:14;
1151                 unsigned int pad1:2;
1152         } planar;
1153         struct {
1154                 unsigned int aux_base_addr_high:16;
1155                 unsigned int pad2:16;
1156         } aux_buffer;
1157     } ss11; 
1158
1159     struct {
1160         unsigned int hier_depth_clear;
1161     } ss12;
1162
1163     struct {
1164         unsigned int pad0;
1165     } ss13;
1166
1167     struct {
1168         unsigned int pad0;
1169     } ss14;
1170
1171     struct {
1172         unsigned int pad0;
1173     } ss15;  
1174 };
1175
1176 struct gen8_surface_state2
1177 {
1178     struct {
1179         unsigned int pad0;
1180     } ss0;
1181
1182     struct {
1183         unsigned int cbcr_pixel_offset_v_direction:2;
1184         unsigned int picture_structure:2;
1185         unsigned int width:14;
1186         unsigned int height:14;
1187     } ss1;
1188
1189     struct {
1190         unsigned int tile_walk:1;
1191         unsigned int tiled_surface:1;
1192         unsigned int half_pitch_for_chroma:1;
1193         unsigned int pitch:18;
1194         unsigned int address_ctrl:1; /* clamp or mirror mode */
1195         unsigned int pad0:4;
1196         unsigned int interleave_chroma:1;
1197         unsigned int surface_format:5;
1198     } ss2;
1199
1200     struct {
1201         unsigned int y_offset_for_cb:14;
1202         unsigned int pad0:2;
1203         unsigned int x_offset_for_cb:14;
1204         unsigned int pad1:2;
1205     } ss3;
1206
1207     struct {
1208         unsigned int y_offset_for_cr:15;
1209         unsigned int pad0:1;
1210         unsigned int x_offset_for_cr:14;
1211         unsigned int pad1:2;
1212     } ss4;
1213
1214     struct {
1215         unsigned int surface_object_mocs:7;
1216         unsigned int pad0:11;
1217         unsigned int pad1:2;
1218         unsigned int pad2:10;
1219         unsigned int vert_line_stride_offset:1;
1220         unsigned int vert_line_stride:1;
1221     } ss5;
1222
1223     struct {
1224         unsigned int base_addr;
1225     } ss6;
1226
1227     struct {
1228         unsigned int base_addr_high:16;
1229         unsigned int pad0:16;
1230     } ss7;
1231 };
1232
1233 struct gen9_surface_state2
1234 {
1235     struct {
1236         unsigned int pad0:16;
1237         unsigned int y_offset:4;
1238         unsigned int x_offset:7;
1239         unsigned int pad1:3;
1240         unsigned int rotation:2;
1241     } ss0;
1242
1243     struct {
1244         unsigned int cbcr_pixel_offset_v_direction:2;
1245         unsigned int picture_structure:2;
1246         unsigned int width:14;
1247         unsigned int height:14;
1248     } ss1;
1249
1250     struct {
1251         unsigned int tile_walk:1;
1252         unsigned int tiled_surface:1;
1253         unsigned int half_pitch_for_chroma:1;
1254         unsigned int pitch:18;
1255         unsigned int address_ctrl:1; /* clamp or mirror mode */
1256         unsigned int memory_compression_enable:1;
1257         unsigned int memory_compression_mode:1;
1258         unsigned int cbcr_pixel_offset_v_direction_msb:1;
1259         unsigned int cbcr_pixel_offset_u_direction:1;
1260         unsigned int interleave_chroma:1;
1261         unsigned int surface_format:5;
1262     } ss2;
1263
1264     struct {
1265         unsigned int y_offset_for_cb:14;
1266         unsigned int pad0:2;
1267         unsigned int x_offset_for_cb:14;
1268         unsigned int pad1:2;
1269     } ss3;
1270
1271     struct {
1272         unsigned int y_offset_for_cr:15;
1273         unsigned int pad0:1;
1274         unsigned int x_offset_for_cr:14;
1275         unsigned int pad1:2;
1276     } ss4;
1277
1278     struct {
1279         unsigned int surface_object_mocs:7;
1280         unsigned int pad0:11;
1281         unsigned int tr_mode:2;
1282         unsigned int pad1:10;
1283         unsigned int vert_line_stride_offset:1;
1284         unsigned int vert_line_stride:1;
1285     } ss5;
1286
1287     struct {
1288         unsigned int base_addr;
1289     } ss6;
1290
1291     struct {
1292         unsigned int base_addr_high:16;
1293         unsigned int pad0:16;
1294     } ss7;
1295 };
1296
1297 struct gen9_surface_state
1298 {
1299     struct {
1300         unsigned int pad0:6;
1301         unsigned int media_boundary_pixel_mode:2;
1302         unsigned int render_cache_read_write:1;
1303         unsigned int sampler_l2bypass_disable:1;
1304         unsigned int vert_line_stride_ofs:1;
1305         unsigned int vert_line_stride:1;
1306         unsigned int tile_walk:1;
1307         unsigned int tiled_surface:1;
1308         unsigned int horizontal_alignment:2;
1309         /* Field 16 */
1310         unsigned int vertical_alignment:2;
1311         unsigned int surface_format:9;     /**< BRW_SURFACEFORMAT_x */
1312         unsigned int astc_enable:1;
1313         unsigned int is_array:1;
1314         unsigned int surface_type:3;       /**< BRW_SURFACE_1D/2D/3D/CUBE */
1315     } ss0;
1316
1317     struct {
1318         unsigned int surface_qpitch:15;
1319         unsigned int pad0:4;
1320         unsigned int base_mip_level:5;
1321         unsigned int surface_mocs:7;
1322         unsigned int pad1:1;
1323     } ss1;
1324
1325     struct {
1326         unsigned int width:14;
1327         unsigned int pad0:2;
1328         unsigned int height:14;
1329         unsigned int pad1:2;
1330     } ss2;
1331
1332     struct {
1333         unsigned int pitch:18;
1334         unsigned int pad:3;
1335         unsigned int depth:11;
1336     } ss3;
1337
1338     struct {
1339         unsigned int multisample_position_palette_index:3;
1340         unsigned int num_multisamples:3;
1341         unsigned int multisampled_surface_storage_format:1;
1342         unsigned int render_target_view_extent:11;
1343         unsigned int min_array_elt:11;
1344         unsigned int rotation:2;
1345         unsigned int force_ncmp_reduce_type:1;
1346     } ss4;
1347
1348     struct {
1349         unsigned int mip_count:4;
1350         unsigned int min_lod:4;
1351         unsigned int miptail_start_lod:4;
1352         unsigned int pad0:2;
1353         unsigned int coherence_type:1;
1354         unsigned int pad1:3;
1355         unsigned int tr_mode:2;
1356         unsigned int ewa_disable_cube:1;
1357         unsigned int y_offset:3;
1358         unsigned int pad2:1;
1359         unsigned int x_offset:7;
1360     } ss5;
1361
1362     struct {
1363         unsigned int y_offset_uv_plane:14;
1364         unsigned int pad0:2;
1365         unsigned int x_offset_uv_plane:14;
1366         unsigned int pad1:1;
1367         unsigned int separate_uv_plane:1;
1368     } ss6;
1369
1370     struct {
1371         unsigned int resource_min_lod:12;
1372         unsigned int pad0:4;
1373         unsigned int shader_chanel_select_a:3;
1374         unsigned int shader_chanel_select_b:3;
1375         unsigned int shader_chanel_select_g:3;
1376         unsigned int shader_chanel_select_r:3;
1377         unsigned int pad1:2;
1378         unsigned int memory_compression_enable:1;
1379         unsigned int memory_compression_mode:1;
1380     } ss7;
1381
1382     struct {
1383         unsigned int base_addr;
1384     } ss8;
1385
1386     struct {
1387         unsigned int base_addr_high;
1388     } ss9;
1389
1390     struct {
1391         unsigned int quilt_width:5;
1392         unsigned int quilt_height:5;
1393         unsigned int pad0:6;
1394         unsigned int pad1:16;
1395     } ss10;
1396
1397     struct {
1398         unsigned int y_offset_v_plane:14;
1399         unsigned int pad0:2;
1400         unsigned int x_offset_v_plane:14;
1401         unsigned int pad1:2;
1402     } ss11;
1403
1404     struct {
1405         unsigned int pad0;
1406     } ss12;
1407
1408     struct {
1409         unsigned int pad0;
1410     } ss13;
1411
1412     struct {
1413         unsigned int pad0;
1414     } ss14;
1415
1416     struct {
1417         unsigned int pad0;
1418     } ss15;
1419 };
1420
1421 struct gen8_sampler_state
1422 {
1423    struct
1424    {
1425       unsigned int aniso_algorithm:1;
1426       unsigned int lod_bias:13;
1427       unsigned int min_filter:3;
1428       unsigned int mag_filter:3;
1429       unsigned int mip_filter:2;
1430       unsigned int base_level:5;
1431       unsigned int lod_preclamp:2;
1432       unsigned int default_color_mode:1;
1433       unsigned int pad0:1;
1434       unsigned int disable:1;
1435    } ss0;
1436
1437    struct
1438    {
1439       unsigned int cube_control_mode:1;
1440       unsigned int shadow_function:3;
1441       unsigned int chroma_key_mode:1;
1442       unsigned int chroma_key_index:2;
1443       unsigned int chroma_key_enable:1;
1444       unsigned int max_lod:12;
1445       unsigned int min_lod:12;
1446    } ss1;
1447
1448    struct
1449    {
1450         unsigned int lod_clamp_mag_mode:1; /* MIPNONE or MIPFILTER */
1451         unsigned int flex_filter_vert_align:1;
1452         unsigned int flex_filter_hort_align:1;
1453         unsigned int flex_filter_coff_size:1; /* coff8 or coff 16 */
1454         unsigned int flex_filter_mode:1;
1455         unsigned int pad0:1;
1456         unsigned int indirect_state_pointer:18; /* point to the SAMPLE_INDIRECT_STATE */
1457         union {
1458                 unsigned char nonsep_filter_footer_highmask;
1459                 struct {
1460                         unsigned char pad1:2;
1461                         unsigned char sep_filter_height:2;
1462                         unsigned char sep_filter_width:2;
1463                         unsigned char sep_filter_coff_size:2;
1464                 } sep_filter;           
1465         } ss2_byte3;
1466    } ss2;
1467
1468    struct
1469    {
1470       unsigned int r_wrap_mode:3;
1471       unsigned int t_wrap_mode:3;
1472       unsigned int s_wrap_mode:3;
1473       unsigned int pad0:1;
1474       unsigned int non_normalized_coord:1;
1475       unsigned int trilinear_quality:2;
1476       unsigned int address_round:6;
1477       unsigned int max_aniso:3;
1478         unsigned int pad1:2;
1479         unsigned int nonsep_filter_foot_lowmask:8; 
1480    } ss3;
1481 };
1482
1483 struct gen8_global_blend_state
1484 {
1485     unsigned int pad0:19;
1486     unsigned int ydither_offset:2;
1487     unsigned int xdither_offset:2;
1488     unsigned int color_dither_enable:1;
1489     unsigned int alpha_test_func:3;
1490     unsigned int alpha_test_enable:1;
1491     unsigned int alpha_to_coverage_dither:1;
1492     unsigned int alpha_to_one:1;
1493     unsigned int ia_blend_enable:1;
1494     unsigned int alpha_to_coverage:1;
1495 };
1496
1497 struct gen8_blend_state_rt {
1498     struct {
1499         unsigned int blue_write_dis:1;
1500         unsigned int green_write_dis:1;
1501         unsigned int red_write_dis:1;
1502         unsigned int alpha_write_dis:1;
1503         unsigned int pad0:1;
1504         unsigned int alpha_blend_func:3;
1505         unsigned int ia_dest_blend_factor:5;
1506         unsigned int ia_src_blend_factor:5;
1507         unsigned int color_blend_func:3;
1508         unsigned int dest_blend_factor:5;
1509         unsigned int src_blend_factor:5;
1510         unsigned int colorbuf_blend:1;
1511     } blend0;
1512
1513     struct {
1514         unsigned int post_blend_clamp_enable:1;
1515         unsigned int pre_blend_clamp_enable:1;
1516         unsigned int clamp_range:2;
1517         unsigned int pre_blend_src_clamp:1;
1518         unsigned int pad0:22;
1519         unsigned int logic_op_func:4;
1520         unsigned int logic_op_enable:1;
1521     } blend1;
1522 };
1523
1524 /* TODO: Add the sampler_8x8 for Gen8+. 
1525  * AVS/Convolve is 256DWs.
1526  * MinMaxfilter/Erode/Dilate: 8DWs*/
1527
1528
1529 struct gen6_blend_state
1530 {
1531     struct {
1532         unsigned int dest_blend_factor:5;
1533         unsigned int source_blend_factor:5;
1534         unsigned int pad3:1;
1535         unsigned int blend_func:3;
1536         unsigned int pad2:1;
1537         unsigned int ia_dest_blend_factor:5;
1538         unsigned int ia_source_blend_factor:5;
1539         unsigned int pad1:1;
1540         unsigned int ia_blend_func:3;
1541         unsigned int pad0:1;
1542         unsigned int ia_blend_enable:1;
1543         unsigned int blend_enable:1;
1544     } blend0;
1545
1546     struct {
1547         unsigned int post_blend_clamp_enable:1;
1548         unsigned int pre_blend_clamp_enable:1;
1549         unsigned int clamp_range:2;
1550         unsigned int pad0:4;
1551         unsigned int x_dither_offset:2;
1552         unsigned int y_dither_offset:2;
1553         unsigned int dither_enable:1;
1554         unsigned int alpha_test_func:3;
1555         unsigned int alpha_test_enable:1;
1556         unsigned int pad1:1;
1557         unsigned int logic_op_func:4;
1558         unsigned int logic_op_enable:1;
1559         unsigned int pad2:1;
1560         unsigned int write_disable_b:1;
1561         unsigned int write_disable_g:1;
1562         unsigned int write_disable_r:1;
1563         unsigned int write_disable_a:1;
1564         unsigned int pad3:1;
1565         unsigned int alpha_to_coverage_dither:1;
1566         unsigned int alpha_to_one:1;
1567         unsigned int alpha_to_coverage:1;
1568     } blend1;
1569 };
1570
1571 struct gen6_color_calc_state
1572 {
1573     struct {
1574         unsigned int alpha_test_format:1;
1575         unsigned int pad0:14;
1576         unsigned int round_disable:1;
1577         unsigned int bf_stencil_ref:8;
1578         unsigned int stencil_ref:8;
1579     } cc0;
1580
1581     union {
1582         float alpha_ref_f;
1583         struct {
1584             unsigned int ui:8;
1585             unsigned int pad0:24;
1586         } alpha_ref_fi;
1587     } cc1;
1588
1589     float constant_r;
1590     float constant_g;
1591     float constant_b;
1592     float constant_a;
1593 };
1594
1595 struct gen6_depth_stencil_state
1596 {
1597     struct {
1598         unsigned int pad0:3;
1599         unsigned int bf_stencil_pass_depth_pass_op:3;
1600         unsigned int bf_stencil_pass_depth_fail_op:3;
1601         unsigned int bf_stencil_fail_op:3;
1602         unsigned int bf_stencil_func:3;
1603         unsigned int bf_stencil_enable:1;
1604         unsigned int pad1:2;
1605         unsigned int stencil_write_enable:1;
1606         unsigned int stencil_pass_depth_pass_op:3;
1607         unsigned int stencil_pass_depth_fail_op:3;
1608         unsigned int stencil_fail_op:3;
1609         unsigned int stencil_func:3;
1610         unsigned int stencil_enable:1;
1611     } ds0;
1612
1613     struct {
1614         unsigned int bf_stencil_write_mask:8;
1615         unsigned int bf_stencil_test_mask:8;
1616         unsigned int stencil_write_mask:8;
1617         unsigned int stencil_test_mask:8;
1618     } ds1;
1619
1620     struct {
1621         unsigned int pad0:26;
1622         unsigned int depth_write_enable:1;
1623         unsigned int depth_test_func:3;
1624         unsigned int pad1:1;
1625         unsigned int depth_test_enable:1;
1626     } ds2;
1627 };
1628
1629 struct gen6_interface_descriptor_data
1630 {
1631     struct {
1632         unsigned int pad0:6;
1633         unsigned int kernel_start_pointer:26;
1634     } desc0;
1635     
1636     struct {
1637         unsigned int pad0:7;
1638         unsigned int software_exception_enable:1;
1639         unsigned int pad1:3;
1640         unsigned int maskstack_exception_enable:1;
1641         unsigned int pad2:1;
1642         unsigned int illegal_opcode_exception_enable:1;
1643         unsigned int pad3:2;
1644         unsigned int floating_point_mode:1;
1645         unsigned int thread_priority:1;
1646         unsigned int single_program_flow:1;
1647         unsigned int pad4:13;
1648     } desc1;
1649
1650     struct {
1651         unsigned int pad0:2;
1652         unsigned int sampler_count:3;
1653         unsigned int sampler_state_pointer:27;
1654     } desc2;
1655
1656     struct {
1657         unsigned int binding_table_entry_count:5;
1658         unsigned int binding_table_pointer:27;
1659     } desc3;
1660
1661     struct {
1662         unsigned int constant_urb_entry_read_offset:16;
1663         unsigned int constant_urb_entry_read_length:16;
1664     } desc4;
1665     
1666     union {
1667         struct {
1668             unsigned int num_threads:8;
1669             unsigned int barrier_return_byte:8;
1670             unsigned int shared_local_memory_size:5;
1671             unsigned int barrier_enable:1;
1672             unsigned int rounding_mode:2;
1673             unsigned int barrier_return_grf_offset:8;
1674         } gen7;
1675
1676         struct {
1677             unsigned int barrier_id:4;
1678             unsigned int pad0:28;
1679         } gen6;
1680     } desc5;
1681
1682     struct {
1683         unsigned int cross_thread_constant_data_read_length:8;
1684         unsigned int pad0:24;
1685     } desc6;
1686
1687     struct {
1688         unsigned int pad0;
1689     } desc7;
1690 };
1691
1692 struct gen7_surface_state
1693 {
1694     struct {
1695         unsigned int cube_pos_z:1;
1696         unsigned int cube_neg_z:1;
1697         unsigned int cube_pos_y:1;
1698         unsigned int cube_neg_y:1;
1699         unsigned int cube_pos_x:1;
1700         unsigned int cube_neg_x:1;
1701         unsigned int pad2:2;
1702         unsigned int render_cache_read_write:1;
1703         unsigned int pad1:1;
1704         unsigned int surface_array_spacing:1;
1705         unsigned int vert_line_stride_ofs:1;
1706         unsigned int vert_line_stride:1;
1707         unsigned int tile_walk:1;
1708         unsigned int tiled_surface:1;
1709         unsigned int horizontal_alignment:1;
1710         unsigned int vertical_alignment:2;
1711         unsigned int surface_format:9;     /**< BRW_SURFACEFORMAT_x */
1712         unsigned int pad0:1;
1713         unsigned int is_array:1;
1714         unsigned int surface_type:3;       /**< BRW_SURFACE_1D/2D/3D/CUBE */
1715     } ss0;
1716
1717     struct {
1718         unsigned int base_addr;
1719     } ss1;
1720
1721     struct {
1722         unsigned int width:14;
1723         unsigned int pad1:2;
1724         unsigned int height:14;
1725         unsigned int pad0:2;
1726     } ss2;
1727
1728     struct {
1729         unsigned int pitch:18;
1730         unsigned int pad:3;
1731         unsigned int depth:11;
1732     } ss3;
1733
1734     struct {
1735         unsigned int multisample_position_palette_index:3;
1736         unsigned int num_multisamples:3;
1737         unsigned int multisampled_surface_storage_format:1;
1738         unsigned int render_target_view_extent:11;
1739         unsigned int min_array_elt:11;
1740         unsigned int rotation:2;
1741         unsigned int pad0:1;
1742     } ss4;
1743
1744     struct {
1745         unsigned int mip_count:4;
1746         unsigned int min_lod:4;
1747         unsigned int pad1:12;
1748         unsigned int y_offset:4;
1749         unsigned int pad0:1;
1750         unsigned int x_offset:7;
1751     } ss5;
1752
1753     struct {
1754         unsigned int pad; /* Multisample Control Surface stuff */
1755     } ss6;
1756
1757     struct {
1758         unsigned int resource_min_lod:12;
1759         unsigned int pad0:4;
1760         unsigned int shader_chanel_select_a:3;
1761         unsigned int shader_chanel_select_b:3;
1762         unsigned int shader_chanel_select_g:3;
1763         unsigned int shader_chanel_select_r:3;
1764         unsigned int alpha_clear_color:1;
1765         unsigned int blue_clear_color:1;
1766         unsigned int green_clear_color:1;
1767         unsigned int red_clear_color:1;
1768     } ss7;
1769 };
1770
1771 struct gen7_sampler_state
1772 {
1773    struct
1774    {
1775       unsigned int aniso_algorithm:1;
1776       unsigned int lod_bias:13;
1777       unsigned int min_filter:3;
1778       unsigned int mag_filter:3;
1779       unsigned int mip_filter:2;
1780       unsigned int base_level:5;
1781       unsigned int pad1:1;
1782       unsigned int lod_preclamp:1;
1783       unsigned int default_color_mode:1;
1784       unsigned int pad0:1;
1785       unsigned int disable:1;
1786    } ss0;
1787
1788    struct
1789    {
1790       unsigned int cube_control_mode:1;
1791       unsigned int shadow_function:3;
1792       unsigned int pad:4;
1793       unsigned int max_lod:12;
1794       unsigned int min_lod:12;
1795    } ss1;
1796
1797    struct
1798    {
1799       unsigned int pad:5;
1800       unsigned int default_color_pointer:27;
1801    } ss2;
1802
1803    struct
1804    {
1805       unsigned int r_wrap_mode:3;
1806       unsigned int t_wrap_mode:3;
1807       unsigned int s_wrap_mode:3;
1808       unsigned int pad:1;
1809       unsigned int non_normalized_coord:1;
1810       unsigned int trilinear_quality:2;
1811       unsigned int address_round:6;
1812       unsigned int max_aniso:3;
1813       unsigned int chroma_key_mode:1;
1814       unsigned int chroma_key_index:2;
1815       unsigned int chroma_key_enable:1;
1816       unsigned int pad0:6;
1817    } ss3;
1818 };
1819
1820 struct gen7_surface_state2
1821 {
1822     struct {
1823         unsigned int surface_base_address;
1824     } ss0;
1825
1826     struct {
1827         unsigned int cbcr_pixel_offset_v_direction:2;
1828         unsigned int picture_structure:2;
1829         unsigned int width:14;
1830         unsigned int height:14;
1831     } ss1;
1832
1833     struct {
1834         unsigned int tile_walk:1;
1835         unsigned int tiled_surface:1;
1836         unsigned int half_pitch_for_chroma:1;
1837         unsigned int pitch:18;
1838         unsigned int pad0:1;
1839         unsigned int surface_object_control_data:4;
1840         unsigned int pad1:1;
1841         unsigned int interleave_chroma:1;
1842         unsigned int surface_format:4;
1843     } ss2;
1844
1845     struct {
1846         unsigned int y_offset_for_cb:15;
1847         unsigned int pad0:1;
1848         unsigned int x_offset_for_cb:14;
1849         unsigned int pad1:2;
1850     } ss3;
1851
1852     struct {
1853         unsigned int y_offset_for_cr:15;
1854         unsigned int pad0:1;
1855         unsigned int x_offset_for_cr:14;
1856         unsigned int pad1:2;
1857     } ss4;
1858
1859     struct {
1860         unsigned int pad0;
1861     } ss5;
1862
1863     struct {
1864         unsigned int pad0;
1865     } ss6;
1866
1867     struct {
1868         unsigned int pad0;
1869     } ss7;
1870 };
1871
1872 struct gen7_sampler_8x8
1873 {
1874     struct {
1875         unsigned int global_noise_estimation:8;
1876         unsigned int pad0:8;
1877         unsigned int chroma_key_index:2;
1878         unsigned int chroma_key_enable:1;
1879         unsigned int pad1:10;
1880         unsigned int ief_bypass:1;
1881         unsigned int pad2:1;
1882         unsigned int disable_8x8_filter:1;
1883     } dw0;
1884
1885     struct {
1886         unsigned int pad0:5;
1887         unsigned int sampler_8x8_state_pointer:27;
1888     } dw1;
1889     
1890     struct {
1891         unsigned int weak_edge_threshold:6;
1892         unsigned int pad0:2;
1893         unsigned int strong_edge_threshold:6;
1894         unsigned int pad1:2;
1895         unsigned int r5x_coefficient:5;
1896         unsigned int r5cx_coefficient:5;
1897         unsigned int r5c_coefficient:5;
1898         unsigned int pad2:1;
1899     } dw2;
1900
1901     struct {
1902         unsigned int r3x_coefficient:5;
1903         unsigned int pad0:1;
1904         unsigned int r3c_coefficient:5;
1905         unsigned int pad1:3;
1906         unsigned int gain_factor:6;
1907         unsigned int non_edge_weight:3;
1908         unsigned int pad2:1;
1909         unsigned int regular_weight:3;
1910         unsigned int pad3:1;
1911         unsigned int strong_edge_weight:3;
1912         unsigned int ief4_smooth_enable:1;
1913     } dw3;
1914 };
1915
1916 /* This can also be used for BDW+ */
1917 struct gen7_sampler_dndi
1918 {
1919     struct {
1920         unsigned int denoise_asd_threshold:8;
1921         unsigned int dnmh_delt:4;
1922         unsigned int vdi_walker_y_stride:2;
1923         unsigned int vdi_walker_frame_sharing_enable:1;
1924         unsigned int pad0:1;
1925         unsigned int denoise_maximum_history:8;
1926         unsigned int denoise_stad_threshold:8;
1927     } dw0;
1928
1929     struct {
1930         unsigned int denoise_threshold_for_sum_of_complexity_measure:8;
1931         unsigned int denoise_moving_pixel_threshold:5;
1932         unsigned int stmm_c2:3;
1933         unsigned int low_temporal_difference_threshold:6;
1934         unsigned int pad0:2;
1935         unsigned int temporal_difference_threshold:6;
1936         unsigned int pad1:2;
1937     } dw1;
1938
1939     struct {
1940         unsigned int block_noise_estimate_noise_threshold:8;
1941         unsigned int bne_edge_th:4;
1942         unsigned int pad0:2;
1943         unsigned int smooth_mv_th:2;
1944         unsigned int sad_tight_th:4;
1945         unsigned int cat_slope_minus1:4;
1946         unsigned int good_neighbor_th:6;
1947         unsigned int pad1:2;
1948    } dw2;
1949
1950     struct {
1951         unsigned int maximum_stmm:8;
1952         unsigned int multipler_for_vecm:6;
1953         unsigned int pad0:2;
1954         unsigned int blending_constant_across_time_for_small_values_of_stmm:8;
1955         unsigned int blending_constant_across_time_for_large_values_of_stmm:7;
1956         unsigned int stmm_blending_constant_select:1;
1957     } dw3;
1958
1959     struct {
1960         unsigned int sdi_delta:8;
1961         unsigned int sdi_threshold:8;
1962         unsigned int stmm_output_shift:4;
1963         unsigned int stmm_shift_up:2;
1964         unsigned int stmm_shift_down:2;
1965         unsigned int minimum_stmm:8;
1966     } dw4;
1967
1968     struct {
1969         unsigned int fmd_temporal_difference_threshold:8;
1970         unsigned int sdi_fallback_mode_2_constant:8;
1971         unsigned int sdi_fallback_mode_1_t2_constant:8;
1972         unsigned int sdi_fallback_mode_1_t1_constant:8;
1973     } dw5;
1974
1975     struct {
1976         unsigned int dn_enable:1;
1977         unsigned int di_enable:1;
1978         unsigned int di_partial:1;
1979         unsigned int dndi_top_first:1;
1980         unsigned int dndi_stream_id:1;
1981         unsigned int dndi_first_frame:1;
1982         unsigned int progressive_dn:1;
1983         unsigned int mcdi_enable:1;
1984         unsigned int fmd_tear_threshold:6;
1985         unsigned int cat_th1:2;
1986         unsigned int fmd2_vertical_difference_threshold:8;
1987         unsigned int fmd1_vertical_difference_threshold:8;
1988     } dw6;
1989
1990     struct {
1991         unsigned int sad_tha:4;
1992         unsigned int sad_thb:4;
1993         unsigned int fmd_for_1st_field_of_current_frame:2;
1994         unsigned int mc_pixel_consistency_th:6;
1995         unsigned int fmd_for_2nd_field_of_previous_frame:2;
1996         unsigned int vdi_walker_enable:1;
1997         unsigned int neighborpixel_th:4;
1998         unsigned int column_width_minus1:9;
1999     } dw7;
2000 };
2001
2002 struct gen8_sampler_8x8_avs_coefficients
2003 {
2004     struct {
2005         unsigned int table_0x_filter_c0:8;
2006         unsigned int table_0y_filter_c0:8;
2007         unsigned int table_0x_filter_c1:8;
2008         unsigned int table_0y_filter_c1:8;
2009     } dw0;
2010
2011     struct {
2012         unsigned int table_0x_filter_c2:8;
2013         unsigned int table_0y_filter_c2:8;
2014         unsigned int table_0x_filter_c3:8;
2015         unsigned int table_0y_filter_c3:8;
2016     } dw1;
2017
2018     struct {
2019         unsigned int table_0x_filter_c4:8;
2020         unsigned int table_0y_filter_c4:8;
2021         unsigned int table_0x_filter_c5:8;
2022         unsigned int table_0y_filter_c5:8;
2023     } dw2;
2024
2025     struct {
2026         unsigned int table_0x_filter_c6:8;
2027         unsigned int table_0y_filter_c6:8;
2028         unsigned int table_0x_filter_c7:8;
2029         unsigned int table_0y_filter_c7:8;
2030     } dw3;
2031
2032     struct {
2033         unsigned int pad0:16;
2034         unsigned int table_1x_filter_c2:8;
2035         unsigned int table_1x_filter_c3:8;
2036     } dw4;
2037
2038     struct {
2039         unsigned int table_1x_filter_c4:8;
2040         unsigned int table_1x_filter_c5:8;
2041         unsigned int pad0:16;
2042     } dw5;
2043
2044     struct {
2045         unsigned int pad0:16;
2046         unsigned int table_1y_filter_c2:8;
2047         unsigned int table_1y_filter_c3:8;
2048     } dw6;
2049
2050     struct {
2051         unsigned int table_1y_filter_c4:8;
2052         unsigned int table_1y_filter_c5:8;
2053         unsigned int pad0:16;
2054     } dw7;
2055 };
2056
2057 struct gen8_sampler_8x8_avs {
2058     struct {
2059         unsigned int gain_factor:6;
2060         unsigned int weak_edge_threshold:6;
2061         unsigned int strong_edge_threshold:6;
2062         unsigned int r3x_coefficient:5;
2063         unsigned int r3c_coefficient:5;
2064         unsigned int chroma_key_index:2;
2065         unsigned int chroma_key_enable:1;
2066         unsigned int pad1:1;
2067     } dw0;
2068
2069     struct {
2070         unsigned int pad0;
2071     } dw1;
2072     
2073     struct {
2074         unsigned int global_noise_estimation:8;
2075         unsigned int non_edge_weight:3;
2076         unsigned int regular_weight:3;
2077         unsigned int strong_edge_weight:3;
2078         unsigned int r5x_coefficient:5;
2079         unsigned int r5cx_coefficient:5;
2080         unsigned int r5c_coefficient:5;
2081     } dw2;
2082     
2083     struct {
2084         unsigned int sin_alpha:8; /* S0.7 */
2085         unsigned int cos_alpha:8; /* S0.7 */
2086         unsigned int sat_max:6;
2087         unsigned int hue_max:6;
2088         unsigned int enable_8tap_filter:2;
2089         unsigned int ief4_smooth_enable:1;
2090         unsigned int skin_ief_enable:1;
2091     } dw3;
2092     
2093     struct {
2094         unsigned int s3u:11; /* S2.8 */
2095         unsigned int pad0:1;
2096         unsigned int diamond_margin:3;
2097         unsigned int vy_std_enable:1;
2098         unsigned int umid:8;
2099         unsigned int vmid:8;
2100     } dw4;
2101
2102     struct {
2103         unsigned int diamond_dv:7;
2104         unsigned int diamond_th:6;
2105         unsigned int diamond_alpha:8;
2106         unsigned int hs_margin:3;
2107         unsigned int diamond_du:7;
2108         unsigned int skin_detailfilter:1;
2109     } dw5;
2110
2111     struct {
2112         unsigned int y_point1:8;
2113         unsigned int y_point2:8;
2114         unsigned int y_point3:8;
2115         unsigned int y_point4:8;
2116     } dw6;
2117
2118     struct {
2119         unsigned int inv_margin_vyl:16;
2120         unsigned int pad0:16;
2121     } dw7;
2122
2123     struct {
2124         unsigned int inv_margin_vyu:16;
2125         unsigned int p0l:8;
2126         unsigned int p1l:8;
2127     } dw8;
2128
2129     struct {
2130         unsigned int p2l:8;
2131         unsigned int p3l:8;
2132         unsigned int b0l:8;
2133         unsigned int b1l:8;
2134     } dw9;
2135
2136     struct {
2137         unsigned int b2l:8;
2138         unsigned int b3l:8;
2139         unsigned int s0l:11;
2140         unsigned int y_slope2:5;
2141     } dw10;
2142
2143     struct {
2144         unsigned int s1l:11;
2145         unsigned int s2l:11;
2146         unsigned int pad0:10;
2147     } dw11;
2148
2149     struct {
2150         unsigned int s3l:11;
2151         unsigned int p0u:8;
2152         unsigned int p1u:8;
2153         unsigned int y_slope1:5;
2154     } dw12;
2155
2156     struct {
2157         unsigned int p2u:8;
2158         unsigned int p3u:8;
2159         unsigned int b0u:8;
2160         unsigned int b1u:8;
2161     } dw13;
2162
2163     struct {
2164         unsigned int b2u:8;
2165         unsigned int b3u:8;
2166         unsigned int s0u:11;
2167         unsigned int pad0:5;
2168     } dw14;
2169
2170     struct {
2171         unsigned int s1u:11;
2172         unsigned int s2u:11;
2173         unsigned int pad0:10;
2174     } dw15;
2175
2176     /* DW16-DW151 */
2177     struct gen8_sampler_8x8_avs_coefficients coefficients[17];
2178     
2179     struct {
2180         unsigned int transition_area_with_8_pixels:3;
2181         unsigned int pad0:1;
2182         unsigned int transition_area_with_4_pixels:3;
2183         unsigned int pad1:1;
2184         unsigned int max_derivative_8_pixels:8;
2185         unsigned int max_derivative_4_pixels:8;
2186         unsigned int default_sharpness_level:8;
2187     } dw152;
2188   
2189     struct {
2190         unsigned int rgb_adaptive:1;
2191         unsigned int adaptive_filter_for_all_channel:1;
2192         unsigned int pad0:19;
2193         unsigned int bypass_y_adaptive_filtering:1;
2194         unsigned int bypass_x_adaptive_filtering:1;
2195         unsigned int pad1:9;
2196     } dw153;
2197
2198     unsigned int reserved[6];
2199
2200     /* DW160-DW279 */
2201     struct gen8_sampler_8x8_avs_coefficients coefficients1[15];
2202 };
2203
2204 struct gen9_sampler_8x8_avs
2205 {
2206     struct {
2207         unsigned int gain_factor:6;
2208         unsigned int weak_edge_threshold:6;
2209         unsigned int strong_edge_threshold:6;
2210         unsigned int r3x_coefficient:5;
2211         unsigned int r3c_coefficient:5;
2212         unsigned int pad1:4;
2213     } dw0;
2214
2215     struct {
2216         unsigned int pad0;
2217     } dw1;
2218
2219     struct {
2220         unsigned int global_noise_estimation:8;
2221         unsigned int non_edge_weight:3;
2222         unsigned int regular_weight:3;
2223         unsigned int strong_edge_weight:3;
2224         unsigned int r5x_coefficient:5;
2225         unsigned int r5cx_coefficient:5;
2226         unsigned int r5c_coefficient:5;
2227     } dw2;
2228
2229     struct {
2230         unsigned int sin_alpha:8; /* S0.7 */
2231         unsigned int cos_alpha:8; /* S0.7 */
2232         unsigned int sat_max:6;
2233         unsigned int hue_max:6;
2234         unsigned int enable_8tap_adaptive_filter:2;
2235         unsigned int ief4_smooth_enable:1;
2236         unsigned int skin_ief_enable:1;
2237     } dw3;
2238
2239     struct {
2240         unsigned int s3u:11; /* S2.8 */
2241         unsigned int shuffle_output_write_back:1;
2242         unsigned int diamond_margin:3;
2243         unsigned int vy_std_enable:1;
2244         unsigned int umid:8;
2245         unsigned int vmid:8;
2246     } dw4;
2247
2248     struct {
2249         unsigned int diamond_dv:7;
2250         unsigned int diamond_th:6;
2251         unsigned int diamond_alpha:8;
2252         unsigned int hs_margin:3;
2253         unsigned int diamond_du:7;
2254         unsigned int skin_detailfilter:1;
2255     } dw5;
2256
2257     struct {
2258         unsigned int y_point1:8;
2259         unsigned int y_point2:8;
2260         unsigned int y_point3:8;
2261         unsigned int y_point4:8;
2262     } dw6;
2263
2264     struct {
2265         unsigned int inv_margin_vyl:16;
2266         unsigned int pad0:16;
2267     } dw7;
2268
2269     struct {
2270         unsigned int inv_margin_vyu:16;
2271         unsigned int p0l:8;
2272         unsigned int p1l:8;
2273     } dw8;
2274
2275     struct {
2276         unsigned int p2l:8;
2277         unsigned int p3l:8;
2278         unsigned int b0l:8;
2279         unsigned int b1l:8;
2280     } dw9;
2281
2282     struct {
2283         unsigned int b2l:8;
2284         unsigned int b3l:8;
2285         unsigned int s0l:11;
2286         unsigned int y_slope2:5;
2287     } dw10;
2288
2289     struct {
2290         unsigned int s1l:11;
2291         unsigned int s2l:11;
2292         unsigned int pad0:10;
2293     } dw11;
2294
2295     struct {
2296         unsigned int s3l:11;
2297         unsigned int p0u:8;
2298         unsigned int p1u:8;
2299         unsigned int y_slope1:5;
2300     } dw12;
2301
2302     struct {
2303         unsigned int p2u:8;
2304         unsigned int p3u:8;
2305         unsigned int b0u:8;
2306         unsigned int b1u:8;
2307     } dw13;
2308
2309     struct {
2310         unsigned int b2u:8;
2311         unsigned int b3u:8;
2312         unsigned int s0u:11;
2313         unsigned int pad0:5;
2314     } dw14;
2315
2316     struct {
2317         unsigned int s1u:11;
2318         unsigned int s2u:11;
2319         unsigned int pad0:10;
2320     } dw15;
2321
2322     /* DW16-DW151 for 17 coeff tabls */
2323     struct gen8_sampler_8x8_avs_coefficients coefficients[17];
2324
2325     struct {
2326         unsigned int transition_area_with_8_pixels:3;
2327         unsigned int pad0:1;
2328         unsigned int transition_area_with_4_pixels:3;
2329         unsigned int pad1:1;
2330         unsigned int max_derivative_8_pixels:8;
2331         unsigned int max_derivative_4_pixels:8;
2332         unsigned int default_sharpness_level:8;
2333     } dw152;
2334
2335     struct {
2336         unsigned int rgb_adaptive:1;
2337         unsigned int adaptive_filter_for_all_channel:1;
2338         unsigned int pad0:19;
2339         unsigned int bypass_y_adaptive_filtering:1;
2340         unsigned int bypass_x_adaptive_filtering:1;
2341         unsigned int pad1:9;
2342     } dw153;
2343
2344     unsigned int reserved1[6];
2345
2346     /* 160-279 for 17..31 avs_coeff */
2347     struct gen8_sampler_8x8_avs_coefficients extra_coefficients[15];
2348
2349     // 280 - 511 (padding to align it to 512 dwords)
2350     unsigned int reserved2[232];
2351 };
2352
2353 #define SURFACE_STATE_PADDED_SIZE_0_GEN7        ALIGN(sizeof(struct gen7_surface_state), 32)
2354 #define SURFACE_STATE_PADDED_SIZE_1_GEN7        ALIGN(sizeof(struct gen7_surface_state2), 32)
2355 #define SURFACE_STATE_PADDED_SIZE_GEN7          MAX(SURFACE_STATE_PADDED_SIZE_0_GEN7, SURFACE_STATE_PADDED_SIZE_1_GEN7)
2356
2357 #define SURFACE_STATE_PADDED_SIZE_0_GEN6        ALIGN(sizeof(struct i965_surface_state), 32)
2358 #define SURFACE_STATE_PADDED_SIZE_1_GEN6        ALIGN(sizeof(struct i965_surface_state2), 32)
2359 #define SURFACE_STATE_PADDED_SIZE_GEN6          MAX(SURFACE_STATE_PADDED_SIZE_0_GEN6, SURFACE_STATE_PADDED_SIZE_1_GEN6)
2360
2361 #define SURFACE_STATE_PADDED_SIZE_0_GEN8        ALIGN(sizeof(struct gen8_surface_state), 32)
2362 #define SURFACE_STATE_PADDED_SIZE_1_GEN8        ALIGN(sizeof(struct gen8_surface_state2), 32)
2363 #define SURFACE_STATE_PADDED_SIZE_GEN8          MAX(SURFACE_STATE_PADDED_SIZE_0_GEN8, SURFACE_STATE_PADDED_SIZE_1_GEN8)
2364
2365 #define SURFACE_STATE_PADDED_SIZE_0_GEN9        ALIGN(sizeof(struct gen9_surface_state), 32)
2366 #define SURFACE_STATE_PADDED_SIZE_1_GEN9        ALIGN(sizeof(struct gen9_surface_state2), 32)
2367 #define SURFACE_STATE_PADDED_SIZE_GEN9          MAX(SURFACE_STATE_PADDED_SIZE_0_GEN9, SURFACE_STATE_PADDED_SIZE_1_GEN9)
2368
2369 #endif /* _I965_STRUCTS_H_ */