i965: Remove comment about chv device numbers being preliminary
[mesa.git] / src / mesa / drivers / dri / i965 / brw_device_info.c
1 /*
2 * Copyright © 2013 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include "brw_device_info.h"
27
28 static const struct brw_device_info brw_device_info_i965 = {
29 .gen = 4,
30 .has_negative_rhw_bug = true,
31 .max_vs_threads = 16,
32 .max_gs_threads = 2,
33 .max_wm_threads = 8 * 4,
34 .urb = {
35 .size = 256,
36 },
37 };
38
39 static const struct brw_device_info brw_device_info_g4x = {
40 .gen = 4,
41 .has_pln = true,
42 .has_compr4 = true,
43 .has_surface_tile_offset = true,
44 .is_g4x = true,
45 .max_vs_threads = 32,
46 .max_gs_threads = 2,
47 .max_wm_threads = 10 * 5,
48 .urb = {
49 .size = 384,
50 },
51 };
52
53 static const struct brw_device_info brw_device_info_ilk = {
54 .gen = 5,
55 .has_pln = true,
56 .has_compr4 = true,
57 .has_surface_tile_offset = true,
58 .max_vs_threads = 72,
59 .max_gs_threads = 32,
60 .max_wm_threads = 12 * 6,
61 .urb = {
62 .size = 1024,
63 },
64 };
65
66 static const struct brw_device_info brw_device_info_snb_gt1 = {
67 .gen = 6,
68 .gt = 1,
69 .has_hiz_and_separate_stencil = true,
70 .has_llc = true,
71 .has_pln = true,
72 .has_surface_tile_offset = true,
73 .needs_unlit_centroid_workaround = true,
74 .max_vs_threads = 24,
75 .max_gs_threads = 21, /* conservative; 24 if rendering disabled. */
76 .max_wm_threads = 40,
77 .urb = {
78 .size = 32,
79 .min_vs_entries = 24,
80 .max_vs_entries = 256,
81 .max_gs_entries = 256,
82 },
83 };
84
85 static const struct brw_device_info brw_device_info_snb_gt2 = {
86 .gen = 6,
87 .gt = 2,
88 .has_hiz_and_separate_stencil = true,
89 .has_llc = true,
90 .has_pln = true,
91 .has_surface_tile_offset = true,
92 .needs_unlit_centroid_workaround = true,
93 .max_vs_threads = 60,
94 .max_gs_threads = 60,
95 .max_wm_threads = 80,
96 .urb = {
97 .size = 64,
98 .min_vs_entries = 24,
99 .max_vs_entries = 256,
100 .max_gs_entries = 256,
101 },
102 };
103
104 #define GEN7_FEATURES \
105 .gen = 7, \
106 .has_hiz_and_separate_stencil = true, \
107 .must_use_separate_stencil = true, \
108 .has_llc = true, \
109 .has_pln = true, \
110 .has_surface_tile_offset = true
111
112 static const struct brw_device_info brw_device_info_ivb_gt1 = {
113 GEN7_FEATURES, .is_ivybridge = true, .gt = 1,
114 .needs_unlit_centroid_workaround = true,
115 .max_vs_threads = 36,
116 .max_hs_threads = 36,
117 .max_ds_threads = 36,
118 .max_gs_threads = 36,
119 .max_wm_threads = 48,
120 .urb = {
121 .size = 128,
122 .min_vs_entries = 32,
123 .max_vs_entries = 512,
124 .max_hs_entries = 32,
125 .max_ds_entries = 288,
126 .max_gs_entries = 192,
127 },
128 };
129
130 static const struct brw_device_info brw_device_info_ivb_gt2 = {
131 GEN7_FEATURES, .is_ivybridge = true, .gt = 2,
132 .needs_unlit_centroid_workaround = true,
133 .max_vs_threads = 128,
134 .max_hs_threads = 128,
135 .max_ds_threads = 128,
136 .max_gs_threads = 128,
137 .max_wm_threads = 172,
138 .urb = {
139 .size = 256,
140 .min_vs_entries = 32,
141 .max_vs_entries = 704,
142 .max_hs_entries = 64,
143 .max_ds_entries = 448,
144 .max_gs_entries = 320,
145 },
146 };
147
148 static const struct brw_device_info brw_device_info_byt = {
149 GEN7_FEATURES, .is_baytrail = true, .gt = 1,
150 .needs_unlit_centroid_workaround = true,
151 .has_llc = false,
152 .max_vs_threads = 36,
153 .max_hs_threads = 36,
154 .max_ds_threads = 36,
155 .max_gs_threads = 36,
156 .max_wm_threads = 48,
157 .urb = {
158 .size = 128,
159 .min_vs_entries = 32,
160 .max_vs_entries = 512,
161 .max_hs_entries = 32,
162 .max_ds_entries = 288,
163 .max_gs_entries = 192,
164 },
165 };
166
167 #define HSW_FEATURES \
168 GEN7_FEATURES, \
169 .is_haswell = true, \
170 .supports_simd16_3src = true
171
172 static const struct brw_device_info brw_device_info_hsw_gt1 = {
173 HSW_FEATURES, .gt = 1,
174 .max_vs_threads = 70,
175 .max_hs_threads = 70,
176 .max_ds_threads = 70,
177 .max_gs_threads = 70,
178 .max_wm_threads = 102,
179 .urb = {
180 .size = 128,
181 .min_vs_entries = 32,
182 .max_vs_entries = 640,
183 .max_hs_entries = 64,
184 .max_ds_entries = 384,
185 .max_gs_entries = 256,
186 },
187 };
188
189 static const struct brw_device_info brw_device_info_hsw_gt2 = {
190 HSW_FEATURES, .gt = 2,
191 .max_vs_threads = 280,
192 .max_hs_threads = 256,
193 .max_ds_threads = 280,
194 .max_gs_threads = 256,
195 .max_wm_threads = 204,
196 .urb = {
197 .size = 256,
198 .min_vs_entries = 64,
199 .max_vs_entries = 1664,
200 .max_hs_entries = 128,
201 .max_ds_entries = 960,
202 .max_gs_entries = 640,
203 },
204 };
205
206 static const struct brw_device_info brw_device_info_hsw_gt3 = {
207 HSW_FEATURES, .gt = 3,
208 .max_vs_threads = 280,
209 .max_hs_threads = 256,
210 .max_ds_threads = 280,
211 .max_gs_threads = 256,
212 .max_wm_threads = 408,
213 .urb = {
214 .size = 512,
215 .min_vs_entries = 64,
216 .max_vs_entries = 1664,
217 .max_hs_entries = 128,
218 .max_ds_entries = 960,
219 .max_gs_entries = 640,
220 },
221 };
222
223 #define GEN8_FEATURES \
224 .gen = 8, \
225 .has_hiz_and_separate_stencil = true, \
226 .must_use_separate_stencil = true, \
227 .has_llc = true, \
228 .has_pln = true, \
229 .supports_simd16_3src = true, \
230 .max_vs_threads = 504, \
231 .max_hs_threads = 504, \
232 .max_ds_threads = 504, \
233 .max_gs_threads = 504, \
234 .max_wm_threads = 384 \
235
236 static const struct brw_device_info brw_device_info_bdw_gt1 = {
237 GEN8_FEATURES, .gt = 1,
238 .urb = {
239 .size = 192,
240 .min_vs_entries = 64,
241 .max_vs_entries = 2560,
242 .max_hs_entries = 504,
243 .max_ds_entries = 1536,
244 .max_gs_entries = 960,
245 }
246 };
247
248 static const struct brw_device_info brw_device_info_bdw_gt2 = {
249 GEN8_FEATURES, .gt = 2,
250 .urb = {
251 .size = 384,
252 .min_vs_entries = 64,
253 .max_vs_entries = 2560,
254 .max_hs_entries = 504,
255 .max_ds_entries = 1536,
256 .max_gs_entries = 960,
257 }
258 };
259
260 static const struct brw_device_info brw_device_info_bdw_gt3 = {
261 GEN8_FEATURES, .gt = 3,
262 .urb = {
263 .size = 384,
264 .min_vs_entries = 64,
265 .max_vs_entries = 2560,
266 .max_hs_entries = 504,
267 .max_ds_entries = 1536,
268 .max_gs_entries = 960,
269 }
270 };
271
272 static const struct brw_device_info brw_device_info_chv = {
273 GEN8_FEATURES, .is_cherryview = 1, .gt = 1,
274 .has_llc = false,
275 .max_vs_threads = 80,
276 .max_hs_threads = 80,
277 .max_ds_threads = 80,
278 .max_gs_threads = 80,
279 .max_wm_threads = 128,
280 .urb = {
281 .size = 192,
282 .min_vs_entries = 34,
283 .max_vs_entries = 640,
284 .max_hs_entries = 80,
285 .max_ds_entries = 384,
286 .max_gs_entries = 256,
287 }
288 };
289
290 /* Thread counts and URB limits are placeholders, and may not be accurate. */
291 #define GEN9_FEATURES \
292 .gen = 9, \
293 .has_hiz_and_separate_stencil = true, \
294 .must_use_separate_stencil = true, \
295 .has_llc = true, \
296 .has_pln = true, \
297 .max_vs_threads = 280, \
298 .max_gs_threads = 256, \
299 .max_wm_threads = 408, \
300 .urb = { \
301 .size = 128, \
302 .min_vs_entries = 64, \
303 .max_vs_entries = 1664, \
304 .max_gs_entries = 640, \
305 }
306
307 static const struct brw_device_info brw_device_info_skl_early = {
308 GEN9_FEATURES, .gt = 1,
309 .supports_simd16_3src = false,
310 };
311
312 static const struct brw_device_info brw_device_info_skl_gt1 = {
313 GEN9_FEATURES, .gt = 1,
314 .supports_simd16_3src = true,
315 };
316
317 static const struct brw_device_info brw_device_info_skl_gt2 = {
318 GEN9_FEATURES, .gt = 2,
319 .supports_simd16_3src = true,
320 };
321
322 static const struct brw_device_info brw_device_info_skl_gt3 = {
323 GEN9_FEATURES, .gt = 3,
324 .supports_simd16_3src = true,
325 };
326
327 const struct brw_device_info *
328 brw_get_device_info(int devid, int revision)
329 {
330 const struct brw_device_info *devinfo;
331 switch (devid) {
332 #undef CHIPSET
333 #define CHIPSET(id, family, name) \
334 case id: devinfo = &brw_device_info_##family; break;
335 #include "pci_ids/i965_pci_ids.h"
336 default:
337 fprintf(stderr, "i965_dri.so does not support the 0x%x PCI ID.\n", devid);
338 return NULL;
339 }
340
341 if (devinfo->gen == 9 && (revision == 2 || revision == 3 || revision == -1))
342 return &brw_device_info_skl_early;
343
344 return devinfo;
345 }