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