Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 1 | /* |
| 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 Wilson | a09d0ba | 2016-06-24 14:00:27 +0100 | [diff] [blame] | 25 | #include <linux/console.h> |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 26 | #include <linux/vgaarb.h> |
| 27 | #include <linux/vga_switcheroo.h> |
| 28 | |
| 29 | #include "i915_drv.h" |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 30 | #include "i915_selftest.h" |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 31 | |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 32 | #define PLATFORM(x) .platform = (x), .platform_mask = BIT(x) |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 33 | #define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1) |
| 34 | |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 35 | #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 Vivi | 4672770 | 2017-10-02 23:36:52 -0700 | [diff] [blame] | 60 | #define GLK_COLORS \ |
| 61 | .color = { .degamma_lut_size = 0, .gamma_lut_size = 1024 } |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 62 | |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 63 | /* Keep in gen based order, and chronological order within a gen */ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 64 | |
| 65 | #define GEN_DEFAULT_PAGE_SIZES \ |
| 66 | .page_sizes = I915_GTT_PAGE_SIZE_4K |
| 67 | |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 68 | #define GEN2_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 69 | GEN(2), \ |
| 70 | .num_pipes = 1, \ |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 71 | .has_overlay = 1, .overlay_needs_physical = 1, \ |
Carlos Santa | 804b871 | 2016-08-17 12:30:55 -0700 | [diff] [blame] | 72 | .has_gmch_display = 1, \ |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 73 | .hws_needs_physical = 1, \ |
Chris Wilson | f4ce766 | 2017-03-25 11:32:43 +0000 | [diff] [blame] | 74 | .unfenced_needs_alignment = 1, \ |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 75 | .ring_mask = RENDER_RING, \ |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 76 | .has_snoop = true, \ |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 77 | GEN_DEFAULT_PIPEOFFSETS, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 78 | GEN_DEFAULT_PAGE_SIZES, \ |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 79 | CURSOR_OFFSETS |
| 80 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 81 | static const struct intel_device_info intel_i830_info = { |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 82 | GEN2_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 83 | PLATFORM(INTEL_I830), |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 84 | .is_mobile = 1, .cursor_needs_physical = 1, |
| 85 | .num_pipes = 2, /* legal, last one wins */ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 86 | }; |
| 87 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 88 | static const struct intel_device_info intel_i845g_info = { |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 89 | GEN2_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 90 | PLATFORM(INTEL_I845G), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 91 | }; |
| 92 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 93 | static const struct intel_device_info intel_i85x_info = { |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 94 | GEN2_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 95 | PLATFORM(INTEL_I85X), |
| 96 | .is_mobile = 1, |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 97 | .num_pipes = 2, /* legal, last one wins */ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 98 | .cursor_needs_physical = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 99 | .has_fbc = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 100 | }; |
| 101 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 102 | static const struct intel_device_info intel_i865g_info = { |
Carlos Santa | 0eec8dc | 2016-08-17 12:30:51 -0700 | [diff] [blame] | 103 | GEN2_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 104 | PLATFORM(INTEL_I865G), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 105 | }; |
| 106 | |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 107 | #define GEN3_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 108 | GEN(3), \ |
| 109 | .num_pipes = 2, \ |
Carlos Santa | 804b871 | 2016-08-17 12:30:55 -0700 | [diff] [blame] | 110 | .has_gmch_display = 1, \ |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 111 | .ring_mask = RENDER_RING, \ |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 112 | .has_snoop = true, \ |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 113 | GEN_DEFAULT_PIPEOFFSETS, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 114 | GEN_DEFAULT_PAGE_SIZES, \ |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 115 | CURSOR_OFFSETS |
| 116 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 117 | static const struct intel_device_info intel_i915g_info = { |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 118 | GEN3_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 119 | PLATFORM(INTEL_I915G), |
| 120 | .cursor_needs_physical = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 121 | .has_overlay = 1, .overlay_needs_physical = 1, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 122 | .hws_needs_physical = 1, |
Chris Wilson | f4ce766 | 2017-03-25 11:32:43 +0000 | [diff] [blame] | 123 | .unfenced_needs_alignment = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 124 | }; |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 125 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 126 | static const struct intel_device_info intel_i915gm_info = { |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 127 | GEN3_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 128 | PLATFORM(INTEL_I915GM), |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 129 | .is_mobile = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 130 | .cursor_needs_physical = 1, |
| 131 | .has_overlay = 1, .overlay_needs_physical = 1, |
| 132 | .supports_tv = 1, |
| 133 | .has_fbc = 1, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 134 | .hws_needs_physical = 1, |
Chris Wilson | f4ce766 | 2017-03-25 11:32:43 +0000 | [diff] [blame] | 135 | .unfenced_needs_alignment = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 136 | }; |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 137 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 138 | static const struct intel_device_info intel_i945g_info = { |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 139 | GEN3_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 140 | PLATFORM(INTEL_I945G), |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 141 | .has_hotplug = 1, .cursor_needs_physical = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 142 | .has_overlay = 1, .overlay_needs_physical = 1, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 143 | .hws_needs_physical = 1, |
Chris Wilson | f4ce766 | 2017-03-25 11:32:43 +0000 | [diff] [blame] | 144 | .unfenced_needs_alignment = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 145 | }; |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 146 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 147 | static const struct intel_device_info intel_i945gm_info = { |
Carlos Santa | 54d2a6a | 2016-08-17 12:30:50 -0700 | [diff] [blame] | 148 | GEN3_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 149 | PLATFORM(INTEL_I945GM), |
| 150 | .is_mobile = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 151 | .has_hotplug = 1, .cursor_needs_physical = 1, |
| 152 | .has_overlay = 1, .overlay_needs_physical = 1, |
| 153 | .supports_tv = 1, |
| 154 | .has_fbc = 1, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 155 | .hws_needs_physical = 1, |
Chris Wilson | f4ce766 | 2017-03-25 11:32:43 +0000 | [diff] [blame] | 156 | .unfenced_needs_alignment = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 157 | }; |
| 158 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 159 | static const struct intel_device_info intel_g33_info = { |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 160 | GEN3_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 161 | PLATFORM(INTEL_G33), |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 162 | .has_hotplug = 1, |
| 163 | .has_overlay = 1, |
| 164 | }; |
| 165 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 166 | static const struct intel_device_info intel_pineview_info = { |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 167 | GEN3_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 168 | PLATFORM(INTEL_PINEVIEW), |
| 169 | .is_mobile = 1, |
Jani Nikula | a5ce929 | 2016-11-30 17:43:02 +0200 | [diff] [blame] | 170 | .has_hotplug = 1, |
| 171 | .has_overlay = 1, |
| 172 | }; |
| 173 | |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 174 | #define GEN4_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 175 | GEN(4), \ |
| 176 | .num_pipes = 2, \ |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 177 | .has_hotplug = 1, \ |
Carlos Santa | 804b871 | 2016-08-17 12:30:55 -0700 | [diff] [blame] | 178 | .has_gmch_display = 1, \ |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 179 | .ring_mask = RENDER_RING, \ |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 180 | .has_snoop = true, \ |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 181 | GEN_DEFAULT_PIPEOFFSETS, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 182 | GEN_DEFAULT_PAGE_SIZES, \ |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 183 | CURSOR_OFFSETS |
| 184 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 185 | static const struct intel_device_info intel_i965g_info = { |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 186 | GEN4_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 187 | PLATFORM(INTEL_I965G), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 188 | .has_overlay = 1, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 189 | .hws_needs_physical = 1, |
Chris Wilson | df0700e | 2017-09-06 20:24:24 +0100 | [diff] [blame] | 190 | .has_snoop = false, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 191 | }; |
| 192 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 193 | static const struct intel_device_info intel_i965gm_info = { |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 194 | GEN4_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 195 | PLATFORM(INTEL_I965GM), |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 196 | .is_mobile = 1, .has_fbc = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 197 | .has_overlay = 1, |
| 198 | .supports_tv = 1, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 199 | .hws_needs_physical = 1, |
Chris Wilson | df0700e | 2017-09-06 20:24:24 +0100 | [diff] [blame] | 200 | .has_snoop = false, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 201 | }; |
| 202 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 203 | static const struct intel_device_info intel_g45_info = { |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 204 | GEN4_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 205 | PLATFORM(INTEL_G45), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 206 | .ring_mask = RENDER_RING | BSD_RING, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 207 | }; |
| 208 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 209 | static const struct intel_device_info intel_gm45_info = { |
Carlos Santa | 4d495be | 2016-08-17 12:30:49 -0700 | [diff] [blame] | 210 | GEN4_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 211 | PLATFORM(INTEL_GM45), |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 212 | .is_mobile = 1, .has_fbc = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 213 | .supports_tv = 1, |
| 214 | .ring_mask = RENDER_RING | BSD_RING, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 215 | }; |
| 216 | |
Carlos Santa | a132338 | 2016-08-17 12:30:47 -0700 | [diff] [blame] | 217 | #define GEN5_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 218 | GEN(5), \ |
| 219 | .num_pipes = 2, \ |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 220 | .has_hotplug = 1, \ |
Carlos Santa | a132338 | 2016-08-17 12:30:47 -0700 | [diff] [blame] | 221 | .ring_mask = RENDER_RING | BSD_RING, \ |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 222 | .has_snoop = true, \ |
Chris Wilson | fb6db0f | 2017-12-01 11:30:30 +0000 | [diff] [blame] | 223 | /* ilk does support rc6, but we do not implement [power] contexts */ \ |
| 224 | .has_rc6 = 0, \ |
Carlos Santa | a132338 | 2016-08-17 12:30:47 -0700 | [diff] [blame] | 225 | GEN_DEFAULT_PIPEOFFSETS, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 226 | GEN_DEFAULT_PAGE_SIZES, \ |
Carlos Santa | a132338 | 2016-08-17 12:30:47 -0700 | [diff] [blame] | 227 | CURSOR_OFFSETS |
| 228 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 229 | static const struct intel_device_info intel_ironlake_d_info = { |
Carlos Santa | a132338 | 2016-08-17 12:30:47 -0700 | [diff] [blame] | 230 | GEN5_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 231 | PLATFORM(INTEL_IRONLAKE), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 232 | }; |
| 233 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 234 | static const struct intel_device_info intel_ironlake_m_info = { |
Carlos Santa | a132338 | 2016-08-17 12:30:47 -0700 | [diff] [blame] | 235 | GEN5_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 236 | PLATFORM(INTEL_IRONLAKE), |
Ville Syrjälä | c2d1a0c | 2017-06-06 16:32:29 +0300 | [diff] [blame] | 237 | .is_mobile = 1, .has_fbc = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 238 | }; |
| 239 | |
Carlos Santa | 07db6be | 2016-08-17 12:30:38 -0700 | [diff] [blame] | 240 | #define GEN6_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 241 | GEN(6), \ |
| 242 | .num_pipes = 2, \ |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 243 | .has_hotplug = 1, \ |
Carlos Santa | 07db6be | 2016-08-17 12:30:38 -0700 | [diff] [blame] | 244 | .has_fbc = 1, \ |
| 245 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \ |
| 246 | .has_llc = 1, \ |
Carlos Santa | 86f3624 | 2016-08-17 12:30:44 -0700 | [diff] [blame] | 247 | .has_rc6 = 1, \ |
Carlos Santa | 33b5bf8 | 2016-08-17 12:30:45 -0700 | [diff] [blame] | 248 | .has_rc6p = 1, \ |
Michel Thierry | 9e1d0e6 | 2016-12-05 17:57:03 -0800 | [diff] [blame] | 249 | .has_aliasing_ppgtt = 1, \ |
Carlos Santa | 07db6be | 2016-08-17 12:30:38 -0700 | [diff] [blame] | 250 | GEN_DEFAULT_PIPEOFFSETS, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 251 | GEN_DEFAULT_PAGE_SIZES, \ |
Carlos Santa | 07db6be | 2016-08-17 12:30:38 -0700 | [diff] [blame] | 252 | CURSOR_OFFSETS |
| 253 | |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 254 | #define SNB_D_PLATFORM \ |
| 255 | GEN6_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 256 | PLATFORM(INTEL_SANDYBRIDGE) |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 257 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 258 | static const struct intel_device_info intel_sandybridge_d_gt1_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 259 | SNB_D_PLATFORM, |
| 260 | .gt = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 261 | }; |
| 262 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 263 | static const struct intel_device_info intel_sandybridge_d_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 264 | SNB_D_PLATFORM, |
| 265 | .gt = 2, |
| 266 | }; |
| 267 | |
| 268 | #define SNB_M_PLATFORM \ |
| 269 | GEN6_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 270 | PLATFORM(INTEL_SANDYBRIDGE), \ |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 271 | .is_mobile = 1 |
| 272 | |
| 273 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 274 | static const struct intel_device_info intel_sandybridge_m_gt1_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 275 | SNB_M_PLATFORM, |
| 276 | .gt = 1, |
| 277 | }; |
| 278 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 279 | static const struct intel_device_info intel_sandybridge_m_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 280 | SNB_M_PLATFORM, |
| 281 | .gt = 2, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 282 | }; |
| 283 | |
| 284 | #define GEN7_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 285 | GEN(7), \ |
| 286 | .num_pipes = 3, \ |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 287 | .has_hotplug = 1, \ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 288 | .has_fbc = 1, \ |
| 289 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \ |
| 290 | .has_llc = 1, \ |
Carlos Santa | 86f3624 | 2016-08-17 12:30:44 -0700 | [diff] [blame] | 291 | .has_rc6 = 1, \ |
Carlos Santa | 33b5bf8 | 2016-08-17 12:30:45 -0700 | [diff] [blame] | 292 | .has_rc6p = 1, \ |
Michel Thierry | 9e1d0e6 | 2016-12-05 17:57:03 -0800 | [diff] [blame] | 293 | .has_aliasing_ppgtt = 1, \ |
| 294 | .has_full_ppgtt = 1, \ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 295 | GEN_DEFAULT_PIPEOFFSETS, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 296 | GEN_DEFAULT_PAGE_SIZES, \ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 297 | IVB_CURSOR_OFFSETS |
| 298 | |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 299 | #define IVB_D_PLATFORM \ |
| 300 | GEN7_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 301 | PLATFORM(INTEL_IVYBRIDGE), \ |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 302 | .has_l3_dpf = 1 |
| 303 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 304 | static const struct intel_device_info intel_ivybridge_d_gt1_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 305 | IVB_D_PLATFORM, |
| 306 | .gt = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 307 | }; |
| 308 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 309 | static const struct intel_device_info intel_ivybridge_d_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 310 | IVB_D_PLATFORM, |
| 311 | .gt = 2, |
| 312 | }; |
| 313 | |
| 314 | #define IVB_M_PLATFORM \ |
| 315 | GEN7_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 316 | PLATFORM(INTEL_IVYBRIDGE), \ |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 317 | .is_mobile = 1, \ |
| 318 | .has_l3_dpf = 1 |
| 319 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 320 | static const struct intel_device_info intel_ivybridge_m_gt1_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 321 | IVB_M_PLATFORM, |
| 322 | .gt = 1, |
| 323 | }; |
| 324 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 325 | static const struct intel_device_info intel_ivybridge_m_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 326 | IVB_M_PLATFORM, |
| 327 | .gt = 2, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 328 | }; |
| 329 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 330 | static const struct intel_device_info intel_ivybridge_q_info = { |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 331 | GEN7_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 332 | PLATFORM(INTEL_IVYBRIDGE), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 333 | .gt = 2, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 334 | .num_pipes = 0, /* legal, last one wins */ |
Carlos Santa | ca9c452 | 2016-08-17 12:30:54 -0700 | [diff] [blame] | 335 | .has_l3_dpf = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 336 | }; |
| 337 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 338 | static const struct intel_device_info intel_valleyview_info = { |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 339 | PLATFORM(INTEL_VALLEYVIEW), |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 340 | GEN(7), |
Rodrigo Vivi | eb6f771 | 2016-12-19 13:55:08 -0800 | [diff] [blame] | 341 | .is_lp = 1, |
| 342 | .num_pipes = 2, |
Rodrigo Vivi | eb6f771 | 2016-12-19 13:55:08 -0800 | [diff] [blame] | 343 | .has_runtime_pm = 1, |
| 344 | .has_rc6 = 1, |
Rodrigo Vivi | eb6f771 | 2016-12-19 13:55:08 -0800 | [diff] [blame] | 345 | .has_gmch_display = 1, |
| 346 | .has_hotplug = 1, |
| 347 | .has_aliasing_ppgtt = 1, |
| 348 | .has_full_ppgtt = 1, |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 349 | .has_snoop = true, |
Rodrigo Vivi | eb6f771 | 2016-12-19 13:55:08 -0800 | [diff] [blame] | 350 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING, |
| 351 | .display_mmio_offset = VLV_DISPLAY_BASE, |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 352 | GEN_DEFAULT_PAGE_SIZES, |
Rodrigo Vivi | eb6f771 | 2016-12-19 13:55:08 -0800 | [diff] [blame] | 353 | GEN_DEFAULT_PIPEOFFSETS, |
| 354 | CURSOR_OFFSETS |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 355 | }; |
| 356 | |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 357 | #define G75_FEATURES \ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 358 | GEN7_FEATURES, \ |
| 359 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \ |
| 360 | .has_ddi = 1, \ |
Carlos Santa | 6e3b84d | 2016-08-17 12:30:36 -0700 | [diff] [blame] | 361 | .has_fpga_dbg = 1, \ |
Carlos Santa | 4aa4c23 | 2016-08-17 12:30:39 -0700 | [diff] [blame] | 362 | .has_psr = 1, \ |
Carlos Santa | 53233f0 | 2016-08-17 12:30:43 -0700 | [diff] [blame] | 363 | .has_resource_streamer = 1, \ |
Carlos Santa | 1d3fe53 | 2016-08-17 12:30:46 -0700 | [diff] [blame] | 364 | .has_dp_mst = 1, \ |
Carlos Santa | 33b5bf8 | 2016-08-17 12:30:45 -0700 | [diff] [blame] | 365 | .has_rc6p = 0 /* RC6p removed-by HSW */, \ |
Carlos Santa | 4aa4c23 | 2016-08-17 12:30:39 -0700 | [diff] [blame] | 366 | .has_runtime_pm = 1 |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 367 | |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 368 | #define HSW_PLATFORM \ |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 369 | G75_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 370 | PLATFORM(INTEL_HASWELL), \ |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 371 | .has_l3_dpf = 1 |
| 372 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 373 | static const struct intel_device_info intel_haswell_gt1_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 374 | HSW_PLATFORM, |
| 375 | .gt = 1, |
| 376 | }; |
| 377 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 378 | static const struct intel_device_info intel_haswell_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 379 | HSW_PLATFORM, |
| 380 | .gt = 2, |
| 381 | }; |
| 382 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 383 | static const struct intel_device_info intel_haswell_gt3_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 384 | HSW_PLATFORM, |
| 385 | .gt = 3, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 386 | }; |
| 387 | |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 388 | #define GEN8_FEATURES \ |
| 389 | G75_FEATURES, \ |
Chris Wilson | a6e1c5a | 2018-02-15 08:19:29 +0000 | [diff] [blame] | 390 | GEN(8), \ |
Carlos Santa | 4586f1d | 2016-08-17 12:30:53 -0700 | [diff] [blame] | 391 | BDW_COLORS, \ |
Matthew Auld | a883241 | 2017-10-06 23:18:33 +0100 | [diff] [blame] | 392 | .page_sizes = I915_GTT_PAGE_SIZE_4K | \ |
| 393 | I915_GTT_PAGE_SIZE_2M, \ |
Joonas Lahtinen | dfc5148 | 2016-11-03 10:39:46 +0200 | [diff] [blame] | 394 | .has_logical_ring_contexts = 1, \ |
Michel Thierry | 9e1d0e6 | 2016-12-05 17:57:03 -0800 | [diff] [blame] | 395 | .has_full_48bit_ppgtt = 1, \ |
Michel Thierry | 142bc7d | 2017-06-20 10:57:46 +0100 | [diff] [blame] | 396 | .has_64bit_reloc = 1, \ |
| 397 | .has_reset_engine = 1 |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 398 | |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 399 | #define BDW_PLATFORM \ |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 400 | GEN8_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 401 | PLATFORM(INTEL_BROADWELL) |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 402 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 403 | static const struct intel_device_info intel_broadwell_gt1_info = { |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 404 | BDW_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 405 | .gt = 1, |
| 406 | }; |
| 407 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 408 | static const struct intel_device_info intel_broadwell_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 409 | BDW_PLATFORM, |
| 410 | .gt = 2, |
| 411 | }; |
| 412 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 413 | static const struct intel_device_info intel_broadwell_rsvd_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 414 | BDW_PLATFORM, |
| 415 | .gt = 3, |
| 416 | /* According to the device ID those devices are GT3, they were |
| 417 | * previously treated as not GT3, keep it like that. |
| 418 | */ |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 419 | }; |
| 420 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 421 | static const struct intel_device_info intel_broadwell_gt3_info = { |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 422 | BDW_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 423 | .gt = 3, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 424 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING, |
| 425 | }; |
| 426 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 427 | static const struct intel_device_info intel_cherryview_info = { |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 428 | PLATFORM(INTEL_CHERRYVIEW), |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 429 | GEN(8), |
| 430 | .num_pipes = 3, |
Carlos Santa | 3177659 | 2016-08-17 12:30:56 -0700 | [diff] [blame] | 431 | .has_hotplug = 1, |
Rodrigo Vivi | 8727dc0 | 2016-12-18 13:36:26 -0800 | [diff] [blame] | 432 | .is_lp = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 433 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, |
Joonas Lahtinen | dfc5148 | 2016-11-03 10:39:46 +0200 | [diff] [blame] | 434 | .has_64bit_reloc = 1, |
Carlos Santa | 4aa4c23 | 2016-08-17 12:30:39 -0700 | [diff] [blame] | 435 | .has_runtime_pm = 1, |
Carlos Santa | 53233f0 | 2016-08-17 12:30:43 -0700 | [diff] [blame] | 436 | .has_resource_streamer = 1, |
Carlos Santa | 86f3624 | 2016-08-17 12:30:44 -0700 | [diff] [blame] | 437 | .has_rc6 = 1, |
Carlos Santa | 4586f1d | 2016-08-17 12:30:53 -0700 | [diff] [blame] | 438 | .has_logical_ring_contexts = 1, |
Carlos Santa | 804b871 | 2016-08-17 12:30:55 -0700 | [diff] [blame] | 439 | .has_gmch_display = 1, |
Michel Thierry | 9e1d0e6 | 2016-12-05 17:57:03 -0800 | [diff] [blame] | 440 | .has_aliasing_ppgtt = 1, |
| 441 | .has_full_ppgtt = 1, |
Michel Thierry | 142bc7d | 2017-06-20 10:57:46 +0100 | [diff] [blame] | 442 | .has_reset_engine = 1, |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 443 | .has_snoop = true, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 444 | .display_mmio_offset = VLV_DISPLAY_BASE, |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 445 | GEN_DEFAULT_PAGE_SIZES, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 446 | GEN_CHV_PIPEOFFSETS, |
| 447 | CURSOR_OFFSETS, |
| 448 | CHV_COLORS, |
| 449 | }; |
| 450 | |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 451 | #define GEN9_DEFAULT_PAGE_SIZES \ |
Matthew Auld | f1f3f98 | 2017-10-06 23:18:32 +0100 | [diff] [blame] | 452 | .page_sizes = I915_GTT_PAGE_SIZE_4K | \ |
Matthew Auld | a883241 | 2017-10-06 23:18:33 +0100 | [diff] [blame] | 453 | I915_GTT_PAGE_SIZE_64K | \ |
| 454 | I915_GTT_PAGE_SIZE_2M |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 455 | |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 456 | #define GEN9_FEATURES \ |
| 457 | GEN8_FEATURES, \ |
Chris Wilson | a6e1c5a | 2018-02-15 08:19:29 +0000 | [diff] [blame] | 458 | GEN(9), \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 459 | GEN9_DEFAULT_PAGE_SIZES, \ |
Chris Wilson | beecec9 | 2017-10-03 21:34:52 +0100 | [diff] [blame] | 460 | .has_logical_ring_preemption = 1, \ |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 461 | .has_csr = 1, \ |
| 462 | .has_guc = 1, \ |
Rodrigo Vivi | 4d6ef0d | 2017-10-02 23:36:50 -0700 | [diff] [blame] | 463 | .has_ipc = 1, \ |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 464 | .ddb_size = 896 |
| 465 | |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 466 | #define SKL_PLATFORM \ |
| 467 | GEN9_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 468 | PLATFORM(INTEL_SKYLAKE) |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 469 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 470 | static const struct intel_device_info intel_skylake_gt1_info = { |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 471 | SKL_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 472 | .gt = 1, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 473 | }; |
| 474 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 475 | static const struct intel_device_info intel_skylake_gt2_info = { |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 476 | SKL_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 477 | .gt = 2, |
| 478 | }; |
| 479 | |
| 480 | #define SKL_GT3_PLUS_PLATFORM \ |
| 481 | SKL_PLATFORM, \ |
| 482 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING |
| 483 | |
| 484 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 485 | static const struct intel_device_info intel_skylake_gt3_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 486 | SKL_GT3_PLUS_PLATFORM, |
| 487 | .gt = 3, |
| 488 | }; |
| 489 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 490 | static const struct intel_device_info intel_skylake_gt4_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 491 | SKL_GT3_PLUS_PLATFORM, |
| 492 | .gt = 4, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 493 | }; |
| 494 | |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 495 | #define GEN9_LP_FEATURES \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 496 | GEN(9), \ |
Ander Conselvan de Oliveira | 3e4274f | 2016-11-10 17:23:09 +0200 | [diff] [blame] | 497 | .is_lp = 1, \ |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 498 | .has_hotplug = 1, \ |
| 499 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \ |
| 500 | .num_pipes = 3, \ |
| 501 | .has_64bit_reloc = 1, \ |
| 502 | .has_ddi = 1, \ |
| 503 | .has_fpga_dbg = 1, \ |
| 504 | .has_fbc = 1, \ |
David Weinehall | 495001c | 2017-08-08 13:09:52 +0300 | [diff] [blame] | 505 | .has_psr = 1, \ |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 506 | .has_runtime_pm = 1, \ |
| 507 | .has_pooled_eu = 0, \ |
| 508 | .has_csr = 1, \ |
| 509 | .has_resource_streamer = 1, \ |
| 510 | .has_rc6 = 1, \ |
| 511 | .has_dp_mst = 1, \ |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 512 | .has_logical_ring_contexts = 1, \ |
Chris Wilson | beecec9 | 2017-10-03 21:34:52 +0100 | [diff] [blame] | 513 | .has_logical_ring_preemption = 1, \ |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 514 | .has_guc = 1, \ |
Michel Thierry | 9e1d0e6 | 2016-12-05 17:57:03 -0800 | [diff] [blame] | 515 | .has_aliasing_ppgtt = 1, \ |
| 516 | .has_full_ppgtt = 1, \ |
| 517 | .has_full_48bit_ppgtt = 1, \ |
Michel Thierry | 142bc7d | 2017-06-20 10:57:46 +0100 | [diff] [blame] | 518 | .has_reset_engine = 1, \ |
Chris Wilson | 5d95c24 | 2017-09-06 11:56:53 +0100 | [diff] [blame] | 519 | .has_snoop = true, \ |
Mahesh Kumar | e57f1c02 | 2017-08-17 19:15:27 +0530 | [diff] [blame] | 520 | .has_ipc = 1, \ |
Matthew Auld | 2a9654b | 2017-10-06 23:18:16 +0100 | [diff] [blame] | 521 | GEN9_DEFAULT_PAGE_SIZES, \ |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 522 | GEN_DEFAULT_PIPEOFFSETS, \ |
| 523 | IVB_CURSOR_OFFSETS, \ |
| 524 | BDW_COLORS |
| 525 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 526 | static const struct intel_device_info intel_broxton_info = { |
Rodrigo Vivi | 80fa66b | 2016-12-01 11:33:16 +0200 | [diff] [blame] | 527 | GEN9_LP_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 528 | PLATFORM(INTEL_BROXTON), |
Deepak M | 6f3fff6 | 2016-09-15 15:01:10 +0530 | [diff] [blame] | 529 | .ddb_size = 512, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 530 | }; |
| 531 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 532 | static const struct intel_device_info intel_geminilake_info = { |
Ander Conselvan de Oliveira | c22097f | 2016-11-14 16:25:26 +0200 | [diff] [blame] | 533 | GEN9_LP_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 534 | PLATFORM(INTEL_GEMINILAKE), |
Ander Conselvan de Oliveira | c22097f | 2016-11-14 16:25:26 +0200 | [diff] [blame] | 535 | .ddb_size = 1024, |
Rodrigo Vivi | 4672770 | 2017-10-02 23:36:52 -0700 | [diff] [blame] | 536 | GLK_COLORS, |
Ander Conselvan de Oliveira | c22097f | 2016-11-14 16:25:26 +0200 | [diff] [blame] | 537 | }; |
| 538 | |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 539 | #define KBL_PLATFORM \ |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 540 | GEN9_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 541 | PLATFORM(INTEL_KABYLAKE) |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 542 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 543 | static const struct intel_device_info intel_kabylake_gt1_info = { |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 544 | KBL_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 545 | .gt = 1, |
| 546 | }; |
| 547 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 548 | static const struct intel_device_info intel_kabylake_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 549 | KBL_PLATFORM, |
| 550 | .gt = 2, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 551 | }; |
| 552 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 553 | static const struct intel_device_info intel_kabylake_gt3_info = { |
Rodrigo Vivi | 94829de | 2017-06-06 09:06:06 -0700 | [diff] [blame] | 554 | KBL_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 555 | .gt = 3, |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 556 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING, |
| 557 | }; |
| 558 | |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 559 | #define CFL_PLATFORM \ |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 560 | GEN9_FEATURES, \ |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 561 | PLATFORM(INTEL_COFFEELAKE) |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 562 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 563 | static const struct intel_device_info intel_coffeelake_gt1_info = { |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 564 | CFL_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 565 | .gt = 1, |
| 566 | }; |
| 567 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 568 | static const struct intel_device_info intel_coffeelake_gt2_info = { |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 569 | CFL_PLATFORM, |
| 570 | .gt = 2, |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 571 | }; |
| 572 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 573 | static const struct intel_device_info intel_coffeelake_gt3_info = { |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 574 | CFL_PLATFORM, |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 575 | .gt = 3, |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 576 | .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING, |
| 577 | }; |
| 578 | |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 579 | #define GEN10_FEATURES \ |
| 580 | GEN9_FEATURES, \ |
Chris Wilson | a6e1c5a | 2018-02-15 08:19:29 +0000 | [diff] [blame] | 581 | GEN(10), \ |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 582 | .ddb_size = 1024, \ |
Rodrigo Vivi | 4672770 | 2017-10-02 23:36:52 -0700 | [diff] [blame] | 583 | GLK_COLORS |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 584 | |
Rodrigo Vivi | 3f43031 | 2018-01-29 15:22:14 -0800 | [diff] [blame] | 585 | static const struct intel_device_info intel_cannonlake_info = { |
Rodrigo Vivi | 42a3ae8 | 2017-10-02 23:36:51 -0700 | [diff] [blame] | 586 | GEN10_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 587 | PLATFORM(INTEL_CANNONLAKE), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 588 | .gt = 2, |
Rodrigo Vivi | 413f3c1 | 2017-06-06 13:30:30 -0700 | [diff] [blame] | 589 | }; |
| 590 | |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 591 | #define GEN11_FEATURES \ |
| 592 | GEN10_FEATURES, \ |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 593 | GEN(11), \ |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 594 | .ddb_size = 2048, \ |
Thomas Daniel | 05f0add | 2018-03-02 18:14:59 +0200 | [diff] [blame] | 595 | .has_csr = 0, \ |
| 596 | .has_logical_ring_elsq = 1 |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 597 | |
Lionel Landwerlin | 5db47e3 | 2018-01-29 08:33:46 +0000 | [diff] [blame] | 598 | static const struct intel_device_info intel_icelake_11_info = { |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 599 | GEN11_FEATURES, |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 600 | PLATFORM(INTEL_ICELAKE), |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 601 | .is_alpha_support = 1, |
| 602 | .has_resource_streamer = 0, |
Oscar Mateo | d53d5ff | 2018-03-16 14:14:50 +0200 | [diff] [blame] | 603 | .ring_mask = RENDER_RING | BLT_RING | VEBOX_RING | BSD_RING | BSD3_RING, |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 604 | }; |
| 605 | |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 606 | #undef GEN |
Chris Wilson | c5cb21c | 2018-02-15 08:19:30 +0000 | [diff] [blame] | 607 | #undef PLATFORM |
Chris Wilson | bc76298 | 2018-02-15 08:19:28 +0000 | [diff] [blame] | 608 | |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 609 | /* |
| 610 | * Make sure any device matches here are from most specific to most |
| 611 | * general. For example, since the Quanta match is based on the subsystem |
| 612 | * and subvendor IDs, we need it to come before the more general IVB |
| 613 | * PCI ID matches, otherwise we'll use the wrong info struct above. |
| 614 | */ |
| 615 | static const struct pci_device_id pciidlist[] = { |
| 616 | INTEL_I830_IDS(&intel_i830_info), |
Jani Nikula | 2a307c2 | 2016-11-30 17:43:04 +0200 | [diff] [blame] | 617 | INTEL_I845G_IDS(&intel_i845g_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 618 | INTEL_I85X_IDS(&intel_i85x_info), |
| 619 | INTEL_I865G_IDS(&intel_i865g_info), |
| 620 | INTEL_I915G_IDS(&intel_i915g_info), |
| 621 | INTEL_I915GM_IDS(&intel_i915gm_info), |
| 622 | INTEL_I945G_IDS(&intel_i945g_info), |
| 623 | INTEL_I945GM_IDS(&intel_i945gm_info), |
| 624 | INTEL_I965G_IDS(&intel_i965g_info), |
| 625 | INTEL_G33_IDS(&intel_g33_info), |
| 626 | INTEL_I965GM_IDS(&intel_i965gm_info), |
| 627 | INTEL_GM45_IDS(&intel_gm45_info), |
| 628 | INTEL_G45_IDS(&intel_g45_info), |
| 629 | INTEL_PINEVIEW_IDS(&intel_pineview_info), |
| 630 | INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info), |
| 631 | INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 632 | INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info), |
| 633 | INTEL_SNB_D_GT2_IDS(&intel_sandybridge_d_gt2_info), |
| 634 | INTEL_SNB_M_GT1_IDS(&intel_sandybridge_m_gt1_info), |
| 635 | INTEL_SNB_M_GT2_IDS(&intel_sandybridge_m_gt2_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 636 | INTEL_IVB_Q_IDS(&intel_ivybridge_q_info), /* must be first IVB */ |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 637 | INTEL_IVB_M_GT1_IDS(&intel_ivybridge_m_gt1_info), |
| 638 | INTEL_IVB_M_GT2_IDS(&intel_ivybridge_m_gt2_info), |
| 639 | INTEL_IVB_D_GT1_IDS(&intel_ivybridge_d_gt1_info), |
| 640 | INTEL_IVB_D_GT2_IDS(&intel_ivybridge_d_gt2_info), |
| 641 | INTEL_HSW_GT1_IDS(&intel_haswell_gt1_info), |
| 642 | INTEL_HSW_GT2_IDS(&intel_haswell_gt2_info), |
| 643 | INTEL_HSW_GT3_IDS(&intel_haswell_gt3_info), |
Carlos Santa | 8d9c20e | 2016-08-17 12:30:37 -0700 | [diff] [blame] | 644 | INTEL_VLV_IDS(&intel_valleyview_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 645 | INTEL_BDW_GT1_IDS(&intel_broadwell_gt1_info), |
| 646 | INTEL_BDW_GT2_IDS(&intel_broadwell_gt2_info), |
Carlos Santa | 8d9c20e | 2016-08-17 12:30:37 -0700 | [diff] [blame] | 647 | INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 648 | INTEL_BDW_RSVD_IDS(&intel_broadwell_rsvd_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 649 | INTEL_CHV_IDS(&intel_cherryview_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 650 | INTEL_SKL_GT1_IDS(&intel_skylake_gt1_info), |
| 651 | INTEL_SKL_GT2_IDS(&intel_skylake_gt2_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 652 | INTEL_SKL_GT3_IDS(&intel_skylake_gt3_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 653 | INTEL_SKL_GT4_IDS(&intel_skylake_gt4_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 654 | INTEL_BXT_IDS(&intel_broxton_info), |
Ander Conselvan de Oliveira | 8363e3c | 2016-11-10 17:23:08 +0200 | [diff] [blame] | 655 | INTEL_GLK_IDS(&intel_geminilake_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 656 | INTEL_KBL_GT1_IDS(&intel_kabylake_gt1_info), |
| 657 | INTEL_KBL_GT2_IDS(&intel_kabylake_gt2_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 658 | INTEL_KBL_GT3_IDS(&intel_kabylake_gt3_info), |
| 659 | INTEL_KBL_GT4_IDS(&intel_kabylake_gt3_info), |
José Roberto de Souza | e364672 | 2018-06-14 16:37:20 -0700 | [diff] [blame] | 660 | INTEL_AML_GT2_IDS(&intel_kabylake_gt2_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 661 | 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 Vivi | c99d783 | 2017-12-20 10:29:19 -0800 | [diff] [blame] | 664 | INTEL_CFL_U_GT2_IDS(&intel_coffeelake_gt2_info), |
Lionel Landwerlin | 0890540 | 2017-08-30 17:12:05 +0100 | [diff] [blame] | 665 | INTEL_CFL_U_GT3_IDS(&intel_coffeelake_gt3_info), |
José Roberto de Souza | b9be785 | 2018-06-14 16:37:19 -0700 | [diff] [blame] | 666 | INTEL_WHL_U_GT1_IDS(&intel_coffeelake_gt1_info), |
| 667 | INTEL_WHL_U_GT2_IDS(&intel_coffeelake_gt2_info), |
| 668 | INTEL_WHL_U_GT3_IDS(&intel_coffeelake_gt3_info), |
Rodrigo Vivi | 3f43031 | 2018-01-29 15:22:14 -0800 | [diff] [blame] | 669 | INTEL_CNL_IDS(&intel_cannonlake_info), |
Paulo Zanoni | d55cb4f | 2018-02-20 17:37:52 +0200 | [diff] [blame] | 670 | INTEL_ICL_11_IDS(&intel_icelake_11_info), |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 671 | {0, 0, 0} |
| 672 | }; |
| 673 | MODULE_DEVICE_TABLE(pci, pciidlist); |
| 674 | |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 675 | static void i915_pci_remove(struct pci_dev *pdev) |
| 676 | { |
Chris Wilson | 159b69b | 2018-07-16 09:03:31 +0100 | [diff] [blame^] | 677 | struct drm_device *dev; |
| 678 | |
| 679 | dev = pci_get_drvdata(pdev); |
| 680 | if (!dev) /* driver load aborted, nothing to cleanup */ |
| 681 | return; |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 682 | |
| 683 | i915_driver_unload(dev); |
Harsha Sharma | 8e9f8ab | 2017-10-15 00:06:44 +0530 | [diff] [blame] | 684 | drm_dev_put(dev); |
Chris Wilson | 159b69b | 2018-07-16 09:03:31 +0100 | [diff] [blame^] | 685 | |
| 686 | pci_set_drvdata(pdev, NULL); |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 687 | } |
| 688 | |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 689 | static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
| 690 | { |
| 691 | struct intel_device_info *intel_info = |
| 692 | (struct intel_device_info *) ent->driver_data; |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 693 | int err; |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 694 | |
Michal Wajdeczko | 4f044a8 | 2017-09-19 19:38:44 +0000 | [diff] [blame] | 695 | if (IS_ALPHA_SUPPORT(intel_info) && !i915_modparams.alpha_support) { |
Jani Nikula | c007fb4 | 2016-10-31 12:18:28 +0200 | [diff] [blame] | 696 | DRM_INFO("The driver support for your hardware in this kernel version is alpha quality\n" |
| 697 | "See CONFIG_DRM_I915_ALPHA_SUPPORT or i915.alpha_support module parameter\n" |
| 698 | "to enable support in this kernel version, or check for kernel updates.\n"); |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 699 | return -ENODEV; |
| 700 | } |
| 701 | |
| 702 | /* Only bind to function 0 of the device. Early generations |
| 703 | * used function 1 as a placeholder for multi-head. This causes |
| 704 | * us confusion instead, especially on the systems where both |
| 705 | * functions have the same PCI-ID! |
| 706 | */ |
| 707 | if (PCI_FUNC(pdev->devfn)) |
| 708 | return -ENODEV; |
| 709 | |
| 710 | /* |
| 711 | * apple-gmux is needed on dual GPU MacBook Pro |
| 712 | * to probe the panel if we're the inactive GPU. |
| 713 | */ |
| 714 | if (vga_switcheroo_client_probe_defer(pdev)) |
| 715 | return -EPROBE_DEFER; |
| 716 | |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 717 | err = i915_driver_load(pdev, ent); |
| 718 | if (err) |
| 719 | return err; |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 720 | |
Chris Wilson | 159b69b | 2018-07-16 09:03:31 +0100 | [diff] [blame^] | 721 | if (i915_inject_load_failure()) { |
| 722 | i915_pci_remove(pdev); |
| 723 | return -ENODEV; |
| 724 | } |
| 725 | |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 726 | err = i915_live_selftests(pdev); |
| 727 | if (err) { |
| 728 | i915_pci_remove(pdev); |
| 729 | return err > 0 ? -ENOTTY : err; |
| 730 | } |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 731 | |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 732 | return 0; |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 733 | } |
| 734 | |
Chris Wilson | a09d0ba | 2016-06-24 14:00:27 +0100 | [diff] [blame] | 735 | static struct pci_driver i915_pci_driver = { |
Chris Wilson | 42f5551 | 2016-06-24 14:00:26 +0100 | [diff] [blame] | 736 | .name = DRIVER_NAME, |
| 737 | .id_table = pciidlist, |
| 738 | .probe = i915_pci_probe, |
| 739 | .remove = i915_pci_remove, |
| 740 | .driver.pm = &i915_pm_ops, |
| 741 | }; |
Chris Wilson | a09d0ba | 2016-06-24 14:00:27 +0100 | [diff] [blame] | 742 | |
| 743 | static int __init i915_init(void) |
| 744 | { |
| 745 | bool use_kms = true; |
Chris Wilson | 953c7f8 | 2017-02-13 17:15:12 +0000 | [diff] [blame] | 746 | int err; |
| 747 | |
| 748 | err = i915_mock_selftests(); |
| 749 | if (err) |
| 750 | return err > 0 ? 0 : err; |
Chris Wilson | a09d0ba | 2016-06-24 14:00:27 +0100 | [diff] [blame] | 751 | |
| 752 | /* |
| 753 | * Enable KMS by default, unless explicitly overriden by |
| 754 | * either the i915.modeset prarameter or by the |
| 755 | * vga_text_mode_force boot option. |
| 756 | */ |
| 757 | |
Michal Wajdeczko | 4f044a8 | 2017-09-19 19:38:44 +0000 | [diff] [blame] | 758 | if (i915_modparams.modeset == 0) |
Chris Wilson | a09d0ba | 2016-06-24 14:00:27 +0100 | [diff] [blame] | 759 | use_kms = false; |
| 760 | |
Michal Wajdeczko | 4f044a8 | 2017-09-19 19:38:44 +0000 | [diff] [blame] | 761 | if (vgacon_text_force() && i915_modparams.modeset == -1) |
Chris Wilson | a09d0ba | 2016-06-24 14:00:27 +0100 | [diff] [blame] | 762 | use_kms = false; |
| 763 | |
| 764 | if (!use_kms) { |
| 765 | /* Silently fail loading to not upset userspace. */ |
| 766 | DRM_DEBUG_DRIVER("KMS disabled.\n"); |
| 767 | return 0; |
| 768 | } |
| 769 | |
| 770 | return pci_register_driver(&i915_pci_driver); |
| 771 | } |
| 772 | |
| 773 | static void __exit i915_exit(void) |
| 774 | { |
| 775 | if (!i915_pci_driver.driver.owner) |
| 776 | return; |
| 777 | |
| 778 | pci_unregister_driver(&i915_pci_driver); |
| 779 | } |
| 780 | |
| 781 | module_init(i915_init); |
| 782 | module_exit(i915_exit); |
| 783 | |
| 784 | MODULE_AUTHOR("Tungsten Graphics, Inc."); |
| 785 | MODULE_AUTHOR("Intel Corporation"); |
| 786 | |
| 787 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 788 | MODULE_LICENSE("GPL and additional rights"); |