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,
42 static const struct gen_device_info gen_device_info_g4x
= {
46 .has_surface_tile_offset
= true,
51 .max_wm_threads
= 10 * 5,
58 static const struct gen_device_info gen_device_info_ilk
= {
62 .has_surface_tile_offset
= true,
66 .max_wm_threads
= 12 * 6,
73 static const struct gen_device_info gen_device_info_snb_gt1
= {
76 .has_hiz_and_separate_stencil
= true,
79 .has_surface_tile_offset
= true,
80 .needs_unlit_centroid_workaround
= true,
83 .max_gs_threads
= 21, /* conservative; 24 if rendering disabled. */
88 [MESA_SHADER_VERTEX
] = 24,
91 [MESA_SHADER_VERTEX
] = 256,
92 [MESA_SHADER_GEOMETRY
] = 256,
98 static const struct gen_device_info gen_device_info_snb_gt2
= {
101 .has_hiz_and_separate_stencil
= true,
104 .has_surface_tile_offset
= true,
105 .needs_unlit_centroid_workaround
= true,
107 .max_vs_threads
= 60,
108 .max_gs_threads
= 60,
109 .max_wm_threads
= 80,
113 [MESA_SHADER_VERTEX
] = 24,
116 [MESA_SHADER_VERTEX
] = 256,
117 [MESA_SHADER_GEOMETRY
] = 256,
120 .timebase_scale
= 80,
123 #define GEN7_FEATURES \
125 .has_hiz_and_separate_stencil = true, \
126 .must_use_separate_stencil = true, \
129 .has_surface_tile_offset = true, \
132 static const struct gen_device_info gen_device_info_ivb_gt1
= {
133 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 1,
136 .max_vs_threads
= 36,
137 .max_tcs_threads
= 36,
138 .max_tes_threads
= 36,
139 .max_gs_threads
= 36,
140 .max_wm_threads
= 48,
141 .max_cs_threads
= 36,
145 [MESA_SHADER_VERTEX
] = 32,
146 [MESA_SHADER_TESS_EVAL
] = 10,
149 [MESA_SHADER_VERTEX
] = 512,
150 [MESA_SHADER_TESS_CTRL
] = 32,
151 [MESA_SHADER_TESS_EVAL
] = 288,
152 [MESA_SHADER_GEOMETRY
] = 192,
157 static const struct gen_device_info gen_device_info_ivb_gt2
= {
158 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 2,
161 .max_vs_threads
= 128,
162 .max_tcs_threads
= 128,
163 .max_tes_threads
= 128,
164 .max_gs_threads
= 128,
165 .max_wm_threads
= 172,
166 .max_cs_threads
= 64,
170 [MESA_SHADER_VERTEX
] = 32,
171 [MESA_SHADER_TESS_EVAL
] = 10,
174 [MESA_SHADER_VERTEX
] = 704,
175 [MESA_SHADER_TESS_CTRL
] = 64,
176 [MESA_SHADER_TESS_EVAL
] = 448,
177 [MESA_SHADER_GEOMETRY
] = 320,
182 static const struct gen_device_info gen_device_info_byt
= {
183 GEN7_FEATURES
, .is_baytrail
= true, .gt
= 1,
187 .max_vs_threads
= 36,
188 .max_tcs_threads
= 36,
189 .max_tes_threads
= 36,
190 .max_gs_threads
= 36,
191 .max_wm_threads
= 48,
192 .max_cs_threads
= 32,
196 [MESA_SHADER_VERTEX
] = 32,
197 [MESA_SHADER_TESS_EVAL
] = 10,
200 [MESA_SHADER_VERTEX
] = 512,
201 [MESA_SHADER_TESS_CTRL
] = 32,
202 [MESA_SHADER_TESS_EVAL
] = 288,
203 [MESA_SHADER_GEOMETRY
] = 192,
208 #define HSW_FEATURES \
210 .is_haswell = true, \
211 .supports_simd16_3src = true, \
212 .has_resource_streamer = true
214 static const struct gen_device_info gen_device_info_hsw_gt1
= {
215 HSW_FEATURES
, .gt
= 1,
218 .max_vs_threads
= 70,
219 .max_tcs_threads
= 70,
220 .max_tes_threads
= 70,
221 .max_gs_threads
= 70,
222 .max_wm_threads
= 102,
223 .max_cs_threads
= 70,
227 [MESA_SHADER_VERTEX
] = 32,
228 [MESA_SHADER_TESS_EVAL
] = 10,
231 [MESA_SHADER_VERTEX
] = 640,
232 [MESA_SHADER_TESS_CTRL
] = 64,
233 [MESA_SHADER_TESS_EVAL
] = 384,
234 [MESA_SHADER_GEOMETRY
] = 256,
239 static const struct gen_device_info gen_device_info_hsw_gt2
= {
240 HSW_FEATURES
, .gt
= 2,
243 .max_vs_threads
= 280,
244 .max_tcs_threads
= 256,
245 .max_tes_threads
= 280,
246 .max_gs_threads
= 256,
247 .max_wm_threads
= 204,
248 .max_cs_threads
= 70,
252 [MESA_SHADER_VERTEX
] = 64,
253 [MESA_SHADER_TESS_EVAL
] = 10,
256 [MESA_SHADER_VERTEX
] = 1664,
257 [MESA_SHADER_TESS_CTRL
] = 128,
258 [MESA_SHADER_TESS_EVAL
] = 960,
259 [MESA_SHADER_GEOMETRY
] = 640,
264 static const struct gen_device_info gen_device_info_hsw_gt3
= {
265 HSW_FEATURES
, .gt
= 3,
268 .max_vs_threads
= 280,
269 .max_tcs_threads
= 256,
270 .max_tes_threads
= 280,
271 .max_gs_threads
= 256,
272 .max_wm_threads
= 408,
273 .max_cs_threads
= 70,
277 [MESA_SHADER_VERTEX
] = 64,
278 [MESA_SHADER_TESS_EVAL
] = 10,
281 [MESA_SHADER_VERTEX
] = 1664,
282 [MESA_SHADER_TESS_CTRL
] = 128,
283 [MESA_SHADER_TESS_EVAL
] = 960,
284 [MESA_SHADER_GEOMETRY
] = 640,
289 #define GEN8_FEATURES \
291 .has_hiz_and_separate_stencil = true, \
292 .has_resource_streamer = true, \
293 .must_use_separate_stencil = true, \
296 .supports_simd16_3src = true, \
297 .has_surface_tile_offset = true, \
298 .max_vs_threads = 504, \
299 .max_tcs_threads = 504, \
300 .max_tes_threads = 504, \
301 .max_gs_threads = 504, \
302 .max_wm_threads = 384, \
305 static const struct gen_device_info gen_device_info_bdw_gt1
= {
306 GEN8_FEATURES
, .gt
= 1,
307 .is_broadwell
= true,
310 .max_cs_threads
= 42,
314 [MESA_SHADER_VERTEX
] = 64,
315 [MESA_SHADER_TESS_EVAL
] = 34,
318 [MESA_SHADER_VERTEX
] = 2560,
319 [MESA_SHADER_TESS_CTRL
] = 504,
320 [MESA_SHADER_TESS_EVAL
] = 1536,
321 [MESA_SHADER_GEOMETRY
] = 960,
326 static const struct gen_device_info gen_device_info_bdw_gt2
= {
327 GEN8_FEATURES
, .gt
= 2,
328 .is_broadwell
= true,
331 .max_cs_threads
= 56,
335 [MESA_SHADER_VERTEX
] = 64,
336 [MESA_SHADER_TESS_EVAL
] = 34,
339 [MESA_SHADER_VERTEX
] = 2560,
340 [MESA_SHADER_TESS_CTRL
] = 504,
341 [MESA_SHADER_TESS_EVAL
] = 1536,
342 [MESA_SHADER_GEOMETRY
] = 960,
347 static const struct gen_device_info gen_device_info_bdw_gt3
= {
348 GEN8_FEATURES
, .gt
= 3,
349 .is_broadwell
= true,
352 .max_cs_threads
= 56,
356 [MESA_SHADER_VERTEX
] = 64,
357 [MESA_SHADER_TESS_EVAL
] = 34,
360 [MESA_SHADER_VERTEX
] = 2560,
361 [MESA_SHADER_TESS_CTRL
] = 504,
362 [MESA_SHADER_TESS_EVAL
] = 1536,
363 [MESA_SHADER_GEOMETRY
] = 960,
368 static const struct gen_device_info gen_device_info_chv
= {
369 GEN8_FEATURES
, .is_cherryview
= 1, .gt
= 1,
373 .max_vs_threads
= 80,
374 .max_tcs_threads
= 80,
375 .max_tes_threads
= 80,
376 .max_gs_threads
= 80,
377 .max_wm_threads
= 128,
378 .max_cs_threads
= 6 * 7,
382 [MESA_SHADER_VERTEX
] = 34,
383 [MESA_SHADER_TESS_EVAL
] = 34,
386 [MESA_SHADER_VERTEX
] = 640,
387 [MESA_SHADER_TESS_CTRL
] = 80,
388 [MESA_SHADER_TESS_EVAL
] = 384,
389 [MESA_SHADER_GEOMETRY
] = 256,
394 #define GEN9_HW_INFO \
396 .max_vs_threads = 336, \
397 .max_gs_threads = 336, \
398 .max_tcs_threads = 336, \
399 .max_tes_threads = 336, \
400 .max_cs_threads = 56, \
401 .timebase_scale = 1000000000.0 / 12000000.0, \
405 [MESA_SHADER_VERTEX] = 64, \
406 [MESA_SHADER_TESS_EVAL] = 34, \
409 [MESA_SHADER_VERTEX] = 1856, \
410 [MESA_SHADER_TESS_CTRL] = 672, \
411 [MESA_SHADER_TESS_EVAL] = 1120, \
412 [MESA_SHADER_GEOMETRY] = 640, \
416 #define GEN9_LP_FEATURES \
421 .max_vs_threads = 112, \
422 .max_tcs_threads = 112, \
423 .max_tes_threads = 112, \
424 .max_gs_threads = 112, \
425 .max_cs_threads = 6 * 6, \
426 .timebase_scale = 1000000000.0 / 19200123.0, \
430 [MESA_SHADER_VERTEX] = 34, \
431 [MESA_SHADER_TESS_EVAL] = 34, \
434 [MESA_SHADER_VERTEX] = 704, \
435 [MESA_SHADER_TESS_CTRL] = 256, \
436 [MESA_SHADER_TESS_EVAL] = 416, \
437 [MESA_SHADER_GEOMETRY] = 256, \
441 #define GEN9_LP_FEATURES_2X6 \
443 .max_vs_threads = 56, \
444 .max_tcs_threads = 56, \
445 .max_tes_threads = 56, \
446 .max_gs_threads = 56, \
447 .max_cs_threads = 6 * 6, \
451 [MESA_SHADER_VERTEX] = 34, \
452 [MESA_SHADER_TESS_EVAL] = 34, \
455 [MESA_SHADER_VERTEX] = 352, \
456 [MESA_SHADER_TESS_CTRL] = 128, \
457 [MESA_SHADER_TESS_EVAL] = 208, \
458 [MESA_SHADER_GEOMETRY] = 128, \
462 #define GEN9_FEATURES \
466 static const struct gen_device_info gen_device_info_skl_gt1
= {
467 GEN9_FEATURES
, .gt
= 1,
474 static const struct gen_device_info gen_device_info_skl_gt2
= {
475 GEN9_FEATURES
, .gt
= 2,
481 static const struct gen_device_info gen_device_info_skl_gt3
= {
482 GEN9_FEATURES
, .gt
= 3,
488 static const struct gen_device_info gen_device_info_skl_gt4
= {
489 GEN9_FEATURES
, .gt
= 4,
493 /* From the "L3 Allocation and Programming" documentation:
495 * "URB is limited to 1008KB due to programming restrictions. This is not a
496 * restriction of the L3 implementation, but of the FF and other clients.
497 * Therefore, in a GT4 implementation it is possible for the programmed
498 * allocation of the L3 data array to provide 3*384KB=1152KB for URB, but
499 * only 1008KB of this will be used."
501 .urb
.size
= 1008 / 3,
504 static const struct gen_device_info gen_device_info_bxt
= {
510 static const struct gen_device_info gen_device_info_bxt_2x6
= {
511 GEN9_LP_FEATURES_2X6
,
516 * Note: for all KBL SKUs, the PRM says SKL for GS entries, not SKL+.
517 * There's no KBL entry. Using the default SKL (GEN9) GS entries value.
520 static const struct gen_device_info gen_device_info_kbl_gt1
= {
525 .max_cs_threads
= 7 * 6,
531 static const struct gen_device_info gen_device_info_kbl_gt1_5
= {
536 .max_cs_threads
= 7 * 6,
541 static const struct gen_device_info gen_device_info_kbl_gt2
= {
550 static const struct gen_device_info gen_device_info_kbl_gt3
= {
559 static const struct gen_device_info gen_device_info_kbl_gt4
= {
565 * From the "L3 Allocation and Programming" documentation:
567 * "URB is limited to 1008KB due to programming restrictions. This
568 * is not a restriction of the L3 implementation, but of the FF and
569 * other clients. Therefore, in a GT4 implementation it is
570 * possible for the programmed allocation of the L3 data array to
571 * provide 3*384KB=1152KB for URB, but only 1008KB of this
574 .urb
.size
= 1008 / 3,
579 static const struct gen_device_info gen_device_info_glk
= {
581 .is_geminilake
= true,
585 /*TODO: Initialize l3_banks when we know the number. */
586 static const struct gen_device_info gen_device_info_glk_2x6
= {
587 GEN9_LP_FEATURES_2X6
,
588 .is_geminilake
= true,
591 #define GEN10_HW_INFO \
593 .max_vs_threads = 728, \
594 .max_gs_threads = 432, \
595 .max_tcs_threads = 432, \
596 .max_tes_threads = 624, \
597 .max_cs_threads = 56, \
601 [MESA_SHADER_VERTEX] = 64, \
602 [MESA_SHADER_TESS_EVAL] = 34, \
605 [MESA_SHADER_VERTEX] = 3936, \
606 [MESA_SHADER_TESS_CTRL] = 896, \
607 [MESA_SHADER_TESS_EVAL] = 2064, \
608 [MESA_SHADER_GEOMETRY] = 832, \
612 #define GEN10_FEATURES(_gt, _slices, _l3) \
615 .gt = _gt, .num_slices = _slices, .l3_banks = _l3
617 static const struct gen_device_info gen_device_info_cnl_2x8
= {
619 GEN10_FEATURES(1, 1, 2),
620 .is_cannonlake
= true,
623 static const struct gen_device_info gen_device_info_cnl_3x8
= {
625 GEN10_FEATURES(1, 1, 3),
626 .is_cannonlake
= true,
629 static const struct gen_device_info gen_device_info_cnl_4x8
= {
631 GEN10_FEATURES(1, 2, 6),
632 .is_cannonlake
= true,
635 static const struct gen_device_info gen_device_info_cnl_5x8
= {
637 GEN10_FEATURES(2, 2, 6),
638 .is_cannonlake
= true,
642 gen_get_device_info(int devid
, struct gen_device_info
*devinfo
)
646 #define CHIPSET(id, family, name) \
647 case id: *devinfo = gen_device_info_##family; break;
648 #include "pci_ids/i965_pci_ids.h"
650 fprintf(stderr
, "i965_dri.so does not support the 0x%x PCI ID.\n", devid
);
654 /* From the Skylake PRM, 3DSTATE_PS::Scratch Space Base Pointer:
656 * "Scratch Space per slice is computed based on 4 sub-slices. SW must
657 * allocate scratch space enough so that each slice has 4 slices allowed."
659 * The equivalent internal documentation says that this programming note
660 * applies to all Gen9+ platforms.
662 * The hardware typically calculates the scratch space pointer by taking
663 * the base address, and adding per-thread-scratch-space * thread ID.
664 * Extra padding can be necessary depending how the thread IDs are
665 * calculated for a particular shader stage.
667 if (devinfo
->gen
>= 9) {
668 devinfo
->max_wm_threads
= 64 /* threads-per-PSD */
669 * devinfo
->num_slices
670 * 4; /* effective subslices per slice */
677 gen_get_device_name(int devid
)
681 #define CHIPSET(id, family, name) case id: return name;
682 #include "pci_ids/i965_pci_ids.h"