blob: 062e91b390855d33626f1a1360270e3e9de5386b [file] [log] [blame]
Chris Wilson42f55512016-06-24 14:00:26 +01001/*
2 * Copyright © 2016 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
Chris Wilsona09d0ba2016-06-24 14:00:27 +010025#include <linux/console.h>
Chris Wilson42f55512016-06-24 14:00:26 +010026#include <linux/vgaarb.h>
27#include <linux/vga_switcheroo.h>
28
29#include "i915_drv.h"
Chris Wilson953c7f82017-02-13 17:15:12 +000030#include "i915_selftest.h"
Chris Wilson42f55512016-06-24 14:00:26 +010031
Chris Wilsonc5cb21c2018-02-15 08:19:30 +000032#define PLATFORM(x) .platform = (x), .platform_mask = BIT(x)
Chris Wilsonbc762982018-02-15 08:19:28 +000033#define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
34
Chris Wilson42f55512016-06-24 14:00:26 +010035#define GEN_DEFAULT_PIPEOFFSETS \
36 .pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
37 PIPE_C_OFFSET, PIPE_EDP_OFFSET }, \
38 .trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
39 TRANSCODER_C_OFFSET, TRANSCODER_EDP_OFFSET }, \
40 .palette_offsets = { PALETTE_A_OFFSET, PALETTE_B_OFFSET }
41
42#define GEN_CHV_PIPEOFFSETS \
43 .pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
44 CHV_PIPE_C_OFFSET }, \
45 .trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
46 CHV_TRANSCODER_C_OFFSET, }, \
47 .palette_offsets = { PALETTE_A_OFFSET, PALETTE_B_OFFSET, \
48 CHV_PALETTE_C_OFFSET }
49
50#define CURSOR_OFFSETS \
51 .cursor_offsets = { CURSOR_A_OFFSET, CURSOR_B_OFFSET, CHV_CURSOR_C_OFFSET }
52
53#define IVB_CURSOR_OFFSETS \
54 .cursor_offsets = { CURSOR_A_OFFSET, IVB_CURSOR_B_OFFSET, IVB_CURSOR_C_OFFSET }
55
56#define BDW_COLORS \
57 .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
58#define CHV_COLORS \
59 .color = { .degamma_lut_size = 65, .gamma_lut_size = 257 }
Rodrigo Vivi46727702017-10-02 23:36:52 -070060#define GLK_COLORS \
61 .color = { .degamma_lut_size = 0, .gamma_lut_size = 1024 }
Chris Wilson42f55512016-06-24 14:00:26 +010062
Jani Nikulaa5ce9292016-11-30 17:43:02 +020063/* Keep in gen based order, and chronological order within a gen */
Matthew Auld2a9654b2017-10-06 23:18:16 +010064
65#define GEN_DEFAULT_PAGE_SIZES \
66 .page_sizes = I915_GTT_PAGE_SIZE_4K
67
Carlos Santa0eec8dc2016-08-17 12:30:51 -070068#define GEN2_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +000069 GEN(2), \
70 .num_pipes = 1, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070071 .has_overlay = 1, .overlay_needs_physical = 1, \
Carlos Santa804b8712016-08-17 12:30:55 -070072 .has_gmch_display = 1, \
Carlos Santa31776592016-08-17 12:30:56 -070073 .hws_needs_physical = 1, \
Chris Wilsonf4ce7662017-03-25 11:32:43 +000074 .unfenced_needs_alignment = 1, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070075 .ring_mask = RENDER_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +010076 .has_snoop = true, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070077 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +010078 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070079 CURSOR_OFFSETS
80
Lionel Landwerlin5db47e32018-01-29 08:33:46 +000081static const struct intel_device_info intel_i830_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -070082 GEN2_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +000083 PLATFORM(INTEL_I830),
Carlos Santa0eec8dc2016-08-17 12:30:51 -070084 .is_mobile = 1, .cursor_needs_physical = 1,
85 .num_pipes = 2, /* legal, last one wins */
Chris Wilson42f55512016-06-24 14:00:26 +010086};
87
Lionel Landwerlin5db47e32018-01-29 08:33:46 +000088static const struct intel_device_info intel_i845g_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -070089 GEN2_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +000090 PLATFORM(INTEL_I845G),
Chris Wilson42f55512016-06-24 14:00:26 +010091};
92
Lionel Landwerlin5db47e32018-01-29 08:33:46 +000093static const struct intel_device_info intel_i85x_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -070094 GEN2_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +000095 PLATFORM(INTEL_I85X),
96 .is_mobile = 1,
Carlos Santa0eec8dc2016-08-17 12:30:51 -070097 .num_pipes = 2, /* legal, last one wins */
Chris Wilson42f55512016-06-24 14:00:26 +010098 .cursor_needs_physical = 1,
Chris Wilson42f55512016-06-24 14:00:26 +010099 .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100100};
101
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000102static const struct intel_device_info intel_i865g_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -0700103 GEN2_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000104 PLATFORM(INTEL_I865G),
Chris Wilson42f55512016-06-24 14:00:26 +0100105};
106
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700107#define GEN3_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000108 GEN(3), \
109 .num_pipes = 2, \
Carlos Santa804b8712016-08-17 12:30:55 -0700110 .has_gmch_display = 1, \
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700111 .ring_mask = RENDER_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100112 .has_snoop = true, \
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700113 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100114 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700115 CURSOR_OFFSETS
116
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000117static const struct intel_device_info intel_i915g_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700118 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000119 PLATFORM(INTEL_I915G),
120 .cursor_needs_physical = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100121 .has_overlay = 1, .overlay_needs_physical = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700122 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000123 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100124};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200125
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000126static const struct intel_device_info intel_i915gm_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700127 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000128 PLATFORM(INTEL_I915GM),
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700129 .is_mobile = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100130 .cursor_needs_physical = 1,
131 .has_overlay = 1, .overlay_needs_physical = 1,
132 .supports_tv = 1,
133 .has_fbc = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700134 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000135 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100136};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200137
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000138static const struct intel_device_info intel_i945g_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700139 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000140 PLATFORM(INTEL_I945G),
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700141 .has_hotplug = 1, .cursor_needs_physical = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100142 .has_overlay = 1, .overlay_needs_physical = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700143 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000144 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100145};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200146
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000147static const struct intel_device_info intel_i945gm_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700148 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000149 PLATFORM(INTEL_I945GM),
150 .is_mobile = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100151 .has_hotplug = 1, .cursor_needs_physical = 1,
152 .has_overlay = 1, .overlay_needs_physical = 1,
153 .supports_tv = 1,
154 .has_fbc = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700155 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000156 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100157};
158
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000159static const struct intel_device_info intel_g33_info = {
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200160 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000161 PLATFORM(INTEL_G33),
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200162 .has_hotplug = 1,
163 .has_overlay = 1,
164};
165
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000166static const struct intel_device_info intel_pineview_info = {
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200167 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000168 PLATFORM(INTEL_PINEVIEW),
169 .is_mobile = 1,
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200170 .has_hotplug = 1,
171 .has_overlay = 1,
172};
173
Carlos Santa4d495be2016-08-17 12:30:49 -0700174#define GEN4_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000175 GEN(4), \
176 .num_pipes = 2, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700177 .has_hotplug = 1, \
Carlos Santa804b8712016-08-17 12:30:55 -0700178 .has_gmch_display = 1, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700179 .ring_mask = RENDER_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100180 .has_snoop = true, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700181 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100182 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700183 CURSOR_OFFSETS
184
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000185static const struct intel_device_info intel_i965g_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700186 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000187 PLATFORM(INTEL_I965G),
Chris Wilson42f55512016-06-24 14:00:26 +0100188 .has_overlay = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700189 .hws_needs_physical = 1,
Chris Wilsondf0700e2017-09-06 20:24:24 +0100190 .has_snoop = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100191};
192
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000193static const struct intel_device_info intel_i965gm_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700194 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000195 PLATFORM(INTEL_I965GM),
Carlos Santa4d495be2016-08-17 12:30:49 -0700196 .is_mobile = 1, .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100197 .has_overlay = 1,
198 .supports_tv = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700199 .hws_needs_physical = 1,
Chris Wilsondf0700e2017-09-06 20:24:24 +0100200 .has_snoop = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100201};
202
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000203static const struct intel_device_info intel_g45_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700204 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000205 PLATFORM(INTEL_G45),
Chris Wilson42f55512016-06-24 14:00:26 +0100206 .ring_mask = RENDER_RING | BSD_RING,
Chris Wilson42f55512016-06-24 14:00:26 +0100207};
208
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000209static const struct intel_device_info intel_gm45_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700210 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000211 PLATFORM(INTEL_GM45),
Carlos Santa31776592016-08-17 12:30:56 -0700212 .is_mobile = 1, .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100213 .supports_tv = 1,
214 .ring_mask = RENDER_RING | BSD_RING,
Chris Wilson42f55512016-06-24 14:00:26 +0100215};
216
Carlos Santaa1323382016-08-17 12:30:47 -0700217#define GEN5_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000218 GEN(5), \
219 .num_pipes = 2, \
Carlos Santa31776592016-08-17 12:30:56 -0700220 .has_hotplug = 1, \
Carlos Santaa1323382016-08-17 12:30:47 -0700221 .ring_mask = RENDER_RING | BSD_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100222 .has_snoop = true, \
Chris Wilsonfb6db0f2017-12-01 11:30:30 +0000223 /* ilk does support rc6, but we do not implement [power] contexts */ \
224 .has_rc6 = 0, \
Carlos Santaa1323382016-08-17 12:30:47 -0700225 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100226 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santaa1323382016-08-17 12:30:47 -0700227 CURSOR_OFFSETS
228
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000229static const struct intel_device_info intel_ironlake_d_info = {
Carlos Santaa1323382016-08-17 12:30:47 -0700230 GEN5_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000231 PLATFORM(INTEL_IRONLAKE),
Chris Wilson42f55512016-06-24 14:00:26 +0100232};
233
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000234static const struct intel_device_info intel_ironlake_m_info = {
Carlos Santaa1323382016-08-17 12:30:47 -0700235 GEN5_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000236 PLATFORM(INTEL_IRONLAKE),
Ville Syrjäläc2d1a0c2017-06-06 16:32:29 +0300237 .is_mobile = 1, .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100238};
239
Carlos Santa07db6be2016-08-17 12:30:38 -0700240#define GEN6_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000241 GEN(6), \
242 .num_pipes = 2, \
Carlos Santa31776592016-08-17 12:30:56 -0700243 .has_hotplug = 1, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700244 .has_fbc = 1, \
245 .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
246 .has_llc = 1, \
Carlos Santa86f36242016-08-17 12:30:44 -0700247 .has_rc6 = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700248 .has_rc6p = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800249 .has_aliasing_ppgtt = 1, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700250 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100251 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700252 CURSOR_OFFSETS
253
Lionel Landwerlin08905402017-08-30 17:12:05 +0100254#define SNB_D_PLATFORM \
255 GEN6_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000256 PLATFORM(INTEL_SANDYBRIDGE)
Lionel Landwerlin08905402017-08-30 17:12:05 +0100257
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000258static const struct intel_device_info intel_sandybridge_d_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100259 SNB_D_PLATFORM,
260 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100261};
262
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000263static const struct intel_device_info intel_sandybridge_d_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100264 SNB_D_PLATFORM,
265 .gt = 2,
266};
267
268#define SNB_M_PLATFORM \
269 GEN6_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000270 PLATFORM(INTEL_SANDYBRIDGE), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100271 .is_mobile = 1
272
273
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000274static const struct intel_device_info intel_sandybridge_m_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100275 SNB_M_PLATFORM,
276 .gt = 1,
277};
278
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000279static const struct intel_device_info intel_sandybridge_m_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100280 SNB_M_PLATFORM,
281 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100282};
283
284#define GEN7_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000285 GEN(7), \
286 .num_pipes = 3, \
Carlos Santa31776592016-08-17 12:30:56 -0700287 .has_hotplug = 1, \
Chris Wilson42f55512016-06-24 14:00:26 +0100288 .has_fbc = 1, \
289 .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
290 .has_llc = 1, \
Carlos Santa86f36242016-08-17 12:30:44 -0700291 .has_rc6 = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700292 .has_rc6p = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800293 .has_aliasing_ppgtt = 1, \
294 .has_full_ppgtt = 1, \
Chris Wilson42f55512016-06-24 14:00:26 +0100295 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100296 GEN_DEFAULT_PAGE_SIZES, \
Chris Wilson42f55512016-06-24 14:00:26 +0100297 IVB_CURSOR_OFFSETS
298
Lionel Landwerlin08905402017-08-30 17:12:05 +0100299#define IVB_D_PLATFORM \
300 GEN7_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000301 PLATFORM(INTEL_IVYBRIDGE), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100302 .has_l3_dpf = 1
303
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000304static const struct intel_device_info intel_ivybridge_d_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100305 IVB_D_PLATFORM,
306 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100307};
308
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000309static const struct intel_device_info intel_ivybridge_d_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100310 IVB_D_PLATFORM,
311 .gt = 2,
312};
313
314#define IVB_M_PLATFORM \
315 GEN7_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000316 PLATFORM(INTEL_IVYBRIDGE), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100317 .is_mobile = 1, \
318 .has_l3_dpf = 1
319
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000320static const struct intel_device_info intel_ivybridge_m_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100321 IVB_M_PLATFORM,
322 .gt = 1,
323};
324
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000325static const struct intel_device_info intel_ivybridge_m_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100326 IVB_M_PLATFORM,
327 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100328};
329
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000330static const struct intel_device_info intel_ivybridge_q_info = {
Chris Wilson42f55512016-06-24 14:00:26 +0100331 GEN7_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000332 PLATFORM(INTEL_IVYBRIDGE),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100333 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100334 .num_pipes = 0, /* legal, last one wins */
Carlos Santaca9c4522016-08-17 12:30:54 -0700335 .has_l3_dpf = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100336};
337
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000338static const struct intel_device_info intel_valleyview_info = {
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000339 PLATFORM(INTEL_VALLEYVIEW),
Chris Wilsonbc762982018-02-15 08:19:28 +0000340 GEN(7),
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800341 .is_lp = 1,
342 .num_pipes = 2,
343 .has_psr = 1,
344 .has_runtime_pm = 1,
345 .has_rc6 = 1,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800346 .has_gmch_display = 1,
347 .has_hotplug = 1,
348 .has_aliasing_ppgtt = 1,
349 .has_full_ppgtt = 1,
Chris Wilson5d95c242017-09-06 11:56:53 +0100350 .has_snoop = true,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800351 .ring_mask = RENDER_RING | BSD_RING | BLT_RING,
352 .display_mmio_offset = VLV_DISPLAY_BASE,
Matthew Auld2a9654b2017-10-06 23:18:16 +0100353 GEN_DEFAULT_PAGE_SIZES,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800354 GEN_DEFAULT_PIPEOFFSETS,
355 CURSOR_OFFSETS
Chris Wilson42f55512016-06-24 14:00:26 +0100356};
357
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700358#define G75_FEATURES \
Chris Wilson42f55512016-06-24 14:00:26 +0100359 GEN7_FEATURES, \
360 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
361 .has_ddi = 1, \
Carlos Santa6e3b84d2016-08-17 12:30:36 -0700362 .has_fpga_dbg = 1, \
Carlos Santa4aa4c232016-08-17 12:30:39 -0700363 .has_psr = 1, \
Carlos Santa53233f02016-08-17 12:30:43 -0700364 .has_resource_streamer = 1, \
Carlos Santa1d3fe532016-08-17 12:30:46 -0700365 .has_dp_mst = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700366 .has_rc6p = 0 /* RC6p removed-by HSW */, \
Carlos Santa4aa4c232016-08-17 12:30:39 -0700367 .has_runtime_pm = 1
Chris Wilson42f55512016-06-24 14:00:26 +0100368
Lionel Landwerlin08905402017-08-30 17:12:05 +0100369#define HSW_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700370 G75_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000371 PLATFORM(INTEL_HASWELL), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100372 .has_l3_dpf = 1
373
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000374static const struct intel_device_info intel_haswell_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100375 HSW_PLATFORM,
376 .gt = 1,
377};
378
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000379static const struct intel_device_info intel_haswell_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100380 HSW_PLATFORM,
381 .gt = 2,
382};
383
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000384static const struct intel_device_info intel_haswell_gt3_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100385 HSW_PLATFORM,
386 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100387};
388
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700389#define GEN8_FEATURES \
390 G75_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000391 GEN(8), \
Carlos Santa4586f1d2016-08-17 12:30:53 -0700392 BDW_COLORS, \
Matthew Aulda8832412017-10-06 23:18:33 +0100393 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
394 I915_GTT_PAGE_SIZE_2M, \
Joonas Lahtinendfc51482016-11-03 10:39:46 +0200395 .has_logical_ring_contexts = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800396 .has_full_48bit_ppgtt = 1, \
Michel Thierry142bc7d2017-06-20 10:57:46 +0100397 .has_64bit_reloc = 1, \
398 .has_reset_engine = 1
Chris Wilson42f55512016-06-24 14:00:26 +0100399
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700400#define BDW_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700401 GEN8_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000402 PLATFORM(INTEL_BROADWELL)
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700403
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000404static const struct intel_device_info intel_broadwell_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700405 BDW_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100406 .gt = 1,
407};
408
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000409static const struct intel_device_info intel_broadwell_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100410 BDW_PLATFORM,
411 .gt = 2,
412};
413
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000414static const struct intel_device_info intel_broadwell_rsvd_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100415 BDW_PLATFORM,
416 .gt = 3,
417 /* According to the device ID those devices are GT3, they were
418 * previously treated as not GT3, keep it like that.
419 */
Chris Wilson42f55512016-06-24 14:00:26 +0100420};
421
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000422static const struct intel_device_info intel_broadwell_gt3_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700423 BDW_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100424 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100425 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
426};
427
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000428static const struct intel_device_info intel_cherryview_info = {
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000429 PLATFORM(INTEL_CHERRYVIEW),
Chris Wilsonbc762982018-02-15 08:19:28 +0000430 GEN(8),
431 .num_pipes = 3,
Carlos Santa31776592016-08-17 12:30:56 -0700432 .has_hotplug = 1,
Rodrigo Vivi8727dc02016-12-18 13:36:26 -0800433 .is_lp = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100434 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING,
Joonas Lahtinendfc51482016-11-03 10:39:46 +0200435 .has_64bit_reloc = 1,
Carlos Santa6e3b84d2016-08-17 12:30:36 -0700436 .has_psr = 1,
Carlos Santa4aa4c232016-08-17 12:30:39 -0700437 .has_runtime_pm = 1,
Carlos Santa53233f02016-08-17 12:30:43 -0700438 .has_resource_streamer = 1,
Carlos Santa86f36242016-08-17 12:30:44 -0700439 .has_rc6 = 1,
Carlos Santa4586f1d2016-08-17 12:30:53 -0700440 .has_logical_ring_contexts = 1,
Carlos Santa804b8712016-08-17 12:30:55 -0700441 .has_gmch_display = 1,
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800442 .has_aliasing_ppgtt = 1,
443 .has_full_ppgtt = 1,
Michel Thierry142bc7d2017-06-20 10:57:46 +0100444 .has_reset_engine = 1,
Chris Wilson5d95c242017-09-06 11:56:53 +0100445 .has_snoop = true,
Chris Wilson42f55512016-06-24 14:00:26 +0100446 .display_mmio_offset = VLV_DISPLAY_BASE,
Matthew Auld2a9654b2017-10-06 23:18:16 +0100447 GEN_DEFAULT_PAGE_SIZES,
Chris Wilson42f55512016-06-24 14:00:26 +0100448 GEN_CHV_PIPEOFFSETS,
449 CURSOR_OFFSETS,
450 CHV_COLORS,
451};
452
Matthew Auld2a9654b2017-10-06 23:18:16 +0100453#define GEN9_DEFAULT_PAGE_SIZES \
Matthew Auldf1f3f982017-10-06 23:18:32 +0100454 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
Matthew Aulda8832412017-10-06 23:18:33 +0100455 I915_GTT_PAGE_SIZE_64K | \
456 I915_GTT_PAGE_SIZE_2M
Matthew Auld2a9654b2017-10-06 23:18:16 +0100457
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700458#define GEN9_FEATURES \
459 GEN8_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000460 GEN(9), \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100461 GEN9_DEFAULT_PAGE_SIZES, \
Chris Wilsonbeecec92017-10-03 21:34:52 +0100462 .has_logical_ring_preemption = 1, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700463 .has_csr = 1, \
464 .has_guc = 1, \
Rodrigo Vivi4d6ef0d2017-10-02 23:36:50 -0700465 .has_ipc = 1, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700466 .ddb_size = 896
467
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700468#define SKL_PLATFORM \
469 GEN9_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000470 PLATFORM(INTEL_SKYLAKE)
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700471
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000472static const struct intel_device_info intel_skylake_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700473 SKL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100474 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100475};
476
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000477static const struct intel_device_info intel_skylake_gt2_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700478 SKL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100479 .gt = 2,
480};
481
482#define SKL_GT3_PLUS_PLATFORM \
483 SKL_PLATFORM, \
484 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING
485
486
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000487static const struct intel_device_info intel_skylake_gt3_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100488 SKL_GT3_PLUS_PLATFORM,
489 .gt = 3,
490};
491
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000492static const struct intel_device_info intel_skylake_gt4_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100493 SKL_GT3_PLUS_PLATFORM,
494 .gt = 4,
Chris Wilson42f55512016-06-24 14:00:26 +0100495};
496
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200497#define GEN9_LP_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000498 GEN(9), \
Ander Conselvan de Oliveira3e4274f2016-11-10 17:23:09 +0200499 .is_lp = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200500 .has_hotplug = 1, \
501 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
502 .num_pipes = 3, \
503 .has_64bit_reloc = 1, \
504 .has_ddi = 1, \
505 .has_fpga_dbg = 1, \
506 .has_fbc = 1, \
David Weinehall495001c2017-08-08 13:09:52 +0300507 .has_psr = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200508 .has_runtime_pm = 1, \
509 .has_pooled_eu = 0, \
510 .has_csr = 1, \
511 .has_resource_streamer = 1, \
512 .has_rc6 = 1, \
513 .has_dp_mst = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200514 .has_logical_ring_contexts = 1, \
Chris Wilsonbeecec92017-10-03 21:34:52 +0100515 .has_logical_ring_preemption = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200516 .has_guc = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800517 .has_aliasing_ppgtt = 1, \
518 .has_full_ppgtt = 1, \
519 .has_full_48bit_ppgtt = 1, \
Michel Thierry142bc7d2017-06-20 10:57:46 +0100520 .has_reset_engine = 1, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100521 .has_snoop = true, \
Mahesh Kumare57f1c022017-08-17 19:15:27 +0530522 .has_ipc = 1, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100523 GEN9_DEFAULT_PAGE_SIZES, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200524 GEN_DEFAULT_PIPEOFFSETS, \
525 IVB_CURSOR_OFFSETS, \
526 BDW_COLORS
527
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000528static const struct intel_device_info intel_broxton_info = {
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200529 GEN9_LP_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000530 PLATFORM(INTEL_BROXTON),
Deepak M6f3fff62016-09-15 15:01:10 +0530531 .ddb_size = 512,
Chris Wilson42f55512016-06-24 14:00:26 +0100532};
533
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000534static const struct intel_device_info intel_geminilake_info = {
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200535 GEN9_LP_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000536 PLATFORM(INTEL_GEMINILAKE),
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200537 .ddb_size = 1024,
Rodrigo Vivi46727702017-10-02 23:36:52 -0700538 GLK_COLORS,
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200539};
540
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700541#define KBL_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700542 GEN9_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000543 PLATFORM(INTEL_KABYLAKE)
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700544
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000545static const struct intel_device_info intel_kabylake_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700546 KBL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100547 .gt = 1,
548};
549
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000550static const struct intel_device_info intel_kabylake_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100551 KBL_PLATFORM,
552 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100553};
554
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000555static const struct intel_device_info intel_kabylake_gt3_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700556 KBL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100557 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100558 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
559};
560
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700561#define CFL_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700562 GEN9_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000563 PLATFORM(INTEL_COFFEELAKE)
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700564
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000565static const struct intel_device_info intel_coffeelake_gt1_info = {
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700566 CFL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100567 .gt = 1,
568};
569
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000570static const struct intel_device_info intel_coffeelake_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100571 CFL_PLATFORM,
572 .gt = 2,
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700573};
574
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000575static const struct intel_device_info intel_coffeelake_gt3_info = {
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700576 CFL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100577 .gt = 3,
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700578 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
579};
580
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700581#define GEN10_FEATURES \
582 GEN9_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000583 GEN(10), \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700584 .ddb_size = 1024, \
Rodrigo Vivi46727702017-10-02 23:36:52 -0700585 GLK_COLORS
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700586
Rodrigo Vivi3f430312018-01-29 15:22:14 -0800587static const struct intel_device_info intel_cannonlake_info = {
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700588 GEN10_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000589 PLATFORM(INTEL_CANNONLAKE),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100590 .gt = 2,
Rodrigo Vivi413f3c12017-06-06 13:30:30 -0700591};
592
Rodrigo Vivi412310012018-01-11 16:00:04 -0200593#define GEN11_FEATURES \
594 GEN10_FEATURES, \
Chris Wilsonbc762982018-02-15 08:19:28 +0000595 GEN(11), \
Rodrigo Vivi412310012018-01-11 16:00:04 -0200596 .ddb_size = 2048, \
Thomas Daniel05f0add2018-03-02 18:14:59 +0200597 .has_csr = 0, \
598 .has_logical_ring_elsq = 1
Rodrigo Vivi412310012018-01-11 16:00:04 -0200599
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000600static const struct intel_device_info intel_icelake_11_info = {
Rodrigo Vivi412310012018-01-11 16:00:04 -0200601 GEN11_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000602 PLATFORM(INTEL_ICELAKE),
Rodrigo Vivi412310012018-01-11 16:00:04 -0200603 .is_alpha_support = 1,
604 .has_resource_streamer = 0,
605};
606
Chris Wilsonbc762982018-02-15 08:19:28 +0000607#undef GEN
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000608#undef PLATFORM
Chris Wilsonbc762982018-02-15 08:19:28 +0000609
Chris Wilson42f55512016-06-24 14:00:26 +0100610/*
611 * Make sure any device matches here are from most specific to most
612 * general. For example, since the Quanta match is based on the subsystem
613 * and subvendor IDs, we need it to come before the more general IVB
614 * PCI ID matches, otherwise we'll use the wrong info struct above.
615 */
616static const struct pci_device_id pciidlist[] = {
617 INTEL_I830_IDS(&intel_i830_info),
Jani Nikula2a307c22016-11-30 17:43:04 +0200618 INTEL_I845G_IDS(&intel_i845g_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100619 INTEL_I85X_IDS(&intel_i85x_info),
620 INTEL_I865G_IDS(&intel_i865g_info),
621 INTEL_I915G_IDS(&intel_i915g_info),
622 INTEL_I915GM_IDS(&intel_i915gm_info),
623 INTEL_I945G_IDS(&intel_i945g_info),
624 INTEL_I945GM_IDS(&intel_i945gm_info),
625 INTEL_I965G_IDS(&intel_i965g_info),
626 INTEL_G33_IDS(&intel_g33_info),
627 INTEL_I965GM_IDS(&intel_i965gm_info),
628 INTEL_GM45_IDS(&intel_gm45_info),
629 INTEL_G45_IDS(&intel_g45_info),
630 INTEL_PINEVIEW_IDS(&intel_pineview_info),
631 INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
632 INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100633 INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info),
634 INTEL_SNB_D_GT2_IDS(&intel_sandybridge_d_gt2_info),
635 INTEL_SNB_M_GT1_IDS(&intel_sandybridge_m_gt1_info),
636 INTEL_SNB_M_GT2_IDS(&intel_sandybridge_m_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100637 INTEL_IVB_Q_IDS(&intel_ivybridge_q_info), /* must be first IVB */
Lionel Landwerlin08905402017-08-30 17:12:05 +0100638 INTEL_IVB_M_GT1_IDS(&intel_ivybridge_m_gt1_info),
639 INTEL_IVB_M_GT2_IDS(&intel_ivybridge_m_gt2_info),
640 INTEL_IVB_D_GT1_IDS(&intel_ivybridge_d_gt1_info),
641 INTEL_IVB_D_GT2_IDS(&intel_ivybridge_d_gt2_info),
642 INTEL_HSW_GT1_IDS(&intel_haswell_gt1_info),
643 INTEL_HSW_GT2_IDS(&intel_haswell_gt2_info),
644 INTEL_HSW_GT3_IDS(&intel_haswell_gt3_info),
Carlos Santa8d9c20e2016-08-17 12:30:37 -0700645 INTEL_VLV_IDS(&intel_valleyview_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100646 INTEL_BDW_GT1_IDS(&intel_broadwell_gt1_info),
647 INTEL_BDW_GT2_IDS(&intel_broadwell_gt2_info),
Carlos Santa8d9c20e2016-08-17 12:30:37 -0700648 INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100649 INTEL_BDW_RSVD_IDS(&intel_broadwell_rsvd_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100650 INTEL_CHV_IDS(&intel_cherryview_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100651 INTEL_SKL_GT1_IDS(&intel_skylake_gt1_info),
652 INTEL_SKL_GT2_IDS(&intel_skylake_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100653 INTEL_SKL_GT3_IDS(&intel_skylake_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100654 INTEL_SKL_GT4_IDS(&intel_skylake_gt4_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100655 INTEL_BXT_IDS(&intel_broxton_info),
Ander Conselvan de Oliveira8363e3c2016-11-10 17:23:08 +0200656 INTEL_GLK_IDS(&intel_geminilake_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100657 INTEL_KBL_GT1_IDS(&intel_kabylake_gt1_info),
658 INTEL_KBL_GT2_IDS(&intel_kabylake_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100659 INTEL_KBL_GT3_IDS(&intel_kabylake_gt3_info),
660 INTEL_KBL_GT4_IDS(&intel_kabylake_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100661 INTEL_CFL_S_GT1_IDS(&intel_coffeelake_gt1_info),
662 INTEL_CFL_S_GT2_IDS(&intel_coffeelake_gt2_info),
663 INTEL_CFL_H_GT2_IDS(&intel_coffeelake_gt2_info),
Rodrigo Vivic99d7832017-12-20 10:29:19 -0800664 INTEL_CFL_U_GT1_IDS(&intel_coffeelake_gt1_info),
665 INTEL_CFL_U_GT2_IDS(&intel_coffeelake_gt2_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100666 INTEL_CFL_U_GT3_IDS(&intel_coffeelake_gt3_info),
Rodrigo Vivi3f430312018-01-29 15:22:14 -0800667 INTEL_CNL_IDS(&intel_cannonlake_info),
Paulo Zanonid55cb4f2018-02-20 17:37:52 +0200668 INTEL_ICL_11_IDS(&intel_icelake_11_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100669 {0, 0, 0}
670};
671MODULE_DEVICE_TABLE(pci, pciidlist);
672
Chris Wilson953c7f82017-02-13 17:15:12 +0000673static void i915_pci_remove(struct pci_dev *pdev)
674{
675 struct drm_device *dev = pci_get_drvdata(pdev);
676
677 i915_driver_unload(dev);
Harsha Sharma8e9f8ab2017-10-15 00:06:44 +0530678 drm_dev_put(dev);
Chris Wilson953c7f82017-02-13 17:15:12 +0000679}
680
Chris Wilson42f55512016-06-24 14:00:26 +0100681static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
682{
683 struct intel_device_info *intel_info =
684 (struct intel_device_info *) ent->driver_data;
Chris Wilson953c7f82017-02-13 17:15:12 +0000685 int err;
Chris Wilson42f55512016-06-24 14:00:26 +0100686
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000687 if (IS_ALPHA_SUPPORT(intel_info) && !i915_modparams.alpha_support) {
Jani Nikulac007fb42016-10-31 12:18:28 +0200688 DRM_INFO("The driver support for your hardware in this kernel version is alpha quality\n"
689 "See CONFIG_DRM_I915_ALPHA_SUPPORT or i915.alpha_support module parameter\n"
690 "to enable support in this kernel version, or check for kernel updates.\n");
Chris Wilson42f55512016-06-24 14:00:26 +0100691 return -ENODEV;
692 }
693
694 /* Only bind to function 0 of the device. Early generations
695 * used function 1 as a placeholder for multi-head. This causes
696 * us confusion instead, especially on the systems where both
697 * functions have the same PCI-ID!
698 */
699 if (PCI_FUNC(pdev->devfn))
700 return -ENODEV;
701
702 /*
703 * apple-gmux is needed on dual GPU MacBook Pro
704 * to probe the panel if we're the inactive GPU.
705 */
706 if (vga_switcheroo_client_probe_defer(pdev))
707 return -EPROBE_DEFER;
708
Chris Wilson953c7f82017-02-13 17:15:12 +0000709 err = i915_driver_load(pdev, ent);
710 if (err)
711 return err;
Chris Wilson42f55512016-06-24 14:00:26 +0100712
Chris Wilson953c7f82017-02-13 17:15:12 +0000713 err = i915_live_selftests(pdev);
714 if (err) {
715 i915_pci_remove(pdev);
716 return err > 0 ? -ENOTTY : err;
717 }
Chris Wilson42f55512016-06-24 14:00:26 +0100718
Chris Wilson953c7f82017-02-13 17:15:12 +0000719 return 0;
Chris Wilson42f55512016-06-24 14:00:26 +0100720}
721
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100722static struct pci_driver i915_pci_driver = {
Chris Wilson42f55512016-06-24 14:00:26 +0100723 .name = DRIVER_NAME,
724 .id_table = pciidlist,
725 .probe = i915_pci_probe,
726 .remove = i915_pci_remove,
727 .driver.pm = &i915_pm_ops,
728};
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100729
730static int __init i915_init(void)
731{
732 bool use_kms = true;
Chris Wilson953c7f82017-02-13 17:15:12 +0000733 int err;
734
735 err = i915_mock_selftests();
736 if (err)
737 return err > 0 ? 0 : err;
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100738
739 /*
740 * Enable KMS by default, unless explicitly overriden by
741 * either the i915.modeset prarameter or by the
742 * vga_text_mode_force boot option.
743 */
744
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000745 if (i915_modparams.modeset == 0)
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100746 use_kms = false;
747
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000748 if (vgacon_text_force() && i915_modparams.modeset == -1)
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100749 use_kms = false;
750
751 if (!use_kms) {
752 /* Silently fail loading to not upset userspace. */
753 DRM_DEBUG_DRIVER("KMS disabled.\n");
754 return 0;
755 }
756
757 return pci_register_driver(&i915_pci_driver);
758}
759
760static void __exit i915_exit(void)
761{
762 if (!i915_pci_driver.driver.owner)
763 return;
764
765 pci_unregister_driver(&i915_pci_driver);
766}
767
768module_init(i915_init);
769module_exit(i915_exit);
770
771MODULE_AUTHOR("Tungsten Graphics, Inc.");
772MODULE_AUTHOR("Intel Corporation");
773
774MODULE_DESCRIPTION(DRIVER_DESC);
775MODULE_LICENSE("GPL and additional rights");