OSDN Git Service

Update for post processing on IVB
[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     struct {
845         unsigned int bit_field_name:1;
846         unsigned int adaptive_filter_for_all_channel:1;
847         unsigned int pad0:19;
848         unsigned int bypass_y_adaptive_filtering:1;
849         unsigned int bypass_x_adaptive_filtering:1;
850         unsigned int pad1:9;
851     } dw137;
852 };
853
854 struct i965_surface_state2
855 {
856     struct {
857         unsigned int surface_base_address;
858     } ss0;
859
860     struct {
861         unsigned int cbcr_pixel_offset_v_direction:2;
862         unsigned int pad0:4;
863         unsigned int width:13;
864         unsigned int height:13;
865     } ss1;
866
867     struct {
868         unsigned int tile_walk:1;
869         unsigned int tiled_surface:1;
870         unsigned int half_pitch_for_chroma:1;
871         unsigned int pitch:17;
872         unsigned int pad0:2;
873         unsigned int surface_object_control_data:4;
874         unsigned int pad1:1;
875         unsigned int interleave_chroma:1;
876         unsigned int surface_format:4;
877     } ss2;
878
879     struct {
880         unsigned int y_offset_for_cb:13;
881         unsigned int pad0:3;
882         unsigned int x_offset_for_cb:13;
883         unsigned int pad1:3;
884     } ss3;
885
886     struct {
887         unsigned int y_offset_for_cr:13;
888         unsigned int pad0:3;
889         unsigned int x_offset_for_cr:13;
890         unsigned int pad1:3;
891     } ss4;
892 };
893
894 struct i965_sampler_dndi
895 {
896     struct {
897         unsigned int denoise_asd_threshold:8;
898         unsigned int denoise_history_delta:8;
899         unsigned int denoise_maximum_history:8;
900         unsigned int denoise_stad_threshold:8;
901     } dw0;
902
903     struct {
904         unsigned int denoise_threshold_for_sum_of_complexity_measure:8;
905         unsigned int denoise_moving_pixel_threshold:5;
906         unsigned int stmm_c2:3;
907         unsigned int low_temporal_difference_threshold:6;
908         unsigned int pad0:2;
909         unsigned int temporal_difference_threshold:6;
910         unsigned int pad1:2;
911     } dw1;
912
913     struct {
914         unsigned int block_noise_estimate_noise_threshold:8;
915         unsigned int block_noise_estimate_edge_threshold:8; 
916         unsigned int denoise_edge_threshold:8;
917         unsigned int good_neighbor_threshold:8;
918    } dw2;
919
920     struct {
921         unsigned int maximum_stmm:8;
922         unsigned int multipler_for_vecm:6;
923         unsigned int pad0:2;
924         unsigned int blending_constant_across_time_for_small_values_of_stmm:8;
925         unsigned int blending_constant_across_time_for_large_values_of_stmm:7;
926         unsigned int stmm_blending_constant_select:1;
927     } dw3;
928
929     struct {
930         unsigned int sdi_delta:8;
931         unsigned int sdi_threshold:8;
932         unsigned int stmm_output_shift:4;
933         unsigned int stmm_shift_up:2;
934         unsigned int stmm_shift_down:2;
935         unsigned int minimum_stmm:8;
936     } dw4;
937
938     struct {
939         unsigned int fmd_temporal_difference_threshold:8;
940         unsigned int sdi_fallback_mode_2_constant:8;
941         unsigned int sdi_fallback_mode_1_t2_constant:8;
942         unsigned int sdi_fallback_mode_1_t1_constant:8;
943     } dw5;
944
945     struct {
946         unsigned int dn_enable:1;
947         unsigned int di_enable:1;
948         unsigned int di_partial:1;
949         unsigned int dndi_top_first:1;
950         unsigned int dndi_stream_id:1;
951         unsigned int dndi_first_frame:1;
952         unsigned int progressive_dn:1;
953         unsigned int pad0:1;
954         unsigned int fmd_tear_threshold:6;
955         unsigned int pad1:2;
956         unsigned int fmd2_vertical_difference_threshold:8;
957         unsigned int fmd1_vertical_difference_threshold:8;
958     } dw6;
959
960     struct {
961         unsigned int pad0:8;
962         unsigned int fmd_for_1st_field_of_current_frame:2;
963         unsigned int pad1:6;
964         unsigned int fmd_for_2nd_field_of_previous_frame:2;
965         unsigned int vdi_walker_enable:1;
966         unsigned int pad2:4;
967         unsigned int column_width_minus1:9;
968     } dw7;
969 };
970
971
972 struct gen6_blend_state
973 {
974     struct {
975         unsigned int dest_blend_factor:5;
976         unsigned int source_blend_factor:5;
977         unsigned int pad3:1;
978         unsigned int blend_func:3;
979         unsigned int pad2:1;
980         unsigned int ia_dest_blend_factor:5;
981         unsigned int ia_source_blend_factor:5;
982         unsigned int pad1:1;
983         unsigned int ia_blend_func:3;
984         unsigned int pad0:1;
985         unsigned int ia_blend_enable:1;
986         unsigned int blend_enable:1;
987     } blend0;
988
989     struct {
990         unsigned int post_blend_clamp_enable:1;
991         unsigned int pre_blend_clamp_enable:1;
992         unsigned int clamp_range:2;
993         unsigned int pad0:4;
994         unsigned int x_dither_offset:2;
995         unsigned int y_dither_offset:2;
996         unsigned int dither_enable:1;
997         unsigned int alpha_test_func:3;
998         unsigned int alpha_test_enable:1;
999         unsigned int pad1:1;
1000         unsigned int logic_op_func:4;
1001         unsigned int logic_op_enable:1;
1002         unsigned int pad2:1;
1003         unsigned int write_disable_b:1;
1004         unsigned int write_disable_g:1;
1005         unsigned int write_disable_r:1;
1006         unsigned int write_disable_a:1;
1007         unsigned int pad3:1;
1008         unsigned int alpha_to_coverage_dither:1;
1009         unsigned int alpha_to_one:1;
1010         unsigned int alpha_to_coverage:1;
1011     } blend1;
1012 };
1013
1014 struct gen6_color_calc_state
1015 {
1016     struct {
1017         unsigned int alpha_test_format:1;
1018         unsigned int pad0:14;
1019         unsigned int round_disable:1;
1020         unsigned int bf_stencil_ref:8;
1021         unsigned int stencil_ref:8;
1022     } cc0;
1023
1024     union {
1025         float alpha_ref_f;
1026         struct {
1027             unsigned int ui:8;
1028             unsigned int pad0:24;
1029         } alpha_ref_fi;
1030     } cc1;
1031
1032     float constant_r;
1033     float constant_g;
1034     float constant_b;
1035     float constant_a;
1036 };
1037
1038 struct gen6_depth_stencil_state
1039 {
1040     struct {
1041         unsigned int pad0:3;
1042         unsigned int bf_stencil_pass_depth_pass_op:3;
1043         unsigned int bf_stencil_pass_depth_fail_op:3;
1044         unsigned int bf_stencil_fail_op:3;
1045         unsigned int bf_stencil_func:3;
1046         unsigned int bf_stencil_enable:1;
1047         unsigned int pad1:2;
1048         unsigned int stencil_write_enable:1;
1049         unsigned int stencil_pass_depth_pass_op:3;
1050         unsigned int stencil_pass_depth_fail_op:3;
1051         unsigned int stencil_fail_op:3;
1052         unsigned int stencil_func:3;
1053         unsigned int stencil_enable:1;
1054     } ds0;
1055
1056     struct {
1057         unsigned int bf_stencil_write_mask:8;
1058         unsigned int bf_stencil_test_mask:8;
1059         unsigned int stencil_write_mask:8;
1060         unsigned int stencil_test_mask:8;
1061     } ds1;
1062
1063     struct {
1064         unsigned int pad0:26;
1065         unsigned int depth_write_enable:1;
1066         unsigned int depth_test_func:3;
1067         unsigned int pad1:1;
1068         unsigned int depth_test_enable:1;
1069     } ds2;
1070 };
1071
1072 struct gen6_interface_descriptor_data
1073 {
1074     struct {
1075         unsigned int pad0:6;
1076         unsigned int kernel_start_pointer:26;
1077     } desc0;
1078     
1079     struct {
1080         unsigned int pad0:7;
1081         unsigned int software_exception_enable:1;
1082         unsigned int pad1:3;
1083         unsigned int maskstack_exception_enable:1;
1084         unsigned int pad2:1;
1085         unsigned int illegal_opcode_exception_enable:1;
1086         unsigned int pad3:2;
1087         unsigned int floating_point_mode:1;
1088         unsigned int thread_priority:1;
1089         unsigned int single_program_flow:1;
1090         unsigned int pad4:13;
1091     } desc1;
1092
1093     struct {
1094         unsigned int pad0:2;
1095         unsigned int sampler_count:3;
1096         unsigned int sampler_state_pointer:27;
1097     } desc2;
1098
1099     struct {
1100         unsigned int binding_table_entry_count:5;
1101         unsigned int binding_table_pointer:27;
1102     } desc3;
1103
1104     struct {
1105         unsigned int constant_urb_entry_read_offset:16;
1106         unsigned int constant_urb_entry_read_length:16;
1107     } desc4;
1108     
1109     union {
1110         struct {
1111             unsigned int num_threads:8;
1112             unsigned int barrier_return_byte:8;
1113             unsigned int shared_local_memory_size:5;
1114             unsigned int barrier_enable:1;
1115             unsigned int rounding_mode:2;
1116             unsigned int barrier_return_grf_offset:8;
1117         } gen7;
1118
1119         struct {
1120             unsigned int barrier_id:4;
1121             unsigned int pad0:28;
1122         } gen6;
1123     } desc5;
1124
1125     struct {
1126         unsigned int cross_thread_constant_data_read_length:8;
1127         unsigned int pad0:24;
1128     } desc6;
1129
1130     struct {
1131         unsigned int pad0;
1132     } desc7;
1133 };
1134
1135 struct gen7_surface_state
1136 {
1137     struct {
1138         unsigned int cube_pos_z:1;
1139         unsigned int cube_neg_z:1;
1140         unsigned int cube_pos_y:1;
1141         unsigned int cube_neg_y:1;
1142         unsigned int cube_pos_x:1;
1143         unsigned int cube_neg_x:1;
1144         unsigned int pad2:2;
1145         unsigned int render_cache_read_write:1;
1146         unsigned int pad1:1;
1147         unsigned int surface_array_spacing:1;
1148         unsigned int vert_line_stride_ofs:1;
1149         unsigned int vert_line_stride:1;
1150         unsigned int tile_walk:1;
1151         unsigned int tiled_surface:1;
1152         unsigned int horizontal_alignment:1;
1153         unsigned int vertical_alignment:2;
1154         unsigned int surface_format:9;     /**< BRW_SURFACEFORMAT_x */
1155         unsigned int pad0:1;
1156         unsigned int is_array:1;
1157         unsigned int surface_type:3;       /**< BRW_SURFACE_1D/2D/3D/CUBE */
1158     } ss0;
1159
1160     struct {
1161         unsigned int base_addr;
1162     } ss1;
1163
1164     struct {
1165         unsigned int width:14;
1166         unsigned int pad1:2;
1167         unsigned int height:14;
1168         unsigned int pad0:2;
1169     } ss2;
1170
1171     struct {
1172         unsigned int pitch:18;
1173         unsigned int pad:3;
1174         unsigned int depth:11;
1175     } ss3;
1176
1177     struct {
1178         unsigned int multisample_position_palette_index:3;
1179         unsigned int num_multisamples:3;
1180         unsigned int multisampled_surface_storage_format:1;
1181         unsigned int render_target_view_extent:11;
1182         unsigned int min_array_elt:11;
1183         unsigned int rotation:2;
1184         unsigned int pad0:1;
1185     } ss4;
1186
1187     struct {
1188         unsigned int mip_count:4;
1189         unsigned int min_lod:4;
1190         unsigned int pad1:12;
1191         unsigned int y_offset:4;
1192         unsigned int pad0:1;
1193         unsigned int x_offset:7;
1194     } ss5;
1195
1196     struct {
1197         unsigned int pad; /* Multisample Control Surface stuff */
1198     } ss6;
1199
1200     struct {
1201         unsigned int resource_min_lod:12;
1202         unsigned int pad0:16;
1203         unsigned int alpha_clear_color:1;
1204         unsigned int blue_clear_color:1;
1205         unsigned int green_clear_color:1;
1206         unsigned int red_clear_color:1;
1207     } ss7;
1208 };
1209
1210 struct gen7_sampler_state
1211 {
1212    struct
1213    {
1214       unsigned int aniso_algorithm:1;
1215       unsigned int lod_bias:13;
1216       unsigned int min_filter:3;
1217       unsigned int mag_filter:3;
1218       unsigned int mip_filter:2;
1219       unsigned int base_level:5;
1220       unsigned int pad1:1;
1221       unsigned int lod_preclamp:1;
1222       unsigned int default_color_mode:1;
1223       unsigned int pad0:1;
1224       unsigned int disable:1;
1225    } ss0;
1226
1227    struct
1228    {
1229       unsigned int cube_control_mode:1;
1230       unsigned int shadow_function:3;
1231       unsigned int pad:4;
1232       unsigned int max_lod:12;
1233       unsigned int min_lod:12;
1234    } ss1;
1235
1236    struct
1237    {
1238       unsigned int pad:5;
1239       unsigned int default_color_pointer:27;
1240    } ss2;
1241
1242    struct
1243    {
1244       unsigned int r_wrap_mode:3;
1245       unsigned int t_wrap_mode:3;
1246       unsigned int s_wrap_mode:3;
1247       unsigned int pad:1;
1248       unsigned int non_normalized_coord:1;
1249       unsigned int trilinear_quality:2;
1250       unsigned int address_round:6;
1251       unsigned int max_aniso:3;
1252       unsigned int chroma_key_mode:1;
1253       unsigned int chroma_key_index:2;
1254       unsigned int chroma_key_enable:1;
1255       unsigned int pad0:6;
1256    } ss3;
1257 };
1258
1259 struct gen7_surface_state2
1260 {
1261     struct {
1262         unsigned int surface_base_address;
1263     } ss0;
1264
1265     struct {
1266         unsigned int cbcr_pixel_offset_v_direction:2;
1267         unsigned int picture_structure:2;
1268         unsigned int width:14;
1269         unsigned int height:14;
1270     } ss1;
1271
1272     struct {
1273         unsigned int tile_walk:1;
1274         unsigned int tiled_surface:1;
1275         unsigned int half_pitch_for_chroma:1;
1276         unsigned int pitch:18;
1277         unsigned int pad0:1;
1278         unsigned int surface_object_control_data:4;
1279         unsigned int pad1:1;
1280         unsigned int interleave_chroma:1;
1281         unsigned int surface_format:4;
1282     } ss2;
1283
1284     struct {
1285         unsigned int y_offset_for_cb:15;
1286         unsigned int pad0:1;
1287         unsigned int x_offset_for_cb:14;
1288         unsigned int pad1:2;
1289     } ss3;
1290
1291     struct {
1292         unsigned int y_offset_for_cr:15;
1293         unsigned int pad0:1;
1294         unsigned int x_offset_for_cr:14;
1295         unsigned int pad1:2;
1296     } ss4;
1297
1298     struct {
1299         unsigned int pad0;
1300     } ss5;
1301
1302     struct {
1303         unsigned int pad0;
1304     } ss6;
1305
1306     struct {
1307         unsigned int pad0;
1308     } ss7;
1309 };
1310
1311 struct gen7_sampler_8x8
1312 {
1313     struct {
1314         unsigned int global_noise_estimation:8;
1315         unsigned int pad0:8;
1316         unsigned int chroma_key_index:2;
1317         unsigned int chroma_key_enable:1;
1318         unsigned int pad1:10;
1319         unsigned int ief_bypass:1;
1320         unsigned int pad2:1;
1321         unsigned int disable_8x8_filter:1;
1322     } dw0;
1323
1324     struct {
1325         unsigned int pad0:5;
1326         unsigned int sampler_8x8_state_pointer:27;
1327     } dw1;
1328     
1329     struct {
1330         unsigned int weak_edge_threshold:6;
1331         unsigned int pad0:2;
1332         unsigned int strong_edge_threshold:6;
1333         unsigned int pad1:2;
1334         unsigned int r5x_coefficient:5;
1335         unsigned int r5cx_coefficient:5;
1336         unsigned int r5c_coefficient:5;
1337         unsigned int pad2:1;
1338     } dw2;
1339
1340     struct {
1341         unsigned int r3x_coefficient:5;
1342         unsigned int pad0:1;
1343         unsigned int r3c_coefficient:5;
1344         unsigned int pad1:3;
1345         unsigned int gain_factor:6;
1346         unsigned int non_edge_weight:3;
1347         unsigned int pad2:1;
1348         unsigned int regular_weight:3;
1349         unsigned int pad3:1;
1350         unsigned int strong_edge_weight:3;
1351         unsigned int ief4_smooth_enable:1;
1352     } dw3;
1353 };
1354
1355 struct gen7_sampler_dndi
1356 {
1357     struct {
1358         unsigned int denoise_asd_threshold:8;
1359         unsigned int dnmh_delt:4;
1360         unsigned int vdi_walker_y_stride:2;
1361         unsigned int vdi_walker_frame_sharing_enable:1;
1362         unsigned int pad0:1;
1363         unsigned int denoise_maximum_history:8;
1364         unsigned int denoise_stad_threshold:8;
1365     } dw0;
1366
1367     struct {
1368         unsigned int denoise_threshold_for_sum_of_complexity_measure:8;
1369         unsigned int denoise_moving_pixel_threshold:5;
1370         unsigned int stmm_c2:3;
1371         unsigned int low_temporal_difference_threshold:6;
1372         unsigned int pad0:2;
1373         unsigned int temporal_difference_threshold:6;
1374         unsigned int pad1:2;
1375     } dw1;
1376
1377     struct {
1378         unsigned int block_noise_estimate_noise_threshold:8;
1379         unsigned int bne_edge_th:4;
1380         unsigned int pad0:2;
1381         unsigned int smooth_mv_th:2;
1382         unsigned int sad_tight_th:4;
1383         unsigned int cat_slope_minus1:4;
1384         unsigned int good_neighbor_th:6;
1385         unsigned int pad1:2;
1386    } dw2;
1387
1388     struct {
1389         unsigned int maximum_stmm:8;
1390         unsigned int multipler_for_vecm:6;
1391         unsigned int pad0:2;
1392         unsigned int blending_constant_across_time_for_small_values_of_stmm:8;
1393         unsigned int blending_constant_across_time_for_large_values_of_stmm:7;
1394         unsigned int stmm_blending_constant_select:1;
1395     } dw3;
1396
1397     struct {
1398         unsigned int sdi_delta:8;
1399         unsigned int sdi_threshold:8;
1400         unsigned int stmm_output_shift:4;
1401         unsigned int stmm_shift_up:2;
1402         unsigned int stmm_shift_down:2;
1403         unsigned int minimum_stmm:8;
1404     } dw4;
1405
1406     struct {
1407         unsigned int fmd_temporal_difference_threshold:8;
1408         unsigned int sdi_fallback_mode_2_constant:8;
1409         unsigned int sdi_fallback_mode_1_t2_constant:8;
1410         unsigned int sdi_fallback_mode_1_t1_constant:8;
1411     } dw5;
1412
1413     struct {
1414         unsigned int dn_enable:1;
1415         unsigned int di_enable:1;
1416         unsigned int di_partial:1;
1417         unsigned int dndi_top_first:1;
1418         unsigned int dndi_stream_id:1;
1419         unsigned int dndi_first_frame:1;
1420         unsigned int progressive_dn:1;
1421         unsigned int mcdi_enable:1;
1422         unsigned int fmd_tear_threshold:6;
1423         unsigned int cat_th1:2;
1424         unsigned int fmd2_vertical_difference_threshold:8;
1425         unsigned int fmd1_vertical_difference_threshold:8;
1426     } dw6;
1427
1428     struct {
1429         unsigned int sad_tha:4;
1430         unsigned int sad_thb:4;
1431         unsigned int fmd_for_1st_field_of_current_frame:2;
1432         unsigned int mc_pixel_consistency_th:6;
1433         unsigned int fmd_for_2nd_field_of_previous_frame:2;
1434         unsigned int vdi_walker_enable:1;
1435         unsigned int neighborpixel_th:4;
1436         unsigned int column_width_minus1:9;
1437     } dw7;
1438 };
1439
1440 #endif /* _I965_STRUCTS_H_ */