2 * Copyright © 2013 Intel Corporation
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:
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
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
26 #include "gen_device_info.h"
27 #include "compiler/shader_enums.h"
29 static const struct gen_device_info gen_device_info_i965
= {
31 .has_negative_rhw_bug
= true,
35 .max_wm_threads
= 8 * 4,
41 static const struct gen_device_info gen_device_info_g4x
= {
45 .has_surface_tile_offset
= true,
50 .max_wm_threads
= 10 * 5,
56 static const struct gen_device_info gen_device_info_ilk
= {
60 .has_surface_tile_offset
= true,
64 .max_wm_threads
= 12 * 6,
70 static const struct gen_device_info gen_device_info_snb_gt1
= {
73 .has_hiz_and_separate_stencil
= true,
76 .has_surface_tile_offset
= true,
77 .needs_unlit_centroid_workaround
= true,
80 .max_gs_threads
= 21, /* conservative; 24 if rendering disabled. */
86 [MESA_SHADER_VERTEX
] = 256,
87 [MESA_SHADER_GEOMETRY
] = 256,
92 static const struct gen_device_info gen_device_info_snb_gt2
= {
95 .has_hiz_and_separate_stencil
= true,
98 .has_surface_tile_offset
= true,
99 .needs_unlit_centroid_workaround
= true,
101 .max_vs_threads
= 60,
102 .max_gs_threads
= 60,
103 .max_wm_threads
= 80,
106 .min_vs_entries
= 24,
108 [MESA_SHADER_VERTEX
] = 256,
109 [MESA_SHADER_GEOMETRY
] = 256,
114 #define GEN7_FEATURES \
116 .has_hiz_and_separate_stencil = true, \
117 .must_use_separate_stencil = true, \
120 .has_surface_tile_offset = true
122 static const struct gen_device_info gen_device_info_ivb_gt1
= {
123 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 1,
125 .max_vs_threads
= 36,
126 .max_tcs_threads
= 36,
127 .max_tes_threads
= 36,
128 .max_gs_threads
= 36,
129 .max_wm_threads
= 48,
130 .max_cs_threads
= 36,
133 .min_vs_entries
= 32,
134 .min_ds_entries
= 10,
136 [MESA_SHADER_VERTEX
] = 512,
137 [MESA_SHADER_TESS_CTRL
] = 32,
138 [MESA_SHADER_TESS_EVAL
] = 288,
139 [MESA_SHADER_GEOMETRY
] = 192,
144 static const struct gen_device_info gen_device_info_ivb_gt2
= {
145 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 2,
147 .max_vs_threads
= 128,
148 .max_tcs_threads
= 128,
149 .max_tes_threads
= 128,
150 .max_gs_threads
= 128,
151 .max_wm_threads
= 172,
152 .max_cs_threads
= 64,
155 .min_vs_entries
= 32,
156 .min_ds_entries
= 10,
158 [MESA_SHADER_VERTEX
] = 704,
159 [MESA_SHADER_TESS_CTRL
] = 64,
160 [MESA_SHADER_TESS_EVAL
] = 448,
161 [MESA_SHADER_GEOMETRY
] = 320,
166 static const struct gen_device_info gen_device_info_byt
= {
167 GEN7_FEATURES
, .is_baytrail
= true, .gt
= 1,
170 .max_vs_threads
= 36,
171 .max_tcs_threads
= 36,
172 .max_tes_threads
= 36,
173 .max_gs_threads
= 36,
174 .max_wm_threads
= 48,
175 .max_cs_threads
= 32,
178 .min_vs_entries
= 32,
179 .min_ds_entries
= 10,
181 [MESA_SHADER_VERTEX
] = 512,
182 [MESA_SHADER_TESS_CTRL
] = 32,
183 [MESA_SHADER_TESS_EVAL
] = 288,
184 [MESA_SHADER_GEOMETRY
] = 192,
189 #define HSW_FEATURES \
191 .is_haswell = true, \
192 .supports_simd16_3src = true, \
193 .has_resource_streamer = true
195 static const struct gen_device_info gen_device_info_hsw_gt1
= {
196 HSW_FEATURES
, .gt
= 1,
198 .max_vs_threads
= 70,
199 .max_tcs_threads
= 70,
200 .max_tes_threads
= 70,
201 .max_gs_threads
= 70,
202 .max_wm_threads
= 102,
203 .max_cs_threads
= 70,
206 .min_vs_entries
= 32,
207 .min_ds_entries
= 10,
209 [MESA_SHADER_VERTEX
] = 640,
210 [MESA_SHADER_TESS_CTRL
] = 64,
211 [MESA_SHADER_TESS_EVAL
] = 384,
212 [MESA_SHADER_GEOMETRY
] = 256,
217 static const struct gen_device_info gen_device_info_hsw_gt2
= {
218 HSW_FEATURES
, .gt
= 2,
220 .max_vs_threads
= 280,
221 .max_tcs_threads
= 256,
222 .max_tes_threads
= 280,
223 .max_gs_threads
= 256,
224 .max_wm_threads
= 204,
225 .max_cs_threads
= 70,
228 .min_vs_entries
= 64,
229 .min_ds_entries
= 10,
231 [MESA_SHADER_VERTEX
] = 1664,
232 [MESA_SHADER_TESS_CTRL
] = 128,
233 [MESA_SHADER_TESS_EVAL
] = 960,
234 [MESA_SHADER_GEOMETRY
] = 640,
239 static const struct gen_device_info gen_device_info_hsw_gt3
= {
240 HSW_FEATURES
, .gt
= 3,
242 .max_vs_threads
= 280,
243 .max_tcs_threads
= 256,
244 .max_tes_threads
= 280,
245 .max_gs_threads
= 256,
246 .max_wm_threads
= 408,
247 .max_cs_threads
= 70,
250 .min_vs_entries
= 64,
251 .min_ds_entries
= 10,
253 [MESA_SHADER_VERTEX
] = 1664,
254 [MESA_SHADER_TESS_CTRL
] = 128,
255 [MESA_SHADER_TESS_EVAL
] = 960,
256 [MESA_SHADER_GEOMETRY
] = 640,
261 #define GEN8_FEATURES \
263 .has_hiz_and_separate_stencil = true, \
264 .has_resource_streamer = true, \
265 .must_use_separate_stencil = true, \
268 .supports_simd16_3src = true, \
269 .has_surface_tile_offset = true, \
270 .max_vs_threads = 504, \
271 .max_tcs_threads = 504, \
272 .max_tes_threads = 504, \
273 .max_gs_threads = 504, \
274 .max_wm_threads = 384
276 static const struct gen_device_info gen_device_info_bdw_gt1
= {
277 GEN8_FEATURES
, .gt
= 1,
279 .max_cs_threads
= 42,
282 .min_vs_entries
= 64,
283 .min_ds_entries
= 34,
285 [MESA_SHADER_VERTEX
] = 2560,
286 [MESA_SHADER_TESS_CTRL
] = 504,
287 [MESA_SHADER_TESS_EVAL
] = 1536,
288 [MESA_SHADER_GEOMETRY
] = 960,
293 static const struct gen_device_info gen_device_info_bdw_gt2
= {
294 GEN8_FEATURES
, .gt
= 2,
296 .max_cs_threads
= 56,
299 .min_vs_entries
= 64,
300 .min_ds_entries
= 34,
302 [MESA_SHADER_VERTEX
] = 2560,
303 [MESA_SHADER_TESS_CTRL
] = 504,
304 [MESA_SHADER_TESS_EVAL
] = 1536,
305 [MESA_SHADER_GEOMETRY
] = 960,
310 static const struct gen_device_info gen_device_info_bdw_gt3
= {
311 GEN8_FEATURES
, .gt
= 3,
313 .max_cs_threads
= 56,
316 .min_vs_entries
= 64,
317 .min_ds_entries
= 34,
319 [MESA_SHADER_VERTEX
] = 2560,
320 [MESA_SHADER_TESS_CTRL
] = 504,
321 [MESA_SHADER_TESS_EVAL
] = 1536,
322 [MESA_SHADER_GEOMETRY
] = 960,
327 static const struct gen_device_info gen_device_info_chv
= {
328 GEN8_FEATURES
, .is_cherryview
= 1, .gt
= 1,
331 .max_vs_threads
= 80,
332 .max_tcs_threads
= 80,
333 .max_tes_threads
= 80,
334 .max_gs_threads
= 80,
335 .max_wm_threads
= 128,
336 .max_cs_threads
= 6 * 7,
339 .min_vs_entries
= 34,
340 .min_ds_entries
= 34,
342 [MESA_SHADER_VERTEX
] = 640,
343 [MESA_SHADER_TESS_CTRL
] = 80,
344 [MESA_SHADER_TESS_EVAL
] = 384,
345 [MESA_SHADER_GEOMETRY
] = 256,
350 #define GEN9_FEATURES \
352 .has_hiz_and_separate_stencil = true, \
353 .has_resource_streamer = true, \
354 .must_use_separate_stencil = true, \
357 .supports_simd16_3src = true, \
358 .has_surface_tile_offset = true, \
359 .max_vs_threads = 336, \
360 .max_gs_threads = 336, \
361 .max_tcs_threads = 336, \
362 .max_tes_threads = 336, \
363 .max_cs_threads = 56, \
366 .min_vs_entries = 64, \
367 .min_ds_entries = 34, \
369 [MESA_SHADER_VERTEX] = 1856, \
370 [MESA_SHADER_TESS_CTRL] = 672, \
371 [MESA_SHADER_TESS_EVAL] = 1120, \
372 [MESA_SHADER_GEOMETRY] = 640, \
376 #define GEN9_LP_FEATURES \
382 .max_vs_threads = 112, \
383 .max_tcs_threads = 112, \
384 .max_tes_threads = 112, \
385 .max_gs_threads = 112, \
386 .max_cs_threads = 6 * 6, \
389 .min_vs_entries = 34, \
390 .min_ds_entries = 34, \
392 [MESA_SHADER_VERTEX] = 704, \
393 [MESA_SHADER_TESS_CTRL] = 256, \
394 [MESA_SHADER_TESS_EVAL] = 416, \
395 [MESA_SHADER_GEOMETRY] = 256, \
399 #define GEN9_LP_FEATURES_2X6 \
401 .max_vs_threads = 56, \
402 .max_tcs_threads = 56, \
403 .max_tes_threads = 56, \
404 .max_gs_threads = 56, \
405 .max_cs_threads = 6 * 6, \
408 .min_vs_entries = 34, \
409 .min_ds_entries = 34, \
411 [MESA_SHADER_VERTEX] = 352, \
412 [MESA_SHADER_TESS_CTRL] = 128, \
413 [MESA_SHADER_TESS_EVAL] = 208, \
414 [MESA_SHADER_GEOMETRY] = 128, \
418 static const struct gen_device_info gen_device_info_skl_gt1
= {
419 GEN9_FEATURES
, .gt
= 1,
424 static const struct gen_device_info gen_device_info_skl_gt2
= {
425 GEN9_FEATURES
, .gt
= 2,
429 static const struct gen_device_info gen_device_info_skl_gt3
= {
430 GEN9_FEATURES
, .gt
= 3,
434 static const struct gen_device_info gen_device_info_skl_gt4
= {
435 GEN9_FEATURES
, .gt
= 4,
437 /* From the "L3 Allocation and Programming" documentation:
439 * "URB is limited to 1008KB due to programming restrictions. This is not a
440 * restriction of the L3 implementation, but of the FF and other clients.
441 * Therefore, in a GT4 implementation it is possible for the programmed
442 * allocation of the L3 data array to provide 3*384KB=1152KB for URB, but
443 * only 1008KB of this will be used."
445 .urb
.size
= 1008 / 3,
448 static const struct gen_device_info gen_device_info_bxt
= {
452 static const struct gen_device_info gen_device_info_bxt_2x6
= {
456 * Note: for all KBL SKUs, the PRM says SKL for GS entries, not SKL+.
457 * There's no KBL entry. Using the default SKL (GEN9) GS entries value.
460 static const struct gen_device_info gen_device_info_kbl_gt1
= {
464 .max_cs_threads
= 7 * 6,
469 static const struct gen_device_info gen_device_info_kbl_gt1_5
= {
473 .max_cs_threads
= 7 * 6,
477 static const struct gen_device_info gen_device_info_kbl_gt2
= {
484 static const struct gen_device_info gen_device_info_kbl_gt3
= {
491 static const struct gen_device_info gen_device_info_kbl_gt4
= {
496 * From the "L3 Allocation and Programming" documentation:
498 * "URB is limited to 1008KB due to programming restrictions. This
499 * is not a restriction of the L3 implementation, but of the FF and
500 * other clients. Therefore, in a GT4 implementation it is
501 * possible for the programmed allocation of the L3 data array to
502 * provide 3*384KB=1152KB for URB, but only 1008KB of this
505 .urb
.size
= 1008 / 3,
509 static const struct gen_device_info gen_device_info_glk
= {
513 static const struct gen_device_info gen_device_info_glk_2x6
= {
518 gen_get_device_info(int devid
, struct gen_device_info
*devinfo
)
522 #define CHIPSET(id, family, name) \
523 case id: *devinfo = gen_device_info_##family; break;
524 #include "pci_ids/i965_pci_ids.h"
526 fprintf(stderr
, "i965_dri.so does not support the 0x%x PCI ID.\n", devid
);
530 /* From the Skylake PRM, 3DSTATE_PS::Scratch Space Base Pointer:
532 * "Scratch Space per slice is computed based on 4 sub-slices. SW must
533 * allocate scratch space enough so that each slice has 4 slices allowed."
535 * The equivalent internal documentation says that this programming note
536 * applies to all Gen9+ platforms.
538 * The hardware typically calculates the scratch space pointer by taking
539 * the base address, and adding per-thread-scratch-space * thread ID.
540 * Extra padding can be necessary depending how the thread IDs are
541 * calculated for a particular shader stage.
543 if (devinfo
->gen
>= 9) {
544 devinfo
->max_wm_threads
= 64 /* threads-per-PSD */
545 * devinfo
->num_slices
546 * 4; /* effective subslices per slice */
553 gen_get_device_name(int devid
)
557 #define CHIPSET(id, family, name) case id: return name;
558 #include "pci_ids/i965_pci_ids.h"