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_OBJECT CMD(2, 1, 0)
21 #define CMD_MEDIA_OBJECT_EX CMD(2, 1, 1)
23 #define CMD_AVC_BSD_IMG_STATE CMD(2, 4, 0)
24 #define CMD_AVC_BSD_QM_STATE CMD(2, 4, 1)
25 #define CMD_AVC_BSD_SLICE_STATE CMD(2, 4, 2)
26 #define CMD_AVC_BSD_BUF_BASE_STATE CMD(2, 4, 3)
27 #define CMD_BSD_IND_OBJ_BASE_ADDR CMD(2, 4, 4)
28 #define CMD_AVC_BSD_OBJECT CMD(2, 4, 8)
30 #define CMD_PIPELINED_POINTERS CMD(3, 0, 0)
31 #define CMD_BINDING_TABLE_POINTERS CMD(3, 0, 1)
32 #define CMD_VERTEX_BUFFERS CMD(3, 0, 8)
33 #define CMD_VERTEX_ELEMENTS CMD(3, 0, 9)
34 #define CMD_DRAWING_RECTANGLE CMD(3, 1, 0)
35 #define CMD_CONSTANT_COLOR CMD(3, 1, 1)
36 #define CMD_3DPRIMITIVE CMD(3, 3, 0)
38 #define BASE_ADDRESS_MODIFY (1 << 0)
40 #define PIPELINE_SELECT_3D 0
41 #define PIPELINE_SELECT_MEDIA 1
44 #define UF0_CS_REALLOC (1 << 13)
45 #define UF0_VFE_REALLOC (1 << 12)
46 #define UF0_SF_REALLOC (1 << 11)
47 #define UF0_CLIP_REALLOC (1 << 10)
48 #define UF0_GS_REALLOC (1 << 9)
49 #define UF0_VS_REALLOC (1 << 8)
50 #define UF1_CLIP_FENCE_SHIFT 20
51 #define UF1_GS_FENCE_SHIFT 10
52 #define UF1_VS_FENCE_SHIFT 0
53 #define UF2_CS_FENCE_SHIFT 20
54 #define UF2_VFE_FENCE_SHIFT 10
55 #define UF2_SF_FENCE_SHIFT 0
57 #define VFE_GENERIC_MODE 0x0
58 #define VFE_VLD_MODE 0x1
59 #define VFE_IS_MODE 0x2
60 #define VFE_AVC_MC_MODE 0x4
61 #define VFE_AVC_IT_MODE 0x7
63 #define FLOATING_POINT_IEEE_754 0
64 #define FLOATING_POINT_NON_IEEE_754 1
67 #define I965_SURFACE_1D 0
68 #define I965_SURFACE_2D 1
69 #define I965_SURFACE_3D 2
70 #define I965_SURFACE_CUBE 3
71 #define I965_SURFACE_BUFFER 4
72 #define I965_SURFACE_NULL 7
74 #define I965_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000
75 #define I965_SURFACEFORMAT_R32G32B32A32_SINT 0x001
76 #define I965_SURFACEFORMAT_R32G32B32A32_UINT 0x002
77 #define I965_SURFACEFORMAT_R32G32B32A32_UNORM 0x003
78 #define I965_SURFACEFORMAT_R32G32B32A32_SNORM 0x004
79 #define I965_SURFACEFORMAT_R64G64_FLOAT 0x005
80 #define I965_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006
81 #define I965_SURFACEFORMAT_R32G32B32A32_SSCALED 0x007
82 #define I965_SURFACEFORMAT_R32G32B32A32_USCALED 0x008
83 #define I965_SURFACEFORMAT_R32G32B32_FLOAT 0x040
84 #define I965_SURFACEFORMAT_R32G32B32_SINT 0x041
85 #define I965_SURFACEFORMAT_R32G32B32_UINT 0x042
86 #define I965_SURFACEFORMAT_R32G32B32_UNORM 0x043
87 #define I965_SURFACEFORMAT_R32G32B32_SNORM 0x044
88 #define I965_SURFACEFORMAT_R32G32B32_SSCALED 0x045
89 #define I965_SURFACEFORMAT_R32G32B32_USCALED 0x046
90 #define I965_SURFACEFORMAT_R16G16B16A16_UNORM 0x080
91 #define I965_SURFACEFORMAT_R16G16B16A16_SNORM 0x081
92 #define I965_SURFACEFORMAT_R16G16B16A16_SINT 0x082
93 #define I965_SURFACEFORMAT_R16G16B16A16_UINT 0x083
94 #define I965_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084
95 #define I965_SURFACEFORMAT_R32G32_FLOAT 0x085
96 #define I965_SURFACEFORMAT_R32G32_SINT 0x086
97 #define I965_SURFACEFORMAT_R32G32_UINT 0x087
98 #define I965_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088
99 #define I965_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089
100 #define I965_SURFACEFORMAT_L32A32_FLOAT 0x08A
101 #define I965_SURFACEFORMAT_R32G32_UNORM 0x08B
102 #define I965_SURFACEFORMAT_R32G32_SNORM 0x08C
103 #define I965_SURFACEFORMAT_R64_FLOAT 0x08D
104 #define I965_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E
105 #define I965_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F
106 #define I965_SURFACEFORMAT_A32X32_FLOAT 0x090
107 #define I965_SURFACEFORMAT_L32X32_FLOAT 0x091
108 #define I965_SURFACEFORMAT_I32X32_FLOAT 0x092
109 #define I965_SURFACEFORMAT_R16G16B16A16_SSCALED 0x093
110 #define I965_SURFACEFORMAT_R16G16B16A16_USCALED 0x094
111 #define I965_SURFACEFORMAT_R32G32_SSCALED 0x095
112 #define I965_SURFACEFORMAT_R32G32_USCALED 0x096
113 #define I965_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0
114 #define I965_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1
115 #define I965_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2
116 #define I965_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3
117 #define I965_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4
118 #define I965_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5
119 #define I965_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7
120 #define I965_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8
121 #define I965_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9
122 #define I965_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA
123 #define I965_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB
124 #define I965_SURFACEFORMAT_R16G16_UNORM 0x0CC
125 #define I965_SURFACEFORMAT_R16G16_SNORM 0x0CD
126 #define I965_SURFACEFORMAT_R16G16_SINT 0x0CE
127 #define I965_SURFACEFORMAT_R16G16_UINT 0x0CF
128 #define I965_SURFACEFORMAT_R16G16_FLOAT 0x0D0
129 #define I965_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1
130 #define I965_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2
131 #define I965_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3
132 #define I965_SURFACEFORMAT_R32_SINT 0x0D6
133 #define I965_SURFACEFORMAT_R32_UINT 0x0D7
134 #define I965_SURFACEFORMAT_R32_FLOAT 0x0D8
135 #define I965_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9
136 #define I965_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA
137 #define I965_SURFACEFORMAT_L16A16_UNORM 0x0DF
138 #define I965_SURFACEFORMAT_I24X8_UNORM 0x0E0
139 #define I965_SURFACEFORMAT_L24X8_UNORM 0x0E1
140 #define I965_SURFACEFORMAT_A24X8_UNORM 0x0E2
141 #define I965_SURFACEFORMAT_I32_FLOAT 0x0E3
142 #define I965_SURFACEFORMAT_L32_FLOAT 0x0E4
143 #define I965_SURFACEFORMAT_A32_FLOAT 0x0E5
144 #define I965_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9
145 #define I965_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA
146 #define I965_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB
147 #define I965_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC
148 #define I965_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED
149 #define I965_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE
150 #define I965_SURFACEFORMAT_L16A16_FLOAT 0x0F0
151 #define I965_SURFACEFORMAT_R32_UNORM 0x0F1
152 #define I965_SURFACEFORMAT_R32_SNORM 0x0F2
153 #define I965_SURFACEFORMAT_R10G10B10X2_USCALED 0x0F3
154 #define I965_SURFACEFORMAT_R8G8B8A8_SSCALED 0x0F4
155 #define I965_SURFACEFORMAT_R8G8B8A8_USCALED 0x0F5
156 #define I965_SURFACEFORMAT_R16G16_SSCALED 0x0F6
157 #define I965_SURFACEFORMAT_R16G16_USCALED 0x0F7
158 #define I965_SURFACEFORMAT_R32_SSCALED 0x0F8
159 #define I965_SURFACEFORMAT_R32_USCALED 0x0F9
160 #define I965_SURFACEFORMAT_B5G6R5_UNORM 0x100
161 #define I965_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101
162 #define I965_SURFACEFORMAT_B5G5R5A1_UNORM 0x102
163 #define I965_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103
164 #define I965_SURFACEFORMAT_B4G4R4A4_UNORM 0x104
165 #define I965_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105
166 #define I965_SURFACEFORMAT_R8G8_UNORM 0x106
167 #define I965_SURFACEFORMAT_R8G8_SNORM 0x107
168 #define I965_SURFACEFORMAT_R8G8_SINT 0x108
169 #define I965_SURFACEFORMAT_R8G8_UINT 0x109
170 #define I965_SURFACEFORMAT_R16_UNORM 0x10A
171 #define I965_SURFACEFORMAT_R16_SNORM 0x10B
172 #define I965_SURFACEFORMAT_R16_SINT 0x10C
173 #define I965_SURFACEFORMAT_R16_UINT 0x10D
174 #define I965_SURFACEFORMAT_R16_FLOAT 0x10E
175 #define I965_SURFACEFORMAT_I16_UNORM 0x111
176 #define I965_SURFACEFORMAT_L16_UNORM 0x112
177 #define I965_SURFACEFORMAT_A16_UNORM 0x113
178 #define I965_SURFACEFORMAT_L8A8_UNORM 0x114
179 #define I965_SURFACEFORMAT_I16_FLOAT 0x115
180 #define I965_SURFACEFORMAT_L16_FLOAT 0x116
181 #define I965_SURFACEFORMAT_A16_FLOAT 0x117
182 #define I965_SURFACEFORMAT_R5G5_SNORM_B6_UNORM 0x119
183 #define I965_SURFACEFORMAT_B5G5R5X1_UNORM 0x11A
184 #define I965_SURFACEFORMAT_B5G5R5X1_UNORM_SRGB 0x11B
185 #define I965_SURFACEFORMAT_R8G8_SSCALED 0x11C
186 #define I965_SURFACEFORMAT_R8G8_USCALED 0x11D
187 #define I965_SURFACEFORMAT_R16_SSCALED 0x11E
188 #define I965_SURFACEFORMAT_R16_USCALED 0x11F
189 #define I965_SURFACEFORMAT_R8_UNORM 0x140
190 #define I965_SURFACEFORMAT_R8_SNORM 0x141
191 #define I965_SURFACEFORMAT_R8_SINT 0x142
192 #define I965_SURFACEFORMAT_R8_UINT 0x143
193 #define I965_SURFACEFORMAT_A8_UNORM 0x144
194 #define I965_SURFACEFORMAT_I8_UNORM 0x145
195 #define I965_SURFACEFORMAT_L8_UNORM 0x146
196 #define I965_SURFACEFORMAT_P4A4_UNORM 0x147
197 #define I965_SURFACEFORMAT_A4P4_UNORM 0x148
198 #define I965_SURFACEFORMAT_R8_SSCALED 0x149
199 #define I965_SURFACEFORMAT_R8_USCALED 0x14A
200 #define I965_SURFACEFORMAT_R1_UINT 0x181
201 #define I965_SURFACEFORMAT_YCRCB_NORMAL 0x182
202 #define I965_SURFACEFORMAT_YCRCB_SWAPUVY 0x183
203 #define I965_SURFACEFORMAT_BC1_UNORM 0x186
204 #define I965_SURFACEFORMAT_BC2_UNORM 0x187
205 #define I965_SURFACEFORMAT_BC3_UNORM 0x188
206 #define I965_SURFACEFORMAT_BC4_UNORM 0x189
207 #define I965_SURFACEFORMAT_BC5_UNORM 0x18A
208 #define I965_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B
209 #define I965_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C
210 #define I965_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D
211 #define I965_SURFACEFORMAT_MONO8 0x18E
212 #define I965_SURFACEFORMAT_YCRCB_SWAPUV 0x18F
213 #define I965_SURFACEFORMAT_YCRCB_SWAPY 0x190
214 #define I965_SURFACEFORMAT_DXT1_RGB 0x191
215 #define I965_SURFACEFORMAT_FXT1 0x192
216 #define I965_SURFACEFORMAT_R8G8B8_UNORM 0x193
217 #define I965_SURFACEFORMAT_R8G8B8_SNORM 0x194
218 #define I965_SURFACEFORMAT_R8G8B8_SSCALED 0x195
219 #define I965_SURFACEFORMAT_R8G8B8_USCALED 0x196
220 #define I965_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197
221 #define I965_SURFACEFORMAT_R64G64B64_FLOAT 0x198
222 #define I965_SURFACEFORMAT_BC4_SNORM 0x199
223 #define I965_SURFACEFORMAT_BC5_SNORM 0x19A
224 #define I965_SURFACEFORMAT_R16G16B16_UNORM 0x19C
225 #define I965_SURFACEFORMAT_R16G16B16_SNORM 0x19D
226 #define I965_SURFACEFORMAT_R16G16B16_SSCALED 0x19E
227 #define I965_SURFACEFORMAT_R16G16B16_USCALED 0x19F
229 #define I965_CULLMODE_BOTH 0
230 #define I965_CULLMODE_NONE 1
231 #define I965_CULLMODE_FRONT 2
232 #define I965_CULLMODE_BACK 3
234 #define I965_MAPFILTER_NEAREST 0x0
235 #define I965_MAPFILTER_LINEAR 0x1
236 #define I965_MAPFILTER_ANISOTROPIC 0x2
238 #define I965_MIPFILTER_NONE 0
239 #define I965_MIPFILTER_NEAREST 1
240 #define I965_MIPFILTER_LINEAR 3
242 #define I965_TEXCOORDMODE_WRAP 0
243 #define I965_TEXCOORDMODE_MIRROR 1
244 #define I965_TEXCOORDMODE_CLAMP 2
245 #define I965_TEXCOORDMODE_CUBE 3
246 #define I965_TEXCOORDMODE_CLAMP_BORDER 4
247 #define I965_TEXCOORDMODE_MIRROR_ONCE 5
249 #define I965_BLENDFACTOR_ONE 0x1
250 #define I965_BLENDFACTOR_SRC_COLOR 0x2
251 #define I965_BLENDFACTOR_SRC_ALPHA 0x3
252 #define I965_BLENDFACTOR_DST_ALPHA 0x4
253 #define I965_BLENDFACTOR_DST_COLOR 0x5
254 #define I965_BLENDFACTOR_SRC_ALPHA_SATURATE 0x6
255 #define I965_BLENDFACTOR_CONST_COLOR 0x7
256 #define I965_BLENDFACTOR_CONST_ALPHA 0x8
257 #define I965_BLENDFACTOR_SRC1_COLOR 0x9
258 #define I965_BLENDFACTOR_SRC1_ALPHA 0x0A
259 #define I965_BLENDFACTOR_ZERO 0x11
260 #define I965_BLENDFACTOR_INV_SRC_COLOR 0x12
261 #define I965_BLENDFACTOR_INV_SRC_ALPHA 0x13
262 #define I965_BLENDFACTOR_INV_DST_ALPHA 0x14
263 #define I965_BLENDFACTOR_INV_DST_COLOR 0x15
264 #define I965_BLENDFACTOR_INV_CONST_COLOR 0x17
265 #define I965_BLENDFACTOR_INV_CONST_ALPHA 0x18
266 #define I965_BLENDFACTOR_INV_SRC1_COLOR 0x19
267 #define I965_BLENDFACTOR_INV_SRC1_ALPHA 0x1A
269 #define I965_BLENDFUNCTION_ADD 0
270 #define I965_BLENDFUNCTION_SUBTRACT 1
271 #define I965_BLENDFUNCTION_REVERSE_SUBTRACT 2
272 #define I965_BLENDFUNCTION_MIN 3
273 #define I965_BLENDFUNCTION_MAX 4
275 #define I965_SURFACERETURNFORMAT_FLOAT32 0
276 #define I965_SURFACERETURNFORMAT_S1 1
278 #define I965_VFCOMPONENT_NOSTORE 0
279 #define I965_VFCOMPONENT_STORE_SRC 1
280 #define I965_VFCOMPONENT_STORE_0 2
281 #define I965_VFCOMPONENT_STORE_1_FLT 3
282 #define I965_VFCOMPONENT_STORE_1_INT 4
283 #define I965_VFCOMPONENT_STORE_VID 5
284 #define I965_VFCOMPONENT_STORE_IID 6
285 #define I965_VFCOMPONENT_STORE_PID 7
287 #define VE0_VERTEX_BUFFER_INDEX_SHIFT 27
288 #define VE0_VALID (1 << 26)
289 #define VE0_FORMAT_SHIFT 16
290 #define VE0_OFFSET_SHIFT 0
291 #define VE1_VFCOMPONENT_0_SHIFT 28
292 #define VE1_VFCOMPONENT_1_SHIFT 24
293 #define VE1_VFCOMPONENT_2_SHIFT 20
294 #define VE1_VFCOMPONENT_3_SHIFT 16
295 #define VE1_DESTINATION_ELEMENT_OFFSET_SHIFT 0
297 #define VB0_BUFFER_INDEX_SHIFT 27
298 #define VB0_VERTEXDATA (0 << 26)
299 #define VB0_INSTANCEDATA (1 << 26)
300 #define VB0_BUFFER_PITCH_SHIFT 0
302 #define _3DPRIMITIVE_VERTEX_SEQUENTIAL (0 << 15)
303 #define _3DPRIMITIVE_VERTEX_RANDOM (1 << 15)
304 #define _3DPRIMITIVE_TOPOLOGY_SHIFT 10
306 #define _3DPRIM_POINTLIST 0x01
307 #define _3DPRIM_LINELIST 0x02
308 #define _3DPRIM_LINESTRIP 0x03
309 #define _3DPRIM_TRILIST 0x04
310 #define _3DPRIM_TRISTRIP 0x05
311 #define _3DPRIM_TRIFAN 0x06
312 #define _3DPRIM_QUADLIST 0x07
313 #define _3DPRIM_QUADSTRIP 0x08
314 #define _3DPRIM_LINELIST_ADJ 0x09
315 #define _3DPRIM_LINESTRIP_ADJ 0x0A
316 #define _3DPRIM_TRILIST_ADJ 0x0B
317 #define _3DPRIM_TRISTRIP_ADJ 0x0C
318 #define _3DPRIM_TRISTRIP_REVERSE 0x0D
319 #define _3DPRIM_POLYGON 0x0E
320 #define _3DPRIM_RECTLIST 0x0F
321 #define _3DPRIM_LINELOOP 0x10
322 #define _3DPRIM_POINTLIST_BF 0x11
323 #define _3DPRIM_LINESTRIP_CONT 0x12
324 #define _3DPRIM_LINESTRIP_BF 0x13
325 #define _3DPRIM_LINESTRIP_CONT_BF 0x14
326 #define _3DPRIM_TRIFAN_NOSTIPPLE 0x15
328 #define I965_TILEWALK_XMAJOR 0
329 #define I965_TILEWALK_YMAJOR 1
331 #define SCAN_RASTER_ORDER 0
332 #define SCAN_SPECIAL_ORDER 1
334 #define ENTROPY_CAVLD 0
335 #define ENTROPY_CABAC 1
337 #define SLICE_TYPE_P 0
338 #define SLICE_TYPE_B 1
339 #define SLICE_TYPE_I 2
340 #define SLICE_TYPE_SP 3
341 #define SLICE_TYPE_SI 4
343 #define PRESENT_REF_LIST0 (1 << 0)
344 #define PRESENT_REF_LIST1 (1 << 1)
345 #define PRESENT_WEIGHT_OFFSET_L0 (1 << 2)
346 #define PRESENT_WEIGHT_OFFSET_L1 (1 << 3)
348 #define RESIDUAL_DATA_OFFSET 48
350 #define PRESENT_NOMV 0
351 #define PRESENT_NOWO 1
352 #define PRESENT_MV_WO 3
354 #define SCOREBOARD_STALLING 0
355 #define SCOREBOARD_NON_STALLING 1
357 #define URB_SIZE(intel) (IS_IRONLAKE(intel->device_id) ? 1024 : \
358 IS_G4X(intel->device_id) ? 384 : 256)
359 #endif /* _I965_DEFINES_H_ */