blob: 0ed99966c7a744af81c09a9f52057134b2f10db1 [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 Wilsonbc762982018-02-15 08:19:28 +000032#define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
33
Chris Wilson42f55512016-06-24 14:00:26 +010034#define GEN_DEFAULT_PIPEOFFSETS \
35 .pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
36 PIPE_C_OFFSET, PIPE_EDP_OFFSET }, \
37 .trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
38 TRANSCODER_C_OFFSET, TRANSCODER_EDP_OFFSET }, \
39 .palette_offsets = { PALETTE_A_OFFSET, PALETTE_B_OFFSET }
40
41#define GEN_CHV_PIPEOFFSETS \
42 .pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
43 CHV_PIPE_C_OFFSET }, \
44 .trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
45 CHV_TRANSCODER_C_OFFSET, }, \
46 .palette_offsets = { PALETTE_A_OFFSET, PALETTE_B_OFFSET, \
47 CHV_PALETTE_C_OFFSET }
48
49#define CURSOR_OFFSETS \
50 .cursor_offsets = { CURSOR_A_OFFSET, CURSOR_B_OFFSET, CHV_CURSOR_C_OFFSET }
51
52#define IVB_CURSOR_OFFSETS \
53 .cursor_offsets = { CURSOR_A_OFFSET, IVB_CURSOR_B_OFFSET, IVB_CURSOR_C_OFFSET }
54
55#define BDW_COLORS \
56 .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
57#define CHV_COLORS \
58 .color = { .degamma_lut_size = 65, .gamma_lut_size = 257 }
Rodrigo Vivi46727702017-10-02 23:36:52 -070059#define GLK_COLORS \
60 .color = { .degamma_lut_size = 0, .gamma_lut_size = 1024 }
Chris Wilson42f55512016-06-24 14:00:26 +010061
Jani Nikulaa5ce9292016-11-30 17:43:02 +020062/* Keep in gen based order, and chronological order within a gen */
Matthew Auld2a9654b2017-10-06 23:18:16 +010063
64#define GEN_DEFAULT_PAGE_SIZES \
65 .page_sizes = I915_GTT_PAGE_SIZE_4K
66
Carlos Santa0eec8dc2016-08-17 12:30:51 -070067#define GEN2_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +000068 GEN(2), \
69 .num_pipes = 1, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070070 .has_overlay = 1, .overlay_needs_physical = 1, \
Carlos Santa804b8712016-08-17 12:30:55 -070071 .has_gmch_display = 1, \
Carlos Santa31776592016-08-17 12:30:56 -070072 .hws_needs_physical = 1, \
Chris Wilsonf4ce7662017-03-25 11:32:43 +000073 .unfenced_needs_alignment = 1, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070074 .ring_mask = RENDER_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +010075 .has_snoop = true, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070076 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +010077 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa0eec8dc2016-08-17 12:30:51 -070078 CURSOR_OFFSETS
79
Lionel Landwerlin5db47e32018-01-29 08:33:46 +000080static const struct intel_device_info intel_i830_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -070081 GEN2_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +020082 .platform = INTEL_I830,
Carlos Santa0eec8dc2016-08-17 12:30:51 -070083 .is_mobile = 1, .cursor_needs_physical = 1,
84 .num_pipes = 2, /* legal, last one wins */
Chris Wilson42f55512016-06-24 14:00:26 +010085};
86
Lionel Landwerlin5db47e32018-01-29 08:33:46 +000087static const struct intel_device_info intel_i845g_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -070088 GEN2_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +020089 .platform = INTEL_I845G,
Chris Wilson42f55512016-06-24 14:00:26 +010090};
91
Lionel Landwerlin5db47e32018-01-29 08:33:46 +000092static const struct intel_device_info intel_i85x_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -070093 GEN2_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +020094 .platform = INTEL_I85X, .is_mobile = 1,
Carlos Santa0eec8dc2016-08-17 12:30:51 -070095 .num_pipes = 2, /* legal, last one wins */
Chris Wilson42f55512016-06-24 14:00:26 +010096 .cursor_needs_physical = 1,
Chris Wilson42f55512016-06-24 14:00:26 +010097 .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +010098};
99
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000100static const struct intel_device_info intel_i865g_info = {
Carlos Santa0eec8dc2016-08-17 12:30:51 -0700101 GEN2_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200102 .platform = INTEL_I865G,
Chris Wilson42f55512016-06-24 14:00:26 +0100103};
104
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700105#define GEN3_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000106 GEN(3), \
107 .num_pipes = 2, \
Carlos Santa804b8712016-08-17 12:30:55 -0700108 .has_gmch_display = 1, \
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700109 .ring_mask = RENDER_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100110 .has_snoop = true, \
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700111 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100112 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700113 CURSOR_OFFSETS
114
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000115static const struct intel_device_info intel_i915g_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700116 GEN3_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200117 .platform = INTEL_I915G, .cursor_needs_physical = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100118 .has_overlay = 1, .overlay_needs_physical = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700119 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000120 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100121};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200122
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000123static const struct intel_device_info intel_i915gm_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700124 GEN3_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200125 .platform = INTEL_I915GM,
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700126 .is_mobile = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100127 .cursor_needs_physical = 1,
128 .has_overlay = 1, .overlay_needs_physical = 1,
129 .supports_tv = 1,
130 .has_fbc = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700131 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000132 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100133};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200134
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000135static const struct intel_device_info intel_i945g_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700136 GEN3_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200137 .platform = INTEL_I945G,
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700138 .has_hotplug = 1, .cursor_needs_physical = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100139 .has_overlay = 1, .overlay_needs_physical = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700140 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000141 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100142};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200143
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000144static const struct intel_device_info intel_i945gm_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700145 GEN3_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200146 .platform = INTEL_I945GM, .is_mobile = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100147 .has_hotplug = 1, .cursor_needs_physical = 1,
148 .has_overlay = 1, .overlay_needs_physical = 1,
149 .supports_tv = 1,
150 .has_fbc = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700151 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000152 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100153};
154
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000155static const struct intel_device_info intel_g33_info = {
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200156 GEN3_FEATURES,
157 .platform = INTEL_G33,
158 .has_hotplug = 1,
159 .has_overlay = 1,
160};
161
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000162static const struct intel_device_info intel_pineview_info = {
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200163 GEN3_FEATURES,
Jani Nikula73f67aa2016-12-07 22:48:09 +0200164 .platform = INTEL_PINEVIEW, .is_mobile = 1,
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200165 .has_hotplug = 1,
166 .has_overlay = 1,
167};
168
Carlos Santa4d495be2016-08-17 12:30:49 -0700169#define GEN4_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000170 GEN(4), \
171 .num_pipes = 2, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700172 .has_hotplug = 1, \
Carlos Santa804b8712016-08-17 12:30:55 -0700173 .has_gmch_display = 1, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700174 .ring_mask = RENDER_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100175 .has_snoop = true, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700176 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100177 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa4d495be2016-08-17 12:30:49 -0700178 CURSOR_OFFSETS
179
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000180static const struct intel_device_info intel_i965g_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700181 GEN4_FEATURES,
Jani Nikulac0f86832016-12-07 12:13:04 +0200182 .platform = INTEL_I965G,
Chris Wilson42f55512016-06-24 14:00:26 +0100183 .has_overlay = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700184 .hws_needs_physical = 1,
Chris Wilsondf0700e2017-09-06 20:24:24 +0100185 .has_snoop = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100186};
187
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000188static const struct intel_device_info intel_i965gm_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700189 GEN4_FEATURES,
Jani Nikulac0f86832016-12-07 12:13:04 +0200190 .platform = INTEL_I965GM,
Carlos Santa4d495be2016-08-17 12:30:49 -0700191 .is_mobile = 1, .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100192 .has_overlay = 1,
193 .supports_tv = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700194 .hws_needs_physical = 1,
Chris Wilsondf0700e2017-09-06 20:24:24 +0100195 .has_snoop = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100196};
197
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000198static const struct intel_device_info intel_g45_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700199 GEN4_FEATURES,
Jani Nikulaf69c11a2016-11-30 17:43:05 +0200200 .platform = INTEL_G45,
Chris Wilson42f55512016-06-24 14:00:26 +0100201 .ring_mask = RENDER_RING | BSD_RING,
Chris Wilson42f55512016-06-24 14:00:26 +0100202};
203
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000204static const struct intel_device_info intel_gm45_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700205 GEN4_FEATURES,
Jani Nikulaf69c11a2016-11-30 17:43:05 +0200206 .platform = INTEL_GM45,
Carlos Santa31776592016-08-17 12:30:56 -0700207 .is_mobile = 1, .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100208 .supports_tv = 1,
209 .ring_mask = RENDER_RING | BSD_RING,
Chris Wilson42f55512016-06-24 14:00:26 +0100210};
211
Carlos Santaa1323382016-08-17 12:30:47 -0700212#define GEN5_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000213 GEN(5), \
214 .num_pipes = 2, \
Carlos Santa31776592016-08-17 12:30:56 -0700215 .has_hotplug = 1, \
Carlos Santaa1323382016-08-17 12:30:47 -0700216 .ring_mask = RENDER_RING | BSD_RING, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100217 .has_snoop = true, \
Chris Wilsonfb6db0f2017-12-01 11:30:30 +0000218 /* ilk does support rc6, but we do not implement [power] contexts */ \
219 .has_rc6 = 0, \
Carlos Santaa1323382016-08-17 12:30:47 -0700220 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100221 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santaa1323382016-08-17 12:30:47 -0700222 CURSOR_OFFSETS
223
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000224static const struct intel_device_info intel_ironlake_d_info = {
Carlos Santaa1323382016-08-17 12:30:47 -0700225 GEN5_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200226 .platform = INTEL_IRONLAKE,
Chris Wilson42f55512016-06-24 14:00:26 +0100227};
228
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000229static const struct intel_device_info intel_ironlake_m_info = {
Carlos Santaa1323382016-08-17 12:30:47 -0700230 GEN5_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200231 .platform = INTEL_IRONLAKE,
Ville Syrjäläc2d1a0c2017-06-06 16:32:29 +0300232 .is_mobile = 1, .has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100233};
234
Carlos Santa07db6be2016-08-17 12:30:38 -0700235#define GEN6_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000236 GEN(6), \
237 .num_pipes = 2, \
Carlos Santa31776592016-08-17 12:30:56 -0700238 .has_hotplug = 1, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700239 .has_fbc = 1, \
240 .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
241 .has_llc = 1, \
Carlos Santa86f36242016-08-17 12:30:44 -0700242 .has_rc6 = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700243 .has_rc6p = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800244 .has_aliasing_ppgtt = 1, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700245 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100246 GEN_DEFAULT_PAGE_SIZES, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700247 CURSOR_OFFSETS
248
Lionel Landwerlin08905402017-08-30 17:12:05 +0100249#define SNB_D_PLATFORM \
250 GEN6_FEATURES, \
251 .platform = INTEL_SANDYBRIDGE
252
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000253static const struct intel_device_info intel_sandybridge_d_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100254 SNB_D_PLATFORM,
255 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100256};
257
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000258static const struct intel_device_info intel_sandybridge_d_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100259 SNB_D_PLATFORM,
260 .gt = 2,
261};
262
263#define SNB_M_PLATFORM \
264 GEN6_FEATURES, \
265 .platform = INTEL_SANDYBRIDGE, \
266 .is_mobile = 1
267
268
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000269static const struct intel_device_info intel_sandybridge_m_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100270 SNB_M_PLATFORM,
271 .gt = 1,
272};
273
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000274static const struct intel_device_info intel_sandybridge_m_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100275 SNB_M_PLATFORM,
276 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100277};
278
279#define GEN7_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000280 GEN(7), \
281 .num_pipes = 3, \
Carlos Santa31776592016-08-17 12:30:56 -0700282 .has_hotplug = 1, \
Chris Wilson42f55512016-06-24 14:00:26 +0100283 .has_fbc = 1, \
284 .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
285 .has_llc = 1, \
Carlos Santa86f36242016-08-17 12:30:44 -0700286 .has_rc6 = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700287 .has_rc6p = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800288 .has_aliasing_ppgtt = 1, \
289 .has_full_ppgtt = 1, \
Chris Wilson42f55512016-06-24 14:00:26 +0100290 GEN_DEFAULT_PIPEOFFSETS, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100291 GEN_DEFAULT_PAGE_SIZES, \
Chris Wilson42f55512016-06-24 14:00:26 +0100292 IVB_CURSOR_OFFSETS
293
Lionel Landwerlin08905402017-08-30 17:12:05 +0100294#define IVB_D_PLATFORM \
295 GEN7_FEATURES, \
296 .platform = INTEL_IVYBRIDGE, \
297 .has_l3_dpf = 1
298
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000299static const struct intel_device_info intel_ivybridge_d_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100300 IVB_D_PLATFORM,
301 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100302};
303
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000304static const struct intel_device_info intel_ivybridge_d_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100305 IVB_D_PLATFORM,
306 .gt = 2,
307};
308
309#define IVB_M_PLATFORM \
310 GEN7_FEATURES, \
311 .platform = INTEL_IVYBRIDGE, \
312 .is_mobile = 1, \
313 .has_l3_dpf = 1
314
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000315static const struct intel_device_info intel_ivybridge_m_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100316 IVB_M_PLATFORM,
317 .gt = 1,
318};
319
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000320static const struct intel_device_info intel_ivybridge_m_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100321 IVB_M_PLATFORM,
322 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100323};
324
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000325static const struct intel_device_info intel_ivybridge_q_info = {
Chris Wilson42f55512016-06-24 14:00:26 +0100326 GEN7_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200327 .platform = INTEL_IVYBRIDGE,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100328 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100329 .num_pipes = 0, /* legal, last one wins */
Carlos Santaca9c4522016-08-17 12:30:54 -0700330 .has_l3_dpf = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100331};
332
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000333static const struct intel_device_info intel_valleyview_info = {
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200334 .platform = INTEL_VALLEYVIEW,
Chris Wilsonbc762982018-02-15 08:19:28 +0000335 GEN(7),
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800336 .is_lp = 1,
337 .num_pipes = 2,
338 .has_psr = 1,
339 .has_runtime_pm = 1,
340 .has_rc6 = 1,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800341 .has_gmch_display = 1,
342 .has_hotplug = 1,
343 .has_aliasing_ppgtt = 1,
344 .has_full_ppgtt = 1,
Chris Wilson5d95c242017-09-06 11:56:53 +0100345 .has_snoop = true,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800346 .ring_mask = RENDER_RING | BSD_RING | BLT_RING,
347 .display_mmio_offset = VLV_DISPLAY_BASE,
Matthew Auld2a9654b2017-10-06 23:18:16 +0100348 GEN_DEFAULT_PAGE_SIZES,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800349 GEN_DEFAULT_PIPEOFFSETS,
350 CURSOR_OFFSETS
Chris Wilson42f55512016-06-24 14:00:26 +0100351};
352
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700353#define G75_FEATURES \
Chris Wilson42f55512016-06-24 14:00:26 +0100354 GEN7_FEATURES, \
355 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
356 .has_ddi = 1, \
Carlos Santa6e3b84d2016-08-17 12:30:36 -0700357 .has_fpga_dbg = 1, \
Carlos Santa4aa4c232016-08-17 12:30:39 -0700358 .has_psr = 1, \
Carlos Santa53233f02016-08-17 12:30:43 -0700359 .has_resource_streamer = 1, \
Carlos Santa1d3fe532016-08-17 12:30:46 -0700360 .has_dp_mst = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700361 .has_rc6p = 0 /* RC6p removed-by HSW */, \
Carlos Santa4aa4c232016-08-17 12:30:39 -0700362 .has_runtime_pm = 1
Chris Wilson42f55512016-06-24 14:00:26 +0100363
Lionel Landwerlin08905402017-08-30 17:12:05 +0100364#define HSW_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700365 G75_FEATURES, \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100366 .platform = INTEL_HASWELL, \
367 .has_l3_dpf = 1
368
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000369static const struct intel_device_info intel_haswell_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100370 HSW_PLATFORM,
371 .gt = 1,
372};
373
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000374static const struct intel_device_info intel_haswell_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100375 HSW_PLATFORM,
376 .gt = 2,
377};
378
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000379static const struct intel_device_info intel_haswell_gt3_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100380 HSW_PLATFORM,
381 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100382};
383
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700384#define GEN8_FEATURES \
385 G75_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000386 GEN(8), \
Carlos Santa4586f1d2016-08-17 12:30:53 -0700387 BDW_COLORS, \
Matthew Aulda8832412017-10-06 23:18:33 +0100388 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
389 I915_GTT_PAGE_SIZE_2M, \
Joonas Lahtinendfc51482016-11-03 10:39:46 +0200390 .has_logical_ring_contexts = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800391 .has_full_48bit_ppgtt = 1, \
Michel Thierry142bc7d2017-06-20 10:57:46 +0100392 .has_64bit_reloc = 1, \
393 .has_reset_engine = 1
Chris Wilson42f55512016-06-24 14:00:26 +0100394
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700395#define BDW_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700396 GEN8_FEATURES, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700397 .platform = INTEL_BROADWELL
398
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000399static const struct intel_device_info intel_broadwell_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700400 BDW_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100401 .gt = 1,
402};
403
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000404static const struct intel_device_info intel_broadwell_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100405 BDW_PLATFORM,
406 .gt = 2,
407};
408
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000409static const struct intel_device_info intel_broadwell_rsvd_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100410 BDW_PLATFORM,
411 .gt = 3,
412 /* According to the device ID those devices are GT3, they were
413 * previously treated as not GT3, keep it like that.
414 */
Chris Wilson42f55512016-06-24 14:00:26 +0100415};
416
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000417static const struct intel_device_info intel_broadwell_gt3_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700418 BDW_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100419 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100420 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
421};
422
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000423static const struct intel_device_info intel_cherryview_info = {
Chris Wilsonbc762982018-02-15 08:19:28 +0000424 GEN(8),
425 .num_pipes = 3,
Carlos Santa31776592016-08-17 12:30:56 -0700426 .has_hotplug = 1,
Rodrigo Vivi8727dc02016-12-18 13:36:26 -0800427 .is_lp = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100428 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200429 .platform = INTEL_CHERRYVIEW,
Joonas Lahtinendfc51482016-11-03 10:39:46 +0200430 .has_64bit_reloc = 1,
Carlos Santa6e3b84d2016-08-17 12:30:36 -0700431 .has_psr = 1,
Carlos Santa4aa4c232016-08-17 12:30:39 -0700432 .has_runtime_pm = 1,
Carlos Santa53233f02016-08-17 12:30:43 -0700433 .has_resource_streamer = 1,
Carlos Santa86f36242016-08-17 12:30:44 -0700434 .has_rc6 = 1,
Carlos Santa4586f1d2016-08-17 12:30:53 -0700435 .has_logical_ring_contexts = 1,
Carlos Santa804b8712016-08-17 12:30:55 -0700436 .has_gmch_display = 1,
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800437 .has_aliasing_ppgtt = 1,
438 .has_full_ppgtt = 1,
Michel Thierry142bc7d2017-06-20 10:57:46 +0100439 .has_reset_engine = 1,
Chris Wilson5d95c242017-09-06 11:56:53 +0100440 .has_snoop = true,
Chris Wilson42f55512016-06-24 14:00:26 +0100441 .display_mmio_offset = VLV_DISPLAY_BASE,
Matthew Auld2a9654b2017-10-06 23:18:16 +0100442 GEN_DEFAULT_PAGE_SIZES,
Chris Wilson42f55512016-06-24 14:00:26 +0100443 GEN_CHV_PIPEOFFSETS,
444 CURSOR_OFFSETS,
445 CHV_COLORS,
446};
447
Matthew Auld2a9654b2017-10-06 23:18:16 +0100448#define GEN9_DEFAULT_PAGE_SIZES \
Matthew Auldf1f3f982017-10-06 23:18:32 +0100449 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
Matthew Aulda8832412017-10-06 23:18:33 +0100450 I915_GTT_PAGE_SIZE_64K | \
451 I915_GTT_PAGE_SIZE_2M
Matthew Auld2a9654b2017-10-06 23:18:16 +0100452
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700453#define GEN9_FEATURES \
454 GEN8_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000455 GEN(9), \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100456 GEN9_DEFAULT_PAGE_SIZES, \
Chris Wilsonbeecec92017-10-03 21:34:52 +0100457 .has_logical_ring_preemption = 1, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700458 .has_csr = 1, \
459 .has_guc = 1, \
Rodrigo Vivi4d6ef0d2017-10-02 23:36:50 -0700460 .has_ipc = 1, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700461 .ddb_size = 896
462
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700463#define SKL_PLATFORM \
464 GEN9_FEATURES, \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700465 .platform = INTEL_SKYLAKE
466
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000467static const struct intel_device_info intel_skylake_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700468 SKL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100469 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100470};
471
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000472static const struct intel_device_info intel_skylake_gt2_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700473 SKL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100474 .gt = 2,
475};
476
477#define SKL_GT3_PLUS_PLATFORM \
478 SKL_PLATFORM, \
479 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING
480
481
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000482static const struct intel_device_info intel_skylake_gt3_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100483 SKL_GT3_PLUS_PLATFORM,
484 .gt = 3,
485};
486
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000487static const struct intel_device_info intel_skylake_gt4_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100488 SKL_GT3_PLUS_PLATFORM,
489 .gt = 4,
Chris Wilson42f55512016-06-24 14:00:26 +0100490};
491
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200492#define GEN9_LP_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000493 GEN(9), \
Ander Conselvan de Oliveira3e4274f2016-11-10 17:23:09 +0200494 .is_lp = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200495 .has_hotplug = 1, \
496 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
497 .num_pipes = 3, \
498 .has_64bit_reloc = 1, \
499 .has_ddi = 1, \
500 .has_fpga_dbg = 1, \
501 .has_fbc = 1, \
David Weinehall495001c2017-08-08 13:09:52 +0300502 .has_psr = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200503 .has_runtime_pm = 1, \
504 .has_pooled_eu = 0, \
505 .has_csr = 1, \
506 .has_resource_streamer = 1, \
507 .has_rc6 = 1, \
508 .has_dp_mst = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200509 .has_logical_ring_contexts = 1, \
Chris Wilsonbeecec92017-10-03 21:34:52 +0100510 .has_logical_ring_preemption = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200511 .has_guc = 1, \
Michel Thierry9e1d0e62016-12-05 17:57:03 -0800512 .has_aliasing_ppgtt = 1, \
513 .has_full_ppgtt = 1, \
514 .has_full_48bit_ppgtt = 1, \
Michel Thierry142bc7d2017-06-20 10:57:46 +0100515 .has_reset_engine = 1, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100516 .has_snoop = true, \
Mahesh Kumare57f1c022017-08-17 19:15:27 +0530517 .has_ipc = 1, \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100518 GEN9_DEFAULT_PAGE_SIZES, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200519 GEN_DEFAULT_PIPEOFFSETS, \
520 IVB_CURSOR_OFFSETS, \
521 BDW_COLORS
522
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000523static const struct intel_device_info intel_broxton_info = {
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200524 GEN9_LP_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200525 .platform = INTEL_BROXTON,
Deepak M6f3fff62016-09-15 15:01:10 +0530526 .ddb_size = 512,
Chris Wilson42f55512016-06-24 14:00:26 +0100527};
528
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000529static const struct intel_device_info intel_geminilake_info = {
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200530 GEN9_LP_FEATURES,
Jani Nikula2e0d26f2016-12-01 14:49:55 +0200531 .platform = INTEL_GEMINILAKE,
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200532 .ddb_size = 1024,
Rodrigo Vivi46727702017-10-02 23:36:52 -0700533 GLK_COLORS,
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200534};
535
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700536#define KBL_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700537 GEN9_FEATURES, \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700538 .platform = INTEL_KABYLAKE
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700539
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000540static const struct intel_device_info intel_kabylake_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700541 KBL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100542 .gt = 1,
543};
544
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000545static const struct intel_device_info intel_kabylake_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100546 KBL_PLATFORM,
547 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100548};
549
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000550static const struct intel_device_info intel_kabylake_gt3_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700551 KBL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100552 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100553 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
554};
555
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700556#define CFL_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700557 GEN9_FEATURES, \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700558 .platform = INTEL_COFFEELAKE
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700559
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000560static const struct intel_device_info intel_coffeelake_gt1_info = {
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700561 CFL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100562 .gt = 1,
563};
564
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000565static const struct intel_device_info intel_coffeelake_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100566 CFL_PLATFORM,
567 .gt = 2,
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700568};
569
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000570static const struct intel_device_info intel_coffeelake_gt3_info = {
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700571 CFL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100572 .gt = 3,
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700573 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
574};
575
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700576#define GEN10_FEATURES \
577 GEN9_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000578 GEN(10), \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700579 .ddb_size = 1024, \
Rodrigo Vivi46727702017-10-02 23:36:52 -0700580 GLK_COLORS
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700581
Rodrigo Vivi3f430312018-01-29 15:22:14 -0800582static const struct intel_device_info intel_cannonlake_info = {
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700583 GEN10_FEATURES,
Rodrigo Vivi413f3c12017-06-06 13:30:30 -0700584 .platform = INTEL_CANNONLAKE,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100585 .gt = 2,
Rodrigo Vivi413f3c12017-06-06 13:30:30 -0700586};
587
Rodrigo Vivi412310012018-01-11 16:00:04 -0200588#define GEN11_FEATURES \
589 GEN10_FEATURES, \
Chris Wilsonbc762982018-02-15 08:19:28 +0000590 GEN(11), \
Rodrigo Vivi412310012018-01-11 16:00:04 -0200591 .ddb_size = 2048, \
592 .has_csr = 0
593
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000594static const struct intel_device_info intel_icelake_11_info = {
Rodrigo Vivi412310012018-01-11 16:00:04 -0200595 GEN11_FEATURES,
596 .platform = INTEL_ICELAKE,
597 .is_alpha_support = 1,
598 .has_resource_streamer = 0,
599};
600
Chris Wilsonbc762982018-02-15 08:19:28 +0000601#undef GEN
602
Chris Wilson42f55512016-06-24 14:00:26 +0100603/*
604 * Make sure any device matches here are from most specific to most
605 * general. For example, since the Quanta match is based on the subsystem
606 * and subvendor IDs, we need it to come before the more general IVB
607 * PCI ID matches, otherwise we'll use the wrong info struct above.
608 */
609static const struct pci_device_id pciidlist[] = {
610 INTEL_I830_IDS(&intel_i830_info),
Jani Nikula2a307c22016-11-30 17:43:04 +0200611 INTEL_I845G_IDS(&intel_i845g_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100612 INTEL_I85X_IDS(&intel_i85x_info),
613 INTEL_I865G_IDS(&intel_i865g_info),
614 INTEL_I915G_IDS(&intel_i915g_info),
615 INTEL_I915GM_IDS(&intel_i915gm_info),
616 INTEL_I945G_IDS(&intel_i945g_info),
617 INTEL_I945GM_IDS(&intel_i945gm_info),
618 INTEL_I965G_IDS(&intel_i965g_info),
619 INTEL_G33_IDS(&intel_g33_info),
620 INTEL_I965GM_IDS(&intel_i965gm_info),
621 INTEL_GM45_IDS(&intel_gm45_info),
622 INTEL_G45_IDS(&intel_g45_info),
623 INTEL_PINEVIEW_IDS(&intel_pineview_info),
624 INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
625 INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100626 INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info),
627 INTEL_SNB_D_GT2_IDS(&intel_sandybridge_d_gt2_info),
628 INTEL_SNB_M_GT1_IDS(&intel_sandybridge_m_gt1_info),
629 INTEL_SNB_M_GT2_IDS(&intel_sandybridge_m_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100630 INTEL_IVB_Q_IDS(&intel_ivybridge_q_info), /* must be first IVB */
Lionel Landwerlin08905402017-08-30 17:12:05 +0100631 INTEL_IVB_M_GT1_IDS(&intel_ivybridge_m_gt1_info),
632 INTEL_IVB_M_GT2_IDS(&intel_ivybridge_m_gt2_info),
633 INTEL_IVB_D_GT1_IDS(&intel_ivybridge_d_gt1_info),
634 INTEL_IVB_D_GT2_IDS(&intel_ivybridge_d_gt2_info),
635 INTEL_HSW_GT1_IDS(&intel_haswell_gt1_info),
636 INTEL_HSW_GT2_IDS(&intel_haswell_gt2_info),
637 INTEL_HSW_GT3_IDS(&intel_haswell_gt3_info),
Carlos Santa8d9c20e2016-08-17 12:30:37 -0700638 INTEL_VLV_IDS(&intel_valleyview_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100639 INTEL_BDW_GT1_IDS(&intel_broadwell_gt1_info),
640 INTEL_BDW_GT2_IDS(&intel_broadwell_gt2_info),
Carlos Santa8d9c20e2016-08-17 12:30:37 -0700641 INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100642 INTEL_BDW_RSVD_IDS(&intel_broadwell_rsvd_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100643 INTEL_CHV_IDS(&intel_cherryview_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100644 INTEL_SKL_GT1_IDS(&intel_skylake_gt1_info),
645 INTEL_SKL_GT2_IDS(&intel_skylake_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100646 INTEL_SKL_GT3_IDS(&intel_skylake_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100647 INTEL_SKL_GT4_IDS(&intel_skylake_gt4_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100648 INTEL_BXT_IDS(&intel_broxton_info),
Ander Conselvan de Oliveira8363e3c2016-11-10 17:23:08 +0200649 INTEL_GLK_IDS(&intel_geminilake_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100650 INTEL_KBL_GT1_IDS(&intel_kabylake_gt1_info),
651 INTEL_KBL_GT2_IDS(&intel_kabylake_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100652 INTEL_KBL_GT3_IDS(&intel_kabylake_gt3_info),
653 INTEL_KBL_GT4_IDS(&intel_kabylake_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100654 INTEL_CFL_S_GT1_IDS(&intel_coffeelake_gt1_info),
655 INTEL_CFL_S_GT2_IDS(&intel_coffeelake_gt2_info),
656 INTEL_CFL_H_GT2_IDS(&intel_coffeelake_gt2_info),
Rodrigo Vivic99d7832017-12-20 10:29:19 -0800657 INTEL_CFL_U_GT1_IDS(&intel_coffeelake_gt1_info),
658 INTEL_CFL_U_GT2_IDS(&intel_coffeelake_gt2_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100659 INTEL_CFL_U_GT3_IDS(&intel_coffeelake_gt3_info),
Rodrigo Vivi3f430312018-01-29 15:22:14 -0800660 INTEL_CNL_IDS(&intel_cannonlake_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100661 {0, 0, 0}
662};
663MODULE_DEVICE_TABLE(pci, pciidlist);
664
Chris Wilson953c7f82017-02-13 17:15:12 +0000665static void i915_pci_remove(struct pci_dev *pdev)
666{
667 struct drm_device *dev = pci_get_drvdata(pdev);
668
669 i915_driver_unload(dev);
Harsha Sharma8e9f8ab2017-10-15 00:06:44 +0530670 drm_dev_put(dev);
Chris Wilson953c7f82017-02-13 17:15:12 +0000671}
672
Chris Wilson42f55512016-06-24 14:00:26 +0100673static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
674{
675 struct intel_device_info *intel_info =
676 (struct intel_device_info *) ent->driver_data;
Chris Wilson953c7f82017-02-13 17:15:12 +0000677 int err;
Chris Wilson42f55512016-06-24 14:00:26 +0100678
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000679 if (IS_ALPHA_SUPPORT(intel_info) && !i915_modparams.alpha_support) {
Jani Nikulac007fb42016-10-31 12:18:28 +0200680 DRM_INFO("The driver support for your hardware in this kernel version is alpha quality\n"
681 "See CONFIG_DRM_I915_ALPHA_SUPPORT or i915.alpha_support module parameter\n"
682 "to enable support in this kernel version, or check for kernel updates.\n");
Chris Wilson42f55512016-06-24 14:00:26 +0100683 return -ENODEV;
684 }
685
686 /* Only bind to function 0 of the device. Early generations
687 * used function 1 as a placeholder for multi-head. This causes
688 * us confusion instead, especially on the systems where both
689 * functions have the same PCI-ID!
690 */
691 if (PCI_FUNC(pdev->devfn))
692 return -ENODEV;
693
694 /*
695 * apple-gmux is needed on dual GPU MacBook Pro
696 * to probe the panel if we're the inactive GPU.
697 */
698 if (vga_switcheroo_client_probe_defer(pdev))
699 return -EPROBE_DEFER;
700
Chris Wilson953c7f82017-02-13 17:15:12 +0000701 err = i915_driver_load(pdev, ent);
702 if (err)
703 return err;
Chris Wilson42f55512016-06-24 14:00:26 +0100704
Chris Wilson953c7f82017-02-13 17:15:12 +0000705 err = i915_live_selftests(pdev);
706 if (err) {
707 i915_pci_remove(pdev);
708 return err > 0 ? -ENOTTY : err;
709 }
Chris Wilson42f55512016-06-24 14:00:26 +0100710
Chris Wilson953c7f82017-02-13 17:15:12 +0000711 return 0;
Chris Wilson42f55512016-06-24 14:00:26 +0100712}
713
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100714static struct pci_driver i915_pci_driver = {
Chris Wilson42f55512016-06-24 14:00:26 +0100715 .name = DRIVER_NAME,
716 .id_table = pciidlist,
717 .probe = i915_pci_probe,
718 .remove = i915_pci_remove,
719 .driver.pm = &i915_pm_ops,
720};
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100721
722static int __init i915_init(void)
723{
724 bool use_kms = true;
Chris Wilson953c7f82017-02-13 17:15:12 +0000725 int err;
726
727 err = i915_mock_selftests();
728 if (err)
729 return err > 0 ? 0 : err;
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100730
731 /*
732 * Enable KMS by default, unless explicitly overriden by
733 * either the i915.modeset prarameter or by the
734 * vga_text_mode_force boot option.
735 */
736
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000737 if (i915_modparams.modeset == 0)
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100738 use_kms = false;
739
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000740 if (vgacon_text_force() && i915_modparams.modeset == -1)
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100741 use_kms = false;
742
743 if (!use_kms) {
744 /* Silently fail loading to not upset userspace. */
745 DRM_DEBUG_DRIVER("KMS disabled.\n");
746 return 0;
747 }
748
749 return pci_register_driver(&i915_pci_driver);
750}
751
752static void __exit i915_exit(void)
753{
754 if (!i915_pci_driver.driver.owner)
755 return;
756
757 pci_unregister_driver(&i915_pci_driver);
758}
759
760module_init(i915_init);
761module_exit(i915_exit);
762
763MODULE_AUTHOR("Tungsten Graphics, Inc.");
764MODULE_AUTHOR("Intel Corporation");
765
766MODULE_DESCRIPTION(DRIVER_DESC);
767MODULE_LICENSE("GPL and additional rights");