i965: Move device quirks to brw_device_info.
[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 .needs_unlit_centroid_workaround = true,
43 .is_g4x = true,
44 .max_vs_threads = 32,
45 .max_gs_threads = 2,
46 .max_wm_threads = 10 * 5,
47 .urb = {
48 .size = 384,
49 },
50 };
51
52 static const struct brw_device_info brw_device_info_ilk = {
53 .gen = 5,
54 .needs_unlit_centroid_workaround = true,
55 .max_vs_threads = 72,
56 .max_gs_threads = 32,
57 .max_wm_threads = 12 * 6,
58 .urb = {
59 .size = 1024,
60 },
61 };
62
63 static const struct brw_device_info brw_device_info_snb_gt1 = {
64 .gen = 6,
65 .gt = 2,
66 .has_hiz_and_separate_stencil = true,
67 .has_llc = true,
68 .needs_unlit_centroid_workaround = true,
69 .max_vs_threads = 24,
70 .max_gs_threads = 21, /* conservative; 24 if rendering disabled. */
71 .max_wm_threads = 40,
72 .urb = {
73 .size = 32,
74 .min_vs_entries = 24,
75 .max_vs_entries = 256,
76 .max_gs_entries = 256,
77 },
78 };
79
80 static const struct brw_device_info brw_device_info_snb_gt2 = {
81 .gen = 6,
82 .gt = 2,
83 .has_hiz_and_separate_stencil = true,
84 .has_llc = true,
85 .needs_unlit_centroid_workaround = true,
86 .max_vs_threads = 60,
87 .max_gs_threads = 60,
88 .max_wm_threads = 80,
89 .urb = {
90 .size = 64,
91 .min_vs_entries = 24,
92 .max_vs_entries = 256,
93 .max_gs_entries = 256,
94 },
95 };
96
97 #define GEN7_FEATURES \
98 .gen = 7, \
99 .has_hiz_and_separate_stencil = true, \
100 .must_use_separate_stencil = true, \
101 .has_llc = true, \
102 .needs_unlit_centroid_workaround = true
103
104 static const struct brw_device_info brw_device_info_ivb_gt1 = {
105 GEN7_FEATURES, .is_ivybridge = true, .gt = 1,
106 .max_vs_threads = 36,
107 .max_gs_threads = 36,
108 .max_wm_threads = 48,
109 .urb = {
110 .size = 128,
111 .min_vs_entries = 32,
112 .max_vs_entries = 512,
113 .max_gs_entries = 192,
114 },
115 };
116
117 static const struct brw_device_info brw_device_info_ivb_gt2 = {
118 GEN7_FEATURES, .is_ivybridge = true, .gt = 2,
119 .max_vs_threads = 128,
120 .max_gs_threads = 128,
121 .max_wm_threads = 172,
122 .urb = {
123 .size = 256,
124 .min_vs_entries = 32,
125 .max_vs_entries = 704,
126 .max_gs_entries = 320,
127 },
128 };
129
130 static const struct brw_device_info brw_device_info_byt = {
131 GEN7_FEATURES, .is_baytrail = true, .gt = 1,
132 .has_llc = false,
133 .max_vs_threads = 36,
134 .max_gs_threads = 36,
135 .max_wm_threads = 48,
136 .urb = {
137 .size = 128,
138 .min_vs_entries = 32,
139 .max_vs_entries = 512,
140 .max_gs_entries = 192,
141 },
142 };
143
144 static const struct brw_device_info brw_device_info_hsw_gt1 = {
145 GEN7_FEATURES, .is_haswell = true, .gt = 1,
146 .max_vs_threads = 70,
147 .max_gs_threads = 70,
148 .max_wm_threads = 102,
149 .urb = {
150 .size = 128,
151 .min_vs_entries = 32,
152 .max_vs_entries = 640,
153 .max_gs_entries = 256,
154 },
155 };
156
157 static const struct brw_device_info brw_device_info_hsw_gt2 = {
158 GEN7_FEATURES, .is_haswell = true, .gt = 2,
159 .max_vs_threads = 280,
160 .max_gs_threads = 256,
161 .max_wm_threads = 204,
162 .urb = {
163 .size = 256,
164 .min_vs_entries = 64,
165 .max_vs_entries = 1664,
166 .max_gs_entries = 640,
167 },
168 };
169
170 static const struct brw_device_info brw_device_info_hsw_gt3 = {
171 GEN7_FEATURES, .is_haswell = true, .gt = 3,
172 .max_vs_threads = 280,
173 .max_gs_threads = 256,
174 .max_wm_threads = 408,
175 .urb = {
176 .size = 512,
177 .min_vs_entries = 64,
178 .max_vs_entries = 1664,
179 .max_gs_entries = 640,
180 },
181 };
182
183 const struct brw_device_info *
184 brw_get_device_info(int devid)
185 {
186 switch (devid) {
187 #undef CHIPSET
188 #define CHIPSET(id, family, name) case id: return &brw_device_info_##family;
189 #include "pci_ids/i965_pci_ids.h"
190 default:
191 fprintf(stderr, "Unknown Intel device.");
192 abort();
193 }
194 }