blob: 716f2f95c57d03523e2862ff7308cddb56d76820 [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
Daniel Vetterfcd70cd2019-01-17 22:03:34 +010029#include <drm/drm_drv.h>
30
Chris Wilson42f55512016-06-24 14:00:26 +010031#include "i915_drv.h"
Chris Wilson32eb6bc2019-02-28 10:20:33 +000032#include "i915_globals.h"
Chris Wilson953c7f82017-02-13 17:15:12 +000033#include "i915_selftest.h"
Chris Wilson42f55512016-06-24 14:00:26 +010034
Chris Wilsonc5cb21c2018-02-15 08:19:30 +000035#define PLATFORM(x) .platform = (x), .platform_mask = BIT(x)
Chris Wilsonbc762982018-02-15 08:19:28 +000036#define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
37
Ville Syrjälä37fbbd492019-03-05 21:29:05 +020038#define I845_PIPE_OFFSETS \
39 .pipe_offsets = { \
40 [TRANSCODER_A] = PIPE_A_OFFSET, \
41 }, \
42 .trans_offsets = { \
43 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
44 }
45
46#define I9XX_PIPE_OFFSETS \
47 .pipe_offsets = { \
48 [TRANSCODER_A] = PIPE_A_OFFSET, \
49 [TRANSCODER_B] = PIPE_B_OFFSET, \
50 }, \
51 .trans_offsets = { \
52 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
53 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
54 }
55
56#define IVB_PIPE_OFFSETS \
57 .pipe_offsets = { \
58 [TRANSCODER_A] = PIPE_A_OFFSET, \
59 [TRANSCODER_B] = PIPE_B_OFFSET, \
60 [TRANSCODER_C] = PIPE_C_OFFSET, \
61 }, \
62 .trans_offsets = { \
63 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
64 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
65 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
66 }
67
68#define HSW_PIPE_OFFSETS \
Imre Deak931f5492018-11-20 11:23:23 +020069 .pipe_offsets = { \
70 [TRANSCODER_A] = PIPE_A_OFFSET, \
71 [TRANSCODER_B] = PIPE_B_OFFSET, \
72 [TRANSCODER_C] = PIPE_C_OFFSET, \
73 [TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
74 }, \
75 .trans_offsets = { \
76 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
77 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
78 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
79 [TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
80 }
Chris Wilson42f55512016-06-24 14:00:26 +010081
Ville Syrjälä37fbbd492019-03-05 21:29:05 +020082#define CHV_PIPE_OFFSETS \
Imre Deak931f5492018-11-20 11:23:23 +020083 .pipe_offsets = { \
84 [TRANSCODER_A] = PIPE_A_OFFSET, \
85 [TRANSCODER_B] = PIPE_B_OFFSET, \
86 [TRANSCODER_C] = CHV_PIPE_C_OFFSET, \
87 }, \
88 .trans_offsets = { \
89 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
90 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
91 [TRANSCODER_C] = CHV_TRANSCODER_C_OFFSET, \
92 }
Chris Wilson42f55512016-06-24 14:00:26 +010093
Ville Syrjälä37fbbd492019-03-05 21:29:05 +020094#define I845_CURSOR_OFFSETS \
95 .cursor_offsets = { \
96 [PIPE_A] = CURSOR_A_OFFSET, \
97 }
98
99#define I9XX_CURSOR_OFFSETS \
100 .cursor_offsets = { \
101 [PIPE_A] = CURSOR_A_OFFSET, \
102 [PIPE_B] = CURSOR_B_OFFSET, \
103 }
104
105#define CHV_CURSOR_OFFSETS \
106 .cursor_offsets = { \
107 [PIPE_A] = CURSOR_A_OFFSET, \
108 [PIPE_B] = CURSOR_B_OFFSET, \
109 [PIPE_C] = CHV_CURSOR_C_OFFSET, \
110 }
Chris Wilson42f55512016-06-24 14:00:26 +0100111
112#define IVB_CURSOR_OFFSETS \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200113 .cursor_offsets = { \
114 [PIPE_A] = CURSOR_A_OFFSET, \
115 [PIPE_B] = IVB_CURSOR_B_OFFSET, \
116 [PIPE_C] = IVB_CURSOR_C_OFFSET, \
117 }
Chris Wilson42f55512016-06-24 14:00:26 +0100118
119#define BDW_COLORS \
120 .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
121#define CHV_COLORS \
Matt Ropere4c0d532019-01-30 10:10:22 -0800122 .color = { .degamma_lut_size = 65, .gamma_lut_size = 257, \
123 .degamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING, \
124 .gamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING, \
125 }
Rodrigo Vivi46727702017-10-02 23:36:52 -0700126#define GLK_COLORS \
Uma Shankar89571292019-02-11 19:20:21 +0530127 .color = { .degamma_lut_size = 33, .gamma_lut_size = 1024, \
Matt Ropere4c0d532019-01-30 10:10:22 -0800128 .degamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING | \
129 DRM_COLOR_LUT_EQUAL_CHANNELS, \
130 }
Chris Wilson42f55512016-06-24 14:00:26 +0100131
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200132/* Keep in gen based order, and chronological order within a gen */
Matthew Auld2a9654b2017-10-06 23:18:16 +0100133
134#define GEN_DEFAULT_PAGE_SIZES \
135 .page_sizes = I915_GTT_PAGE_SIZE_4K
136
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200137#define I830_FEATURES \
138 GEN(2), \
139 .is_mobile = 1, \
140 .num_pipes = 2, \
141 .display.has_overlay = 1, \
142 .display.cursor_needs_physical = 1, \
143 .display.overlay_needs_physical = 1, \
144 .display.has_gmch = 1, \
145 .gpu_reset_clobbers_display = true, \
146 .hws_needs_physical = 1, \
147 .unfenced_needs_alignment = 1, \
148 .engine_mask = BIT(RCS0), \
149 .has_snoop = true, \
150 .has_coherent_ggtt = false, \
151 I9XX_PIPE_OFFSETS, \
152 I9XX_CURSOR_OFFSETS, \
153 GEN_DEFAULT_PAGE_SIZES
154
155#define I845_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000156 GEN(2), \
157 .num_pipes = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800158 .display.has_overlay = 1, \
159 .display.overlay_needs_physical = 1, \
Rodrigo Vivib2ae3182019-02-04 14:25:38 -0800160 .display.has_gmch = 1, \
Chris Wilson55277e12019-01-03 11:21:04 +0000161 .gpu_reset_clobbers_display = true, \
Carlos Santa31776592016-08-17 12:30:56 -0700162 .hws_needs_physical = 1, \
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000163 .unfenced_needs_alignment = 1, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000164 .engine_mask = BIT(RCS0), \
Chris Wilson5d95c242017-09-06 11:56:53 +0100165 .has_snoop = true, \
Chris Wilson900ccf32018-07-20 11:19:10 +0100166 .has_coherent_ggtt = false, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200167 I845_PIPE_OFFSETS, \
168 I845_CURSOR_OFFSETS, \
169 GEN_DEFAULT_PAGE_SIZES
Carlos Santa0eec8dc2016-08-17 12:30:51 -0700170
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000171static const struct intel_device_info intel_i830_info = {
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200172 I830_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000173 PLATFORM(INTEL_I830),
Chris Wilson42f55512016-06-24 14:00:26 +0100174};
175
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000176static const struct intel_device_info intel_i845g_info = {
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200177 I845_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000178 PLATFORM(INTEL_I845G),
Chris Wilson42f55512016-06-24 14:00:26 +0100179};
180
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000181static const struct intel_device_info intel_i85x_info = {
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200182 I830_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000183 PLATFORM(INTEL_I85X),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800184 .display.has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100185};
186
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000187static const struct intel_device_info intel_i865g_info = {
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200188 I845_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000189 PLATFORM(INTEL_I865G),
Chris Wilson42f55512016-06-24 14:00:26 +0100190};
191
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700192#define GEN3_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000193 GEN(3), \
194 .num_pipes = 2, \
Rodrigo Vivib2ae3182019-02-04 14:25:38 -0800195 .display.has_gmch = 1, \
Chris Wilson55277e12019-01-03 11:21:04 +0000196 .gpu_reset_clobbers_display = true, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000197 .engine_mask = BIT(RCS0), \
Chris Wilson5d95c242017-09-06 11:56:53 +0100198 .has_snoop = true, \
Chris Wilson900ccf32018-07-20 11:19:10 +0100199 .has_coherent_ggtt = true, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200200 I9XX_PIPE_OFFSETS, \
201 I9XX_CURSOR_OFFSETS, \
202 GEN_DEFAULT_PAGE_SIZES
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700203
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000204static const struct intel_device_info intel_i915g_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700205 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000206 PLATFORM(INTEL_I915G),
Chris Wilson900ccf32018-07-20 11:19:10 +0100207 .has_coherent_ggtt = false,
José Roberto de Souzad53db442018-11-30 15:20:48 -0800208 .display.cursor_needs_physical = 1,
209 .display.has_overlay = 1,
210 .display.overlay_needs_physical = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700211 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000212 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100213};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200214
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000215static const struct intel_device_info intel_i915gm_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700216 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000217 PLATFORM(INTEL_I915GM),
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700218 .is_mobile = 1,
José Roberto de Souzad53db442018-11-30 15:20:48 -0800219 .display.cursor_needs_physical = 1,
220 .display.has_overlay = 1,
221 .display.overlay_needs_physical = 1,
222 .display.supports_tv = 1,
223 .display.has_fbc = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700224 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000225 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100226};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200227
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000228static const struct intel_device_info intel_i945g_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700229 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000230 PLATFORM(INTEL_I945G),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800231 .display.has_hotplug = 1,
232 .display.cursor_needs_physical = 1,
233 .display.has_overlay = 1,
234 .display.overlay_needs_physical = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700235 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000236 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100237};
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200238
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000239static const struct intel_device_info intel_i945gm_info = {
Carlos Santa54d2a6a2016-08-17 12:30:50 -0700240 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000241 PLATFORM(INTEL_I945GM),
242 .is_mobile = 1,
José Roberto de Souzad53db442018-11-30 15:20:48 -0800243 .display.has_hotplug = 1,
244 .display.cursor_needs_physical = 1,
245 .display.has_overlay = 1,
246 .display.overlay_needs_physical = 1,
247 .display.supports_tv = 1,
248 .display.has_fbc = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700249 .hws_needs_physical = 1,
Chris Wilsonf4ce7662017-03-25 11:32:43 +0000250 .unfenced_needs_alignment = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100251};
252
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000253static const struct intel_device_info intel_g33_info = {
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200254 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000255 PLATFORM(INTEL_G33),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800256 .display.has_hotplug = 1,
257 .display.has_overlay = 1,
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200258};
259
Tvrtko Ursulin86d35d42019-03-26 07:40:54 +0000260static const struct intel_device_info intel_pineview_g_info = {
261 GEN3_FEATURES,
262 PLATFORM(INTEL_PINEVIEW),
263 .display.has_hotplug = 1,
264 .display.has_overlay = 1,
265};
266
267static const struct intel_device_info intel_pineview_m_info = {
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200268 GEN3_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000269 PLATFORM(INTEL_PINEVIEW),
270 .is_mobile = 1,
José Roberto de Souzad53db442018-11-30 15:20:48 -0800271 .display.has_hotplug = 1,
272 .display.has_overlay = 1,
Jani Nikulaa5ce9292016-11-30 17:43:02 +0200273};
274
Carlos Santa4d495be2016-08-17 12:30:49 -0700275#define GEN4_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000276 GEN(4), \
277 .num_pipes = 2, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800278 .display.has_hotplug = 1, \
Rodrigo Vivib2ae3182019-02-04 14:25:38 -0800279 .display.has_gmch = 1, \
Chris Wilson55277e12019-01-03 11:21:04 +0000280 .gpu_reset_clobbers_display = true, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000281 .engine_mask = BIT(RCS0), \
Chris Wilson5d95c242017-09-06 11:56:53 +0100282 .has_snoop = true, \
Chris Wilson900ccf32018-07-20 11:19:10 +0100283 .has_coherent_ggtt = true, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200284 I9XX_PIPE_OFFSETS, \
285 I9XX_CURSOR_OFFSETS, \
286 GEN_DEFAULT_PAGE_SIZES
Carlos Santa4d495be2016-08-17 12:30:49 -0700287
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000288static const struct intel_device_info intel_i965g_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700289 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000290 PLATFORM(INTEL_I965G),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800291 .display.has_overlay = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700292 .hws_needs_physical = 1,
Chris Wilsondf0700e2017-09-06 20:24:24 +0100293 .has_snoop = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100294};
295
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000296static const struct intel_device_info intel_i965gm_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700297 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000298 PLATFORM(INTEL_I965GM),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800299 .is_mobile = 1,
300 .display.has_fbc = 1,
301 .display.has_overlay = 1,
302 .display.supports_tv = 1,
Carlos Santa31776592016-08-17 12:30:56 -0700303 .hws_needs_physical = 1,
Chris Wilsondf0700e2017-09-06 20:24:24 +0100304 .has_snoop = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100305};
306
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000307static const struct intel_device_info intel_g45_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700308 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000309 PLATFORM(INTEL_G45),
Chris Wilson8a68d462019-03-05 18:03:30 +0000310 .engine_mask = BIT(RCS0) | BIT(VCS0),
Chris Wilson55277e12019-01-03 11:21:04 +0000311 .gpu_reset_clobbers_display = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100312};
313
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000314static const struct intel_device_info intel_gm45_info = {
Carlos Santa4d495be2016-08-17 12:30:49 -0700315 GEN4_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000316 PLATFORM(INTEL_GM45),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800317 .is_mobile = 1,
318 .display.has_fbc = 1,
319 .display.supports_tv = 1,
Chris Wilson8a68d462019-03-05 18:03:30 +0000320 .engine_mask = BIT(RCS0) | BIT(VCS0),
Chris Wilson55277e12019-01-03 11:21:04 +0000321 .gpu_reset_clobbers_display = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100322};
323
Carlos Santaa1323382016-08-17 12:30:47 -0700324#define GEN5_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000325 GEN(5), \
326 .num_pipes = 2, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800327 .display.has_hotplug = 1, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000328 .engine_mask = BIT(RCS0) | BIT(VCS0), \
Chris Wilson5d95c242017-09-06 11:56:53 +0100329 .has_snoop = true, \
Chris Wilson900ccf32018-07-20 11:19:10 +0100330 .has_coherent_ggtt = true, \
Chris Wilsonfb6db0f2017-12-01 11:30:30 +0000331 /* ilk does support rc6, but we do not implement [power] contexts */ \
332 .has_rc6 = 0, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200333 I9XX_PIPE_OFFSETS, \
334 I9XX_CURSOR_OFFSETS, \
335 GEN_DEFAULT_PAGE_SIZES
Carlos Santaa1323382016-08-17 12:30:47 -0700336
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000337static const struct intel_device_info intel_ironlake_d_info = {
Carlos Santaa1323382016-08-17 12:30:47 -0700338 GEN5_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000339 PLATFORM(INTEL_IRONLAKE),
Chris Wilson42f55512016-06-24 14:00:26 +0100340};
341
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000342static const struct intel_device_info intel_ironlake_m_info = {
Carlos Santaa1323382016-08-17 12:30:47 -0700343 GEN5_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000344 PLATFORM(INTEL_IRONLAKE),
José Roberto de Souzad53db442018-11-30 15:20:48 -0800345 .is_mobile = 1,
346 .display.has_fbc = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100347};
348
Carlos Santa07db6be2016-08-17 12:30:38 -0700349#define GEN6_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000350 GEN(6), \
351 .num_pipes = 2, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800352 .display.has_hotplug = 1, \
353 .display.has_fbc = 1, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000354 .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0), \
Chris Wilson900ccf32018-07-20 11:19:10 +0100355 .has_coherent_ggtt = true, \
Carlos Santa07db6be2016-08-17 12:30:38 -0700356 .has_llc = 1, \
Carlos Santa86f36242016-08-17 12:30:44 -0700357 .has_rc6 = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700358 .has_rc6p = 1, \
Chris Wilsoncbecbcc2019-03-14 22:38:36 +0000359 .ppgtt_type = INTEL_PPGTT_ALIASING, \
360 .ppgtt_size = 31, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200361 I9XX_PIPE_OFFSETS, \
362 I9XX_CURSOR_OFFSETS, \
363 GEN_DEFAULT_PAGE_SIZES
Carlos Santa07db6be2016-08-17 12:30:38 -0700364
Lionel Landwerlin08905402017-08-30 17:12:05 +0100365#define SNB_D_PLATFORM \
366 GEN6_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000367 PLATFORM(INTEL_SANDYBRIDGE)
Lionel Landwerlin08905402017-08-30 17:12:05 +0100368
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000369static const struct intel_device_info intel_sandybridge_d_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100370 SNB_D_PLATFORM,
371 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100372};
373
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000374static const struct intel_device_info intel_sandybridge_d_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100375 SNB_D_PLATFORM,
376 .gt = 2,
377};
378
379#define SNB_M_PLATFORM \
380 GEN6_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000381 PLATFORM(INTEL_SANDYBRIDGE), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100382 .is_mobile = 1
383
384
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000385static const struct intel_device_info intel_sandybridge_m_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100386 SNB_M_PLATFORM,
387 .gt = 1,
388};
389
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000390static const struct intel_device_info intel_sandybridge_m_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100391 SNB_M_PLATFORM,
392 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100393};
394
395#define GEN7_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000396 GEN(7), \
397 .num_pipes = 3, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800398 .display.has_hotplug = 1, \
399 .display.has_fbc = 1, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000400 .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0), \
Chris Wilson900ccf32018-07-20 11:19:10 +0100401 .has_coherent_ggtt = true, \
Chris Wilson42f55512016-06-24 14:00:26 +0100402 .has_llc = 1, \
Carlos Santa86f36242016-08-17 12:30:44 -0700403 .has_rc6 = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700404 .has_rc6p = 1, \
Chris Wilsoncbecbcc2019-03-14 22:38:36 +0000405 .ppgtt_type = INTEL_PPGTT_FULL, \
406 .ppgtt_size = 31, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200407 IVB_PIPE_OFFSETS, \
408 IVB_CURSOR_OFFSETS, \
409 GEN_DEFAULT_PAGE_SIZES
Chris Wilson42f55512016-06-24 14:00:26 +0100410
Lionel Landwerlin08905402017-08-30 17:12:05 +0100411#define IVB_D_PLATFORM \
412 GEN7_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000413 PLATFORM(INTEL_IVYBRIDGE), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100414 .has_l3_dpf = 1
415
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000416static const struct intel_device_info intel_ivybridge_d_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100417 IVB_D_PLATFORM,
418 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100419};
420
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000421static const struct intel_device_info intel_ivybridge_d_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100422 IVB_D_PLATFORM,
423 .gt = 2,
424};
425
426#define IVB_M_PLATFORM \
427 GEN7_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000428 PLATFORM(INTEL_IVYBRIDGE), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100429 .is_mobile = 1, \
430 .has_l3_dpf = 1
431
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000432static const struct intel_device_info intel_ivybridge_m_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100433 IVB_M_PLATFORM,
434 .gt = 1,
435};
436
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000437static const struct intel_device_info intel_ivybridge_m_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100438 IVB_M_PLATFORM,
439 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100440};
441
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000442static const struct intel_device_info intel_ivybridge_q_info = {
Chris Wilson42f55512016-06-24 14:00:26 +0100443 GEN7_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000444 PLATFORM(INTEL_IVYBRIDGE),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100445 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100446 .num_pipes = 0, /* legal, last one wins */
Carlos Santaca9c4522016-08-17 12:30:54 -0700447 .has_l3_dpf = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100448};
449
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000450static const struct intel_device_info intel_valleyview_info = {
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000451 PLATFORM(INTEL_VALLEYVIEW),
Chris Wilsonbc762982018-02-15 08:19:28 +0000452 GEN(7),
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800453 .is_lp = 1,
454 .num_pipes = 2,
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800455 .has_runtime_pm = 1,
456 .has_rc6 = 1,
Rodrigo Vivib2ae3182019-02-04 14:25:38 -0800457 .display.has_gmch = 1,
José Roberto de Souzad53db442018-11-30 15:20:48 -0800458 .display.has_hotplug = 1,
Chris Wilsoncbecbcc2019-03-14 22:38:36 +0000459 .ppgtt_type = INTEL_PPGTT_FULL,
460 .ppgtt_size = 31,
Chris Wilson5d95c242017-09-06 11:56:53 +0100461 .has_snoop = true,
Chris Wilson900ccf32018-07-20 11:19:10 +0100462 .has_coherent_ggtt = false,
Chris Wilson8a68d462019-03-05 18:03:30 +0000463 .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0),
Rodrigo Vivieb6f7712016-12-19 13:55:08 -0800464 .display_mmio_offset = VLV_DISPLAY_BASE,
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200465 I9XX_PIPE_OFFSETS,
466 I9XX_CURSOR_OFFSETS,
Matthew Auld2a9654b2017-10-06 23:18:16 +0100467 GEN_DEFAULT_PAGE_SIZES,
Chris Wilson42f55512016-06-24 14:00:26 +0100468};
469
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700470#define G75_FEATURES \
Chris Wilson42f55512016-06-24 14:00:26 +0100471 GEN7_FEATURES, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000472 .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800473 .display.has_ddi = 1, \
Carlos Santa6e3b84d2016-08-17 12:30:36 -0700474 .has_fpga_dbg = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800475 .display.has_psr = 1, \
476 .display.has_dp_mst = 1, \
Carlos Santa33b5bf82016-08-17 12:30:45 -0700477 .has_rc6p = 0 /* RC6p removed-by HSW */, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200478 HSW_PIPE_OFFSETS, \
Carlos Santa4aa4c232016-08-17 12:30:39 -0700479 .has_runtime_pm = 1
Chris Wilson42f55512016-06-24 14:00:26 +0100480
Lionel Landwerlin08905402017-08-30 17:12:05 +0100481#define HSW_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700482 G75_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000483 PLATFORM(INTEL_HASWELL), \
Lionel Landwerlin08905402017-08-30 17:12:05 +0100484 .has_l3_dpf = 1
485
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000486static const struct intel_device_info intel_haswell_gt1_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100487 HSW_PLATFORM,
488 .gt = 1,
489};
490
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000491static const struct intel_device_info intel_haswell_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100492 HSW_PLATFORM,
493 .gt = 2,
494};
495
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000496static const struct intel_device_info intel_haswell_gt3_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100497 HSW_PLATFORM,
498 .gt = 3,
Chris Wilson42f55512016-06-24 14:00:26 +0100499};
500
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700501#define GEN8_FEATURES \
502 G75_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000503 GEN(8), \
Carlos Santa4586f1d2016-08-17 12:30:53 -0700504 BDW_COLORS, \
Matthew Aulda8832412017-10-06 23:18:33 +0100505 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
506 I915_GTT_PAGE_SIZE_2M, \
Joonas Lahtinendfc51482016-11-03 10:39:46 +0200507 .has_logical_ring_contexts = 1, \
Chris Wilson51d623b2019-03-14 22:38:37 +0000508 .ppgtt_type = INTEL_PPGTT_FULL, \
Chris Wilsoncbecbcc2019-03-14 22:38:36 +0000509 .ppgtt_size = 48, \
Michel Thierry142bc7d2017-06-20 10:57:46 +0100510 .has_64bit_reloc = 1, \
511 .has_reset_engine = 1
Chris Wilson42f55512016-06-24 14:00:26 +0100512
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700513#define BDW_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700514 GEN8_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000515 PLATFORM(INTEL_BROADWELL)
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700516
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000517static const struct intel_device_info intel_broadwell_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700518 BDW_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100519 .gt = 1,
520};
521
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000522static const struct intel_device_info intel_broadwell_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100523 BDW_PLATFORM,
524 .gt = 2,
525};
526
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000527static const struct intel_device_info intel_broadwell_rsvd_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100528 BDW_PLATFORM,
529 .gt = 3,
530 /* According to the device ID those devices are GT3, they were
531 * previously treated as not GT3, keep it like that.
532 */
Chris Wilson42f55512016-06-24 14:00:26 +0100533};
534
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000535static const struct intel_device_info intel_broadwell_gt3_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700536 BDW_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100537 .gt = 3,
Chris Wilson8a68d462019-03-05 18:03:30 +0000538 .engine_mask =
539 BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS1),
Chris Wilson42f55512016-06-24 14:00:26 +0100540};
541
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000542static const struct intel_device_info intel_cherryview_info = {
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000543 PLATFORM(INTEL_CHERRYVIEW),
Chris Wilsonbc762982018-02-15 08:19:28 +0000544 GEN(8),
545 .num_pipes = 3,
José Roberto de Souzad53db442018-11-30 15:20:48 -0800546 .display.has_hotplug = 1,
Rodrigo Vivi8727dc02016-12-18 13:36:26 -0800547 .is_lp = 1,
Chris Wilson8a68d462019-03-05 18:03:30 +0000548 .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0),
Joonas Lahtinendfc51482016-11-03 10:39:46 +0200549 .has_64bit_reloc = 1,
Carlos Santa4aa4c232016-08-17 12:30:39 -0700550 .has_runtime_pm = 1,
Carlos Santa86f36242016-08-17 12:30:44 -0700551 .has_rc6 = 1,
Carlos Santa4586f1d2016-08-17 12:30:53 -0700552 .has_logical_ring_contexts = 1,
Rodrigo Vivib2ae3182019-02-04 14:25:38 -0800553 .display.has_gmch = 1,
Chris Wilsoncbecbcc2019-03-14 22:38:36 +0000554 .ppgtt_type = INTEL_PPGTT_FULL,
555 .ppgtt_size = 32,
Michel Thierry142bc7d2017-06-20 10:57:46 +0100556 .has_reset_engine = 1,
Chris Wilson5d95c242017-09-06 11:56:53 +0100557 .has_snoop = true,
Chris Wilson900ccf32018-07-20 11:19:10 +0100558 .has_coherent_ggtt = false,
Chris Wilson42f55512016-06-24 14:00:26 +0100559 .display_mmio_offset = VLV_DISPLAY_BASE,
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200560 CHV_PIPE_OFFSETS,
561 CHV_CURSOR_OFFSETS,
Chris Wilson42f55512016-06-24 14:00:26 +0100562 CHV_COLORS,
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200563 GEN_DEFAULT_PAGE_SIZES,
Chris Wilson42f55512016-06-24 14:00:26 +0100564};
565
Matthew Auld2a9654b2017-10-06 23:18:16 +0100566#define GEN9_DEFAULT_PAGE_SIZES \
Matthew Auldf1f3f982017-10-06 23:18:32 +0100567 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
Matthew Aulda8832412017-10-06 23:18:33 +0100568 I915_GTT_PAGE_SIZE_64K | \
569 I915_GTT_PAGE_SIZE_2M
Matthew Auld2a9654b2017-10-06 23:18:16 +0100570
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700571#define GEN9_FEATURES \
572 GEN8_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000573 GEN(9), \
Matthew Auld2a9654b2017-10-06 23:18:16 +0100574 GEN9_DEFAULT_PAGE_SIZES, \
Chris Wilsonbeecec92017-10-03 21:34:52 +0100575 .has_logical_ring_preemption = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800576 .display.has_csr = 1, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700577 .has_guc = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800578 .display.has_ipc = 1, \
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700579 .ddb_size = 896
580
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700581#define SKL_PLATFORM \
582 GEN9_FEATURES, \
José Roberto de Souza63231132018-09-18 13:47:12 -0700583 /* Display WA #0477 WaDisableIPC: skl */ \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800584 .display.has_ipc = 0, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000585 PLATFORM(INTEL_SKYLAKE)
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700586
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000587static const struct intel_device_info intel_skylake_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700588 SKL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100589 .gt = 1,
Chris Wilson42f55512016-06-24 14:00:26 +0100590};
591
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000592static const struct intel_device_info intel_skylake_gt2_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700593 SKL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100594 .gt = 2,
595};
596
597#define SKL_GT3_PLUS_PLATFORM \
598 SKL_PLATFORM, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000599 .engine_mask = \
600 BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS1)
Lionel Landwerlin08905402017-08-30 17:12:05 +0100601
602
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000603static const struct intel_device_info intel_skylake_gt3_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100604 SKL_GT3_PLUS_PLATFORM,
605 .gt = 3,
606};
607
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000608static const struct intel_device_info intel_skylake_gt4_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100609 SKL_GT3_PLUS_PLATFORM,
610 .gt = 4,
Chris Wilson42f55512016-06-24 14:00:26 +0100611};
612
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200613#define GEN9_LP_FEATURES \
Chris Wilsonbc762982018-02-15 08:19:28 +0000614 GEN(9), \
Ander Conselvan de Oliveira3e4274f2016-11-10 17:23:09 +0200615 .is_lp = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800616 .display.has_hotplug = 1, \
Chris Wilson8a68d462019-03-05 18:03:30 +0000617 .engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200618 .num_pipes = 3, \
619 .has_64bit_reloc = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800620 .display.has_ddi = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200621 .has_fpga_dbg = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800622 .display.has_fbc = 1, \
623 .display.has_psr = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200624 .has_runtime_pm = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800625 .display.has_csr = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200626 .has_rc6 = 1, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800627 .display.has_dp_mst = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200628 .has_logical_ring_contexts = 1, \
Chris Wilsonbeecec92017-10-03 21:34:52 +0100629 .has_logical_ring_preemption = 1, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200630 .has_guc = 1, \
Chris Wilson51d623b2019-03-14 22:38:37 +0000631 .ppgtt_type = INTEL_PPGTT_FULL, \
Chris Wilsoncbecbcc2019-03-14 22:38:36 +0000632 .ppgtt_size = 48, \
Michel Thierry142bc7d2017-06-20 10:57:46 +0100633 .has_reset_engine = 1, \
Chris Wilson5d95c242017-09-06 11:56:53 +0100634 .has_snoop = true, \
Chris Wilson900ccf32018-07-20 11:19:10 +0100635 .has_coherent_ggtt = false, \
José Roberto de Souzad53db442018-11-30 15:20:48 -0800636 .display.has_ipc = 1, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200637 HSW_PIPE_OFFSETS, \
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200638 IVB_CURSOR_OFFSETS, \
Ville Syrjälä37fbbd492019-03-05 21:29:05 +0200639 BDW_COLORS, \
640 GEN9_DEFAULT_PAGE_SIZES
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200641
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000642static const struct intel_device_info intel_broxton_info = {
Rodrigo Vivi80fa66b2016-12-01 11:33:16 +0200643 GEN9_LP_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000644 PLATFORM(INTEL_BROXTON),
Deepak M6f3fff62016-09-15 15:01:10 +0530645 .ddb_size = 512,
Chris Wilson42f55512016-06-24 14:00:26 +0100646};
647
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000648static const struct intel_device_info intel_geminilake_info = {
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200649 GEN9_LP_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000650 PLATFORM(INTEL_GEMINILAKE),
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200651 .ddb_size = 1024,
Rodrigo Vivi46727702017-10-02 23:36:52 -0700652 GLK_COLORS,
Ander Conselvan de Oliveirac22097f2016-11-14 16:25:26 +0200653};
654
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700655#define KBL_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700656 GEN9_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000657 PLATFORM(INTEL_KABYLAKE)
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700658
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000659static const struct intel_device_info intel_kabylake_gt1_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700660 KBL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100661 .gt = 1,
662};
663
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000664static const struct intel_device_info intel_kabylake_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100665 KBL_PLATFORM,
666 .gt = 2,
Chris Wilson42f55512016-06-24 14:00:26 +0100667};
668
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000669static const struct intel_device_info intel_kabylake_gt3_info = {
Rodrigo Vivi94829de2017-06-06 09:06:06 -0700670 KBL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100671 .gt = 3,
Chris Wilson8a68d462019-03-05 18:03:30 +0000672 .engine_mask =
673 BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS1),
Chris Wilson42f55512016-06-24 14:00:26 +0100674};
675
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700676#define CFL_PLATFORM \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700677 GEN9_FEATURES, \
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000678 PLATFORM(INTEL_COFFEELAKE)
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700679
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000680static const struct intel_device_info intel_coffeelake_gt1_info = {
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700681 CFL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100682 .gt = 1,
683};
684
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000685static const struct intel_device_info intel_coffeelake_gt2_info = {
Lionel Landwerlin08905402017-08-30 17:12:05 +0100686 CFL_PLATFORM,
687 .gt = 2,
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700688};
689
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000690static const struct intel_device_info intel_coffeelake_gt3_info = {
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700691 CFL_PLATFORM,
Lionel Landwerlin08905402017-08-30 17:12:05 +0100692 .gt = 3,
Chris Wilson8a68d462019-03-05 18:03:30 +0000693 .engine_mask =
694 BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS1),
Rodrigo Vivi71851fa2017-06-08 08:49:58 -0700695};
696
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700697#define GEN10_FEATURES \
698 GEN9_FEATURES, \
Chris Wilsona6e1c5a2018-02-15 08:19:29 +0000699 GEN(10), \
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700700 .ddb_size = 1024, \
Chris Wilson21eb1852018-08-01 11:47:21 +0100701 .has_coherent_ggtt = false, \
Rodrigo Vivi46727702017-10-02 23:36:52 -0700702 GLK_COLORS
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700703
Rodrigo Vivi3f430312018-01-29 15:22:14 -0800704static const struct intel_device_info intel_cannonlake_info = {
Rodrigo Vivi42a3ae82017-10-02 23:36:51 -0700705 GEN10_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000706 PLATFORM(INTEL_CANNONLAKE),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100707 .gt = 2,
Rodrigo Vivi413f3c12017-06-06 13:30:30 -0700708};
709
Rodrigo Vivi412310012018-01-11 16:00:04 -0200710#define GEN11_FEATURES \
711 GEN10_FEATURES, \
Imre Deak931f5492018-11-20 11:23:23 +0200712 .pipe_offsets = { \
713 [TRANSCODER_A] = PIPE_A_OFFSET, \
714 [TRANSCODER_B] = PIPE_B_OFFSET, \
715 [TRANSCODER_C] = PIPE_C_OFFSET, \
716 [TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
717 [TRANSCODER_DSI_0] = PIPE_DSI0_OFFSET, \
718 [TRANSCODER_DSI_1] = PIPE_DSI1_OFFSET, \
719 }, \
720 .trans_offsets = { \
721 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
722 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
723 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
724 [TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
725 [TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \
726 [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \
727 }, \
Chris Wilsonbc762982018-02-15 08:19:28 +0000728 GEN(11), \
Rodrigo Vivi412310012018-01-11 16:00:04 -0200729 .ddb_size = 2048, \
Uma Shankare6ed0782019-02-11 19:20:25 +0530730 .has_logical_ring_elsq = 1, \
731 .color = { .degamma_lut_size = 33, .gamma_lut_size = 1024 }
Rodrigo Vivi412310012018-01-11 16:00:04 -0200732
Lionel Landwerlin5db47e32018-01-29 08:33:46 +0000733static const struct intel_device_info intel_icelake_11_info = {
Rodrigo Vivi412310012018-01-11 16:00:04 -0200734 GEN11_FEATURES,
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000735 PLATFORM(INTEL_ICELAKE),
Chris Wilson8a68d462019-03-05 18:03:30 +0000736 .engine_mask =
737 BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2),
Rodrigo Vivi412310012018-01-11 16:00:04 -0200738};
739
James Ausmus29f38632019-03-22 10:58:42 -0700740static const struct intel_device_info intel_elkhartlake_info = {
741 GEN11_FEATURES,
Bob Paauwe897f2962019-03-22 10:58:43 -0700742 PLATFORM(INTEL_ELKHARTLAKE),
James Ausmus29f38632019-03-22 10:58:42 -0700743 .is_alpha_support = 1,
744 .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0),
745 .ppgtt_size = 36,
746};
747
Chris Wilsonbc762982018-02-15 08:19:28 +0000748#undef GEN
Chris Wilsonc5cb21c2018-02-15 08:19:30 +0000749#undef PLATFORM
Chris Wilsonbc762982018-02-15 08:19:28 +0000750
Chris Wilson42f55512016-06-24 14:00:26 +0100751/*
752 * Make sure any device matches here are from most specific to most
753 * general. For example, since the Quanta match is based on the subsystem
754 * and subvendor IDs, we need it to come before the more general IVB
755 * PCI ID matches, otherwise we'll use the wrong info struct above.
756 */
757static const struct pci_device_id pciidlist[] = {
758 INTEL_I830_IDS(&intel_i830_info),
Jani Nikula2a307c22016-11-30 17:43:04 +0200759 INTEL_I845G_IDS(&intel_i845g_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100760 INTEL_I85X_IDS(&intel_i85x_info),
761 INTEL_I865G_IDS(&intel_i865g_info),
762 INTEL_I915G_IDS(&intel_i915g_info),
763 INTEL_I915GM_IDS(&intel_i915gm_info),
764 INTEL_I945G_IDS(&intel_i945g_info),
765 INTEL_I945GM_IDS(&intel_i945gm_info),
766 INTEL_I965G_IDS(&intel_i965g_info),
767 INTEL_G33_IDS(&intel_g33_info),
768 INTEL_I965GM_IDS(&intel_i965gm_info),
769 INTEL_GM45_IDS(&intel_gm45_info),
770 INTEL_G45_IDS(&intel_g45_info),
Tvrtko Ursulin86d35d42019-03-26 07:40:54 +0000771 INTEL_PINEVIEW_G_IDS(&intel_pineview_g_info),
772 INTEL_PINEVIEW_M_IDS(&intel_pineview_m_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100773 INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
774 INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100775 INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info),
776 INTEL_SNB_D_GT2_IDS(&intel_sandybridge_d_gt2_info),
777 INTEL_SNB_M_GT1_IDS(&intel_sandybridge_m_gt1_info),
778 INTEL_SNB_M_GT2_IDS(&intel_sandybridge_m_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100779 INTEL_IVB_Q_IDS(&intel_ivybridge_q_info), /* must be first IVB */
Lionel Landwerlin08905402017-08-30 17:12:05 +0100780 INTEL_IVB_M_GT1_IDS(&intel_ivybridge_m_gt1_info),
781 INTEL_IVB_M_GT2_IDS(&intel_ivybridge_m_gt2_info),
782 INTEL_IVB_D_GT1_IDS(&intel_ivybridge_d_gt1_info),
783 INTEL_IVB_D_GT2_IDS(&intel_ivybridge_d_gt2_info),
784 INTEL_HSW_GT1_IDS(&intel_haswell_gt1_info),
785 INTEL_HSW_GT2_IDS(&intel_haswell_gt2_info),
786 INTEL_HSW_GT3_IDS(&intel_haswell_gt3_info),
Carlos Santa8d9c20e2016-08-17 12:30:37 -0700787 INTEL_VLV_IDS(&intel_valleyview_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100788 INTEL_BDW_GT1_IDS(&intel_broadwell_gt1_info),
789 INTEL_BDW_GT2_IDS(&intel_broadwell_gt2_info),
Carlos Santa8d9c20e2016-08-17 12:30:37 -0700790 INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100791 INTEL_BDW_RSVD_IDS(&intel_broadwell_rsvd_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100792 INTEL_CHV_IDS(&intel_cherryview_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100793 INTEL_SKL_GT1_IDS(&intel_skylake_gt1_info),
794 INTEL_SKL_GT2_IDS(&intel_skylake_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100795 INTEL_SKL_GT3_IDS(&intel_skylake_gt3_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100796 INTEL_SKL_GT4_IDS(&intel_skylake_gt4_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100797 INTEL_BXT_IDS(&intel_broxton_info),
Ander Conselvan de Oliveira8363e3c2016-11-10 17:23:08 +0200798 INTEL_GLK_IDS(&intel_geminilake_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100799 INTEL_KBL_GT1_IDS(&intel_kabylake_gt1_info),
800 INTEL_KBL_GT2_IDS(&intel_kabylake_gt2_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100801 INTEL_KBL_GT3_IDS(&intel_kabylake_gt3_info),
802 INTEL_KBL_GT4_IDS(&intel_kabylake_gt3_info),
José Roberto de Souzac0c46ca2018-09-26 18:06:50 -0700803 INTEL_AML_KBL_GT2_IDS(&intel_kabylake_gt2_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100804 INTEL_CFL_S_GT1_IDS(&intel_coffeelake_gt1_info),
805 INTEL_CFL_S_GT2_IDS(&intel_coffeelake_gt2_info),
Rodrigo Vivi5e0f5a52019-02-01 15:50:49 -0800806 INTEL_CFL_H_GT1_IDS(&intel_coffeelake_gt1_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100807 INTEL_CFL_H_GT2_IDS(&intel_coffeelake_gt2_info),
Rodrigo Vivic99d7832017-12-20 10:29:19 -0800808 INTEL_CFL_U_GT2_IDS(&intel_coffeelake_gt2_info),
Lionel Landwerlin08905402017-08-30 17:12:05 +0100809 INTEL_CFL_U_GT3_IDS(&intel_coffeelake_gt3_info),
José Roberto de Souzab9be7852018-06-14 16:37:19 -0700810 INTEL_WHL_U_GT1_IDS(&intel_coffeelake_gt1_info),
811 INTEL_WHL_U_GT2_IDS(&intel_coffeelake_gt2_info),
José Roberto de Souzac0c46ca2018-09-26 18:06:50 -0700812 INTEL_AML_CFL_GT2_IDS(&intel_coffeelake_gt2_info),
José Roberto de Souzab9be7852018-06-14 16:37:19 -0700813 INTEL_WHL_U_GT3_IDS(&intel_coffeelake_gt3_info),
Anusha Srivatsaa7b4dee2019-03-18 13:01:32 -0700814 INTEL_CML_GT1_IDS(&intel_coffeelake_gt1_info),
815 INTEL_CML_GT2_IDS(&intel_coffeelake_gt2_info),
Rodrigo Vivi3f430312018-01-29 15:22:14 -0800816 INTEL_CNL_IDS(&intel_cannonlake_info),
Paulo Zanonid55cb4f2018-02-20 17:37:52 +0200817 INTEL_ICL_11_IDS(&intel_icelake_11_info),
James Ausmus29f38632019-03-22 10:58:42 -0700818 INTEL_EHL_IDS(&intel_elkhartlake_info),
Chris Wilson42f55512016-06-24 14:00:26 +0100819 {0, 0, 0}
820};
821MODULE_DEVICE_TABLE(pci, pciidlist);
822
Chris Wilson953c7f82017-02-13 17:15:12 +0000823static void i915_pci_remove(struct pci_dev *pdev)
824{
Chris Wilson159b69b2018-07-16 09:03:31 +0100825 struct drm_device *dev;
826
827 dev = pci_get_drvdata(pdev);
828 if (!dev) /* driver load aborted, nothing to cleanup */
829 return;
Chris Wilson953c7f82017-02-13 17:15:12 +0000830
831 i915_driver_unload(dev);
Harsha Sharma8e9f8ab2017-10-15 00:06:44 +0530832 drm_dev_put(dev);
Chris Wilson159b69b2018-07-16 09:03:31 +0100833
834 pci_set_drvdata(pdev, NULL);
Chris Wilson953c7f82017-02-13 17:15:12 +0000835}
836
Chris Wilson42f55512016-06-24 14:00:26 +0100837static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
838{
839 struct intel_device_info *intel_info =
840 (struct intel_device_info *) ent->driver_data;
Chris Wilson953c7f82017-02-13 17:15:12 +0000841 int err;
Chris Wilson42f55512016-06-24 14:00:26 +0100842
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000843 if (IS_ALPHA_SUPPORT(intel_info) && !i915_modparams.alpha_support) {
Jani Nikulac007fb42016-10-31 12:18:28 +0200844 DRM_INFO("The driver support for your hardware in this kernel version is alpha quality\n"
845 "See CONFIG_DRM_I915_ALPHA_SUPPORT or i915.alpha_support module parameter\n"
846 "to enable support in this kernel version, or check for kernel updates.\n");
Chris Wilson42f55512016-06-24 14:00:26 +0100847 return -ENODEV;
848 }
849
850 /* Only bind to function 0 of the device. Early generations
851 * used function 1 as a placeholder for multi-head. This causes
852 * us confusion instead, especially on the systems where both
853 * functions have the same PCI-ID!
854 */
855 if (PCI_FUNC(pdev->devfn))
856 return -ENODEV;
857
858 /*
859 * apple-gmux is needed on dual GPU MacBook Pro
860 * to probe the panel if we're the inactive GPU.
861 */
862 if (vga_switcheroo_client_probe_defer(pdev))
863 return -EPROBE_DEFER;
864
Chris Wilson953c7f82017-02-13 17:15:12 +0000865 err = i915_driver_load(pdev, ent);
866 if (err)
867 return err;
Chris Wilson42f55512016-06-24 14:00:26 +0100868
Chris Wilson159b69b2018-07-16 09:03:31 +0100869 if (i915_inject_load_failure()) {
870 i915_pci_remove(pdev);
871 return -ENODEV;
872 }
873
Chris Wilson953c7f82017-02-13 17:15:12 +0000874 err = i915_live_selftests(pdev);
875 if (err) {
876 i915_pci_remove(pdev);
877 return err > 0 ? -ENOTTY : err;
878 }
Chris Wilson42f55512016-06-24 14:00:26 +0100879
Chris Wilson953c7f82017-02-13 17:15:12 +0000880 return 0;
Chris Wilson42f55512016-06-24 14:00:26 +0100881}
882
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100883static struct pci_driver i915_pci_driver = {
Chris Wilson42f55512016-06-24 14:00:26 +0100884 .name = DRIVER_NAME,
885 .id_table = pciidlist,
886 .probe = i915_pci_probe,
887 .remove = i915_pci_remove,
888 .driver.pm = &i915_pm_ops,
889};
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100890
891static int __init i915_init(void)
892{
893 bool use_kms = true;
Chris Wilson953c7f82017-02-13 17:15:12 +0000894 int err;
895
Chris Wilson32eb6bc2019-02-28 10:20:33 +0000896 err = i915_globals_init();
897 if (err)
898 return err;
Chris Wilson5f5c1392019-02-05 13:00:04 +0000899
Chris Wilson953c7f82017-02-13 17:15:12 +0000900 err = i915_mock_selftests();
901 if (err)
902 return err > 0 ? 0 : err;
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100903
904 /*
905 * Enable KMS by default, unless explicitly overriden by
906 * either the i915.modeset prarameter or by the
907 * vga_text_mode_force boot option.
908 */
909
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000910 if (i915_modparams.modeset == 0)
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100911 use_kms = false;
912
Michal Wajdeczko4f044a82017-09-19 19:38:44 +0000913 if (vgacon_text_force() && i915_modparams.modeset == -1)
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100914 use_kms = false;
915
916 if (!use_kms) {
917 /* Silently fail loading to not upset userspace. */
918 DRM_DEBUG_DRIVER("KMS disabled.\n");
919 return 0;
920 }
921
922 return pci_register_driver(&i915_pci_driver);
923}
924
925static void __exit i915_exit(void)
926{
927 if (!i915_pci_driver.driver.owner)
928 return;
929
930 pci_unregister_driver(&i915_pci_driver);
Chris Wilson32eb6bc2019-02-28 10:20:33 +0000931 i915_globals_exit();
Chris Wilsona09d0ba2016-06-24 14:00:27 +0100932}
933
934module_init(i915_init);
935module_exit(i915_exit);
936
937MODULE_AUTHOR("Tungsten Graphics, Inc.");
938MODULE_AUTHOR("Intel Corporation");
939
940MODULE_DESCRIPTION(DRIVER_DESC);
941MODULE_LICENSE("GPL and additional rights");