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,
135 .max_vs_threads
= 36,
136 .max_tcs_threads
= 36,
137 .max_tes_threads
= 36,
138 .max_gs_threads
= 36,
139 .max_wm_threads
= 48,
140 .max_cs_threads
= 36,
144 [MESA_SHADER_VERTEX
] = 32,
145 [MESA_SHADER_TESS_EVAL
] = 10,
148 [MESA_SHADER_VERTEX
] = 512,
149 [MESA_SHADER_TESS_CTRL
] = 32,
150 [MESA_SHADER_TESS_EVAL
] = 288,
151 [MESA_SHADER_GEOMETRY
] = 192,
156 static const struct gen_device_info gen_device_info_ivb_gt2
= {
157 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 2,
159 .max_vs_threads
= 128,
160 .max_tcs_threads
= 128,
161 .max_tes_threads
= 128,
162 .max_gs_threads
= 128,
163 .max_wm_threads
= 172,
164 .max_cs_threads
= 64,
168 [MESA_SHADER_VERTEX
] = 32,
169 [MESA_SHADER_TESS_EVAL
] = 10,
172 [MESA_SHADER_VERTEX
] = 704,
173 [MESA_SHADER_TESS_CTRL
] = 64,
174 [MESA_SHADER_TESS_EVAL
] = 448,
175 [MESA_SHADER_GEOMETRY
] = 320,
180 static const struct gen_device_info gen_device_info_byt
= {
181 GEN7_FEATURES
, .is_baytrail
= true, .gt
= 1,
184 .max_vs_threads
= 36,
185 .max_tcs_threads
= 36,
186 .max_tes_threads
= 36,
187 .max_gs_threads
= 36,
188 .max_wm_threads
= 48,
189 .max_cs_threads
= 32,
193 [MESA_SHADER_VERTEX
] = 32,
194 [MESA_SHADER_TESS_EVAL
] = 10,
197 [MESA_SHADER_VERTEX
] = 512,
198 [MESA_SHADER_TESS_CTRL
] = 32,
199 [MESA_SHADER_TESS_EVAL
] = 288,
200 [MESA_SHADER_GEOMETRY
] = 192,
205 #define HSW_FEATURES \
207 .is_haswell = true, \
208 .supports_simd16_3src = true, \
209 .has_resource_streamer = true
211 static const struct gen_device_info gen_device_info_hsw_gt1
= {
212 HSW_FEATURES
, .gt
= 1,
214 .max_vs_threads
= 70,
215 .max_tcs_threads
= 70,
216 .max_tes_threads
= 70,
217 .max_gs_threads
= 70,
218 .max_wm_threads
= 102,
219 .max_cs_threads
= 70,
223 [MESA_SHADER_VERTEX
] = 32,
224 [MESA_SHADER_TESS_EVAL
] = 10,
227 [MESA_SHADER_VERTEX
] = 640,
228 [MESA_SHADER_TESS_CTRL
] = 64,
229 [MESA_SHADER_TESS_EVAL
] = 384,
230 [MESA_SHADER_GEOMETRY
] = 256,
235 static const struct gen_device_info gen_device_info_hsw_gt2
= {
236 HSW_FEATURES
, .gt
= 2,
238 .max_vs_threads
= 280,
239 .max_tcs_threads
= 256,
240 .max_tes_threads
= 280,
241 .max_gs_threads
= 256,
242 .max_wm_threads
= 204,
243 .max_cs_threads
= 70,
247 [MESA_SHADER_VERTEX
] = 64,
248 [MESA_SHADER_TESS_EVAL
] = 10,
251 [MESA_SHADER_VERTEX
] = 1664,
252 [MESA_SHADER_TESS_CTRL
] = 128,
253 [MESA_SHADER_TESS_EVAL
] = 960,
254 [MESA_SHADER_GEOMETRY
] = 640,
259 static const struct gen_device_info gen_device_info_hsw_gt3
= {
260 HSW_FEATURES
, .gt
= 3,
262 .max_vs_threads
= 280,
263 .max_tcs_threads
= 256,
264 .max_tes_threads
= 280,
265 .max_gs_threads
= 256,
266 .max_wm_threads
= 408,
267 .max_cs_threads
= 70,
271 [MESA_SHADER_VERTEX
] = 64,
272 [MESA_SHADER_TESS_EVAL
] = 10,
275 [MESA_SHADER_VERTEX
] = 1664,
276 [MESA_SHADER_TESS_CTRL
] = 128,
277 [MESA_SHADER_TESS_EVAL
] = 960,
278 [MESA_SHADER_GEOMETRY
] = 640,
283 #define GEN8_FEATURES \
285 .has_hiz_and_separate_stencil = true, \
286 .has_resource_streamer = true, \
287 .must_use_separate_stencil = true, \
290 .supports_simd16_3src = true, \
291 .has_surface_tile_offset = true, \
292 .max_vs_threads = 504, \
293 .max_tcs_threads = 504, \
294 .max_tes_threads = 504, \
295 .max_gs_threads = 504, \
296 .max_wm_threads = 384, \
299 static const struct gen_device_info gen_device_info_bdw_gt1
= {
300 GEN8_FEATURES
, .gt
= 1,
302 .max_cs_threads
= 42,
306 [MESA_SHADER_VERTEX
] = 64,
307 [MESA_SHADER_TESS_EVAL
] = 34,
310 [MESA_SHADER_VERTEX
] = 2560,
311 [MESA_SHADER_TESS_CTRL
] = 504,
312 [MESA_SHADER_TESS_EVAL
] = 1536,
313 [MESA_SHADER_GEOMETRY
] = 960,
318 static const struct gen_device_info gen_device_info_bdw_gt2
= {
319 GEN8_FEATURES
, .gt
= 2,
321 .max_cs_threads
= 56,
325 [MESA_SHADER_VERTEX
] = 64,
326 [MESA_SHADER_TESS_EVAL
] = 34,
329 [MESA_SHADER_VERTEX
] = 2560,
330 [MESA_SHADER_TESS_CTRL
] = 504,
331 [MESA_SHADER_TESS_EVAL
] = 1536,
332 [MESA_SHADER_GEOMETRY
] = 960,
337 static const struct gen_device_info gen_device_info_bdw_gt3
= {
338 GEN8_FEATURES
, .gt
= 3,
340 .max_cs_threads
= 56,
344 [MESA_SHADER_VERTEX
] = 64,
345 [MESA_SHADER_TESS_EVAL
] = 34,
348 [MESA_SHADER_VERTEX
] = 2560,
349 [MESA_SHADER_TESS_CTRL
] = 504,
350 [MESA_SHADER_TESS_EVAL
] = 1536,
351 [MESA_SHADER_GEOMETRY
] = 960,
356 static const struct gen_device_info gen_device_info_chv
= {
357 GEN8_FEATURES
, .is_cherryview
= 1, .gt
= 1,
360 .max_vs_threads
= 80,
361 .max_tcs_threads
= 80,
362 .max_tes_threads
= 80,
363 .max_gs_threads
= 80,
364 .max_wm_threads
= 128,
365 .max_cs_threads
= 6 * 7,
369 [MESA_SHADER_VERTEX
] = 34,
370 [MESA_SHADER_TESS_EVAL
] = 34,
373 [MESA_SHADER_VERTEX
] = 640,
374 [MESA_SHADER_TESS_CTRL
] = 80,
375 [MESA_SHADER_TESS_EVAL
] = 384,
376 [MESA_SHADER_GEOMETRY
] = 256,
381 #define GEN9_FEATURES \
383 .has_hiz_and_separate_stencil = true, \
384 .has_resource_streamer = true, \
385 .must_use_separate_stencil = true, \
388 .supports_simd16_3src = true, \
389 .has_surface_tile_offset = true, \
390 .max_vs_threads = 336, \
391 .max_gs_threads = 336, \
392 .max_tcs_threads = 336, \
393 .max_tes_threads = 336, \
394 .max_cs_threads = 56, \
395 .timebase_scale = 1000000000.0 / 12000000.0, \
399 [MESA_SHADER_VERTEX] = 64, \
400 [MESA_SHADER_TESS_EVAL] = 34, \
403 [MESA_SHADER_VERTEX] = 1856, \
404 [MESA_SHADER_TESS_CTRL] = 672, \
405 [MESA_SHADER_TESS_EVAL] = 1120, \
406 [MESA_SHADER_GEOMETRY] = 640, \
410 #define GEN9_LP_FEATURES \
416 .max_vs_threads = 112, \
417 .max_tcs_threads = 112, \
418 .max_tes_threads = 112, \
419 .max_gs_threads = 112, \
420 .max_cs_threads = 6 * 6, \
421 .timebase_scale = 1000000000.0 / 19200123.0, \
425 [MESA_SHADER_VERTEX] = 34, \
426 [MESA_SHADER_TESS_EVAL] = 34, \
429 [MESA_SHADER_VERTEX] = 704, \
430 [MESA_SHADER_TESS_CTRL] = 256, \
431 [MESA_SHADER_TESS_EVAL] = 416, \
432 [MESA_SHADER_GEOMETRY] = 256, \
436 #define GEN9_LP_FEATURES_2X6 \
438 .max_vs_threads = 56, \
439 .max_tcs_threads = 56, \
440 .max_tes_threads = 56, \
441 .max_gs_threads = 56, \
442 .max_cs_threads = 6 * 6, \
446 [MESA_SHADER_VERTEX] = 34, \
447 [MESA_SHADER_TESS_EVAL] = 34, \
450 [MESA_SHADER_VERTEX] = 352, \
451 [MESA_SHADER_TESS_CTRL] = 128, \
452 [MESA_SHADER_TESS_EVAL] = 208, \
453 [MESA_SHADER_GEOMETRY] = 128, \
457 static const struct gen_device_info gen_device_info_skl_gt1
= {
458 GEN9_FEATURES
, .gt
= 1,
463 static const struct gen_device_info gen_device_info_skl_gt2
= {
464 GEN9_FEATURES
, .gt
= 2,
468 static const struct gen_device_info gen_device_info_skl_gt3
= {
469 GEN9_FEATURES
, .gt
= 3,
473 static const struct gen_device_info gen_device_info_skl_gt4
= {
474 GEN9_FEATURES
, .gt
= 4,
476 /* From the "L3 Allocation and Programming" documentation:
478 * "URB is limited to 1008KB due to programming restrictions. This is not a
479 * restriction of the L3 implementation, but of the FF and other clients.
480 * Therefore, in a GT4 implementation it is possible for the programmed
481 * allocation of the L3 data array to provide 3*384KB=1152KB for URB, but
482 * only 1008KB of this will be used."
484 .urb
.size
= 1008 / 3,
487 static const struct gen_device_info gen_device_info_bxt
= {
491 static const struct gen_device_info gen_device_info_bxt_2x6
= {
495 * Note: for all KBL SKUs, the PRM says SKL for GS entries, not SKL+.
496 * There's no KBL entry. Using the default SKL (GEN9) GS entries value.
499 static const struct gen_device_info gen_device_info_kbl_gt1
= {
504 .max_cs_threads
= 7 * 6,
509 static const struct gen_device_info gen_device_info_kbl_gt1_5
= {
514 .max_cs_threads
= 7 * 6,
518 static const struct gen_device_info gen_device_info_kbl_gt2
= {
526 static const struct gen_device_info gen_device_info_kbl_gt3
= {
534 static const struct gen_device_info gen_device_info_kbl_gt4
= {
540 * From the "L3 Allocation and Programming" documentation:
542 * "URB is limited to 1008KB due to programming restrictions. This
543 * is not a restriction of the L3 implementation, but of the FF and
544 * other clients. Therefore, in a GT4 implementation it is
545 * possible for the programmed allocation of the L3 data array to
546 * provide 3*384KB=1152KB for URB, but only 1008KB of this
549 .urb
.size
= 1008 / 3,
553 static const struct gen_device_info gen_device_info_glk
= {
557 static const struct gen_device_info gen_device_info_glk_2x6
= {
562 gen_get_device_info(int devid
, struct gen_device_info
*devinfo
)
566 #define CHIPSET(id, family, name) \
567 case id: *devinfo = gen_device_info_##family; break;
568 #include "pci_ids/i965_pci_ids.h"
570 fprintf(stderr
, "i965_dri.so does not support the 0x%x PCI ID.\n", devid
);
574 /* From the Skylake PRM, 3DSTATE_PS::Scratch Space Base Pointer:
576 * "Scratch Space per slice is computed based on 4 sub-slices. SW must
577 * allocate scratch space enough so that each slice has 4 slices allowed."
579 * The equivalent internal documentation says that this programming note
580 * applies to all Gen9+ platforms.
582 * The hardware typically calculates the scratch space pointer by taking
583 * the base address, and adding per-thread-scratch-space * thread ID.
584 * Extra padding can be necessary depending how the thread IDs are
585 * calculated for a particular shader stage.
587 if (devinfo
->gen
>= 9) {
588 devinfo
->max_wm_threads
= 64 /* threads-per-PSD */
589 * devinfo
->num_slices
590 * 4; /* effective subslices per slice */
597 gen_get_device_name(int devid
)
601 #define CHIPSET(id, family, name) case id: return name;
602 #include "pci_ids/i965_pci_ids.h"