1 #ifndef _I965_DEFINES_H_
2 #define _I965_DEFINES_H_
4 #define CMD(pipeline,op,sub_op) ((3 << 29) | \
9 #define CMD_URB_FENCE CMD(0, 0, 0)
10 #define CMD_CS_URB_STATE CMD(0, 0, 1)
11 #define CMD_CONSTANT_BUFFER CMD(0, 0, 2)
12 #define CMD_STATE_PREFETCH CMD(0, 0, 3)
14 #define CMD_STATE_BASE_ADDRESS CMD(0, 1, 1)
15 #define CMD_STATE_SIP CMD(0, 1, 2)
16 #define CMD_PIPELINE_SELECT CMD(1, 1, 4)
17 #define CMD_SAMPLER_PALETTE_LOAD CMD(3, 1, 2)
19 #define CMD_MEDIA_STATE_POINTERS CMD(2, 0, 0)
20 #define CMD_MEDIA_VFE_STATE CMD(2, 0, 0)
21 #define CMD_MEDIA_CURBE_LOAD CMD(2, 0, 1)
22 #define CMD_MEDIA_INTERFACE_LOAD CMD(2, 0, 2)
23 #define CMD_MEDIA_OBJECT CMD(2, 1, 0)
24 #define CMD_MEDIA_OBJECT_EX CMD(2, 1, 1)
26 #define CMD_AVC_BSD_IMG_STATE CMD(2, 4, 0)
27 #define CMD_AVC_BSD_QM_STATE CMD(2, 4, 1)
28 #define CMD_AVC_BSD_SLICE_STATE CMD(2, 4, 2)
29 #define CMD_AVC_BSD_BUF_BASE_STATE CMD(2, 4, 3)
30 #define CMD_BSD_IND_OBJ_BASE_ADDR CMD(2, 4, 4)
31 #define CMD_AVC_BSD_OBJECT CMD(2, 4, 8)
33 #define CMD_MEDIA_VFE_STATE CMD(2, 0, 0)
34 #define CMD_MEDIA_CURBE_LOAD CMD(2, 0, 1)
35 #define CMD_MEDIA_INTERFACE_DESCRIPTOR_LOAD CMD(2, 0, 2)
36 #define CMD_MEDIA_GATEWAY_STATE CMD(2, 0, 3)
37 #define CMD_MEDIA_STATE_FLUSH CMD(2, 0, 4)
38 #define CMD_MEDIA_OBJECT_WALKER CMD(2, 1, 3)
40 #define CMD_PIPELINED_POINTERS CMD(3, 0, 0)
41 #define CMD_BINDING_TABLE_POINTERS CMD(3, 0, 1)
42 # define GEN6_BINDING_TABLE_MODIFY_PS (1 << 12)/* for GEN6 */
43 # define GEN6_BINDING_TABLE_MODIFY_GS (1 << 9) /* for GEN6 */
44 # define GEN6_BINDING_TABLE_MODIFY_VS (1 << 8) /* for GEN6 */
46 #define CMD_VERTEX_BUFFERS CMD(3, 0, 8)
47 #define CMD_VERTEX_ELEMENTS CMD(3, 0, 9)
48 #define CMD_DRAWING_RECTANGLE CMD(3, 1, 0)
49 #define CMD_CONSTANT_COLOR CMD(3, 1, 1)
50 #define CMD_3DPRIMITIVE CMD(3, 3, 0)
52 #define CMD_DEPTH_BUFFER CMD(3, 1, 5)
53 # define CMD_DEPTH_BUFFER_TYPE_SHIFT 29
54 # define CMD_DEPTH_BUFFER_FORMAT_SHIFT 18
56 #define CMD_CLEAR_PARAMS CMD(3, 1, 0x10)
58 # define CMD_CLEAR_PARAMS_DEPTH_CLEAR_VALID (1 << 15)
61 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS CMD(3, 0, 0x02)
62 # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_PS (1 << 12)
63 # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_GS (1 << 9)
64 # define GEN6_3DSTATE_SAMPLER_STATE_MODIFY_VS (1 << 8)
66 #define GEN6_3DSTATE_URB CMD(3, 0, 0x05)
68 # define GEN6_3DSTATE_URB_VS_SIZE_SHIFT 16
69 # define GEN6_3DSTATE_URB_VS_ENTRIES_SHIFT 0
71 # define GEN6_3DSTATE_URB_GS_ENTRIES_SHIFT 8
72 # define GEN6_3DSTATE_URB_GS_SIZE_SHIFT 0
74 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS CMD(3, 0, 0x0d)
75 # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CC (1 << 12)
76 # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_SF (1 << 11)
77 # define GEN6_3DSTATE_VIEWPORT_STATE_MODIFY_CLIP (1 << 10)
79 #define GEN6_3DSTATE_CC_STATE_POINTERS CMD(3, 0, 0x0e)
81 #define GEN6_3DSTATE_VS CMD(3, 0, 0x10)
83 #define GEN6_3DSTATE_GS CMD(3, 0, 0x11)
85 # define GEN6_3DSTATE_GS_DISPATCH_START_GRF_SHIFT 0
87 #define GEN6_3DSTATE_CLIP CMD(3, 0, 0x12)
89 #define GEN6_3DSTATE_SF CMD(3, 0, 0x13)
91 # define GEN6_3DSTATE_SF_NUM_OUTPUTS_SHIFT 22
92 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_LENGTH_SHIFT 11
93 # define GEN6_3DSTATE_SF_URB_ENTRY_READ_OFFSET_SHIFT 4
95 # define GEN7_SF_DEPTH_BUFFER_SURFACE_FORMAT_SHIFT 12
100 # define GEN6_3DSTATE_SF_CULL_BOTH (0 << 29)
101 # define GEN6_3DSTATE_SF_CULL_NONE (1 << 29)
102 # define GEN6_3DSTATE_SF_CULL_FRONT (2 << 29)
103 # define GEN6_3DSTATE_SF_CULL_BACK (3 << 29)
105 # define GEN6_3DSTATE_SF_TRI_PROVOKE_SHIFT 29
106 # define GEN6_3DSTATE_SF_LINE_PROVOKE_SHIFT 27
107 # define GEN6_3DSTATE_SF_TRIFAN_PROVOKE_SHIFT 25
110 #define GEN6_3DSTATE_WM CMD(3, 0, 0x14)
112 # define GEN6_3DSTATE_WM_SAMPLER_COUNT_SHITF 27
113 # define GEN6_3DSTATE_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT 18
115 # define GEN6_3DSTATE_WM_DISPATCH_START_GRF_0_SHIFT 16
117 # define GEN6_3DSTATE_WM_MAX_THREADS_SHIFT 25
118 # define GEN6_3DSTATE_WM_DISPATCH_ENABLE (1 << 19)
119 # define GEN6_3DSTATE_WM_16_DISPATCH_ENABLE (1 << 1)
120 # define GEN6_3DSTATE_WM_8_DISPATCH_ENABLE (1 << 0)
122 # define GEN6_3DSTATE_WM_NUM_SF_OUTPUTS_SHIFT 20
123 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 15)
124 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC (1 << 14)
125 # define GEN6_3DSTATE_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC (1 << 13)
126 # define GEN6_3DSTATE_WM_PERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 12)
127 # define GEN6_3DSTATE_WM_PERSPECTIVE_CENTROID_BARYCENTRIC (1 << 11)
128 # define GEN6_3DSTATE_WM_PERSPECTIVE_PIXEL_BARYCENTRIC (1 << 10)
130 /* 3DSTATE_WM on GEN7 */
132 # define GEN7_WM_STATISTICS_ENABLE (1 << 31)
133 # define GEN7_WM_DEPTH_CLEAR (1 << 30)
134 # define GEN7_WM_DISPATCH_ENABLE (1 << 29)
135 # define GEN6_WM_DEPTH_RESOLVE (1 << 28)
136 # define GEN7_WM_HIERARCHICAL_DEPTH_RESOLVE (1 << 27)
137 # define GEN7_WM_KILL_ENABLE (1 << 25)
138 # define GEN7_WM_PSCDEPTH_OFF (0 << 23)
139 # define GEN7_WM_PSCDEPTH_ON (1 << 23)
140 # define GEN7_WM_PSCDEPTH_ON_GE (2 << 23)
141 # define GEN7_WM_PSCDEPTH_ON_LE (3 << 23)
142 # define GEN7_WM_USES_SOURCE_DEPTH (1 << 20)
143 # define GEN7_WM_USES_SOURCE_W (1 << 19)
144 # define GEN7_WM_POSITION_ZW_PIXEL (0 << 17)
145 # define GEN7_WM_POSITION_ZW_CENTROID (2 << 17)
146 # define GEN7_WM_POSITION_ZW_SAMPLE (3 << 17)
147 # define GEN7_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 16)
148 # define GEN7_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC (1 << 15)
149 # define GEN7_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC (1 << 14)
150 # define GEN7_WM_PERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 13)
151 # define GEN7_WM_PERSPECTIVE_CENTROID_BARYCENTRIC (1 << 12)
152 # define GEN7_WM_PERSPECTIVE_PIXEL_BARYCENTRIC (1 << 11)
153 # define GEN7_WM_USES_INPUT_COVERAGE_MASK (1 << 10)
154 # define GEN7_WM_LINE_END_CAP_AA_WIDTH_0_5 (0 << 8)
155 # define GEN7_WM_LINE_END_CAP_AA_WIDTH_1_0 (1 << 8)
156 # define GEN7_WM_LINE_END_CAP_AA_WIDTH_2_0 (2 << 8)
157 # define GEN7_WM_LINE_END_CAP_AA_WIDTH_4_0 (3 << 8)
158 # define GEN7_WM_LINE_AA_WIDTH_0_5 (0 << 6)
159 # define GEN7_WM_LINE_AA_WIDTH_1_0 (1 << 6)
160 # define GEN7_WM_LINE_AA_WIDTH_2_0 (2 << 6)
161 # define GEN7_WM_LINE_AA_WIDTH_4_0 (3 << 6)
162 # define GEN7_WM_POLYGON_STIPPLE_ENABLE (1 << 4)
163 # define GEN7_WM_LINE_STIPPLE_ENABLE (1 << 3)
164 # define GEN7_WM_POINT_RASTRULE_UPPER_RIGHT (1 << 2)
165 # define GEN7_WM_MSRAST_OFF_PIXEL (0 << 0)
166 # define GEN7_WM_MSRAST_OFF_PATTERN (1 << 0)
167 # define GEN7_WM_MSRAST_ON_PIXEL (2 << 0)
168 # define GEN7_WM_MSRAST_ON_PATTERN (3 << 0)
170 # define GEN7_WM_MSDISPMODE_PERPIXEL (1 << 31)
172 #define GEN6_3DSTATE_CONSTANT_VS CMD(3, 0, 0x15)
173 #define GEN6_3DSTATE_CONSTANT_GS CMD(3, 0, 0x16)
174 #define GEN6_3DSTATE_CONSTANT_PS CMD(3, 0, 0x17)
176 # define GEN6_3DSTATE_CONSTANT_BUFFER_3_ENABLE (1 << 15)
177 # define GEN6_3DSTATE_CONSTANT_BUFFER_2_ENABLE (1 << 14)
178 # define GEN6_3DSTATE_CONSTANT_BUFFER_1_ENABLE (1 << 13)
179 # define GEN6_3DSTATE_CONSTANT_BUFFER_0_ENABLE (1 << 12)
181 #define GEN6_3DSTATE_SAMPLE_MASK CMD(3, 0, 0x18)
183 #define GEN6_3DSTATE_MULTISAMPLE CMD(3, 1, 0x0d)
185 # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_CENTER (0 << 4)
186 # define GEN6_3DSTATE_MULTISAMPLE_PIXEL_LOCATION_UPPER_LEFT (1 << 4)
187 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_1 (0 << 1)
188 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_4 (2 << 1)
189 # define GEN6_3DSTATE_MULTISAMPLE_NUMSAMPLES_8 (3 << 1)
192 #define GEN7_3DSTATE_CLEAR_PARAMS CMD(3, 0, 0x04)
193 #define GEN7_3DSTATE_DEPTH_BUFFER CMD(3, 0, 0x05)
195 #define GEN7_3DSTATE_URB_VS CMD(3, 0, 0x30)
196 #define GEN7_3DSTATE_URB_HS CMD(3, 0, 0x31)
197 #define GEN7_3DSTATE_URB_DS CMD(3, 0, 0x32)
198 #define GEN7_3DSTATE_URB_GS CMD(3, 0, 0x33)
200 # define GEN7_URB_ENTRY_NUMBER_SHIFT 0
201 # define GEN7_URB_ENTRY_SIZE_SHIFT 16
202 # define GEN7_URB_STARTING_ADDRESS_SHIFT 25
204 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS CMD(3, 1, 0x12)
205 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS CMD(3, 1, 0x16)
207 # define GEN7_PUSH_CONSTANT_BUFFER_OFFSET_SHIFT 16
209 #define GEN7_3DSTATE_CONSTANT_HS CMD(3, 0, 0x19)
210 #define GEN7_3DSTATE_CONSTANT_DS CMD(3, 0, 0x1a)
212 #define GEN7_3DSTATE_HS CMD(3, 0, 0x1b)
213 #define GEN7_3DSTATE_TE CMD(3, 0, 0x1c)
214 #define GEN7_3DSTATE_DS CMD(3, 0, 0x1d)
215 #define GEN7_3DSTATE_STREAMOUT CMD(3, 0, 0x1e)
216 #define GEN7_3DSTATE_SBE CMD(3, 0, 0x1f)
219 # define GEN7_SBE_SWIZZLE_CONTROL_MODE (1 << 28)
220 # define GEN7_SBE_NUM_OUTPUTS_SHIFT 22
221 # define GEN7_SBE_SWIZZLE_ENABLE (1 << 21)
222 # define GEN7_SBE_POINT_SPRITE_LOWERLEFT (1 << 20)
223 # define GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT 11
224 # define GEN7_SBE_URB_ENTRY_READ_OFFSET_SHIFT 4
226 #define GEN7_3DSTATE_PS CMD(3, 0, 0x20)
227 /* DW1: kernel pointer */
229 # define GEN7_PS_SPF_MODE (1 << 31)
230 # define GEN7_PS_VECTOR_MASK_ENABLE (1 << 30)
231 # define GEN7_PS_SAMPLER_COUNT_SHIFT 27
232 # define GEN7_PS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18
233 # define GEN7_PS_FLOATING_POINT_MODE_IEEE_754 (0 << 16)
234 # define GEN7_PS_FLOATING_POINT_MODE_ALT (1 << 16)
235 /* DW3: scratch space */
237 # define GEN7_PS_MAX_THREADS_SHIFT_IVB 24
238 # define GEN7_PS_MAX_THREADS_SHIFT_HSW 23
239 # define GEN7_PS_SAMPLE_MASK_SHIFT_HSW 12
240 # define GEN7_PS_PUSH_CONSTANT_ENABLE (1 << 11)
241 # define GEN7_PS_ATTRIBUTE_ENABLE (1 << 10)
242 # define GEN7_PS_OMASK_TO_RENDER_TARGET (1 << 9)
243 # define GEN7_PS_DUAL_SOURCE_BLEND_ENABLE (1 << 7)
244 # define GEN7_PS_POSOFFSET_NONE (0 << 3)
245 # define GEN7_PS_POSOFFSET_CENTROID (2 << 3)
246 # define GEN7_PS_POSOFFSET_SAMPLE (3 << 3)
247 # define GEN7_PS_32_DISPATCH_ENABLE (1 << 2)
248 # define GEN7_PS_16_DISPATCH_ENABLE (1 << 1)
249 # define GEN7_PS_8_DISPATCH_ENABLE (1 << 0)
251 # define GEN7_PS_DISPATCH_START_GRF_SHIFT_0 16
252 # define GEN7_PS_DISPATCH_START_GRF_SHIFT_1 8
253 # define GEN7_PS_DISPATCH_START_GRF_SHIFT_2 0
254 /* DW6: kernel 1 pointer */
255 /* DW7: kernel 2 pointer */
257 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CL CMD(3, 0, 0x21)
258 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC CMD(3, 0, 0x23)
260 #define GEN7_3DSTATE_BLEND_STATE_POINTERS CMD(3, 0, 0x24)
261 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS CMD(3, 0, 0x25)
263 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS CMD(3, 0, 0x26)
264 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS CMD(3, 0, 0x27)
265 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS CMD(3, 0, 0x28)
266 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS CMD(3, 0, 0x29)
267 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS CMD(3, 0, 0x2a)
269 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS CMD(3, 0, 0x2b)
270 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS CMD(3, 0, 0x2e)
271 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS CMD(3, 0, 0x2f)
273 #define MFX(pipeline, op, sub_opa, sub_opb) \
280 #define MFX_PIPE_MODE_SELECT MFX(2, 0, 0, 0)
281 #define MFX_SURFACE_STATE MFX(2, 0, 0, 1)
282 #define MFX_PIPE_BUF_ADDR_STATE MFX(2, 0, 0, 2)
283 #define MFX_IND_OBJ_BASE_ADDR_STATE MFX(2, 0, 0, 3)
284 #define MFX_BSP_BUF_BASE_ADDR_STATE MFX(2, 0, 0, 4)
285 #define MFX_AES_STATE MFX(2, 0, 0, 5)
286 #define MFX_STATE_POINTER MFX(2, 0, 0, 6)
287 #define MFX_QM_STATE MFX(2, 0, 0, 7)
288 #define MFX_FQM_STATE MFX(2, 0, 0, 8)
290 #define MFX_INSERT_OBJECT MFX(2, 0, 2, 8)
292 #define MFX_WAIT MFX(1, 0, 0, 0)
294 #define MFX_AVC_IMG_STATE MFX(2, 1, 0, 0)
295 #define MFX_AVC_QM_STATE MFX(2, 1, 0, 1)
296 #define MFX_AVC_DIRECTMODE_STATE MFX(2, 1, 0, 2)
297 #define MFX_AVC_SLICE_STATE MFX(2, 1, 0, 3)
298 #define MFX_AVC_REF_IDX_STATE MFX(2, 1, 0, 4)
299 #define MFX_AVC_WEIGHTOFFSET_STATE MFX(2, 1, 0, 5)
301 #define MFD_AVC_PICID_STATE MFX(2, 1, 1, 5)
302 #define MFD_AVC_BSD_OBJECT MFX(2, 1, 1, 8)
304 #define MFC_AVC_FQM_STATE MFX(2, 1, 2, 2)
305 #define MFC_AVC_INSERT_OBJECT MFX(2, 1, 2, 8)
306 #define MFC_AVC_PAK_OBJECT MFX(2, 1, 2, 9)
308 #define MFX_MPEG2_PIC_STATE MFX(2, 3, 0, 0)
309 #define MFX_MPEG2_QM_STATE MFX(2, 3, 0, 1)
311 #define MFD_MPEG2_BSD_OBJECT MFX(2, 3, 1, 8)
313 #define MFC_MPEG2_SLICEGROUP_STATE MFX(2, 3, 2, 3)
314 #define MFC_MPEG2_PAK_OBJECT MFX(2, 3, 2, 9)
316 #define MFX_VC1_PIC_STATE MFX(2, 2, 0, 0)
317 #define MFX_VC1_PRED_PIPE_STATE MFX(2, 2, 0, 1)
318 #define MFX_VC1_DIRECTMODE_STATE MFX(2, 2, 0, 2)
320 #define MFD_VC1_SHORT_PIC_STATE MFX(2, 2, 1, 0)
321 #define MFD_VC1_LONG_PIC_STATE MFX(2, 2, 1, 1)
323 #define MFD_VC1_BSD_OBJECT MFX(2, 2, 1, 8)
325 #define MFX_JPEG_PIC_STATE MFX(2, 7, 0, 0)
326 #define MFX_JPEG_HUFF_TABLE_STATE MFX(2, 7, 0, 2)
328 #define MFD_JPEG_BSD_OBJECT MFX(2, 7, 1, 8)
330 #define VEB(pipeline, op, sub_opa, sub_opb) \
337 #define VEB_SURFACE_STATE VEB(2, 4, 0, 0)
338 #define VEB_STATE VEB(2, 4, 0, 2)
339 #define VEB_DNDI_IECP_STATE VEB(2, 4, 0, 3)
341 #define I965_DEPTHFORMAT_D32_FLOAT 1
343 #define BASE_ADDRESS_MODIFY (1 << 0)
345 #define PIPELINE_SELECT_3D 0
346 #define PIPELINE_SELECT_MEDIA 1
349 #define UF0_CS_REALLOC (1 << 13)
350 #define UF0_VFE_REALLOC (1 << 12)
351 #define UF0_SF_REALLOC (1 << 11)
352 #define UF0_CLIP_REALLOC (1 << 10)
353 #define UF0_GS_REALLOC (1 << 9)
354 #define UF0_VS_REALLOC (1 << 8)
355 #define UF1_CLIP_FENCE_SHIFT 20
356 #define UF1_GS_FENCE_SHIFT 10
357 #define UF1_VS_FENCE_SHIFT 0
358 #define UF2_CS_FENCE_SHIFT 20
359 #define UF2_VFE_FENCE_SHIFT 10
360 #define UF2_SF_FENCE_SHIFT 0
362 #define VFE_GENERIC_MODE 0x0
363 #define VFE_VLD_MODE 0x1
364 #define VFE_IS_MODE 0x2
365 #define VFE_AVC_MC_MODE 0x4
366 #define VFE_AVC_IT_MODE 0x7
368 #define FLOATING_POINT_IEEE_754 0
369 #define FLOATING_POINT_NON_IEEE_754 1
372 #define I965_SURFACE_1D 0
373 #define I965_SURFACE_2D 1
374 #define I965_SURFACE_3D 2
375 #define I965_SURFACE_CUBE 3
376 #define I965_SURFACE_BUFFER 4
377 #define I965_SURFACE_NULL 7
379 #define I965_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000
380 #define I965_SURFACEFORMAT_R32G32B32A32_SINT 0x001
381 #define I965_SURFACEFORMAT_R32G32B32A32_UINT 0x002
382 #define I965_SURFACEFORMAT_R32G32B32A32_UNORM 0x003
383 #define I965_SURFACEFORMAT_R32G32B32A32_SNORM 0x004
384 #define I965_SURFACEFORMAT_R64G64_FLOAT 0x005
385 #define I965_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006
386 #define I965_SURFACEFORMAT_R32G32B32A32_SSCALED 0x007
387 #define I965_SURFACEFORMAT_R32G32B32A32_USCALED 0x008
388 #define I965_SURFACEFORMAT_R32G32B32_FLOAT 0x040
389 #define I965_SURFACEFORMAT_R32G32B32_SINT 0x041
390 #define I965_SURFACEFORMAT_R32G32B32_UINT 0x042
391 #define I965_SURFACEFORMAT_R32G32B32_UNORM 0x043
392 #define I965_SURFACEFORMAT_R32G32B32_SNORM 0x044
393 #define I965_SURFACEFORMAT_R32G32B32_SSCALED 0x045
394 #define I965_SURFACEFORMAT_R32G32B32_USCALED 0x046
395 #define I965_SURFACEFORMAT_R16G16B16A16_UNORM 0x080
396 #define I965_SURFACEFORMAT_R16G16B16A16_SNORM 0x081
397 #define I965_SURFACEFORMAT_R16G16B16A16_SINT 0x082
398 #define I965_SURFACEFORMAT_R16G16B16A16_UINT 0x083
399 #define I965_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084
400 #define I965_SURFACEFORMAT_R32G32_FLOAT 0x085
401 #define I965_SURFACEFORMAT_R32G32_SINT 0x086
402 #define I965_SURFACEFORMAT_R32G32_UINT 0x087
403 #define I965_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088
404 #define I965_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089
405 #define I965_SURFACEFORMAT_L32A32_FLOAT 0x08A
406 #define I965_SURFACEFORMAT_R32G32_UNORM 0x08B
407 #define I965_SURFACEFORMAT_R32G32_SNORM 0x08C
408 #define I965_SURFACEFORMAT_R64_FLOAT 0x08D
409 #define I965_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E
410 #define I965_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F
411 #define I965_SURFACEFORMAT_A32X32_FLOAT 0x090
412 #define I965_SURFACEFORMAT_L32X32_FLOAT 0x091
413 #define I965_SURFACEFORMAT_I32X32_FLOAT 0x092
414 #define I965_SURFACEFORMAT_R16G16B16A16_SSCALED 0x093
415 #define I965_SURFACEFORMAT_R16G16B16A16_USCALED 0x094
416 #define I965_SURFACEFORMAT_R32G32_SSCALED 0x095
417 #define I965_SURFACEFORMAT_R32G32_USCALED 0x096
418 #define I965_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0
419 #define I965_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1
420 #define I965_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2
421 #define I965_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3
422 #define I965_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4
423 #define I965_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5
424 #define I965_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7
425 #define I965_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8
426 #define I965_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9
427 #define I965_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA
428 #define I965_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB
429 #define I965_SURFACEFORMAT_R16G16_UNORM 0x0CC
430 #define I965_SURFACEFORMAT_R16G16_SNORM 0x0CD
431 #define I965_SURFACEFORMAT_R16G16_SINT 0x0CE
432 #define I965_SURFACEFORMAT_R16G16_UINT 0x0CF
433 #define I965_SURFACEFORMAT_R16G16_FLOAT 0x0D0
434 #define I965_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1
435 #define I965_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2
436 #define I965_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3
437 #define I965_SURFACEFORMAT_R32_SINT 0x0D6
438 #define I965_SURFACEFORMAT_R32_UINT 0x0D7
439 #define I965_SURFACEFORMAT_R32_FLOAT 0x0D8
440 #define I965_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9
441 #define I965_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA
442 #define I965_SURFACEFORMAT_L16A16_UNORM 0x0DF
443 #define I965_SURFACEFORMAT_I24X8_UNORM 0x0E0
444 #define I965_SURFACEFORMAT_L24X8_UNORM 0x0E1
445 #define I965_SURFACEFORMAT_A24X8_UNORM 0x0E2
446 #define I965_SURFACEFORMAT_I32_FLOAT 0x0E3
447 #define I965_SURFACEFORMAT_L32_FLOAT 0x0E4
448 #define I965_SURFACEFORMAT_A32_FLOAT 0x0E5
449 #define I965_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9
450 #define I965_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA
451 #define I965_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB
452 #define I965_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC
453 #define I965_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED
454 #define I965_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE
455 #define I965_SURFACEFORMAT_L16A16_FLOAT 0x0F0
456 #define I965_SURFACEFORMAT_R32_UNORM 0x0F1
457 #define I965_SURFACEFORMAT_R32_SNORM 0x0F2
458 #define I965_SURFACEFORMAT_R10G10B10X2_USCALED 0x0F3
459 #define I965_SURFACEFORMAT_R8G8B8A8_SSCALED 0x0F4
460 #define I965_SURFACEFORMAT_R8G8B8A8_USCALED 0x0F5
461 #define I965_SURFACEFORMAT_R16G16_SSCALED 0x0F6
462 #define I965_SURFACEFORMAT_R16G16_USCALED 0x0F7
463 #define I965_SURFACEFORMAT_R32_SSCALED 0x0F8
464 #define I965_SURFACEFORMAT_R32_USCALED 0x0F9
465 #define I965_SURFACEFORMAT_B5G6R5_UNORM 0x100
466 #define I965_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101
467 #define I965_SURFACEFORMAT_B5G5R5A1_UNORM 0x102
468 #define I965_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103
469 #define I965_SURFACEFORMAT_B4G4R4A4_UNORM 0x104
470 #define I965_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105
471 #define I965_SURFACEFORMAT_R8G8_UNORM 0x106
472 #define I965_SURFACEFORMAT_R8G8_SNORM 0x107
473 #define I965_SURFACEFORMAT_R8G8_SINT 0x108
474 #define I965_SURFACEFORMAT_R8G8_UINT 0x109
475 #define I965_SURFACEFORMAT_R16_UNORM 0x10A
476 #define I965_SURFACEFORMAT_R16_SNORM 0x10B
477 #define I965_SURFACEFORMAT_R16_SINT 0x10C
478 #define I965_SURFACEFORMAT_R16_UINT 0x10D
479 #define I965_SURFACEFORMAT_R16_FLOAT 0x10E
480 #define I965_SURFACEFORMAT_I16_UNORM 0x111
481 #define I965_SURFACEFORMAT_L16_UNORM 0x112
482 #define I965_SURFACEFORMAT_A16_UNORM 0x113
483 #define I965_SURFACEFORMAT_L8A8_UNORM 0x114
484 #define I965_SURFACEFORMAT_I16_FLOAT 0x115
485 #define I965_SURFACEFORMAT_L16_FLOAT 0x116
486 #define I965_SURFACEFORMAT_A16_FLOAT 0x117
487 #define I965_SURFACEFORMAT_R5G5_SNORM_B6_UNORM 0x119
488 #define I965_SURFACEFORMAT_B5G5R5X1_UNORM 0x11A
489 #define I965_SURFACEFORMAT_B5G5R5X1_UNORM_SRGB 0x11B
490 #define I965_SURFACEFORMAT_R8G8_SSCALED 0x11C
491 #define I965_SURFACEFORMAT_R8G8_USCALED 0x11D
492 #define I965_SURFACEFORMAT_R16_SSCALED 0x11E
493 #define I965_SURFACEFORMAT_R16_USCALED 0x11F
494 #define I965_SURFACEFORMAT_P8A8_UNORM 0x122
495 #define I965_SURFACEFORMAT_A8P8_UNORM 0x123
496 #define I965_SURFACEFORMAT_R8_UNORM 0x140
497 #define I965_SURFACEFORMAT_R8_SNORM 0x141
498 #define I965_SURFACEFORMAT_R8_SINT 0x142
499 #define I965_SURFACEFORMAT_R8_UINT 0x143
500 #define I965_SURFACEFORMAT_A8_UNORM 0x144
501 #define I965_SURFACEFORMAT_I8_UNORM 0x145
502 #define I965_SURFACEFORMAT_L8_UNORM 0x146
503 #define I965_SURFACEFORMAT_P4A4_UNORM 0x147
504 #define I965_SURFACEFORMAT_A4P4_UNORM 0x148
505 #define I965_SURFACEFORMAT_R8_SSCALED 0x149
506 #define I965_SURFACEFORMAT_R8_USCALED 0x14A
507 #define I965_SURFACEFORMAT_R1_UINT 0x181
508 #define I965_SURFACEFORMAT_YCRCB_NORMAL 0x182
509 #define I965_SURFACEFORMAT_YCRCB_SWAPUVY 0x183
510 #define I965_SURFACEFORMAT_BC1_UNORM 0x186
511 #define I965_SURFACEFORMAT_BC2_UNORM 0x187
512 #define I965_SURFACEFORMAT_BC3_UNORM 0x188
513 #define I965_SURFACEFORMAT_BC4_UNORM 0x189
514 #define I965_SURFACEFORMAT_BC5_UNORM 0x18A
515 #define I965_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B
516 #define I965_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C
517 #define I965_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D
518 #define I965_SURFACEFORMAT_MONO8 0x18E
519 #define I965_SURFACEFORMAT_YCRCB_SWAPUV 0x18F
520 #define I965_SURFACEFORMAT_YCRCB_SWAPY 0x190
521 #define I965_SURFACEFORMAT_DXT1_RGB 0x191
522 #define I965_SURFACEFORMAT_FXT1 0x192
523 #define I965_SURFACEFORMAT_R8G8B8_UNORM 0x193
524 #define I965_SURFACEFORMAT_R8G8B8_SNORM 0x194
525 #define I965_SURFACEFORMAT_R8G8B8_SSCALED 0x195
526 #define I965_SURFACEFORMAT_R8G8B8_USCALED 0x196
527 #define I965_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197
528 #define I965_SURFACEFORMAT_R64G64B64_FLOAT 0x198
529 #define I965_SURFACEFORMAT_BC4_SNORM 0x199
530 #define I965_SURFACEFORMAT_BC5_SNORM 0x19A
531 #define I965_SURFACEFORMAT_R16G16B16_UNORM 0x19C
532 #define I965_SURFACEFORMAT_R16G16B16_SNORM 0x19D
533 #define I965_SURFACEFORMAT_R16G16B16_SSCALED 0x19E
534 #define I965_SURFACEFORMAT_R16G16B16_USCALED 0x19F
536 #define I965_CULLMODE_BOTH 0
537 #define I965_CULLMODE_NONE 1
538 #define I965_CULLMODE_FRONT 2
539 #define I965_CULLMODE_BACK 3
541 #define I965_MAPFILTER_NEAREST 0x0
542 #define I965_MAPFILTER_LINEAR 0x1
543 #define I965_MAPFILTER_ANISOTROPIC 0x2
545 #define I965_MIPFILTER_NONE 0
546 #define I965_MIPFILTER_NEAREST 1
547 #define I965_MIPFILTER_LINEAR 3
549 #define HSW_SCS_ZERO 0
550 #define HSW_SCS_ONE 1
551 #define HSW_SCS_RED 4
552 #define HSW_SCS_GREEN 5
553 #define HSW_SCS_BLUE 6
554 #define HSW_SCS_ALPHA 7
556 #define I965_TEXCOORDMODE_WRAP 0
557 #define I965_TEXCOORDMODE_MIRROR 1
558 #define I965_TEXCOORDMODE_CLAMP 2
559 #define I965_TEXCOORDMODE_CUBE 3
560 #define I965_TEXCOORDMODE_CLAMP_BORDER 4
561 #define I965_TEXCOORDMODE_MIRROR_ONCE 5
563 #define I965_BLENDFACTOR_ONE 0x1
564 #define I965_BLENDFACTOR_SRC_COLOR 0x2
565 #define I965_BLENDFACTOR_SRC_ALPHA 0x3
566 #define I965_BLENDFACTOR_DST_ALPHA 0x4
567 #define I965_BLENDFACTOR_DST_COLOR 0x5
568 #define I965_BLENDFACTOR_SRC_ALPHA_SATURATE 0x6
569 #define I965_BLENDFACTOR_CONST_COLOR 0x7
570 #define I965_BLENDFACTOR_CONST_ALPHA 0x8
571 #define I965_BLENDFACTOR_SRC1_COLOR 0x9
572 #define I965_BLENDFACTOR_SRC1_ALPHA 0x0A
573 #define I965_BLENDFACTOR_ZERO 0x11
574 #define I965_BLENDFACTOR_INV_SRC_COLOR 0x12
575 #define I965_BLENDFACTOR_INV_SRC_ALPHA 0x13
576 #define I965_BLENDFACTOR_INV_DST_ALPHA 0x14
577 #define I965_BLENDFACTOR_INV_DST_COLOR 0x15
578 #define I965_BLENDFACTOR_INV_CONST_COLOR 0x17
579 #define I965_BLENDFACTOR_INV_CONST_ALPHA 0x18
580 #define I965_BLENDFACTOR_INV_SRC1_COLOR 0x19
581 #define I965_BLENDFACTOR_INV_SRC1_ALPHA 0x1A
583 #define I965_BLENDFUNCTION_ADD 0
584 #define I965_BLENDFUNCTION_SUBTRACT 1
585 #define I965_BLENDFUNCTION_REVERSE_SUBTRACT 2
586 #define I965_BLENDFUNCTION_MIN 3
587 #define I965_BLENDFUNCTION_MAX 4
589 #define I965_SURFACERETURNFORMAT_FLOAT32 0
590 #define I965_SURFACERETURNFORMAT_S1 1
592 #define I965_VFCOMPONENT_NOSTORE 0
593 #define I965_VFCOMPONENT_STORE_SRC 1
594 #define I965_VFCOMPONENT_STORE_0 2
595 #define I965_VFCOMPONENT_STORE_1_FLT 3
596 #define I965_VFCOMPONENT_STORE_1_INT 4
597 #define I965_VFCOMPONENT_STORE_VID 5
598 #define I965_VFCOMPONENT_STORE_IID 6
599 #define I965_VFCOMPONENT_STORE_PID 7
601 #define VE0_VERTEX_BUFFER_INDEX_SHIFT 27
602 #define GEN6_VE0_VERTEX_BUFFER_INDEX_SHIFT 26 /* for GEN6 */
603 #define VE0_VALID (1 << 26)
604 #define GEN6_VE0_VALID (1 << 25) /* for GEN6 */
605 #define VE0_FORMAT_SHIFT 16
606 #define VE0_OFFSET_SHIFT 0
607 #define VE1_VFCOMPONENT_0_SHIFT 28
608 #define VE1_VFCOMPONENT_1_SHIFT 24
609 #define VE1_VFCOMPONENT_2_SHIFT 20
610 #define VE1_VFCOMPONENT_3_SHIFT 16
611 #define VE1_DESTINATION_ELEMENT_OFFSET_SHIFT 0
613 #define VB0_BUFFER_INDEX_SHIFT 27
614 #define GEN6_VB0_BUFFER_INDEX_SHIFT 26
615 #define VB0_VERTEXDATA (0 << 26)
616 #define VB0_INSTANCEDATA (1 << 26)
617 #define GEN6_VB0_VERTEXDATA (0 << 20)
618 #define GEN6_VB0_INSTANCEDATA (1 << 20)
619 #define GEN7_VB0_ADDRESS_MODIFYENABLE (1 << 14)
620 #define VB0_BUFFER_PITCH_SHIFT 0
622 #define _3DPRIMITIVE_VERTEX_SEQUENTIAL (0 << 15)
623 #define _3DPRIMITIVE_VERTEX_RANDOM (1 << 15)
624 #define _3DPRIMITIVE_TOPOLOGY_SHIFT 10
626 # define GEN7_3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL (0 << 8)
627 # define GEN7_3DPRIM_VERTEXBUFFER_ACCESS_RANDOM (1 << 8)
629 #define _3DPRIM_POINTLIST 0x01
630 #define _3DPRIM_LINELIST 0x02
631 #define _3DPRIM_LINESTRIP 0x03
632 #define _3DPRIM_TRILIST 0x04
633 #define _3DPRIM_TRISTRIP 0x05
634 #define _3DPRIM_TRIFAN 0x06
635 #define _3DPRIM_QUADLIST 0x07
636 #define _3DPRIM_QUADSTRIP 0x08
637 #define _3DPRIM_LINELIST_ADJ 0x09
638 #define _3DPRIM_LINESTRIP_ADJ 0x0A
639 #define _3DPRIM_TRILIST_ADJ 0x0B
640 #define _3DPRIM_TRISTRIP_ADJ 0x0C
641 #define _3DPRIM_TRISTRIP_REVERSE 0x0D
642 #define _3DPRIM_POLYGON 0x0E
643 #define _3DPRIM_RECTLIST 0x0F
644 #define _3DPRIM_LINELOOP 0x10
645 #define _3DPRIM_POINTLIST_BF 0x11
646 #define _3DPRIM_LINESTRIP_CONT 0x12
647 #define _3DPRIM_LINESTRIP_BF 0x13
648 #define _3DPRIM_LINESTRIP_CONT_BF 0x14
649 #define _3DPRIM_TRIFAN_NOSTIPPLE 0x15
651 #define I965_TILEWALK_XMAJOR 0
652 #define I965_TILEWALK_YMAJOR 1
654 #define SCAN_RASTER_ORDER 0
655 #define SCAN_SPECIAL_ORDER 1
657 #define ENTROPY_CAVLD 0
658 #define ENTROPY_CABAC 1
660 #define SLICE_TYPE_P 0
661 #define SLICE_TYPE_B 1
662 #define SLICE_TYPE_I 2
663 #define SLICE_TYPE_SP 3
664 #define SLICE_TYPE_SI 4
666 #define PRESENT_REF_LIST0 (1 << 0)
667 #define PRESENT_REF_LIST1 (1 << 1)
668 #define PRESENT_WEIGHT_OFFSET_L0 (1 << 2)
669 #define PRESENT_WEIGHT_OFFSET_L1 (1 << 3)
671 #define RESIDUAL_DATA_OFFSET 48
673 #define PRESENT_NOMV 0
674 #define PRESENT_NOWO 1
675 #define PRESENT_MV_WO 3
677 #define SCOREBOARD_STALLING 0
678 #define SCOREBOARD_NON_STALLING 1
680 #define SURFACE_FORMAT_YCRCB_NORMAL 0
681 #define SURFACE_FORMAT_YCRCB_SWAPUVY 1
682 #define SURFACE_FORMAT_YCRCB_SWAPUV 2
683 #define SURFACE_FORMAT_YCRCB_SWAPY 3
684 #define SURFACE_FORMAT_PLANAR_420_8 4
685 #define SURFACE_FORMAT_PLANAR_411_8 5
686 #define SURFACE_FORMAT_PLANAR_422_8 6
687 #define SURFACE_FORMAT_STMM_DN_STATISTICS 7
688 #define SURFACE_FORMAT_R10G10B10A2_UNORM 8
689 #define SURFACE_FORMAT_R8G8B8A8_UNORM 9
690 #define SURFACE_FORMAT_R8B8_UNORM 10
691 #define SURFACE_FORMAT_R8_UNORM 11
692 #define SURFACE_FORMAT_Y8_UNORM 12
694 #define AVS_FILTER_ADAPTIVE_8_TAP 0
695 #define AVS_FILTER_NEAREST 1
697 #define IEF_FILTER_COMBO 0
698 #define IEF_FILTER_DETAIL 1
700 #define IEF_FILTER_SIZE_3X3 0
701 #define IEF_FILTER_SIZE_5X5 1
703 #define MFX_FORMAT_MPEG2 0
704 #define MFX_FORMAT_VC1 1
705 #define MFX_FORMAT_AVC 2
706 #define MFX_FORMAT_JPEG 3
708 #define MFX_SHORT_MODE 0
709 #define MFX_LONG_MODE 1
711 #define MFX_CODEC_DECODE 0
712 #define MFX_CODEC_ENCODE 1
714 #define MFX_QM_AVC_4X4_INTRA_MATRIX 0
715 #define MFX_QM_AVC_4X4_INTER_MATRIX 1
716 #define MFX_QM_AVC_8x8_INTRA_MATRIX 2
717 #define MFX_QM_AVC_8x8_INTER_MATRIX 3
719 #define MFX_QM_MPEG_INTRA_QUANTIZER_MATRIX 0
720 #define MFX_QM_MPEG_NON_INTRA_QUANTIZER_MATRIX 1
722 #define MFX_QM_JPEG_LUMA_Y_QUANTIZER_MATRIX 0
723 #define MFX_QM_JPEG_CHROMA_CB_QUANTIZER_MATRIX 1
724 #define MFX_QM_JPEG_CHROMA_CR_QUANTIZER_MATRIX 2
725 #define MFX_QM_JPEG_ALPHA_QUANTIZER_MATRIX 3 /* for new device */
727 #define MFX_HUFFTABLE_ID_Y 0
728 #define MFX_HUFFTABLE_ID_UV 1 /* UV on Ivybridge */
730 #define MFD_MODE_VLD 0
731 #define MFD_MODE_IT 1
733 #define MFX_SURFACE_PLANAR_420_8 4
734 #define MFX_SURFACE_PLANAR_411_8 5
735 #define MFX_SURFACE_PLANAR_422_8 6
736 #define MFX_SURFACE_MONOCHROME 12
738 #define MPEG_I_PICTURE 1
739 #define MPEG_P_PICTURE 2
740 #define MPEG_B_PICTURE 3
742 #define MPEG_TOP_FIELD 1
743 #define MPEG_BOTTOM_FIELD 2
746 #define SUBSAMPLE_YUV400 0
747 #define SUBSAMPLE_YUV420 1
748 #define SUBSAMPLE_YUV422H 2
749 #define SUBSAMPLE_YUV422V 3
750 #define SUBSAMPLE_YUV444 4
751 #define SUBSAMPLE_YUV411 5
752 #define SUBSAMPLE_RGBX 6
754 #define URB_SIZE(intel) (IS_GEN7(intel->device_id) ? 4096 : \
755 IS_GEN6(intel->device_id) ? 1024 : \
756 IS_IRONLAKE(intel->device_id) ? 1024 : \
757 IS_G4X(intel->device_id) ? 384 : 256)
759 #endif /* _I965_DEFINES_H_ */