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"
28 static const struct gen_device_info gen_device_info_i965
= {
30 .has_negative_rhw_bug
= true,
34 .max_wm_threads
= 8 * 4,
40 static const struct gen_device_info gen_device_info_g4x
= {
44 .has_surface_tile_offset
= true,
49 .max_wm_threads
= 10 * 5,
55 static const struct gen_device_info gen_device_info_ilk
= {
59 .has_surface_tile_offset
= true,
63 .max_wm_threads
= 12 * 6,
69 static const struct gen_device_info gen_device_info_snb_gt1
= {
72 .has_hiz_and_separate_stencil
= true,
75 .has_surface_tile_offset
= true,
76 .needs_unlit_centroid_workaround
= true,
79 .max_gs_threads
= 21, /* conservative; 24 if rendering disabled. */
84 .max_vs_entries
= 256,
85 .max_gs_entries
= 256,
89 static const struct gen_device_info gen_device_info_snb_gt2
= {
92 .has_hiz_and_separate_stencil
= true,
95 .has_surface_tile_offset
= true,
96 .needs_unlit_centroid_workaround
= true,
100 .max_wm_threads
= 80,
103 .min_vs_entries
= 24,
104 .max_vs_entries
= 256,
105 .max_gs_entries
= 256,
109 #define GEN7_FEATURES \
111 .has_hiz_and_separate_stencil = true, \
112 .must_use_separate_stencil = true, \
115 .has_surface_tile_offset = true
117 static const struct gen_device_info gen_device_info_ivb_gt1
= {
118 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 1,
120 .max_vs_threads
= 36,
121 .max_tcs_threads
= 36,
122 .max_tes_threads
= 36,
123 .max_gs_threads
= 36,
124 .max_wm_threads
= 48,
125 .max_cs_threads
= 36,
128 .min_vs_entries
= 32,
129 .max_vs_entries
= 512,
130 .max_tcs_entries
= 32,
131 .min_ds_entries
= 10,
132 .max_tes_entries
= 288,
133 .max_gs_entries
= 192,
137 static const struct gen_device_info gen_device_info_ivb_gt2
= {
138 GEN7_FEATURES
, .is_ivybridge
= true, .gt
= 2,
140 .max_vs_threads
= 128,
141 .max_tcs_threads
= 128,
142 .max_tes_threads
= 128,
143 .max_gs_threads
= 128,
144 .max_wm_threads
= 172,
145 .max_cs_threads
= 64,
148 .min_vs_entries
= 32,
149 .max_vs_entries
= 704,
150 .max_tcs_entries
= 64,
151 .min_ds_entries
= 10,
152 .max_tes_entries
= 448,
153 .max_gs_entries
= 320,
157 static const struct gen_device_info gen_device_info_byt
= {
158 GEN7_FEATURES
, .is_baytrail
= true, .gt
= 1,
161 .max_vs_threads
= 36,
162 .max_tcs_threads
= 36,
163 .max_tes_threads
= 36,
164 .max_gs_threads
= 36,
165 .max_wm_threads
= 48,
166 .max_cs_threads
= 32,
169 .min_vs_entries
= 32,
170 .max_vs_entries
= 512,
171 .max_tcs_entries
= 32,
172 .min_ds_entries
= 10,
173 .max_tes_entries
= 288,
174 .max_gs_entries
= 192,
178 #define HSW_FEATURES \
180 .is_haswell = true, \
181 .supports_simd16_3src = true, \
182 .has_resource_streamer = true
184 static const struct gen_device_info gen_device_info_hsw_gt1
= {
185 HSW_FEATURES
, .gt
= 1,
187 .max_vs_threads
= 70,
188 .max_tcs_threads
= 70,
189 .max_tes_threads
= 70,
190 .max_gs_threads
= 70,
191 .max_wm_threads
= 102,
192 .max_cs_threads
= 70,
195 .min_vs_entries
= 32,
196 .max_vs_entries
= 640,
197 .max_tcs_entries
= 64,
198 .min_ds_entries
= 10,
199 .max_tes_entries
= 384,
200 .max_gs_entries
= 256,
204 static const struct gen_device_info gen_device_info_hsw_gt2
= {
205 HSW_FEATURES
, .gt
= 2,
207 .max_vs_threads
= 280,
208 .max_tcs_threads
= 256,
209 .max_tes_threads
= 280,
210 .max_gs_threads
= 256,
211 .max_wm_threads
= 204,
212 .max_cs_threads
= 70,
215 .min_vs_entries
= 64,
216 .max_vs_entries
= 1664,
217 .max_tcs_entries
= 128,
218 .min_ds_entries
= 10,
219 .max_tes_entries
= 960,
220 .max_gs_entries
= 640,
224 static const struct gen_device_info gen_device_info_hsw_gt3
= {
225 HSW_FEATURES
, .gt
= 3,
227 .max_vs_threads
= 280,
228 .max_tcs_threads
= 256,
229 .max_tes_threads
= 280,
230 .max_gs_threads
= 256,
231 .max_wm_threads
= 408,
232 .max_cs_threads
= 70,
235 .min_vs_entries
= 64,
236 .max_vs_entries
= 1664,
237 .max_tcs_entries
= 128,
238 .min_ds_entries
= 10,
239 .max_tes_entries
= 960,
240 .max_gs_entries
= 640,
244 #define GEN8_FEATURES \
246 .has_hiz_and_separate_stencil = true, \
247 .has_resource_streamer = true, \
248 .must_use_separate_stencil = true, \
251 .supports_simd16_3src = true, \
252 .has_surface_tile_offset = true, \
253 .max_vs_threads = 504, \
254 .max_tcs_threads = 504, \
255 .max_tes_threads = 504, \
256 .max_gs_threads = 504, \
257 .max_wm_threads = 384
259 static const struct gen_device_info gen_device_info_bdw_gt1
= {
260 GEN8_FEATURES
, .gt
= 1,
262 .max_cs_threads
= 42,
265 .min_vs_entries
= 64,
266 .max_vs_entries
= 2560,
267 .max_tcs_entries
= 504,
268 .min_ds_entries
= 34,
269 .max_tes_entries
= 1536,
270 .max_gs_entries
= 960,
274 static const struct gen_device_info gen_device_info_bdw_gt2
= {
275 GEN8_FEATURES
, .gt
= 2,
277 .max_cs_threads
= 56,
280 .min_vs_entries
= 64,
281 .max_vs_entries
= 2560,
282 .max_tcs_entries
= 504,
283 .min_ds_entries
= 34,
284 .max_tes_entries
= 1536,
285 .max_gs_entries
= 960,
289 static const struct gen_device_info gen_device_info_bdw_gt3
= {
290 GEN8_FEATURES
, .gt
= 3,
292 .max_cs_threads
= 56,
295 .min_vs_entries
= 64,
296 .max_vs_entries
= 2560,
297 .max_tcs_entries
= 504,
298 .min_ds_entries
= 34,
299 .max_tes_entries
= 1536,
300 .max_gs_entries
= 960,
304 static const struct gen_device_info gen_device_info_chv
= {
305 GEN8_FEATURES
, .is_cherryview
= 1, .gt
= 1,
308 .max_vs_threads
= 80,
309 .max_tcs_threads
= 80,
310 .max_tes_threads
= 80,
311 .max_gs_threads
= 80,
312 .max_wm_threads
= 128,
313 .max_cs_threads
= 6 * 7,
316 .min_vs_entries
= 34,
317 .max_vs_entries
= 640,
318 .max_tcs_entries
= 80,
319 .min_ds_entries
= 34,
320 .max_tes_entries
= 384,
321 .max_gs_entries
= 256,
325 #define GEN9_FEATURES \
327 .has_hiz_and_separate_stencil = true, \
328 .has_resource_streamer = true, \
329 .must_use_separate_stencil = true, \
332 .supports_simd16_3src = true, \
333 .has_surface_tile_offset = true, \
334 .max_vs_threads = 336, \
335 .max_gs_threads = 336, \
336 .max_tcs_threads = 336, \
337 .max_tes_threads = 336, \
338 .max_cs_threads = 56, \
341 .min_vs_entries = 64, \
342 .max_vs_entries = 1856, \
343 .max_tcs_entries = 672, \
344 .min_ds_entries = 34, \
345 .max_tes_entries = 1120, \
346 .max_gs_entries = 640, \
349 static const struct gen_device_info gen_device_info_skl_gt1
= {
350 GEN9_FEATURES
, .gt
= 1,
355 static const struct gen_device_info gen_device_info_skl_gt2
= {
356 GEN9_FEATURES
, .gt
= 2,
360 static const struct gen_device_info gen_device_info_skl_gt3
= {
361 GEN9_FEATURES
, .gt
= 3,
365 static const struct gen_device_info gen_device_info_skl_gt4
= {
366 GEN9_FEATURES
, .gt
= 4,
368 /* From the "L3 Allocation and Programming" documentation:
370 * "URB is limited to 1008KB due to programming restrictions. This is not a
371 * restriction of the L3 implementation, but of the FF and other clients.
372 * Therefore, in a GT4 implementation it is possible for the programmed
373 * allocation of the L3 data array to provide 3*384KB=1152KB for URB, but
374 * only 1008KB of this will be used."
376 .urb
.size
= 1008 / 3,
379 static const struct gen_device_info gen_device_info_bxt
= {
386 .max_vs_threads
= 112,
387 .max_tcs_threads
= 112,
388 .max_tes_threads
= 112,
389 .max_gs_threads
= 112,
390 .max_cs_threads
= 6 * 6,
393 .min_vs_entries
= 34,
394 .min_ds_entries
= 34,
395 .max_vs_entries
= 704,
396 .max_tcs_entries
= 256,
397 .max_tes_entries
= 416,
398 .max_gs_entries
= 256,
402 static const struct gen_device_info gen_device_info_bxt_2x6
= {
409 .max_vs_threads
= 56, /* XXX: guess */
410 .max_tcs_threads
= 56, /* XXX: guess */
411 .max_tes_threads
= 56,
412 .max_gs_threads
= 56,
413 .max_cs_threads
= 6 * 6,
416 .min_vs_entries
= 34,
417 .min_ds_entries
= 34,
418 .max_vs_entries
= 352,
419 .max_tcs_entries
= 128,
420 .max_tes_entries
= 208,
421 .max_gs_entries
= 128,
425 * Note: for all KBL SKUs, the PRM says SKL for GS entries, not SKL+.
426 * There's no KBL entry. Using the default SKL (GEN9) GS entries value.
429 static const struct gen_device_info gen_device_info_kbl_gt1
= {
433 .max_cs_threads
= 7 * 6,
438 static const struct gen_device_info gen_device_info_kbl_gt1_5
= {
442 .max_cs_threads
= 7 * 6,
446 static const struct gen_device_info gen_device_info_kbl_gt2
= {
453 static const struct gen_device_info gen_device_info_kbl_gt3
= {
460 static const struct gen_device_info gen_device_info_kbl_gt4
= {
465 * From the "L3 Allocation and Programming" documentation:
467 * "URB is limited to 1008KB due to programming restrictions. This
468 * is not a restriction of the L3 implementation, but of the FF and
469 * other clients. Therefore, in a GT4 implementation it is
470 * possible for the programmed allocation of the L3 data array to
471 * provide 3*384KB=1152KB for URB, but only 1008KB of this
474 .urb
.size
= 1008 / 3,
479 gen_get_device_info(int devid
, struct gen_device_info
*devinfo
)
483 #define CHIPSET(id, family, name) \
484 case id: *devinfo = gen_device_info_##family; break;
485 #include "pci_ids/i965_pci_ids.h"
487 fprintf(stderr
, "i965_dri.so does not support the 0x%x PCI ID.\n", devid
);
491 /* From the Skylake PRM, 3DSTATE_PS::Scratch Space Base Pointer:
493 * "Scratch Space per slice is computed based on 4 sub-slices. SW must
494 * allocate scratch space enough so that each slice has 4 slices allowed."
496 * The equivalent internal documentation says that this programming note
497 * applies to all Gen9+ platforms.
499 * The hardware typically calculates the scratch space pointer by taking
500 * the base address, and adding per-thread-scratch-space * thread ID.
501 * Extra padding can be necessary depending how the thread IDs are
502 * calculated for a particular shader stage.
504 if (devinfo
->gen
>= 9) {
505 devinfo
->max_wm_threads
= 64 /* threads-per-PSD */
506 * devinfo
->num_slices
507 * 4; /* effective subslices per slice */
514 gen_get_device_name(int devid
)
518 #define CHIPSET(id, family, name) case id: return name;
519 #include "pci_ids/i965_pci_ids.h"