2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keithw@vmware.com>
41 unsigned vs_realloc
:1;
42 unsigned gs_realloc
:1;
43 unsigned clp_realloc
:1;
44 unsigned sf_realloc
:1;
45 unsigned vfe_realloc
:1;
46 unsigned cs_realloc
:1;
55 unsigned clp_fence
:10;
68 /* State structs for the various fixed function units:
75 unsigned grf_reg_count
:3;
77 unsigned kernel_start_pointer
:26; /* Offset from GENERAL_STATE_BASE */
82 unsigned ext_halt_exception_enable
:1;
83 unsigned sw_exception_enable
:1;
84 unsigned mask_stack_exception_enable
:1;
85 unsigned timeout_exception_enable
:1;
86 unsigned illegal_op_exception_enable
:1;
88 unsigned depth_coef_urb_read_offset
:6; /* WM only */
90 unsigned floating_point_mode
:1;
91 unsigned thread_priority
:1;
92 unsigned binding_table_entry_count
:8;
94 unsigned single_program_flow
:1;
99 unsigned per_thread_scratch_space
:4;
101 unsigned scratch_space_base_pointer
:22;
107 unsigned dispatch_grf_start_reg
:4;
108 unsigned urb_entry_read_offset
:6;
110 unsigned urb_entry_read_length
:6;
112 unsigned const_urb_entry_read_offset
:6;
114 unsigned const_urb_entry_read_length
:6;
120 struct brw_clip_unit_state
122 struct thread0 thread0
;
126 unsigned sw_exception_enable
:1;
128 unsigned mask_stack_exception_enable
:1;
130 unsigned illegal_op_exception_enable
:1;
132 unsigned floating_point_mode
:1;
133 unsigned thread_priority
:1;
134 unsigned binding_table_entry_count
:8;
136 unsigned single_program_flow
:1;
139 struct thread2 thread2
;
140 struct thread3 thread3
;
145 unsigned gs_output_stats
:1; /* not always */
146 unsigned stats_enable
:1;
147 unsigned nr_urb_entries
:7;
149 unsigned urb_entry_allocation_size
:5;
151 unsigned max_threads
:5; /* may be less */
158 unsigned clip_mode
:3;
159 unsigned userclip_enable_flags
:8;
160 unsigned userclip_must_clip
:1;
161 unsigned negative_w_clip_test
:1;
162 unsigned guard_band_enable
:1;
163 unsigned viewport_z_clip_enable
:1;
164 unsigned viewport_xy_clip_enable
:1;
165 unsigned vertex_position_space
:1;
173 unsigned clipper_viewport_state_ptr
:27;
183 struct gen6_blend_state
186 unsigned dest_blend_factor
:5;
187 unsigned source_blend_factor
:5;
189 unsigned blend_func
:3;
191 unsigned ia_dest_blend_factor
:5;
192 unsigned ia_source_blend_factor
:5;
194 unsigned ia_blend_func
:3;
196 unsigned ia_blend_enable
:1;
197 unsigned blend_enable
:1;
201 unsigned post_blend_clamp_enable
:1;
202 unsigned pre_blend_clamp_enable
:1;
203 unsigned clamp_range
:2;
205 unsigned x_dither_offset
:2;
206 unsigned y_dither_offset
:2;
207 unsigned dither_enable
:1;
208 unsigned alpha_test_func
:3;
209 unsigned alpha_test_enable
:1;
211 unsigned logic_op_func
:4;
212 unsigned logic_op_enable
:1;
214 unsigned write_disable_b
:1;
215 unsigned write_disable_g
:1;
216 unsigned write_disable_r
:1;
217 unsigned write_disable_a
:1;
219 unsigned alpha_to_coverage_dither
:1;
220 unsigned alpha_to_one
:1;
221 unsigned alpha_to_coverage
:1;
225 struct gen6_color_calc_state
228 unsigned alpha_test_format
:1;
230 unsigned round_disable
:1;
231 unsigned bf_stencil_ref
:8;
232 unsigned stencil_ref
:8;
249 struct gen6_depth_stencil_state
253 unsigned bf_stencil_pass_depth_pass_op
:3;
254 unsigned bf_stencil_pass_depth_fail_op
:3;
255 unsigned bf_stencil_fail_op
:3;
256 unsigned bf_stencil_func
:3;
257 unsigned bf_stencil_enable
:1;
259 unsigned stencil_write_enable
:1;
260 unsigned stencil_pass_depth_pass_op
:3;
261 unsigned stencil_pass_depth_fail_op
:3;
262 unsigned stencil_fail_op
:3;
263 unsigned stencil_func
:3;
264 unsigned stencil_enable
:1;
268 unsigned bf_stencil_write_mask
:8;
269 unsigned bf_stencil_test_mask
:8;
270 unsigned stencil_write_mask
:8;
271 unsigned stencil_test_mask
:8;
276 unsigned depth_write_enable
:1;
277 unsigned depth_test_func
:3;
279 unsigned depth_test_enable
:1;
283 struct brw_cc_unit_state
288 unsigned bf_stencil_pass_depth_pass_op
:3;
289 unsigned bf_stencil_pass_depth_fail_op
:3;
290 unsigned bf_stencil_fail_op
:3;
291 unsigned bf_stencil_func
:3;
292 unsigned bf_stencil_enable
:1;
294 unsigned stencil_write_enable
:1;
295 unsigned stencil_pass_depth_pass_op
:3;
296 unsigned stencil_pass_depth_fail_op
:3;
297 unsigned stencil_fail_op
:3;
298 unsigned stencil_func
:3;
299 unsigned stencil_enable
:1;
305 unsigned bf_stencil_ref
:8;
306 unsigned stencil_write_mask
:8;
307 unsigned stencil_test_mask
:8;
308 unsigned stencil_ref
:8;
314 unsigned logicop_enable
:1;
316 unsigned depth_write_enable
:1;
317 unsigned depth_test_function
:3;
318 unsigned depth_test
:1;
319 unsigned bf_stencil_write_mask
:8;
320 unsigned bf_stencil_test_mask
:8;
327 unsigned alpha_test_func
:3;
328 unsigned alpha_test
:1;
329 unsigned blend_enable
:1;
330 unsigned ia_blend_enable
:1;
332 unsigned alpha_test_format
:1;
339 unsigned cc_viewport_state_offset
:27; /* Offset from GENERAL_STATE_BASE */
345 unsigned ia_dest_blend_factor
:5;
346 unsigned ia_src_blend_factor
:5;
347 unsigned ia_blend_function
:3;
348 unsigned statistics_enable
:1;
349 unsigned logicop_func
:4;
351 unsigned dither_enable
:1;
356 unsigned clamp_post_alpha_blend
:1;
357 unsigned clamp_pre_alpha_blend
:1;
358 unsigned clamp_range
:2;
360 unsigned y_dither_offset
:2;
361 unsigned x_dither_offset
:2;
362 unsigned dest_blend_factor
:5;
363 unsigned src_blend_factor
:5;
364 unsigned blend_function
:3;
375 struct brw_sf_unit_state
377 struct thread0 thread0
;
378 struct thread1 thread1
;
379 struct thread2 thread2
;
380 struct thread3 thread3
;
385 unsigned stats_enable
:1;
386 unsigned nr_urb_entries
:7;
388 unsigned urb_entry_allocation_size
:5;
390 unsigned max_threads
:6;
396 unsigned front_winding
:1;
397 unsigned viewport_transform
:1;
399 unsigned sf_viewport_state_offset
:27; /* Offset from GENERAL_STATE_BASE */
405 unsigned dest_org_vbias
:4;
406 unsigned dest_org_hbias
:4;
408 unsigned disable_2x2_trifilter
:1;
409 unsigned disable_zero_pix_trifilter
:1;
410 unsigned point_rast_rule
:2;
411 unsigned line_endcap_aa_region_width
:2;
412 unsigned line_width
:4;
413 unsigned fast_scissor_disable
:1;
414 unsigned cull_mode
:2;
415 unsigned aa_enable
:1;
420 unsigned point_size
:11;
421 unsigned use_point_size_state
:1;
422 unsigned subpixel_precision
:1;
423 unsigned sprite_point
:1;
425 unsigned aa_line_distance_mode
:1;
426 unsigned trifan_pv
:2;
427 unsigned linestrip_pv
:2;
428 unsigned tristrip_pv
:2;
429 unsigned line_last_pixel_enable
:1;
434 struct gen6_scissor_rect
442 struct brw_gs_unit_state
444 struct thread0 thread0
;
445 struct thread1 thread1
;
446 struct thread2 thread2
;
447 struct thread3 thread3
;
452 unsigned rendering_enable
:1; /* for Ironlake */
454 unsigned stats_enable
:1;
455 unsigned nr_urb_entries
:7;
457 unsigned urb_entry_allocation_size
:5;
459 unsigned max_threads
:5;
465 unsigned sampler_count
:3;
467 unsigned sampler_state_pointer
:27;
473 unsigned max_vp_index
:4;
475 unsigned svbi_post_inc_value
:10;
477 unsigned svbi_post_inc_enable
:1;
478 unsigned svbi_payload
:1;
479 unsigned discard_adjaceny
:1;
480 unsigned reorder_enable
:1;
486 struct brw_vs_unit_state
488 struct thread0 thread0
;
489 struct thread1 thread1
;
490 struct thread2 thread2
;
491 struct thread3 thread3
;
496 unsigned stats_enable
:1;
497 unsigned nr_urb_entries
:7;
499 unsigned urb_entry_allocation_size
:5;
501 unsigned max_threads
:6;
507 unsigned sampler_count
:3;
509 unsigned sampler_state_pointer
:27;
514 unsigned vs_enable
:1;
515 unsigned vert_cache_disable
:1;
521 struct brw_wm_unit_state
523 struct thread0 thread0
;
524 struct thread1 thread1
;
525 struct thread2 thread2
;
526 struct thread3 thread3
;
529 unsigned stats_enable
:1;
530 unsigned depth_buffer_clear
:1;
531 unsigned sampler_count
:3;
532 unsigned sampler_state_pointer
:27;
537 unsigned enable_8_pix
:1;
538 unsigned enable_16_pix
:1;
539 unsigned enable_32_pix
:1;
540 unsigned enable_con_32_pix
:1;
541 unsigned enable_con_64_pix
:1;
544 /* These next four bits are for Ironlake+ */
545 unsigned fast_span_coverage_enable
:1;
546 unsigned depth_buffer_clear
:1;
547 unsigned depth_buffer_resolve_enable
:1;
548 unsigned hierarchical_depth_buffer_resolve_enable
:1;
550 unsigned legacy_global_depth_bias
:1;
551 unsigned line_stipple
:1;
552 unsigned depth_offset
:1;
553 unsigned polygon_stipple
:1;
554 unsigned line_aa_region_width
:2;
555 unsigned line_endcap_aa_region_width
:2;
556 unsigned early_depth_test
:1;
557 unsigned thread_dispatch_enable
:1;
558 unsigned program_uses_depth
:1;
559 unsigned program_computes_depth
:1;
560 unsigned program_uses_killpixel
:1;
561 unsigned legacy_line_rast
: 1;
562 unsigned transposed_urb_read_enable
:1;
563 unsigned max_threads
:7;
566 float global_depth_offset_constant
;
567 float global_depth_offset_scale
;
569 /* for Ironlake only */
572 unsigned grf_reg_count_1
:3;
574 unsigned kernel_start_pointer_1
:26;
579 unsigned grf_reg_count_2
:3;
581 unsigned kernel_start_pointer_2
:26;
586 unsigned grf_reg_count_3
:3;
588 unsigned kernel_start_pointer_3
:26;
592 struct brw_sampler_default_color
{
596 struct gen5_sampler_default_color
{
605 struct brw_sampler_state
610 unsigned shadow_function
:3;
611 unsigned lod_bias
:11;
612 unsigned min_filter
:3;
613 unsigned mag_filter
:3;
614 unsigned mip_filter
:2;
615 unsigned base_level
:5;
616 unsigned min_mag_neq
:1;
617 unsigned lod_preclamp
:1;
618 unsigned default_color_mode
:1;
625 unsigned r_wrap_mode
:3;
626 unsigned t_wrap_mode
:3;
627 unsigned s_wrap_mode
:3;
628 unsigned cube_control_mode
:1;
638 unsigned default_color_pointer
:27;
643 unsigned non_normalized_coord
:1;
645 unsigned address_round
:6;
646 unsigned max_aniso
:3;
647 unsigned chroma_key_mode
:1;
648 unsigned chroma_key_index
:2;
649 unsigned chroma_key_enable
:1;
650 unsigned monochrome_filter_width
:3;
651 unsigned monochrome_filter_height
:3;
655 struct gen7_sampler_state
659 unsigned aniso_algorithm
:1;
660 unsigned lod_bias
:13;
661 unsigned min_filter
:3;
662 unsigned mag_filter
:3;
663 unsigned mip_filter
:2;
664 unsigned base_level
:5;
666 unsigned lod_preclamp
:1;
667 unsigned default_color_mode
:1;
674 unsigned cube_control_mode
:1;
675 unsigned shadow_function
:3;
684 unsigned default_color_pointer
:27;
689 unsigned r_wrap_mode
:3;
690 unsigned t_wrap_mode
:3;
691 unsigned s_wrap_mode
:3;
693 unsigned non_normalized_coord
:1;
694 unsigned trilinear_quality
:2;
695 unsigned address_round
:6;
696 unsigned max_aniso
:3;
697 unsigned chroma_key_mode
:1;
698 unsigned chroma_key_index
:2;
699 unsigned chroma_key_enable
:1;
704 struct brw_clipper_viewport
712 struct brw_cc_viewport
718 struct brw_sf_viewport
729 /* scissor coordinates are inclusive */
738 struct gen6_sf_viewport
{
747 struct gen7_sf_clip_viewport
{
769 struct brw_urb_immediate
{
772 unsigned swizzle_control
:2;
777 unsigned response_length
:4;
778 unsigned msg_length
:4;
779 unsigned msg_target
:4;
781 unsigned end_of_thread
:1;
784 /* Instruction format for the execution units:
787 struct brw_instruction
793 unsigned access_mode
:1;
794 unsigned mask_control
:1;
795 unsigned dependency_control
:2;
796 unsigned compression_control
:2; /* gen6: quarter control */
797 unsigned thread_control
:2;
798 unsigned predicate_control
:4;
799 unsigned predicate_inverse
:1;
800 unsigned execution_size
:3;
802 * Conditional Modifier for most instructions. On Gen6+, this is also
803 * used for the SEND instruction's Message Target/SFID.
805 unsigned destreg__conditionalmod
:4;
806 unsigned acc_wr_control
:1;
807 unsigned cmpt_control
:1;
808 unsigned debug_control
:1;
815 unsigned dest_reg_file
:2;
816 unsigned dest_reg_type
:3;
817 unsigned src0_reg_file
:2;
818 unsigned src0_reg_type
:3;
819 unsigned src1_reg_file
:2;
820 unsigned src1_reg_type
:3;
821 unsigned nibctrl
:1; /* gen7+ */
822 unsigned dest_subreg_nr
:5;
823 unsigned dest_reg_nr
:8;
824 unsigned dest_horiz_stride
:2;
825 unsigned dest_address_mode
:1;
830 unsigned dest_reg_file
:2;
831 unsigned dest_reg_type
:3;
832 unsigned src0_reg_file
:2;
833 unsigned src0_reg_type
:3;
834 unsigned src1_reg_file
:2; /* 0x00000c00 */
835 unsigned src1_reg_type
:3; /* 0x00007000 */
836 unsigned nibctrl
:1; /* gen7+ */
837 int dest_indirect_offset
:10; /* offset against the deref'd address reg */
838 unsigned dest_subreg_nr
:3; /* subnr for the address reg a0.x */
839 unsigned dest_horiz_stride
:2;
840 unsigned dest_address_mode
:1;
845 unsigned dest_reg_file
:2;
846 unsigned dest_reg_type
:3;
847 unsigned src0_reg_file
:2;
848 unsigned src0_reg_type
:3;
849 unsigned src1_reg_file
:2;
850 unsigned src1_reg_type
:3;
851 unsigned nibctrl
:1; /* gen7+ */
852 unsigned dest_writemask
:4;
853 unsigned dest_subreg_nr
:1;
854 unsigned dest_reg_nr
:8;
855 unsigned dest_horiz_stride
:2;
856 unsigned dest_address_mode
:1;
861 unsigned dest_reg_file
:2;
862 unsigned dest_reg_type
:3;
863 unsigned src0_reg_file
:2;
864 unsigned src0_reg_type
:3;
865 unsigned src1_reg_file
:2;
866 unsigned src1_reg_type
:3;
867 unsigned nibctrl
:1; /* gen7+ */
868 unsigned dest_writemask
:4;
869 int dest_indirect_offset
:6;
870 unsigned dest_subreg_nr
:3;
871 unsigned dest_horiz_stride
:2;
872 unsigned dest_address_mode
:1;
876 unsigned dest_reg_file
:2;
877 unsigned dest_reg_type
:3;
878 unsigned src0_reg_file
:2;
879 unsigned src0_reg_type
:3;
880 unsigned src1_reg_file
:2;
881 unsigned src1_reg_type
:3;
888 unsigned dest_reg_file
:1; /* gen6, not gen7+ */
889 unsigned flag_subreg_num
:1;
890 unsigned flag_reg_nr
:1; /* gen7+ */
893 unsigned src0_negate
:1;
895 unsigned src1_negate
:1;
897 unsigned src2_negate
:1;
898 unsigned src_type
:2; /* gen7+ */
899 unsigned dst_type
:2; /* gen7+ */
901 unsigned nibctrl
:1; /* gen7+ */
903 unsigned dest_writemask
:4;
904 unsigned dest_subreg_nr
:3;
905 unsigned dest_reg_nr
:8;
915 unsigned src0_subreg_nr
:5;
916 unsigned src0_reg_nr
:8;
918 unsigned src0_negate
:1;
919 unsigned src0_address_mode
:1;
920 unsigned src0_horiz_stride
:2;
921 unsigned src0_width
:3;
922 unsigned src0_vert_stride
:4;
923 unsigned flag_subreg_nr
:1;
924 unsigned flag_reg_nr
:1; /* gen7+ */
930 int src0_indirect_offset
:10;
931 unsigned src0_subreg_nr
:3;
933 unsigned src0_negate
:1;
934 unsigned src0_address_mode
:1;
935 unsigned src0_horiz_stride
:2;
936 unsigned src0_width
:3;
937 unsigned src0_vert_stride
:4;
938 unsigned flag_subreg_nr
:1;
939 unsigned flag_reg_nr
:1; /* gen7+ */
945 unsigned src0_swz_x
:2;
946 unsigned src0_swz_y
:2;
947 unsigned src0_subreg_nr
:1;
948 unsigned src0_reg_nr
:8;
950 unsigned src0_negate
:1;
951 unsigned src0_address_mode
:1;
952 unsigned src0_swz_z
:2;
953 unsigned src0_swz_w
:2;
955 unsigned src0_vert_stride
:4;
956 unsigned flag_subreg_nr
:1;
957 unsigned flag_reg_nr
:1; /* gen7+ */
963 unsigned src0_swz_x
:2;
964 unsigned src0_swz_y
:2;
965 int src0_indirect_offset
:6;
966 unsigned src0_subreg_nr
:3;
968 unsigned src0_negate
:1;
969 unsigned src0_address_mode
:1;
970 unsigned src0_swz_z
:2;
971 unsigned src0_swz_w
:2;
973 unsigned src0_vert_stride
:4;
974 unsigned flag_subreg_nr
:1;
975 unsigned flag_reg_nr
:1; /* gen7+ */
979 /* Extended Message Descriptor for Ironlake (Gen5) SEND instruction.
981 * Does not apply to Gen6+. The SFID/message target moved to bits
982 * 27:24 of the header (destreg__conditionalmod); EOT is in bits3.
987 unsigned end_of_thread
:1;
990 } send_gen5
; /* for Ironlake only */
993 unsigned src0_rep_ctrl
:1;
994 unsigned src0_swizzle
:8;
995 unsigned src0_subreg_nr
:3;
996 unsigned src0_reg_nr
:8;
998 unsigned src1_rep_ctrl
:1;
999 unsigned src1_swizzle
:8;
1000 unsigned src1_subreg_nr_low
:2;
1010 unsigned src1_subreg_nr
:5;
1011 unsigned src1_reg_nr
:8;
1012 unsigned src1_abs
:1;
1013 unsigned src1_negate
:1;
1014 unsigned src1_address_mode
:1;
1015 unsigned src1_horiz_stride
:2;
1016 unsigned src1_width
:3;
1017 unsigned src1_vert_stride
:4;
1023 unsigned src1_swz_x
:2;
1024 unsigned src1_swz_y
:2;
1025 unsigned src1_subreg_nr
:1;
1026 unsigned src1_reg_nr
:8;
1027 unsigned src1_abs
:1;
1028 unsigned src1_negate
:1;
1029 unsigned src1_address_mode
:1;
1030 unsigned src1_swz_z
:2;
1031 unsigned src1_swz_w
:2;
1033 unsigned src1_vert_stride
:4;
1039 int src1_indirect_offset
:10;
1040 unsigned src1_subreg_nr
:3;
1041 unsigned src1_abs
:1;
1042 unsigned src1_negate
:1;
1043 unsigned src1_address_mode
:1;
1044 unsigned src1_horiz_stride
:2;
1045 unsigned src1_width
:3;
1046 unsigned src1_vert_stride
:4;
1052 unsigned src1_swz_x
:2;
1053 unsigned src1_swz_y
:2;
1054 int src1_indirect_offset
:6;
1055 unsigned src1_subreg_nr
:3;
1056 unsigned src1_abs
:1;
1057 unsigned src1_negate
:1;
1059 unsigned src1_swz_z
:2;
1060 unsigned src1_swz_w
:2;
1062 unsigned src1_vert_stride
:4;
1069 int jump_count
:16; /* note: signed */
1070 unsigned pop_count
:4;
1074 /* This is also used for gen7 IF/ELSE instructions */
1077 /* Signed jump distance to the ip to jump to if all channels
1078 * are disabled after the break or continue. It should point
1079 * to the end of the innermost control flow block, as that's
1080 * where some channel could get re-enabled.
1084 /* Signed jump distance to the location to resume execution
1085 * of this channel if it's enabled for the break or continue.
1091 * \defgroup SEND instructions / Message Descriptors
1097 * Generic Message Descriptor for Gen4 SEND instructions. The structs
1098 * below expand function_control to something specific for their
1099 * message. Due to struct packing issues, they duplicate these bits.
1101 * See the G45 PRM, Volume 4, Table 14-15.
1104 unsigned function_control
:16;
1105 unsigned response_length
:4;
1106 unsigned msg_length
:4;
1107 unsigned msg_target
:4;
1109 unsigned end_of_thread
:1;
1113 * Generic Message Descriptor for Gen5-7 SEND instructions.
1115 * See the Sandybridge PRM, Volume 2 Part 2, Table 8-15. (Sadly, most
1116 * of the information on the SEND instruction is missing from the public
1119 * The table claims that bit 31 is reserved/MBZ on Gen6+, but it lies.
1120 * According to the SEND instruction description:
1121 * "The MSb of the message description, the EOT field, always comes from
1122 * bit 127 of the instruction word"...which is bit 31 of this field.
1125 unsigned function_control
:19;
1126 unsigned header_present
:1;
1127 unsigned response_length
:5;
1128 unsigned msg_length
:4;
1130 unsigned end_of_thread
:1;
1133 /** G45 PRM, Volume 4, Section 6.1.1.1 */
1135 unsigned function
:4;
1136 unsigned int_type
:1;
1137 unsigned precision
:1;
1138 unsigned saturate
:1;
1139 unsigned data_type
:1;
1141 unsigned response_length
:4;
1142 unsigned msg_length
:4;
1143 unsigned msg_target
:4;
1145 unsigned end_of_thread
:1;
1148 /** Ironlake PRM, Volume 4 Part 1, Section 6.1.1.1 */
1150 unsigned function
:4;
1151 unsigned int_type
:1;
1152 unsigned precision
:1;
1153 unsigned saturate
:1;
1154 unsigned data_type
:1;
1155 unsigned snapshot
:1;
1157 unsigned header_present
:1;
1158 unsigned response_length
:5;
1159 unsigned msg_length
:4;
1161 unsigned end_of_thread
:1;
1164 /** G45 PRM, Volume 4, Section 4.8.1.1.1 [DevBW] and [DevCL] */
1166 unsigned binding_table_index
:8;
1168 unsigned return_format
:2;
1169 unsigned msg_type
:2;
1170 unsigned response_length
:4;
1171 unsigned msg_length
:4;
1172 unsigned msg_target
:4;
1174 unsigned end_of_thread
:1;
1177 /** G45 PRM, Volume 4, Section 4.8.1.1.2 [DevCTG] */
1179 unsigned binding_table_index
:8;
1181 unsigned msg_type
:4;
1182 unsigned response_length
:4;
1183 unsigned msg_length
:4;
1184 unsigned msg_target
:4;
1186 unsigned end_of_thread
:1;
1189 /** Ironlake PRM, Volume 4 Part 1, Section 4.11.1.1.3 */
1191 unsigned binding_table_index
:8;
1193 unsigned msg_type
:4;
1194 unsigned simd_mode
:2;
1196 unsigned header_present
:1;
1197 unsigned response_length
:5;
1198 unsigned msg_length
:4;
1200 unsigned end_of_thread
:1;
1204 unsigned binding_table_index
:8;
1206 unsigned msg_type
:5;
1207 unsigned simd_mode
:2;
1208 unsigned header_present
:1;
1209 unsigned response_length
:5;
1210 unsigned msg_length
:4;
1212 unsigned end_of_thread
:1;
1215 struct brw_urb_immediate urb
;
1220 unsigned swizzle_control
:2;
1222 unsigned allocate
:1;
1224 unsigned complete
:1;
1226 unsigned header_present
:1;
1227 unsigned response_length
:5;
1228 unsigned msg_length
:4;
1230 unsigned end_of_thread
:1;
1236 unsigned swizzle_control
:1;
1237 unsigned complete
:1;
1238 unsigned per_slot_offset
:1;
1240 unsigned header_present
:1;
1241 unsigned response_length
:5;
1242 unsigned msg_length
:4;
1244 unsigned end_of_thread
:1;
1247 /** 965 PRM, Volume 4, Section 5.10.1.1: Message Descriptor */
1249 unsigned binding_table_index
:8;
1250 unsigned msg_control
:4;
1251 unsigned msg_type
:2;
1252 unsigned target_cache
:2;
1253 unsigned response_length
:4;
1254 unsigned msg_length
:4;
1255 unsigned msg_target
:4;
1257 unsigned end_of_thread
:1;
1260 /** G45 PRM, Volume 4, Section 5.10.1.1.2 */
1262 unsigned binding_table_index
:8;
1263 unsigned msg_control
:3;
1264 unsigned msg_type
:3;
1265 unsigned target_cache
:2;
1266 unsigned response_length
:4;
1267 unsigned msg_length
:4;
1268 unsigned msg_target
:4;
1270 unsigned end_of_thread
:1;
1273 /** Ironlake PRM, Volume 4 Part 1, Section 5.10.2.1.2. */
1275 unsigned binding_table_index
:8;
1276 unsigned msg_control
:3;
1277 unsigned msg_type
:3;
1278 unsigned target_cache
:2;
1280 unsigned header_present
:1;
1281 unsigned response_length
:5;
1282 unsigned msg_length
:4;
1284 unsigned end_of_thread
:1;
1287 /** G45 PRM, Volume 4, Section 5.10.1.1.2. For both Gen4 and G45. */
1289 unsigned binding_table_index
:8;
1290 unsigned msg_control
:3;
1291 unsigned last_render_target
:1;
1292 unsigned msg_type
:3;
1293 unsigned send_commit_msg
:1;
1294 unsigned response_length
:4;
1295 unsigned msg_length
:4;
1296 unsigned msg_target
:4;
1298 unsigned end_of_thread
:1;
1301 /** Ironlake PRM, Volume 4 Part 1, Section 5.10.2.1.2. */
1303 unsigned binding_table_index
:8;
1304 unsigned msg_control
:3;
1305 unsigned last_render_target
:1;
1306 unsigned msg_type
:3;
1307 unsigned send_commit_msg
:1;
1309 unsigned header_present
:1;
1310 unsigned response_length
:5;
1311 unsigned msg_length
:4;
1313 unsigned end_of_thread
:1;
1317 * Message for the Sandybridge Sampler Cache or Constant Cache Data Port.
1319 * See the Sandybridge PRM, Volume 4 Part 1, Section 3.9.2.1.1.
1322 unsigned binding_table_index
:8;
1323 unsigned msg_control
:5;
1324 unsigned msg_type
:3;
1326 unsigned header_present
:1;
1327 unsigned response_length
:5;
1328 unsigned msg_length
:4;
1330 unsigned end_of_thread
:1;
1331 } gen6_dp_sampler_const_cache
;
1334 * Message for the Sandybridge Render Cache Data Port.
1336 * Most fields are defined in the Sandybridge PRM, Volume 4 Part 1,
1337 * Section 3.9.2.1.1: Message Descriptor.
1339 * "Slot Group Select" and "Last Render Target" are part of the
1340 * 5-bit message control for Render Target Write messages. See
1341 * Section 3.9.9.2.1 of the same volume.
1344 unsigned binding_table_index
:8;
1345 unsigned msg_control
:3;
1346 unsigned slot_group_select
:1;
1347 unsigned last_render_target
:1;
1348 unsigned msg_type
:4;
1349 unsigned send_commit_msg
:1;
1351 unsigned header_present
:1;
1352 unsigned response_length
:5;
1353 unsigned msg_length
:4;
1355 unsigned end_of_thread
:1;
1359 * Message for any of the Gen7 Data Port caches.
1361 * Most fields are defined in the Ivybridge PRM, Volume 4 Part 1,
1362 * section 3.9.2.1.1 "Message Descriptor". Once again, "Slot Group
1363 * Select" and "Last Render Target" are part of the 6-bit message
1364 * control for Render Target Writes (section 3.9.11.2).
1367 unsigned binding_table_index
:8;
1368 unsigned msg_control
:3;
1369 unsigned slot_group_select
:1;
1370 unsigned last_render_target
:1;
1371 unsigned msg_control_pad
:1;
1372 unsigned msg_type
:4;
1374 unsigned header_present
:1;
1375 unsigned response_length
:5;
1376 unsigned msg_length
:4;
1378 unsigned end_of_thread
:1;
1382 * Message for the Gen7 Pixel Interpolator.
1384 * Defined in the Ivybridge PRM, Volume 4 Part 2,
1390 GLuint slot_group
:1;
1392 GLuint interpolation_mode
:1;
1396 GLuint response_length
:5;
1397 GLuint msg_length
:4;
1399 GLuint end_of_thread
:1;
1404 unsigned src1_subreg_nr_high
:1;
1405 unsigned src1_reg_nr
:8;
1407 unsigned src2_rep_ctrl
:1;
1408 unsigned src2_swizzle
:8;
1409 unsigned src2_subreg_nr
:3;
1410 unsigned src2_reg_nr
:8;
1420 struct brw_compact_instruction
{
1422 unsigned opcode
:7; /* 0- 6 */
1423 unsigned debug_control
:1; /* 7- 7 */
1424 unsigned control_index
:5; /* 8-12 */
1425 unsigned data_type_index
:5; /* 13-17 */
1426 unsigned sub_reg_index
:5; /* 18-22 */
1427 unsigned acc_wr_control
:1; /* 23-23 */
1428 unsigned conditionalmod
:4; /* 24-27 */
1429 unsigned flag_subreg_nr
:1; /* 28-28 */
1430 unsigned cmpt_ctrl
:1; /* 29-29 */
1431 unsigned src0_index
:2; /* 30-31 */
1435 unsigned src0_index
:3; /* 32-24 */
1436 unsigned src1_index
:5; /* 35-39 */
1437 unsigned dst_reg_nr
:8; /* 40-47 */
1438 unsigned src0_reg_nr
:8; /* 48-55 */
1439 unsigned src1_reg_nr
:8; /* 56-63 */