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