59160bed84737bce410a0ae6470d901b469b87f1
2 * Mesa 3-D graphics library
4 * Copyright (C) 2014 LunarG, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
28 #include "pipe/p_compiler.h"
29 #include "util/u_debug.h"
31 #include "gen_regs.xml.h"
32 #include "gen_mi.xml.h"
33 #include "gen_blitter.xml.h"
34 #include "gen_render_surface.xml.h"
35 #include "gen_render_dynamic.xml.h"
36 #include "gen_render_3d.xml.h"
37 #include "gen_eu_isa.xml.h"
38 #include "gen_eu_message.xml.h"
40 #define GEN_MI_CMD(op) (GEN6_MI_TYPE_MI | GEN6_MI_OPCODE_ ## op)
42 #define GEN_BLITTER_CMD(op) \
43 (GEN6_BLITTER_TYPE_BLITTER | GEN6_BLITTER_OPCODE_ ## op)
45 #define GEN_RENDER_CMD(subtype, op) \
46 (GEN6_RENDER_TYPE_RENDER | \
47 GEN6_RENDER_SUBTYPE_ ## subtype | \
48 GEN6_RENDER_OPCODE_ ## op)
53 return (devid
== 0x0102 || /* GT1 desktop */
54 devid
== 0x0112 || /* GT2 desktop */
55 devid
== 0x0122 || /* GT2_PLUS desktop */
56 devid
== 0x0106 || /* GT1 mobile */
57 devid
== 0x0116 || /* GT2 mobile */
58 devid
== 0x0126 || /* GT2_PLUS mobile */
59 devid
== 0x010a); /* GT1 server */
63 gen_get_snb_gt(int devid
)
65 assert(gen_is_snb(devid
));
66 return (devid
& 0x30) ? 2 : 1;
72 return (devid
== 0x0152 || /* GT1 desktop */
73 devid
== 0x0162 || /* GT2 desktop */
74 devid
== 0x0156 || /* GT1 mobile */
75 devid
== 0x0166 || /* GT2 mobile */
76 devid
== 0x015a || /* GT1 server */
77 devid
== 0x016a); /* GT2 server */
81 gen_get_ivb_gt(int devid
)
83 assert(gen_is_ivb(devid
));
84 return (devid
& 0x30) >> 4;
90 return (devid
== 0x0402 || /* GT1 desktop */
91 devid
== 0x0412 || /* GT2 desktop */
92 devid
== 0x0422 || /* GT3 desktop */
93 devid
== 0x0406 || /* GT1 mobile */
94 devid
== 0x0416 || /* GT2 mobile */
95 devid
== 0x0426 || /* GT2 mobile */
96 devid
== 0x040a || /* GT1 server */
97 devid
== 0x041a || /* GT2 server */
98 devid
== 0x042a || /* GT3 server */
99 devid
== 0x040b || /* GT1 reserved */
100 devid
== 0x041b || /* GT2 reserved */
101 devid
== 0x042b || /* GT3 reserved */
102 devid
== 0x040e || /* GT1 reserved */
103 devid
== 0x041e || /* GT2 reserved */
104 devid
== 0x042e || /* GT3 reserved */
105 devid
== 0x0c02 || /* SDV */
120 devid
== 0x0a02 || /* ULT */
135 devid
== 0x0d02 || /* CRW */
153 gen_get_hsw_gt(int devid
)
155 assert(gen_is_hsw(devid
));
156 return ((devid
& 0x30) >> 4) + 1;
160 gen_is_vlv(int devid
)
162 return (devid
== 0x0f30 ||
171 gen_is_atom(int devid
)
173 return gen_is_vlv(devid
);
177 gen_is_desktop(int devid
)
179 assert(!gen_is_atom(devid
));
180 return ((devid
& 0xf) == 0x2);
184 gen_is_mobile(int devid
)
186 assert(!gen_is_atom(devid
));
187 return ((devid
& 0xf) == 0x6);
191 gen_is_server(int devid
)
193 assert(!gen_is_atom(devid
));
194 return ((devid
& 0xf) == 0xa);