i965/fs: Disable unlit_centroid_workaround on Haswell.
[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 .needs_unlit_centroid_workaround = true,
32 .max_vs_threads = 16,
33 .max_gs_threads = 2,
34 .max_wm_threads = 8 * 4,
35 .urb = {
36 .size = 256,
37 },
38 };
39
40 static const struct brw_device_info brw_device_info_g4x = {
41 .gen = 4,
42 .has_pln = true,
43 .has_compr4 = true,
44 .has_surface_tile_offset = true,
45 .needs_unlit_centroid_workaround = true,
46 .is_g4x = true,
47 .max_vs_threads = 32,
48 .max_gs_threads = 2,
49 .max_wm_threads = 10 * 5,
50 .urb = {
51 .size = 384,
52 },
53 };
54
55 static const struct brw_device_info brw_device_info_ilk = {
56 .gen = 5,
57 .has_pln = true,
58 .has_compr4 = true,
59 .has_surface_tile_offset = true,
60 .needs_unlit_centroid_workaround = true,
61 .max_vs_threads = 72,
62 .max_gs_threads = 32,
63 .max_wm_threads = 12 * 6,
64 .urb = {
65 .size = 1024,
66 },
67 };
68
69 static const struct brw_device_info brw_device_info_snb_gt1 = {
70 .gen = 6,
71 .gt = 1,
72 .has_hiz_and_separate_stencil = true,
73 .has_llc = true,
74 .has_pln = true,
75 .has_surface_tile_offset = true,
76 .needs_unlit_centroid_workaround = true,
77 .max_vs_threads = 24,
78 .max_gs_threads = 21, /* conservative; 24 if rendering disabled. */
79 .max_wm_threads = 40,
80 .urb = {
81 .size = 32,
82 .min_vs_entries = 24,
83 .max_vs_entries = 256,
84 .max_gs_entries = 256,
85 },
86 };
87
88 static const struct brw_device_info brw_device_info_snb_gt2 = {
89 .gen = 6,
90 .gt = 2,
91 .has_hiz_and_separate_stencil = true,
92 .has_llc = true,
93 .has_pln = true,
94 .has_surface_tile_offset = true,
95 .needs_unlit_centroid_workaround = true,
96 .max_vs_threads = 60,
97 .max_gs_threads = 60,
98 .max_wm_threads = 80,
99 .urb = {
100 .size = 64,
101 .min_vs_entries = 24,
102 .max_vs_entries = 256,
103 .max_gs_entries = 256,
104 },
105 };
106
107 #define GEN7_FEATURES \
108 .gen = 7, \
109 .has_hiz_and_separate_stencil = true, \
110 .must_use_separate_stencil = true, \
111 .has_llc = true, \
112 .has_pln = true, \
113 .has_surface_tile_offset = true
114
115 static const struct brw_device_info brw_device_info_ivb_gt1 = {
116 GEN7_FEATURES, .is_ivybridge = true, .gt = 1,
117 .needs_unlit_centroid_workaround = true,
118 .max_vs_threads = 36,
119 .max_gs_threads = 36,
120 .max_wm_threads = 48,
121 .urb = {
122 .size = 128,
123 .min_vs_entries = 32,
124 .max_vs_entries = 512,
125 .max_gs_entries = 192,
126 },
127 };
128
129 static const struct brw_device_info brw_device_info_ivb_gt2 = {
130 GEN7_FEATURES, .is_ivybridge = true, .gt = 2,
131 .needs_unlit_centroid_workaround = true,
132 .max_vs_threads = 128,
133 .max_gs_threads = 128,
134 .max_wm_threads = 172,
135 .urb = {
136 .size = 256,
137 .min_vs_entries = 32,
138 .max_vs_entries = 704,
139 .max_gs_entries = 320,
140 },
141 };
142
143 static const struct brw_device_info brw_device_info_byt = {
144 GEN7_FEATURES, .is_baytrail = true, .gt = 1,
145 .needs_unlit_centroid_workaround = true,
146 .has_llc = false,
147 .max_vs_threads = 36,
148 .max_gs_threads = 36,
149 .max_wm_threads = 48,
150 .urb = {
151 .size = 128,
152 .min_vs_entries = 32,
153 .max_vs_entries = 512,
154 .max_gs_entries = 192,
155 },
156 };
157
158 static const struct brw_device_info brw_device_info_hsw_gt1 = {
159 GEN7_FEATURES, .is_haswell = true, .gt = 1,
160 .max_vs_threads = 70,
161 .max_gs_threads = 70,
162 .max_wm_threads = 102,
163 .urb = {
164 .size = 128,
165 .min_vs_entries = 32,
166 .max_vs_entries = 640,
167 .max_gs_entries = 256,
168 },
169 };
170
171 static const struct brw_device_info brw_device_info_hsw_gt2 = {
172 GEN7_FEATURES, .is_haswell = true, .gt = 2,
173 .max_vs_threads = 280,
174 .max_gs_threads = 256,
175 .max_wm_threads = 204,
176 .urb = {
177 .size = 256,
178 .min_vs_entries = 64,
179 .max_vs_entries = 1664,
180 .max_gs_entries = 640,
181 },
182 };
183
184 static const struct brw_device_info brw_device_info_hsw_gt3 = {
185 GEN7_FEATURES, .is_haswell = true, .gt = 3,
186 .max_vs_threads = 280,
187 .max_gs_threads = 256,
188 .max_wm_threads = 408,
189 .urb = {
190 .size = 512,
191 .min_vs_entries = 64,
192 .max_vs_entries = 1664,
193 .max_gs_entries = 640,
194 },
195 };
196
197 #define GEN8_FEATURES \
198 .gen = 8, \
199 .has_hiz_and_separate_stencil = true, \
200 .must_use_separate_stencil = true, \
201 .has_llc = true, \
202 .has_pln = true, \
203 .max_vs_threads = 504, \
204 .max_gs_threads = 504, \
205 .max_wm_threads = 384 \
206
207 static const struct brw_device_info brw_device_info_bdw_gt1 = {
208 GEN8_FEATURES, .gt = 1,
209 .urb = {
210 .size = 192,
211 .min_vs_entries = 64,
212 .max_vs_entries = 2560,
213 .max_gs_entries = 960,
214 }
215 };
216
217 static const struct brw_device_info brw_device_info_bdw_gt2 = {
218 GEN8_FEATURES, .gt = 2,
219 .urb = {
220 .size = 384,
221 .min_vs_entries = 64,
222 .max_vs_entries = 2560,
223 .max_gs_entries = 960,
224 }
225 };
226
227 static const struct brw_device_info brw_device_info_bdw_gt3 = {
228 GEN8_FEATURES, .gt = 3,
229 .urb = {
230 .size = 384,
231 .min_vs_entries = 64,
232 .max_vs_entries = 2560,
233 .max_gs_entries = 960,
234 }
235 };
236
237 /* Thread counts and URB limits are placeholders, and may not be accurate.
238 * These were copied from Haswell GT1, above.
239 */
240 static const struct brw_device_info brw_device_info_chv = {
241 GEN8_FEATURES, .is_cherryview = 1, .gt = 1,
242 .has_llc = false,
243 .max_vs_threads = 70,
244 .max_gs_threads = 70,
245 .max_wm_threads = 102,
246 .urb = {
247 .size = 128,
248 .min_vs_entries = 64,
249 .max_vs_entries = 640,
250 .max_gs_entries = 256,
251 }
252 };
253
254 const struct brw_device_info *
255 brw_get_device_info(int devid)
256 {
257 switch (devid) {
258 #undef CHIPSET
259 #define CHIPSET(id, family, name) case id: return &brw_device_info_##family;
260 #include "pci_ids/i965_pci_ids.h"
261 default:
262 fprintf(stderr, "i965_dri.so does not support the 0x%x PCI ID.\n", devid);
263 return NULL;
264 }
265 }