i965: Add a new brw_device_info structure.
[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 };
31
32 static const struct brw_device_info brw_device_info_g4x = {
33 .gen = 4,
34 .is_g4x = true,
35 };
36
37 static const struct brw_device_info brw_device_info_ilk = {
38 .gen = 5,
39 };
40
41 static const struct brw_device_info brw_device_info_snb_gt1 = {
42 .gen = 6,
43 .gt = 2,
44 .has_hiz_and_separate_stencil = true,
45 .has_llc = true,
46 };
47
48 static const struct brw_device_info brw_device_info_snb_gt2 = {
49 .gen = 6,
50 .gt = 2,
51 .has_hiz_and_separate_stencil = true,
52 .has_llc = true,
53 };
54
55 #define GEN7_FEATURES \
56 .gen = 7, \
57 .has_hiz_and_separate_stencil = true, \
58 .must_use_separate_stencil = true, \
59 .has_llc = true
60
61 static const struct brw_device_info brw_device_info_ivb_gt1 = {
62 GEN7_FEATURES, .is_ivybridge = true, .gt = 1,
63 };
64
65 static const struct brw_device_info brw_device_info_ivb_gt2 = {
66 GEN7_FEATURES, .is_ivybridge = true, .gt = 2,
67 };
68
69 static const struct brw_device_info brw_device_info_byt = {
70 GEN7_FEATURES, .is_baytrail = true, .gt = 1,
71 .has_llc = false,
72 };
73
74 static const struct brw_device_info brw_device_info_hsw_gt1 = {
75 GEN7_FEATURES, .is_haswell = true, .gt = 1,
76 };
77
78 static const struct brw_device_info brw_device_info_hsw_gt2 = {
79 GEN7_FEATURES, .is_haswell = true, .gt = 2,
80 };
81
82 static const struct brw_device_info brw_device_info_hsw_gt3 = {
83 GEN7_FEATURES, .is_haswell = true, .gt = 3,
84 };
85
86 const struct brw_device_info *
87 brw_get_device_info(int devid)
88 {
89 switch (devid) {
90 #undef CHIPSET
91 #define CHIPSET(id, family, name) case id: return &brw_device_info_##family;
92 #include "pci_ids/i965_pci_ids.h"
93 default:
94 fprintf(stderr, "Unknown Intel device.");
95 abort();
96 }
97 }