1 #ifndef GEN6_RENDER_H
2 #define GEN6_RENDER_H
3 
4 #include <stdint.h>
5 #include "surfaceformat.h"
6 #include "gen4_render.h"
7 
8 /* GEN6_STATE_BASE_ADDRESS */
9 # define BUFFER_SIZE_MODIFY			       (1 << 0)
10 
11 #define GEN6_3DSTATE_VF_STATISTICS		GEN4_3D(1, 0, 0xB)
12 
13 #define GEN6_MEDIA_STATE_POINTERS		GEN4_3D(2, 0, 0)
14 #define GEN6_MEDIA_OBJECT			GEN4_3D(2, 1, 0)
15 
16 /* GEN6_3DSTATE_BINDING_TABLE_POINTERS */
17 # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_PS	       (1 << 12)/* for GEN6 */
18 # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_GS	       (1 << 9) /* for GEN6 */
19 # define GEN6_3DSTATE_BINDING_TABLE_MODIFY_VS	       (1 << 8) /* for GEN6 */
20 
21 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS	GEN4_3D(3, 0, 0x02)
22 # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_PS	       (1 << 12)
23 # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_GS	       (1 << 9)
24 # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_VS	       (1 << 8)
25 
26 #define GEN6_3DSTATE_URB			GEN4_3D(3, 0, 0x05)
27 /* DW1 */
28 # define GEN6_3DSTATE_URB_VS_SIZE_SHIFT			16
29 # define GEN6_3DSTATE_URB_VS_ENTRIES_SHIFT		0
30 /* DW2 */
31 # define GEN6_3DSTATE_URB_GS_ENTRIES_SHIFT		8
32 # define GEN6_3DSTATE_URB_GS_SIZE_SHIFT			0
33 
34 #define GEN6_3DSTATE_VERTEX_ELEMENTS		GEN4_3D(3, 0, 0x09)
35 #define GEN6_3DSTATE_INDEX_BUFFER		GEN4_3D(3, 0, 0x0A)
36 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS	GEN4_3D(3, 0, 0x0D)
37 # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CC	       (1 << 12)
38 # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_SF	       (1 << 11)
39 # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CLIP       (1 << 10)
40 
41 #define GEN6_3DSTATE_CC_STATE_POINTERS		GEN4_3D(3, 0, 0x0E)
42 
43 #define GEN6_3DSTATE_VS				GEN4_3D(3, 0, 0x10)
44 
45 #define GEN6_3DSTATE_GS				GEN4_3D(3, 0, 0x11)
46 /* DW4 */
47 # define GEN6_3DSTATE_GS_DISPATCH_START_GRF_SHIFT	0
48 
49 #define GEN6_3DSTATE_CLIP			GEN4_3D(3, 0, 0x12)
50 
51 #define GEN6_3DSTATE_SF				GEN4_3D(3, 0, 0x13)
52 /* DW1 */
53 # define GEN6_3DSTATE_SF_NUM_OUTPUTS_SHIFT			22
54 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_LENGTH_SHIFT		11
55 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_OFFSET_SHIFT		4
56 /* DW2 */
57 /* DW3 */
58 # define GEN6_3DSTATE_SF_CULL_BOTH				(0 << 29)
59 # define GEN6_3DSTATE_SF_CULL_NONE				(1 << 29)
60 # define GEN6_3DSTATE_SF_CULL_FRONT				(2 << 29)
61 # define GEN6_3DSTATE_SF_CULL_BACK				(3 << 29)
62 /* DW4 */
63 # define GEN6_3DSTATE_SF_TRI_PROVOKE_SHIFT			29
64 # define GEN6_3DSTATE_SF_LINE_PROVOKE_SHIFT			27
65 # define GEN6_3DSTATE_SF_TRIFAN_PROVOKE_SHIFT			25
66 # define GEN6_3DSTATE_SF_VERTEX_SUB_PIXEL_PRECISION_SHIFT	12
67 
68 #define GEN6_3DSTATE_WM				GEN4_3D(3, 0, 0x14)
69 /* DW2 */
70 # define GEN6_3DSTATE_WM_SAMPLER_COUNT_SHIFT			27
71 # define GEN6_3DSTATE_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT	18
72 /* DW4 */
73 # define GEN6_3DSTATE_WM_DISPATCH_START_GRF_0_SHIFT		16
74 /* DW5 */
75 # define GEN6_3DSTATE_WM_MAX_THREADS_SHIFT			25
76 # define GEN6_3DSTATE_WM_DISPATCH_ENABLE			(1 << 19)
77 # define GEN6_3DSTATE_WM_16_DISPATCH_ENABLE			(1 << 1)
78 # define GEN6_3DSTATE_WM_8_DISPATCH_ENABLE			(1 << 0)
79 /* DW6 */
80 # define GEN6_3DSTATE_WM_NUM_SF_OUTPUTS_SHIFT			20
81 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC	(1 << 15)
82 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC	(1 << 14)
83 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC	(1 << 13)
84 # define GEN6_3DSTATE_WM_PERSPECTIVE_SAMPLE_BARYCENTRIC		(1 << 12)
85 # define GEN6_3DSTATE_WM_PERSPECTIVE_CENTROID_BARYCENTRIC	(1 << 11)
86 # define GEN6_3DSTATE_WM_PERSPECTIVE_PIXEL_BARYCENTRIC		(1 << 10)
87 
88 #define GEN6_3DSTATE_CONSTANT_VS		GEN4_3D(3, 0, 0x15)
89 #define GEN6_3DSTATE_CONSTANT_GS		GEN4_3D(3, 0, 0x16)
90 #define GEN6_3DSTATE_CONSTANT_PS		GEN4_3D(3, 0, 0x17)
91 
92 #define GEN6_3DSTATE_SAMPLE_MASK		GEN4_3D(3, 0, 0x18)
93 
94 #define GEN6_3DSTATE_CONSTANT_COLOR		GEN4_3D(3, 1, 0x01)
95 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD	GEN4_3D(3, 1, 0x02)
96 #define GEN6_3DSTATE_CHROMA_KEY			GEN4_3D(3, 1, 0x04)
97 
98 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET	GEN4_3D(3, 1, 0x06)
99 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN	GEN4_3D(3, 1, 0x07)
100 #define GEN6_3DSTATE_LINE_STIPPLE		GEN4_3D(3, 1, 0x08)
101 #define GEN6_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP	GEN4_3D(3, 1, 0x09)
102 /* These two are BLC and CTG only, not BW or CL */
103 #define GEN6_3DSTATE_AA_LINE_PARAMS		GEN4_3D(3, 1, 0x0A)
104 #define GEN6_3DSTATE_GS_SVB_INDEX		GEN4_3D(3, 1, 0x0B)
105 #define GEN6_3DSTATE_MULTISAMPLE		GEN4_3D(3, 1, 0x0D)
106 /* DW1 */
107 # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_CENTER		(0 << 4)
108 # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_UPPER_LEFT	(1 << 4)
109 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_1			(0 << 1)
110 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_4			(2 << 1)
111 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_8			(3 << 1)
112 
113 /* DW1 */
114 # define GEN6_PIPE_CONTROL_NOWRITE		       (0 << 14)
115 # define GEN6_PIPE_CONTROL_WRITE_QWORD		       (1 << 14)
116 # define GEN6_PIPE_CONTROL_WRITE_DEPTH		       (2 << 14)
117 # define GEN6_PIPE_CONTROL_WRITE_TIME		       (3 << 14)
118 # define GEN6_PIPE_CONTROL_DEPTH_STALL		       (1 << 13)
119 # define GEN6_PIPE_CONTROL_WC_FLUSH		       (1 << 12)
120 # define GEN6_PIPE_CONTROL_IS_FLUSH		       (1 << 11)
121 # define GEN6_PIPE_CONTROL_TC_FLUSH		       (1 << 10)
122 # define GEN6_PIPE_CONTROL_NOTIFY_ENABLE	       (1 << 8)
123 # define GEN6_PIPE_CONTROL_GLOBAL_GTT		       (1 << 2)
124 # define GEN6_PIPE_CONTROL_LOCAL_PGTT		       (0 << 2)
125 # define GEN6_PIPE_CONTROL_DEPTH_CACHE_FLUSH	       (1 << 0)
126 
127 #define GEN6_3DSTATE_MONOFILTER_SIZE		GEN4_3D(3, 1, 0x11)
128 #define GEN6_PIPE_CONTROL			GEN4_3D(3, 2, 0)
129 
130 /* VERTEX_BUFFER_STATE Structure */
131 #define GEN6_VB0_BUFFER_INDEX_SHIFT	 26
132 #define GEN6_VB0_VERTEXDATA		(0 << 20)
133 #define GEN6_VB0_INSTANCEDATA	(1 << 20)
134 #define VB0_NULL_VERTEX_BUFFER	(1 << 13)
135 
136 /* VERTEX_ELEMENT_STATE Structure */
137 #define GEN6_VE0_VERTEX_BUFFER_INDEX_SHIFT	 26 /* for GEN6 */
138 #define GEN6_VE0_VALID				(1 << 25) /* for GEN6 */
139 
140 #define GEN6_SVG_CTL		0x7400
141 # define GEN6_SVG_CTL_GS_BA	(0 << 8)
142 # define GEN6_SVG_CTL_SS_BA	(1 << 8)
143 # define GEN6_SVG_CTL_IO_BA	(2 << 8)
144 # define GEN6_SVG_CTL_GS_AUB	(3 << 8)
145 # define GEN6_SVG_CTL_IO_AUB	(4 << 8)
146 # define GEN6_SVG_CTL_SIP	(5 << 8)
147 
148 #define GEN6_SVG_RDATA		0x7404
149 #define GEN6_SVG_WORK_CTL	0x7408
150 
151 #define GEN6_VF_CTL					0x7500
152 # define GEN6_VF_CTL_SNAPSHOT_COMPLETE			(1 << 31)
153 # define GEN6_VF_CTL_SNAPSHOT_MUX_SELECT_THREADID	(0 << 8)
154 # define GEN6_VF_CTL_SNAPSHOT_MUX_SELECT_VF_DEBUG	(1 << 8)
155 # define GEN6_VF_CTL_SNAPSHOT_TYPE_VERTEX_SEQUENCE	(0 << 4)
156 # define GEN6_VF_CTL_SNAPSHOT_TYPE_VERTEX_INDEX		(1 << 4)
157 # define GEN6_VF_CTL_SKIP_INITIAL_PRIMITIVES		(1 << 3)
158 # define GEN6_VF_CTL_MAX_PRIMITIVES_LIMIT_ENABLE	(1 << 2)
159 # define GEN6_VF_CTL_VERTEX_RANGE_LIMIT_ENABLE		(1 << 1)
160 # define GEN6_VF_CTL_SNAPSHOT_ENABLE			(1 << 0)
161 
162 #define GEN6_VF_STRG_VAL	0x7504
163 #define GEN6_VF_STR_VL_OVR	0x7508
164 #define GEN6_VF_VC_OVR		0x750c
165 #define GEN6_VF_STR_PSKIP	0x7510
166 #define GEN6_VF_MAX_PRIM	0x7514
167 #define GEN6_VF_RDATA		0x7518
168 
169 #define GEN6_VS_CTL					0x7600
170 # define GEN6_VS_CTL_SNAPSHOT_COMPLETE			(1 << 31)
171 # define GEN6_VS_CTL_SNAPSHOT_MUX_VERTEX_0		(0 << 8)
172 # define GEN6_VS_CTL_SNAPSHOT_MUX_VERTEX_1		(1 << 8)
173 # define GEN6_VS_CTL_SNAPSHOT_MUX_VALID_COUNT		(2 << 8)
174 # define GEN6_VS_CTL_SNAPSHOT_MUX_VS_KERNEL_POINTER	(3 << 8)
175 # define GEN6_VS_CTL_SNAPSHOT_ALL_THREADS		(1 << 2)
176 # define GEN6_VS_CTL_THREAD_SNAPSHOT_ENABLE		(1 << 1)
177 # define GEN6_VS_CTL_SNAPSHOT_ENABLE			 (1 << 0)
178 
179 #define GEN6_VS_STRG_VAL	0x7604
180 #define GEN6_VS_RDATA		0x7608
181 
182 #define GEN6_SF_CTL					0x7b00
183 # define GEN6_SF_CTL_SNAPSHOT_COMPLETE			(1 << 31)
184 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_0_FF_ID	(0 << 8)
185 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_0_REL_COUNT	(1 << 8)
186 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_1_FF_ID	(2 << 8)
187 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_1_REL_COUNT	(3 << 8)
188 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_2_FF_ID	(4 << 8)
189 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_2_REL_COUNT	(5 << 8)
190 # define GEN6_SF_CTL_SNAPSHOT_MUX_VERTEX_COUNT		(6 << 8)
191 # define GEN6_SF_CTL_SNAPSHOT_MUX_SF_KERNEL_POINTER	(7 << 8)
192 # define GEN6_SF_CTL_MIN_MAX_PRIMITIVE_RANGE_ENABLE	(1 << 4)
193 # define GEN6_SF_CTL_DEBUG_CLIP_RECTANGLE_ENABLE	(1 << 3)
194 # define GEN6_SF_CTL_SNAPSHOT_ALL_THREADS		(1 << 2)
195 # define GEN6_SF_CTL_THREAD_SNAPSHOT_ENABLE		(1 << 1)
196 # define GEN6_SF_CTL_SNAPSHOT_ENABLE			(1 << 0)
197 
198 #define GEN6_SF_STRG_VAL	0x7b04
199 #define GEN6_SF_RDATA		0x7b18
200 
201 #define GEN6_WIZ_CTL					0x7c00
202 # define GEN6_WIZ_CTL_SNAPSHOT_COMPLETE			(1 << 31)
203 # define GEN6_WIZ_CTL_SUBSPAN_INSTANCE_SHIFT		 16
204 # define GEN6_WIZ_CTL_SNAPSHOT_MUX_WIZ_KERNEL_POINTER	(0 << 8)
205 # define GEN6_WIZ_CTL_SNAPSHOT_MUX_SUBSPAN_INSTANCE	(1 << 8)
206 # define GEN6_WIZ_CTL_SNAPSHOT_MUX_PRIMITIVE_SEQUENCE	(2 << 8)
207 # define GEN6_WIZ_CTL_SINGLE_SUBSPAN_DISPATCH		(1 << 6)
208 # define GEN6_WIZ_CTL_IGNORE_COLOR_SCOREBOARD_STALLS	(1 << 5)
209 # define GEN6_WIZ_CTL_ENABLE_SUBSPAN_INSTANCE_COMPARE	(1 << 4)
210 # define GEN6_WIZ_CTL_USE_UPSTREAM_SNAPSHOT_FLAG	(1 << 3)
211 # define GEN6_WIZ_CTL_SNAPSHOT_ALL_THREADS		(1 << 2)
212 # define GEN6_WIZ_CTL_THREAD_SNAPSHOT_ENABLE		(1 << 1)
213 # define GEN6_WIZ_CTL_SNAPSHOT_ENABLE			(1 << 0)
214 
215 #define GEN6_WIZ_STRG_VAL	0x7c04
216 #define GEN6_WIZ_RDATA	0x7c18
217 
218 #define GEN6_TS_CTL					0x7e00
219 # define GEN6_TS_CTL_SNAPSHOT_COMPLETE			(1 << 31)
220 # define GEN6_TS_CTL_SNAPSHOT_MESSAGE_ERROR		(0 << 8)
221 # define GEN6_TS_CTL_SNAPSHOT_INTERFACE_DESCRIPTOR	(3 << 8)
222 # define GEN6_TS_CTL_SNAPSHOT_ALL_CHILD_THREADS		(1 << 2)
223 # define GEN6_TS_CTL_SNAPSHOT_ALL_ROOT_THREADS		(1 << 1)
224 # define GEN6_TS_CTL_SNAPSHOT_ENABLE			(1 << 0)
225 
226 #define GEN6_TS_STRG_VAL	0x7e04
227 #define GEN6_TS_RDATA		0x7e08
228 
229 #define GEN6_TD_CTL_MUX_SHIFT				 8
230 #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH	(1 << 7)
231 #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT			(1 << 6)
232 #define GEN6_TD_CTL_EXCEPTION_MASK_OVERRIDE		(1 << 5)
233 #define GEN6_TD_CTL_FORCE_THREAD_BREAKPOINT_ENABLE	(1 << 4)
234 #define GEN6_TD_CTL_BREAKPOINT_ENABLE			(1 << 2)
235 
236 #define GEN6_TD_CTL2						0x8004
237 # define GEN6_TD_CTL2_ILLEGAL_OPCODE_EXCEPTION_OVERRIDE		(1 << 28)
238 # define GEN6_TD_CTL2_MASKSTACK_EXCEPTION_OVERRIDE		(1 << 26)
239 # define GEN6_TD_CTL2_SOFTWARE_EXCEPTION_OVERRIDE		(1 << 25)
240 # define GEN6_TD_CTL2_ACTIVE_THREAD_LIMIT_SHIFT			 16
241 # define GEN6_TD_CTL2_ACTIVE_THREAD_LIMIT_ENABLE		(1 << 8)
242 # define GEN6_TD_CTL2_THREAD_SPAWNER_EXECUTION_MASK_ENABLE	(1 << 7)
243 # define GEN6_TD_CTL2_WIZ_EXECUTION_MASK_ENABLE			(1 << 6)
244 # define GEN6_TD_CTL2_SF_EXECUTION_MASK_ENABLE			(1 << 5)
245 # define GEN6_TD_CTL2_CLIPPER_EXECUTION_MASK_ENABLE		(1 << 4)
246 # define GEN6_TD_CTL2_GS_EXECUTION_MASK_ENABLE			(1 << 3)
247 # define GEN6_TD_CTL2_VS_EXECUTION_MASK_ENABLE			(1 << 0)
248 
249 #define GEN6_TD_VF_VS_EMSK	0x8008
250 #define GEN6_TD_GS_EMSK		0x800c
251 #define GEN6_TD_CLIP_EMSK	0x8010
252 #define GEN6_TD_SF_EMSK		0x8014
253 #define GEN6_TD_WIZ_EMSK	0x8018
254 #define GEN6_TD_0_6_EHTRG_VAL	0x801c
255 #define GEN6_TD_0_7_EHTRG_VAL	0x8020
256 #define GEN6_TD_0_6_EHTRG_MSK	0x8024
257 #define GEN6_TD_0_7_EHTRG_MSK	0x8028
258 #define GEN6_TD_RDATA		0x802c
259 #define GEN6_TD_TS_EMSK		0x8030
260 
261 #define GEN6_EU_CTL			0x8800
262 # define GEN6_EU_CTL_SELECT_SHIFT	16
263 # define GEN6_EU_CTL_DATA_MUX_SHIFT	8
264 
265 #define GEN6_EU_ATT_0		0x8810
266 #define GEN6_EU_ATT_1		0x8814
267 #define GEN6_EU_ATT_DATA_0	0x8820
268 #define GEN6_EU_ATT_DATA_1	0x8824
269 #define GEN6_EU_ATT_CLR_0	0x8830
270 #define GEN6_EU_ATT_CLR_1	0x8834
271 #define GEN6_EU_RDATA		0x8840
272 
273 /* 3D state */
274 #define _3DOP_3DSTATE_PIPELINED			0x0
275 #define _3DOP_3DSTATE_NONPIPELINED		0x1
276 #define _3DOP_3DCONTROL				0x2
277 #define _3DOP_3DPRIMITIVE			0x3
278 
279 #define _3DSTATE_PIPELINED_POINTERS		0x00
280 #define _3DSTATE_BINDING_TABLE_POINTERS		0x01
281 #define _3DSTATE_VERTEX_BUFFERS			0x08
282 #define _3DSTATE_VERTEX_ELEMENTS		0x09
283 #define _3DSTATE_INDEX_BUFFER			0x0A
284 #define _3DSTATE_VF_STATISTICS			0x0B
285 #define _3DSTATE_DRAWING_RECTANGLE		0x00
286 #define _3DSTATE_CONSTANT_COLOR			0x01
287 #define _3DSTATE_SAMPLER_PALETTE_LOAD		0x02
288 #define _3DSTATE_CHROMA_KEY			0x04
289 #define _3DSTATE_DEPTH_BUFFER			0x05
290 #define _3DSTATE_POLY_STIPPLE_OFFSET		0x06
291 #define _3DSTATE_POLY_STIPPLE_PATTERN		0x07
292 #define _3DSTATE_LINE_STIPPLE			0x08
293 #define _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP	0x09
294 #define _3DCONTROL				0x00
295 #define _3DPRIMITIVE				0x00
296 
297 #define _3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL	0
298 #define _3DPRIM_VERTEXBUFFER_ACCESS_RANDOM	1
299 
300 #define GEN6_ANISORATIO_2	0
301 #define GEN6_ANISORATIO_4	1
302 #define GEN6_ANISORATIO_6	2
303 #define GEN6_ANISORATIO_8	3
304 #define GEN6_ANISORATIO_10	4
305 #define GEN6_ANISORATIO_12	5
306 #define GEN6_ANISORATIO_14	6
307 #define GEN6_ANISORATIO_16	7
308 
309 #define GEN6_BLENDFACTOR_ONE			0x01
310 #define GEN6_BLENDFACTOR_SRC_COLOR		0x02
311 #define GEN6_BLENDFACTOR_SRC_ALPHA		0x03
312 #define GEN6_BLENDFACTOR_DST_ALPHA		0x04
313 #define GEN6_BLENDFACTOR_DST_COLOR		0x05
314 #define GEN6_BLENDFACTOR_SRC_ALPHA_SATURATE	0x06
315 #define GEN6_BLENDFACTOR_CONST_COLOR		0x07
316 #define GEN6_BLENDFACTOR_CONST_ALPHA		0x08
317 #define GEN6_BLENDFACTOR_SRC1_COLOR		0x09
318 #define GEN6_BLENDFACTOR_SRC1_ALPHA		0x0A
319 #define GEN6_BLENDFACTOR_ZERO			0x11
320 #define GEN6_BLENDFACTOR_INV_SRC_COLOR		0x12
321 #define GEN6_BLENDFACTOR_INV_SRC_ALPHA		0x13
322 #define GEN6_BLENDFACTOR_INV_DST_ALPHA		0x14
323 #define GEN6_BLENDFACTOR_INV_DST_COLOR		0x15
324 #define GEN6_BLENDFACTOR_INV_CONST_COLOR	0x17
325 #define GEN6_BLENDFACTOR_INV_CONST_ALPHA	0x18
326 #define GEN6_BLENDFACTOR_INV_SRC1_COLOR		0x19
327 #define GEN6_BLENDFACTOR_INV_SRC1_ALPHA		0x1A
328 
329 #define GEN6_BLENDFUNCTION_ADD			0
330 #define GEN6_BLENDFUNCTION_SUBTRACT		1
331 #define GEN6_BLENDFUNCTION_REVERSE_SUBTRACT	2
332 #define GEN6_BLENDFUNCTION_MIN			3
333 #define GEN6_BLENDFUNCTION_MAX			4
334 
335 #define GEN6_ALPHATEST_FORMAT_UNORM8	0
336 #define GEN6_ALPHATEST_FORMAT_FLOAT32	1
337 
338 #define GEN6_CHROMAKEY_KILL_ON_ANY_MATCH	0
339 #define GEN6_CHROMAKEY_REPLACE_BLACK		1
340 
341 #define GEN6_CLIP_API_OGL	0
342 #define GEN6_CLIP_API_DX	1
343 
344 #define GEN6_CLIPMODE_NORMAL		0
345 #define GEN6_CLIPMODE_CLIP_ALL		1
346 #define GEN6_CLIPMODE_CLIP_NON_REJECTED	2
347 #define GEN6_CLIPMODE_REJECT_ALL	3
348 #define GEN6_CLIPMODE_ACCEPT_ALL	4
349 
350 #define GEN6_CLIP_NDCSPACE	0
351 #define GEN6_CLIP_SCREENSPACE	1
352 
353 #define GEN6_COMPAREFUNCTION_ALWAYS	0
354 #define GEN6_COMPAREFUNCTION_NEVER	1
355 #define GEN6_COMPAREFUNCTION_LESS	2
356 #define GEN6_COMPAREFUNCTION_EQUAL	3
357 #define GEN6_COMPAREFUNCTION_LEQUAL	4
358 #define GEN6_COMPAREFUNCTION_GREATER	5
359 #define GEN6_COMPAREFUNCTION_NOTEQUAL	6
360 #define GEN6_COMPAREFUNCTION_GEQUAL	7
361 
362 #define GEN6_COVERAGE_PIXELS_HALF	0
363 #define GEN6_COVERAGE_PIXELS_1		1
364 #define GEN6_COVERAGE_PIXELS_2		2
365 #define GEN6_COVERAGE_PIXELS_4		3
366 
367 #define GEN6_DEFAULTCOLOR_R8G8B8A8_UNORM	0
368 #define GEN6_DEFAULTCOLOR_R32G32B32A32_FLOAT	1
369 
370 #define GEN6_FLOATING_POINT_IEEE_754		0
371 #define GEN6_FLOATING_POINT_NON_IEEE_754	1
372 
373 #define GEN6_FRONTWINDING_CW	0
374 #define GEN6_FRONTWINDING_CCW	1
375 
376 #define GEN6_INDEX_BYTE		0
377 #define GEN6_INDEX_WORD		1
378 #define GEN6_INDEX_DWORD	2
379 
380 #define GEN6_LOGICOPFUNCTION_CLEAR		0
381 #define GEN6_LOGICOPFUNCTION_NOR		1
382 #define GEN6_LOGICOPFUNCTION_AND_INVERTED	2
383 #define GEN6_LOGICOPFUNCTION_COPY_INVERTED	3
384 #define GEN6_LOGICOPFUNCTION_AND_REVERSE	4
385 #define GEN6_LOGICOPFUNCTION_INVERT		5
386 #define GEN6_LOGICOPFUNCTION_XOR		6
387 #define GEN6_LOGICOPFUNCTION_NAND		7
388 #define GEN6_LOGICOPFUNCTION_AND		8
389 #define GEN6_LOGICOPFUNCTION_EQUIV		9
390 #define GEN6_LOGICOPFUNCTION_NOOP		10
391 #define GEN6_LOGICOPFUNCTION_OR_INVERTED	11
392 #define GEN6_LOGICOPFUNCTION_COPY		12
393 #define GEN6_LOGICOPFUNCTION_OR_REVERSE		13
394 #define GEN6_LOGICOPFUNCTION_OR			14
395 #define GEN6_LOGICOPFUNCTION_SET		15
396 
397 #define GEN6_POLYGON_FRONT_FACING	0
398 #define GEN6_POLYGON_BACK_FACING	1
399 
400 #define GEN6_PROVOKING_VERTEX_0		0
401 #define GEN6_PROVOKING_VERTEX_1		1
402 #define GEN6_PROVOKING_VERTEX_2		2
403 
404 #define GEN6_RASTRULE_UPPER_LEFT	0
405 #define GEN6_RASTRULE_UPPER_RIGHT	1
406 
407 #define GEN6_RENDERTARGET_CLAMPRANGE_UNORM	0
408 #define GEN6_RENDERTARGET_CLAMPRANGE_SNORM	1
409 #define GEN6_RENDERTARGET_CLAMPRANGE_FORMAT	2
410 
411 #define GEN6_STENCILOP_KEEP	0
412 #define GEN6_STENCILOP_ZERO	1
413 #define GEN6_STENCILOP_REPLACE	2
414 #define GEN6_STENCILOP_INCRSAT	3
415 #define GEN6_STENCILOP_DECRSAT	4
416 #define GEN6_STENCILOP_INCR	5
417 #define GEN6_STENCILOP_DECR	6
418 #define GEN6_STENCILOP_INVERT	7
419 
420 #define GEN6_THREAD_PRIORITY_NORMAL	0
421 #define GEN6_THREAD_PRIORITY_HIGH	1
422 
423 #define GEN6_TILEWALK_XMAJOR		0
424 #define GEN6_TILEWALK_YMAJOR		1
425 
426 #define GEN6_VERTEX_SUBPIXEL_PRECISION_8BITS	0
427 #define GEN6_VERTEX_SUBPIXEL_PRECISION_4BITS	1
428 
429 #define GEN6_VERTEXBUFFER_ACCESS_VERTEXDATA	0
430 #define GEN6_VERTEXBUFFER_ACCESS_INSTANCEDATA	1
431 
432 /* Execution Unit (EU) defines */
433 
434 #define GEN6_ALIGN_1	0
435 #define GEN6_ALIGN_16	1
436 
437 #define GEN6_ADDRESS_DIRECT			0
438 #define GEN6_ADDRESS_REGISTER_INDIRECT_REGISTER	1
439 
440 #define GEN6_CHANNEL_X	0
441 #define GEN6_CHANNEL_Y	1
442 #define GEN6_CHANNEL_Z	2
443 #define GEN6_CHANNEL_W	3
444 
445 #define GEN6_COMPRESSION_NONE	0
446 #define GEN6_COMPRESSION_2NDHALF	1
447 #define GEN6_COMPRESSION_COMPRESSED	2
448 
449 #define GEN6_CONDITIONAL_NONE	0
450 #define GEN6_CONDITIONAL_Z	1
451 #define GEN6_CONDITIONAL_NZ	2
452 #define GEN6_CONDITIONAL_EQ	1	/* Z */
453 #define GEN6_CONDITIONAL_NEQ	2	/* NZ */
454 #define GEN6_CONDITIONAL_G	3
455 #define GEN6_CONDITIONAL_GE	4
456 #define GEN6_CONDITIONAL_L	5
457 #define GEN6_CONDITIONAL_LE	6
458 #define GEN6_CONDITIONAL_C	7
459 #define GEN6_CONDITIONAL_O	8
460 
461 #define GEN6_DEBUG_NONE		0
462 #define GEN6_DEBUG_BREAKPOINT	1
463 
464 #define GEN6_DEPENDENCY_NORMAL		0
465 #define GEN6_DEPENDENCY_NOTCLEARED	1
466 #define GEN6_DEPENDENCY_NOTCHECKED	2
467 #define GEN6_DEPENDENCY_DISABLE		3
468 
469 #define GEN6_EXECUTE_1		0
470 #define GEN6_EXECUTE_2		1
471 #define GEN6_EXECUTE_4		2
472 #define GEN6_EXECUTE_8		3
473 #define GEN6_EXECUTE_16		4
474 #define GEN6_EXECUTE_32		5
475 
476 #define GEN6_HORIZONTAL_STRIDE_0	0
477 #define GEN6_HORIZONTAL_STRIDE_1	1
478 #define GEN6_HORIZONTAL_STRIDE_2	2
479 #define GEN6_HORIZONTAL_STRIDE_4	3
480 
481 #define GEN6_INSTRUCTION_NORMAL		0
482 #define GEN6_INSTRUCTION_SATURATE	1
483 
484 #define GEN6_MASK_ENABLE	0
485 #define GEN6_MASK_DISABLE	1
486 
487 #define GEN6_OPCODE_MOV		1
488 #define GEN6_OPCODE_SEL		2
489 #define GEN6_OPCODE_NOT		4
490 #define GEN6_OPCODE_AND		5
491 #define GEN6_OPCODE_OR		6
492 #define GEN6_OPCODE_XOR		7
493 #define GEN6_OPCODE_SHR		8
494 #define GEN6_OPCODE_SHL		9
495 #define GEN6_OPCODE_RSR		10
496 #define GEN6_OPCODE_RSL		11
497 #define GEN6_OPCODE_ASR		12
498 #define GEN6_OPCODE_CMP		16
499 #define GEN6_OPCODE_JMPI	32
500 #define GEN6_OPCODE_IF		34
501 #define GEN6_OPCODE_IFF		35
502 #define GEN6_OPCODE_ELSE	36
503 #define GEN6_OPCODE_ENDIF	37
504 #define GEN6_OPCODE_DO		38
505 #define GEN6_OPCODE_WHILE	39
506 #define GEN6_OPCODE_BREAK	40
507 #define GEN6_OPCODE_CONTINUE	41
508 #define GEN6_OPCODE_HALT	42
509 #define GEN6_OPCODE_MSAVE	44
510 #define GEN6_OPCODE_MRESTORE	45
511 #define GEN6_OPCODE_PUSH	46
512 #define GEN6_OPCODE_POP		47
513 #define GEN6_OPCODE_WAIT	48
514 #define GEN6_OPCODE_SEND	49
515 #define GEN6_OPCODE_ADD		64
516 #define GEN6_OPCODE_MUL		65
517 #define GEN6_OPCODE_AVG		66
518 #define GEN6_OPCODE_FRC		67
519 #define GEN6_OPCODE_RNDU	68
520 #define GEN6_OPCODE_RNDD	69
521 #define GEN6_OPCODE_RNDE	70
522 #define GEN6_OPCODE_RNDZ	71
523 #define GEN6_OPCODE_MAC		72
524 #define GEN6_OPCODE_MACH	73
525 #define GEN6_OPCODE_LZD		74
526 #define GEN6_OPCODE_SAD2	80
527 #define GEN6_OPCODE_SADA2	81
528 #define GEN6_OPCODE_DP4		84
529 #define GEN6_OPCODE_DPH		85
530 #define GEN6_OPCODE_DP3		86
531 #define GEN6_OPCODE_DP2		87
532 #define GEN6_OPCODE_DPA2	88
533 #define GEN6_OPCODE_LINE	89
534 #define GEN6_OPCODE_NOP		126
535 
536 #define GEN6_PREDICATE_NONE			0
537 #define GEN6_PREDICATE_NORMAL			1
538 #define GEN6_PREDICATE_ALIGN1_ANYV		2
539 #define GEN6_PREDICATE_ALIGN1_ALLV		3
540 #define GEN6_PREDICATE_ALIGN1_ANY2H		4
541 #define GEN6_PREDICATE_ALIGN1_ALL2H		5
542 #define GEN6_PREDICATE_ALIGN1_ANY4H		6
543 #define GEN6_PREDICATE_ALIGN1_ALL4H		7
544 #define GEN6_PREDICATE_ALIGN1_ANY8H		8
545 #define GEN6_PREDICATE_ALIGN1_ALL8H		9
546 #define GEN6_PREDICATE_ALIGN1_ANY16H		10
547 #define GEN6_PREDICATE_ALIGN1_ALL16H		11
548 #define GEN6_PREDICATE_ALIGN16_REPLICATE_X	2
549 #define GEN6_PREDICATE_ALIGN16_REPLICATE_Y	3
550 #define GEN6_PREDICATE_ALIGN16_REPLICATE_Z	4
551 #define GEN6_PREDICATE_ALIGN16_REPLICATE_W	5
552 #define GEN6_PREDICATE_ALIGN16_ANY4H		6
553 #define GEN6_PREDICATE_ALIGN16_ALL4H		7
554 
555 #define GEN6_ARCHITECTURE_REGISTER_FILE		0
556 #define GEN6_GENERAL_REGISTER_FILE		1
557 #define GEN6_MESSAGE_REGISTER_FILE		2
558 #define GEN6_IMMEDIATE_VALUE			3
559 
560 #define GEN6_REGISTER_TYPE_UD	0
561 #define GEN6_REGISTER_TYPE_D	1
562 #define GEN6_REGISTER_TYPE_UW	2
563 #define GEN6_REGISTER_TYPE_W	3
564 #define GEN6_REGISTER_TYPE_UB	4
565 #define GEN6_REGISTER_TYPE_B	5
566 /* packed float vector, immediates only? */
567 #define GEN6_REGISTER_TYPE_VF	5
568 #define GEN6_REGISTER_TYPE_HF	6
569 /* packed int vector, immediates only, uword dest only */
570 #define GEN6_REGISTER_TYPE_V	6
571 #define GEN6_REGISTER_TYPE_F	7
572 
573 #define GEN6_ARF_NULL			0x00
574 #define GEN6_ARF_ADDRESS		0x10
575 #define GEN6_ARF_ACCUMULATOR		0x20
576 #define GEN6_ARF_FLAG			0x30
577 #define GEN6_ARF_MASK			0x40
578 #define GEN6_ARF_MASK_STACK		0x50
579 #define GEN6_ARF_MASK_STACK_DEPTH	0x60
580 #define GEN6_ARF_STATE			0x70
581 #define GEN6_ARF_CONTROL		0x80
582 #define GEN6_ARF_NOTIFICATION_COUNT	0x90
583 #define GEN6_ARF_I			0xA0
584 
585 #define GEN6_AMASK	0
586 #define GEN6_IMASK	1
587 #define GEN6_LMASK	2
588 #define GEN6_CMASK	3
589 
590 #define GEN6_THREAD_NORMAL	0
591 #define GEN6_THREAD_ATOMIC	1
592 #define GEN6_THREAD_SWITCH	2
593 
594 #define GEN6_VERTICAL_STRIDE_0			0
595 #define GEN6_VERTICAL_STRIDE_1			1
596 #define GEN6_VERTICAL_STRIDE_2			2
597 #define GEN6_VERTICAL_STRIDE_4			3
598 #define GEN6_VERTICAL_STRIDE_8			4
599 #define GEN6_VERTICAL_STRIDE_16			5
600 #define GEN6_VERTICAL_STRIDE_32			6
601 #define GEN6_VERTICAL_STRIDE_64			7
602 #define GEN6_VERTICAL_STRIDE_128		8
603 #define GEN6_VERTICAL_STRIDE_256		9
604 #define GEN6_VERTICAL_STRIDE_ONE_DIMENSIONAL	0xF
605 
606 #define GEN6_WIDTH_1	0
607 #define GEN6_WIDTH_2	1
608 #define GEN6_WIDTH_4	2
609 #define GEN6_WIDTH_8	3
610 #define GEN6_WIDTH_16	4
611 
612 #define GEN6_STATELESS_BUFFER_BOUNDARY_1K	0
613 #define GEN6_STATELESS_BUFFER_BOUNDARY_2K	1
614 #define GEN6_STATELESS_BUFFER_BOUNDARY_4K	2
615 #define GEN6_STATELESS_BUFFER_BOUNDARY_8K	3
616 #define GEN6_STATELESS_BUFFER_BOUNDARY_16K	4
617 #define GEN6_STATELESS_BUFFER_BOUNDARY_32K	5
618 #define GEN6_STATELESS_BUFFER_BOUNDARY_64K	6
619 #define GEN6_STATELESS_BUFFER_BOUNDARY_128K	7
620 #define GEN6_STATELESS_BUFFER_BOUNDARY_256K	8
621 #define GEN6_STATELESS_BUFFER_BOUNDARY_512K	9
622 #define GEN6_STATELESS_BUFFER_BOUNDARY_1M	10
623 #define GEN6_STATELESS_BUFFER_BOUNDARY_2M	11
624 
625 #define GEN6_POLYGON_FACING_FRONT	0
626 #define GEN6_POLYGON_FACING_BACK	1
627 
628 #define GEN6_MESSAGE_TARGET_NULL		0
629 #define GEN6_MESSAGE_TARGET_MATH		1
630 #define GEN6_MESSAGE_TARGET_SAMPLER		2
631 #define GEN6_MESSAGE_TARGET_GATEWAY		3
632 #define GEN6_MESSAGE_TARGET_DATAPORT_READ	4
633 #define GEN6_MESSAGE_TARGET_DATAPORT_WRITE	5
634 #define GEN6_MESSAGE_TARGET_URB			6
635 #define GEN6_MESSAGE_TARGET_THREAD_SPAWNER	7
636 
637 #define GEN6_SAMPLER_RETURN_FORMAT_FLOAT32	0
638 #define GEN6_SAMPLER_RETURN_FORMAT_UINT32	2
639 #define GEN6_SAMPLER_RETURN_FORMAT_SINT32	3
640 
641 #define GEN6_SAMPLER_MESSAGE_SIMD8_SAMPLE		0
642 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE		0
643 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS		0
644 #define GEN6_SAMPLER_MESSAGE_SIMD8_KILLPIX		1
645 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_LOD		1
646 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE_LOD		1
647 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_GRADIENTS	2
648 #define GEN6_SAMPLER_MESSAGE_SIMD8_SAMPLE_GRADIENTS	2
649 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_COMPARE	0
650 #define GEN6_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE	2
651 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_RESINFO		2
652 #define GEN6_SAMPLER_MESSAGE_SIMD8_RESINFO		2
653 #define GEN6_SAMPLER_MESSAGE_SIMD16_RESINFO		2
654 #define GEN6_SAMPLER_MESSAGE_SIMD4X2_LD			3
655 #define GEN6_SAMPLER_MESSAGE_SIMD8_LD			3
656 #define GEN6_SAMPLER_MESSAGE_SIMD16_LD			3
657 
658 #define GEN6_DATAPORT_OWORD_BLOCK_1_OWORDLOW	0
659 #define GEN6_DATAPORT_OWORD_BLOCK_1_OWORDHIGH	1
660 #define GEN6_DATAPORT_OWORD_BLOCK_2_OWORDS	2
661 #define GEN6_DATAPORT_OWORD_BLOCK_4_OWORDS	3
662 #define GEN6_DATAPORT_OWORD_BLOCK_8_OWORDS	4
663 
664 #define GEN6_DATAPORT_OWORD_DUAL_BLOCK_1OWORD	0
665 #define GEN6_DATAPORT_OWORD_DUAL_BLOCK_4OWORDS	2
666 
667 #define GEN6_DATAPORT_DWORD_SCATTERED_BLOCK_8DWORDS	2
668 #define GEN6_DATAPORT_DWORD_SCATTERED_BLOCK_16DWORDS	3
669 
670 #define GEN6_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ		0
671 #define GEN6_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ	1
672 #define GEN6_DATAPORT_READ_MESSAGE_DWORD_BLOCK_READ		2
673 #define GEN6_DATAPORT_READ_MESSAGE_DWORD_SCATTERED_READ		3
674 
675 #define GEN6_DATAPORT_READ_TARGET_DATA_CACHE	0
676 #define GEN6_DATAPORT_READ_TARGET_RENDER_CACHE	1
677 #define GEN6_DATAPORT_READ_TARGET_SAMPLER_CACHE	2
678 
679 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE		   0
680 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE_REPLICATED  1
681 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD8_DUAL_SOURCE_SUBSPAN01	   2
682 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD8_DUAL_SOURCE_SUBSPAN23	   3
683 #define GEN6_DATAPORT_RENDER_TARGET_WRITE_SIMD8_SINGLE_SOURCE_SUBSPAN01    4
684 
685 #define GEN6_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE			0
686 #define GEN6_DATAPORT_WRITE_MESSAGE_OWORD_DUAL_BLOCK_WRITE		1
687 #define GEN6_DATAPORT_WRITE_MESSAGE_DWORD_BLOCK_WRITE			2
688 #define GEN6_DATAPORT_WRITE_MESSAGE_DWORD_SCATTERED_WRITE		3
689 #define GEN6_DATAPORT_WRITE_MESSAGE_RENDER_TARGET_WRITE			4
690 #define GEN6_DATAPORT_WRITE_MESSAGE_STREAMED_VERTEX_BUFFER_WRITE	5
691 #define GEN6_DATAPORT_WRITE_MESSAGE_FLUSH_RENDER_CACHE			7
692 
693 #define GEN6_MATH_FUNCTION_INV					1
694 #define GEN6_MATH_FUNCTION_LOG					2
695 #define GEN6_MATH_FUNCTION_EXP					3
696 #define GEN6_MATH_FUNCTION_SQRT					4
697 #define GEN6_MATH_FUNCTION_RSQ					5
698 #define GEN6_MATH_FUNCTION_SIN					6 /* was 7 */
699 #define GEN6_MATH_FUNCTION_COS					7 /* was 8 */
700 #define GEN6_MATH_FUNCTION_SINCOS				8 /* was 6 */
701 #define GEN6_MATH_FUNCTION_TAN					9
702 #define GEN6_MATH_FUNCTION_POW					10
703 #define GEN6_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER	11
704 #define GEN6_MATH_FUNCTION_INT_DIV_QUOTIENT			12
705 #define GEN6_MATH_FUNCTION_INT_DIV_REMAINDER			13
706 
707 #define GEN6_MATH_INTEGER_UNSIGNED	0
708 #define GEN6_MATH_INTEGER_SIGNED	1
709 
710 #define GEN6_MATH_PRECISION_FULL	0
711 #define GEN6_MATH_PRECISION_PARTIAL	1
712 
713 #define GEN6_MATH_SATURATE_NONE		0
714 #define GEN6_MATH_SATURATE_SATURATE	1
715 
716 #define GEN6_MATH_DATA_VECTOR	0
717 #define GEN6_MATH_DATA_SCALAR	1
718 
719 #define GEN6_URB_OPCODE_WRITE	0
720 
721 #define GEN6_URB_SWIZZLE_NONE		0
722 #define GEN6_URB_SWIZZLE_INTERLEAVE	1
723 #define GEN6_URB_SWIZZLE_TRANSPOSE	2
724 
725 #define GEN6_SCRATCH_SPACE_SIZE_1K	0
726 #define GEN6_SCRATCH_SPACE_SIZE_2K	1
727 #define GEN6_SCRATCH_SPACE_SIZE_4K	2
728 #define GEN6_SCRATCH_SPACE_SIZE_8K	3
729 #define GEN6_SCRATCH_SPACE_SIZE_16K	4
730 #define GEN6_SCRATCH_SPACE_SIZE_32K	5
731 #define GEN6_SCRATCH_SPACE_SIZE_64K	6
732 #define GEN6_SCRATCH_SPACE_SIZE_128K	7
733 #define GEN6_SCRATCH_SPACE_SIZE_256K	8
734 #define GEN6_SCRATCH_SPACE_SIZE_512K	9
735 #define GEN6_SCRATCH_SPACE_SIZE_1M	10
736 #define GEN6_SCRATCH_SPACE_SIZE_2M	11
737 
738 #define GEN6_MOCS_GFDT		(1 << 2)
739 #define GEN6_MOCS_PTE		(0 << 0)
740 #define GEN6_MOCS_UC		(1 << 0)
741 #define GEN6_MOCS_LLC		(2 << 0)
742 #define GEN6_MOCS_LLC_MLC	(3 << 0)
743 
744 /* The hardware supports two different modes for border color. The
745  * default (OpenGL) mode uses floating-point color channels, while the
746  * legacy mode uses 4 bytes.
747  *
748  * More significantly, the legacy mode respects the components of the
749  * border color for channels not present in the source, (whereas the
750  * default mode will ignore the border color's alpha channel and use
751  * alpha==1 for an RGB source, for example).
752  *
753  * The legacy mode matches the semantics specified by the Render
754  * extension.
755  */
756 struct gen6_sampler_state {
757    struct {
758       uint32_t shadow_function:3;
759       uint32_t lod_bias:11;
760       uint32_t min_filter:3;
761       uint32_t mag_filter:3;
762       uint32_t mip_filter:2;
763       uint32_t base_level:5;
764       uint32_t pad:1;
765       uint32_t lod_preclamp:1;
766       uint32_t border_color_mode:1;
767       uint32_t pad0:1;
768       uint32_t disable:1;
769    } ss0;
770 
771    struct {
772       uint32_t r_wrap_mode:3;
773       uint32_t t_wrap_mode:3;
774       uint32_t s_wrap_mode:3;
775       uint32_t pad:3;
776       uint32_t max_lod:10;
777       uint32_t min_lod:10;
778    } ss1;
779 
780    struct {
781       uint32_t border_color;
782    } ss2;
783 
784    struct {
785       uint32_t pad:19;
786       uint32_t max_aniso:3;
787       uint32_t chroma_key_mode:1;
788       uint32_t chroma_key_index:2;
789       uint32_t chroma_key_enable:1;
790       uint32_t monochrome_filter_width:3;
791       uint32_t monochrome_filter_height:3;
792    } ss3;
793 };
794 
795 struct gen6_blend_state {
796 	struct {
797 		uint32_t dest_blend_factor:5;
798 		uint32_t source_blend_factor:5;
799 		uint32_t pad3:1;
800 		uint32_t blend_func:3;
801 		uint32_t pad2:1;
802 		uint32_t ia_dest_blend_factor:5;
803 		uint32_t ia_source_blend_factor:5;
804 		uint32_t pad1:1;
805 		uint32_t ia_blend_func:3;
806 		uint32_t pad0:1;
807 		uint32_t ia_blend_enable:1;
808 		uint32_t blend_enable:1;
809 	} blend0;
810 
811 	struct {
812 		uint32_t post_blend_clamp_enable:1;
813 		uint32_t pre_blend_clamp_enable:1;
814 		uint32_t clamp_range:2;
815 		uint32_t pad0:4;
816 		uint32_t x_dither_offset:2;
817 		uint32_t y_dither_offset:2;
818 		uint32_t dither_enable:1;
819 		uint32_t alpha_test_func:3;
820 		uint32_t alpha_test_enable:1;
821 		uint32_t pad1:1;
822 		uint32_t logic_op_func:4;
823 		uint32_t logic_op_enable:1;
824 		uint32_t pad2:1;
825 		uint32_t write_disable_b:1;
826 		uint32_t write_disable_g:1;
827 		uint32_t write_disable_r:1;
828 		uint32_t write_disable_a:1;
829 		uint32_t pad3:1;
830 		uint32_t alpha_to_coverage_dither:1;
831 		uint32_t alpha_to_one:1;
832 		uint32_t alpha_to_coverage:1;
833 	} blend1;
834 };
835 
836 struct gen6_color_calc_state {
837 	struct {
838 		uint32_t alpha_test_format:1;
839 		uint32_t pad0:14;
840 		uint32_t round_disable:1;
841 		uint32_t bf_stencil_ref:8;
842 		uint32_t stencil_ref:8;
843 	} cc0;
844 
845 	union {
846 		float alpha_ref_f;
847 		struct {
848 			uint32_t ui:8;
849 			uint32_t pad0:24;
850 		} alpha_ref_fi;
851 	} cc1;
852 
853 	float constant_r;
854 	float constant_g;
855 	float constant_b;
856 	float constant_a;
857 };
858 
859 struct gen6_depth_stencil_state {
860 	struct {
861 		uint32_t pad0:3;
862 		uint32_t bf_stencil_pass_depth_pass_op:3;
863 		uint32_t bf_stencil_pass_depth_fail_op:3;
864 		uint32_t bf_stencil_fail_op:3;
865 		uint32_t bf_stencil_func:3;
866 		uint32_t bf_stencil_enable:1;
867 		uint32_t pad1:2;
868 		uint32_t stencil_write_enable:1;
869 		uint32_t stencil_pass_depth_pass_op:3;
870 		uint32_t stencil_pass_depth_fail_op:3;
871 		uint32_t stencil_fail_op:3;
872 		uint32_t stencil_func:3;
873 		uint32_t stencil_enable:1;
874 	} ds0;
875 
876 	struct {
877 		uint32_t bf_stencil_write_mask:8;
878 		uint32_t bf_stencil_test_mask:8;
879 		uint32_t stencil_write_mask:8;
880 		uint32_t stencil_test_mask:8;
881 	} ds1;
882 
883 	struct {
884 		uint32_t pad0:26;
885 		uint32_t depth_write_enable:1;
886 		uint32_t depth_test_func:3;
887 		uint32_t pad1:1;
888 		uint32_t depth_test_enable:1;
889 	} ds2;
890 };
891 
892 struct gen6_surface_state {
893 	struct {
894 		uint32_t cube_pos_z:1;
895 		uint32_t cube_neg_z:1;
896 		uint32_t cube_pos_y:1;
897 		uint32_t cube_neg_y:1;
898 		uint32_t cube_pos_x:1;
899 		uint32_t cube_neg_x:1;
900 		uint32_t pad:3;
901 		uint32_t render_cache_read_mode:1;
902 		uint32_t mipmap_layout_mode:1;
903 		uint32_t vert_line_stride_ofs:1;
904 		uint32_t vert_line_stride:1;
905 		uint32_t color_blend:1;
906 		uint32_t writedisable_blue:1;
907 		uint32_t writedisable_green:1;
908 		uint32_t writedisable_red:1;
909 		uint32_t writedisable_alpha:1;
910 		uint32_t surface_format:9;
911 		uint32_t data_return_format:1;
912 		uint32_t pad0:1;
913 		uint32_t surface_type:3;
914 	} ss0;
915 
916 	struct {
917 		uint32_t base_addr;
918 	} ss1;
919 
920 	struct {
921 		uint32_t render_target_rotation:2;
922 		uint32_t mip_count:4;
923 		uint32_t width:13;
924 		uint32_t height:13;
925 	} ss2;
926 
927 	struct {
928 		uint32_t tile_walk:1;
929 		uint32_t tiled_surface:1;
930 		uint32_t pad:1;
931 		uint32_t pitch:18;
932 		uint32_t depth:11;
933 	} ss3;
934 
935 	struct {
936 		uint32_t pad:19;
937 		uint32_t min_array_elt:9;
938 		uint32_t min_lod:4;
939 	} ss4;
940 
941 	struct {
942 		uint32_t pad:16;
943 		uint32_t memory_object_control:4;
944 		uint32_t y_offset:4;
945 		uint32_t pad2:1;
946 		uint32_t x_offset:7;
947 	} ss5;
948 };
949 
950 #endif
951