Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +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 | |
Michal Wajdeczko | a8c9b84 | 2017-12-19 11:43:44 +0000 | [diff] [blame] | 25 | #include <drm/drm_print.h> |
| 26 | |
Michal Wajdeczko | b978520 | 2017-12-21 21:57:32 +0000 | [diff] [blame] | 27 | #include "intel_device_info.h" |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 28 | #include "i915_drv.h" |
| 29 | |
Jani Nikula | 2e0d26f | 2016-12-01 14:49:55 +0200 | [diff] [blame] | 30 | #define PLATFORM_NAME(x) [INTEL_##x] = #x |
| 31 | static const char * const platform_names[] = { |
| 32 | PLATFORM_NAME(I830), |
| 33 | PLATFORM_NAME(I845G), |
| 34 | PLATFORM_NAME(I85X), |
| 35 | PLATFORM_NAME(I865G), |
| 36 | PLATFORM_NAME(I915G), |
| 37 | PLATFORM_NAME(I915GM), |
| 38 | PLATFORM_NAME(I945G), |
| 39 | PLATFORM_NAME(I945GM), |
| 40 | PLATFORM_NAME(G33), |
| 41 | PLATFORM_NAME(PINEVIEW), |
Jani Nikula | c0f8683 | 2016-12-07 12:13:04 +0200 | [diff] [blame] | 42 | PLATFORM_NAME(I965G), |
| 43 | PLATFORM_NAME(I965GM), |
Jani Nikula | f69c11a | 2016-11-30 17:43:05 +0200 | [diff] [blame] | 44 | PLATFORM_NAME(G45), |
| 45 | PLATFORM_NAME(GM45), |
Jani Nikula | 2e0d26f | 2016-12-01 14:49:55 +0200 | [diff] [blame] | 46 | PLATFORM_NAME(IRONLAKE), |
| 47 | PLATFORM_NAME(SANDYBRIDGE), |
| 48 | PLATFORM_NAME(IVYBRIDGE), |
| 49 | PLATFORM_NAME(VALLEYVIEW), |
| 50 | PLATFORM_NAME(HASWELL), |
| 51 | PLATFORM_NAME(BROADWELL), |
| 52 | PLATFORM_NAME(CHERRYVIEW), |
| 53 | PLATFORM_NAME(SKYLAKE), |
| 54 | PLATFORM_NAME(BROXTON), |
| 55 | PLATFORM_NAME(KABYLAKE), |
| 56 | PLATFORM_NAME(GEMINILAKE), |
Rodrigo Vivi | 71851fa | 2017-06-08 08:49:58 -0700 | [diff] [blame] | 57 | PLATFORM_NAME(COFFEELAKE), |
Rodrigo Vivi | 413f3c1 | 2017-06-06 13:30:30 -0700 | [diff] [blame] | 58 | PLATFORM_NAME(CANNONLAKE), |
Rodrigo Vivi | 41231001 | 2018-01-11 16:00:04 -0200 | [diff] [blame] | 59 | PLATFORM_NAME(ICELAKE), |
Jani Nikula | 2e0d26f | 2016-12-01 14:49:55 +0200 | [diff] [blame] | 60 | }; |
| 61 | #undef PLATFORM_NAME |
| 62 | |
| 63 | const char *intel_platform_name(enum intel_platform platform) |
| 64 | { |
Jani Nikula | 9160095 | 2017-02-28 13:11:43 +0200 | [diff] [blame] | 65 | BUILD_BUG_ON(ARRAY_SIZE(platform_names) != INTEL_MAX_PLATFORMS); |
| 66 | |
Jani Nikula | 2e0d26f | 2016-12-01 14:49:55 +0200 | [diff] [blame] | 67 | if (WARN_ON_ONCE(platform >= ARRAY_SIZE(platform_names) || |
| 68 | platform_names[platform] == NULL)) |
| 69 | return "<unknown>"; |
| 70 | |
| 71 | return platform_names[platform]; |
| 72 | } |
| 73 | |
Michal Wajdeczko | a8c9b84 | 2017-12-19 11:43:44 +0000 | [diff] [blame] | 74 | void intel_device_info_dump_flags(const struct intel_device_info *info, |
| 75 | struct drm_printer *p) |
| 76 | { |
| 77 | #define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, yesno(info->name)); |
| 78 | DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG); |
| 79 | #undef PRINT_FLAG |
| 80 | } |
| 81 | |
Michal Wajdeczko | 5fbbe8d | 2017-12-21 21:57:34 +0000 | [diff] [blame] | 82 | static void sseu_dump(const struct sseu_dev_info *sseu, struct drm_printer *p) |
| 83 | { |
| 84 | drm_printf(p, "slice mask: %04x\n", sseu->slice_mask); |
| 85 | drm_printf(p, "slice total: %u\n", hweight8(sseu->slice_mask)); |
| 86 | drm_printf(p, "subslice total: %u\n", sseu_subslice_total(sseu)); |
| 87 | drm_printf(p, "subslice mask %04x\n", sseu->subslice_mask); |
| 88 | drm_printf(p, "subslice per slice: %u\n", |
| 89 | hweight8(sseu->subslice_mask)); |
| 90 | drm_printf(p, "EU total: %u\n", sseu->eu_total); |
| 91 | drm_printf(p, "EU per subslice: %u\n", sseu->eu_per_subslice); |
| 92 | drm_printf(p, "has slice power gating: %s\n", |
| 93 | yesno(sseu->has_slice_pg)); |
| 94 | drm_printf(p, "has subslice power gating: %s\n", |
| 95 | yesno(sseu->has_subslice_pg)); |
| 96 | drm_printf(p, "has EU power gating: %s\n", yesno(sseu->has_eu_pg)); |
| 97 | } |
| 98 | |
| 99 | void intel_device_info_dump_runtime(const struct intel_device_info *info, |
| 100 | struct drm_printer *p) |
| 101 | { |
| 102 | sseu_dump(&info->sseu, p); |
| 103 | |
| 104 | drm_printf(p, "CS timestamp frequency: %u kHz\n", |
| 105 | info->cs_timestamp_frequency_khz); |
| 106 | } |
| 107 | |
Michal Wajdeczko | eb10ed9 | 2017-12-19 11:43:45 +0000 | [diff] [blame] | 108 | void intel_device_info_dump(const struct intel_device_info *info, |
| 109 | struct drm_printer *p) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 110 | { |
Michal Wajdeczko | eb10ed9 | 2017-12-19 11:43:45 +0000 | [diff] [blame] | 111 | struct drm_i915_private *dev_priv = |
| 112 | container_of(info, struct drm_i915_private, info); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 113 | |
Michal Wajdeczko | eb10ed9 | 2017-12-19 11:43:45 +0000 | [diff] [blame] | 114 | drm_printf(p, "pciid=0x%04x rev=0x%02x platform=%s gen=%i\n", |
| 115 | INTEL_DEVID(dev_priv), |
| 116 | INTEL_REVID(dev_priv), |
| 117 | intel_platform_name(info->platform), |
| 118 | info->gen); |
Michal Wajdeczko | a8c9b84 | 2017-12-19 11:43:44 +0000 | [diff] [blame] | 119 | |
Michal Wajdeczko | eb10ed9 | 2017-12-19 11:43:45 +0000 | [diff] [blame] | 120 | intel_device_info_dump_flags(info, p); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 121 | } |
| 122 | |
Ben Widawsky | 4e9767b | 2017-09-20 11:35:24 -0700 | [diff] [blame] | 123 | static void gen10_sseu_info_init(struct drm_i915_private *dev_priv) |
| 124 | { |
| 125 | struct sseu_dev_info *sseu = &mkwrite_device_info(dev_priv)->sseu; |
| 126 | const u32 fuse2 = I915_READ(GEN8_FUSE2); |
| 127 | |
| 128 | sseu->slice_mask = (fuse2 & GEN10_F2_S_ENA_MASK) >> |
| 129 | GEN10_F2_S_ENA_SHIFT; |
| 130 | sseu->subslice_mask = (1 << 4) - 1; |
| 131 | sseu->subslice_mask &= ~((fuse2 & GEN10_F2_SS_DIS_MASK) >> |
| 132 | GEN10_F2_SS_DIS_SHIFT); |
| 133 | |
| 134 | sseu->eu_total = hweight32(~I915_READ(GEN8_EU_DISABLE0)); |
| 135 | sseu->eu_total += hweight32(~I915_READ(GEN8_EU_DISABLE1)); |
| 136 | sseu->eu_total += hweight32(~I915_READ(GEN8_EU_DISABLE2)); |
| 137 | sseu->eu_total += hweight8(~(I915_READ(GEN10_EU_DISABLE3) & |
| 138 | GEN10_EU_DIS_SS_MASK)); |
| 139 | |
| 140 | /* |
| 141 | * CNL is expected to always have a uniform distribution |
| 142 | * of EU across subslices with the exception that any one |
| 143 | * EU in any one subslice may be fused off for die |
| 144 | * recovery. |
| 145 | */ |
| 146 | sseu->eu_per_subslice = sseu_subslice_total(sseu) ? |
| 147 | DIV_ROUND_UP(sseu->eu_total, |
| 148 | sseu_subslice_total(sseu)) : 0; |
| 149 | |
| 150 | /* No restrictions on Power Gating */ |
| 151 | sseu->has_slice_pg = 1; |
| 152 | sseu->has_subslice_pg = 1; |
| 153 | sseu->has_eu_pg = 1; |
| 154 | } |
| 155 | |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 156 | static void cherryview_sseu_info_init(struct drm_i915_private *dev_priv) |
| 157 | { |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 158 | struct sseu_dev_info *sseu = &mkwrite_device_info(dev_priv)->sseu; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 159 | u32 fuse, eu_dis; |
| 160 | |
| 161 | fuse = I915_READ(CHV_FUSE_GT); |
| 162 | |
Imre Deak | f08a0c9 | 2016-08-31 19:13:04 +0300 | [diff] [blame] | 163 | sseu->slice_mask = BIT(0); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 164 | |
| 165 | if (!(fuse & CHV_FGT_DISABLE_SS0)) { |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 166 | sseu->subslice_mask |= BIT(0); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 167 | eu_dis = fuse & (CHV_FGT_EU_DIS_SS0_R0_MASK | |
| 168 | CHV_FGT_EU_DIS_SS0_R1_MASK); |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 169 | sseu->eu_total += 8 - hweight32(eu_dis); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | if (!(fuse & CHV_FGT_DISABLE_SS1)) { |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 173 | sseu->subslice_mask |= BIT(1); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 174 | eu_dis = fuse & (CHV_FGT_EU_DIS_SS1_R0_MASK | |
| 175 | CHV_FGT_EU_DIS_SS1_R1_MASK); |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 176 | sseu->eu_total += 8 - hweight32(eu_dis); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 177 | } |
| 178 | |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 179 | /* |
| 180 | * CHV expected to always have a uniform distribution of EU |
| 181 | * across subslices. |
| 182 | */ |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 183 | sseu->eu_per_subslice = sseu_subslice_total(sseu) ? |
| 184 | sseu->eu_total / sseu_subslice_total(sseu) : |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 185 | 0; |
| 186 | /* |
| 187 | * CHV supports subslice power gating on devices with more than |
| 188 | * one subslice, and supports EU power gating on devices with |
| 189 | * more than one EU pair per subslice. |
| 190 | */ |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 191 | sseu->has_slice_pg = 0; |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 192 | sseu->has_subslice_pg = sseu_subslice_total(sseu) > 1; |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 193 | sseu->has_eu_pg = (sseu->eu_per_subslice > 2); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | static void gen9_sseu_info_init(struct drm_i915_private *dev_priv) |
| 197 | { |
| 198 | struct intel_device_info *info = mkwrite_device_info(dev_priv); |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 199 | struct sseu_dev_info *sseu = &info->sseu; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 200 | int s_max = 3, ss_max = 4, eu_max = 8; |
| 201 | int s, ss; |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 202 | u32 fuse2, eu_disable; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 203 | u8 eu_mask = 0xff; |
| 204 | |
| 205 | fuse2 = I915_READ(GEN8_FUSE2); |
Imre Deak | f08a0c9 | 2016-08-31 19:13:04 +0300 | [diff] [blame] | 206 | sseu->slice_mask = (fuse2 & GEN8_F2_S_ENA_MASK) >> GEN8_F2_S_ENA_SHIFT; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 207 | |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 208 | /* |
| 209 | * The subslice disable field is global, i.e. it applies |
| 210 | * to each of the enabled slices. |
| 211 | */ |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 212 | sseu->subslice_mask = (1 << ss_max) - 1; |
| 213 | sseu->subslice_mask &= ~((fuse2 & GEN9_F2_SS_DIS_MASK) >> |
| 214 | GEN9_F2_SS_DIS_SHIFT); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 215 | |
| 216 | /* |
| 217 | * Iterate through enabled slices and subslices to |
| 218 | * count the total enabled EU. |
| 219 | */ |
| 220 | for (s = 0; s < s_max; s++) { |
Imre Deak | f08a0c9 | 2016-08-31 19:13:04 +0300 | [diff] [blame] | 221 | if (!(sseu->slice_mask & BIT(s))) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 222 | /* skip disabled slice */ |
| 223 | continue; |
| 224 | |
| 225 | eu_disable = I915_READ(GEN9_EU_DISABLE(s)); |
| 226 | for (ss = 0; ss < ss_max; ss++) { |
| 227 | int eu_per_ss; |
| 228 | |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 229 | if (!(sseu->subslice_mask & BIT(ss))) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 230 | /* skip disabled subslice */ |
| 231 | continue; |
| 232 | |
| 233 | eu_per_ss = eu_max - hweight8((eu_disable >> (ss*8)) & |
| 234 | eu_mask); |
| 235 | |
| 236 | /* |
| 237 | * Record which subslice(s) has(have) 7 EUs. we |
| 238 | * can tune the hash used to spread work among |
| 239 | * subslices if they are unbalanced. |
| 240 | */ |
| 241 | if (eu_per_ss == 7) |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 242 | sseu->subslice_7eu[s] |= BIT(ss); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 243 | |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 244 | sseu->eu_total += eu_per_ss; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 245 | } |
| 246 | } |
| 247 | |
| 248 | /* |
| 249 | * SKL is expected to always have a uniform distribution |
| 250 | * of EU across subslices with the exception that any one |
| 251 | * EU in any one subslice may be fused off for die |
| 252 | * recovery. BXT is expected to be perfectly uniform in EU |
| 253 | * distribution. |
| 254 | */ |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 255 | sseu->eu_per_subslice = sseu_subslice_total(sseu) ? |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 256 | DIV_ROUND_UP(sseu->eu_total, |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 257 | sseu_subslice_total(sseu)) : 0; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 258 | /* |
Rodrigo Vivi | c7ae7e9 | 2017-06-06 13:30:36 -0700 | [diff] [blame] | 259 | * SKL+ supports slice power gating on devices with more than |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 260 | * one slice, and supports EU power gating on devices with |
Rodrigo Vivi | c7ae7e9 | 2017-06-06 13:30:36 -0700 | [diff] [blame] | 261 | * more than one EU pair per subslice. BXT+ supports subslice |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 262 | * power gating on devices with more than one subslice, and |
| 263 | * supports EU power gating on devices with more than one EU |
| 264 | * pair per subslice. |
| 265 | */ |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 266 | sseu->has_slice_pg = |
Rodrigo Vivi | c7ae7e9 | 2017-06-06 13:30:36 -0700 | [diff] [blame] | 267 | !IS_GEN9_LP(dev_priv) && hweight8(sseu->slice_mask) > 1; |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 268 | sseu->has_subslice_pg = |
Michel Thierry | 254e093 | 2017-01-09 16:51:35 +0200 | [diff] [blame] | 269 | IS_GEN9_LP(dev_priv) && sseu_subslice_total(sseu) > 1; |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 270 | sseu->has_eu_pg = sseu->eu_per_subslice > 2; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 271 | |
Ander Conselvan de Oliveira | 234516a | 2017-03-17 16:04:36 +0200 | [diff] [blame] | 272 | if (IS_GEN9_LP(dev_priv)) { |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 273 | #define IS_SS_DISABLED(ss) (!(sseu->subslice_mask & BIT(ss))) |
Ander Conselvan de Oliveira | 234516a | 2017-03-17 16:04:36 +0200 | [diff] [blame] | 274 | info->has_pooled_eu = hweight8(sseu->subslice_mask) == 3; |
| 275 | |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 276 | sseu->min_eu_in_pool = 0; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 277 | if (info->has_pooled_eu) { |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 278 | if (IS_SS_DISABLED(2) || IS_SS_DISABLED(0)) |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 279 | sseu->min_eu_in_pool = 3; |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 280 | else if (IS_SS_DISABLED(1)) |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 281 | sseu->min_eu_in_pool = 6; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 282 | else |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 283 | sseu->min_eu_in_pool = 9; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 284 | } |
| 285 | #undef IS_SS_DISABLED |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | static void broadwell_sseu_info_init(struct drm_i915_private *dev_priv) |
| 290 | { |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 291 | struct sseu_dev_info *sseu = &mkwrite_device_info(dev_priv)->sseu; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 292 | const int s_max = 3, ss_max = 3, eu_max = 8; |
| 293 | int s, ss; |
Jani Nikula | ff64aa1 | 2016-10-04 12:54:12 +0300 | [diff] [blame] | 294 | u32 fuse2, eu_disable[3]; /* s_max */ |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 295 | |
| 296 | fuse2 = I915_READ(GEN8_FUSE2); |
Imre Deak | f08a0c9 | 2016-08-31 19:13:04 +0300 | [diff] [blame] | 297 | sseu->slice_mask = (fuse2 & GEN8_F2_S_ENA_MASK) >> GEN8_F2_S_ENA_SHIFT; |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 298 | /* |
| 299 | * The subslice disable field is global, i.e. it applies |
| 300 | * to each of the enabled slices. |
| 301 | */ |
Joonas Lahtinen | 3c779a4 | 2017-02-08 15:12:09 +0200 | [diff] [blame] | 302 | sseu->subslice_mask = GENMASK(ss_max - 1, 0); |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 303 | sseu->subslice_mask &= ~((fuse2 & GEN8_F2_SS_DIS_MASK) >> |
| 304 | GEN8_F2_SS_DIS_SHIFT); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 305 | |
| 306 | eu_disable[0] = I915_READ(GEN8_EU_DISABLE0) & GEN8_EU_DIS0_S0_MASK; |
| 307 | eu_disable[1] = (I915_READ(GEN8_EU_DISABLE0) >> GEN8_EU_DIS0_S1_SHIFT) | |
| 308 | ((I915_READ(GEN8_EU_DISABLE1) & GEN8_EU_DIS1_S1_MASK) << |
| 309 | (32 - GEN8_EU_DIS0_S1_SHIFT)); |
| 310 | eu_disable[2] = (I915_READ(GEN8_EU_DISABLE1) >> GEN8_EU_DIS1_S2_SHIFT) | |
| 311 | ((I915_READ(GEN8_EU_DISABLE2) & GEN8_EU_DIS2_S2_MASK) << |
| 312 | (32 - GEN8_EU_DIS1_S2_SHIFT)); |
| 313 | |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 314 | /* |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 315 | * Iterate through enabled slices and subslices to |
| 316 | * count the total enabled EU. |
| 317 | */ |
| 318 | for (s = 0; s < s_max; s++) { |
Imre Deak | f08a0c9 | 2016-08-31 19:13:04 +0300 | [diff] [blame] | 319 | if (!(sseu->slice_mask & BIT(s))) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 320 | /* skip disabled slice */ |
| 321 | continue; |
| 322 | |
| 323 | for (ss = 0; ss < ss_max; ss++) { |
| 324 | u32 n_disabled; |
| 325 | |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 326 | if (!(sseu->subslice_mask & BIT(ss))) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 327 | /* skip disabled subslice */ |
| 328 | continue; |
| 329 | |
| 330 | n_disabled = hweight8(eu_disable[s] >> (ss * eu_max)); |
| 331 | |
| 332 | /* |
| 333 | * Record which subslices have 7 EUs. |
| 334 | */ |
| 335 | if (eu_max - n_disabled == 7) |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 336 | sseu->subslice_7eu[s] |= 1 << ss; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 337 | |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 338 | sseu->eu_total += eu_max - n_disabled; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 339 | } |
| 340 | } |
| 341 | |
| 342 | /* |
| 343 | * BDW is expected to always have a uniform distribution of EU across |
| 344 | * subslices with the exception that any one EU in any one subslice may |
| 345 | * be fused off for die recovery. |
| 346 | */ |
Imre Deak | 57ec171 | 2016-08-31 19:13:05 +0300 | [diff] [blame] | 347 | sseu->eu_per_subslice = sseu_subslice_total(sseu) ? |
| 348 | DIV_ROUND_UP(sseu->eu_total, |
| 349 | sseu_subslice_total(sseu)) : 0; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 350 | |
| 351 | /* |
| 352 | * BDW supports slice power gating on devices with more than |
| 353 | * one slice. |
| 354 | */ |
Imre Deak | f08a0c9 | 2016-08-31 19:13:04 +0300 | [diff] [blame] | 355 | sseu->has_slice_pg = hweight8(sseu->slice_mask) > 1; |
Imre Deak | 43b6799 | 2016-08-31 19:13:02 +0300 | [diff] [blame] | 356 | sseu->has_subslice_pg = 0; |
| 357 | sseu->has_eu_pg = 0; |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 358 | } |
| 359 | |
Lionel Landwerlin | b8ec759 | 2018-02-21 20:49:02 +0000 | [diff] [blame^] | 360 | static void haswell_sseu_info_init(struct drm_i915_private *dev_priv) |
| 361 | { |
| 362 | struct intel_device_info *info = mkwrite_device_info(dev_priv); |
| 363 | struct sseu_dev_info *sseu = &info->sseu; |
| 364 | u32 fuse1; |
| 365 | |
| 366 | /* |
| 367 | * There isn't a register to tell us how many slices/subslices. We |
| 368 | * work off the PCI-ids here. |
| 369 | */ |
| 370 | switch (info->gt) { |
| 371 | default: |
| 372 | MISSING_CASE(info->gt); |
| 373 | /* fall through */ |
| 374 | case 1: |
| 375 | sseu->slice_mask = BIT(0); |
| 376 | sseu->subslice_mask = BIT(0); |
| 377 | break; |
| 378 | case 2: |
| 379 | sseu->slice_mask = BIT(0); |
| 380 | sseu->subslice_mask = BIT(0) | BIT(1); |
| 381 | break; |
| 382 | case 3: |
| 383 | sseu->slice_mask = BIT(0) | BIT(1); |
| 384 | sseu->subslice_mask = BIT(0) | BIT(1); |
| 385 | break; |
| 386 | } |
| 387 | |
| 388 | fuse1 = I915_READ(HSW_PAVP_FUSE1); |
| 389 | switch ((fuse1 & HSW_F1_EU_DIS_MASK) >> HSW_F1_EU_DIS_SHIFT) { |
| 390 | default: |
| 391 | MISSING_CASE((fuse1 & HSW_F1_EU_DIS_MASK) >> |
| 392 | HSW_F1_EU_DIS_SHIFT); |
| 393 | /* fall through */ |
| 394 | case HSW_F1_EU_DIS_10EUS: |
| 395 | sseu->eu_per_subslice = 10; |
| 396 | break; |
| 397 | case HSW_F1_EU_DIS_8EUS: |
| 398 | sseu->eu_per_subslice = 8; |
| 399 | break; |
| 400 | case HSW_F1_EU_DIS_6EUS: |
| 401 | sseu->eu_per_subslice = 6; |
| 402 | break; |
| 403 | } |
| 404 | |
| 405 | sseu->eu_total = sseu_subslice_total(sseu) * sseu->eu_per_subslice; |
| 406 | |
| 407 | /* No powergating for you. */ |
| 408 | sseu->has_slice_pg = 0; |
| 409 | sseu->has_subslice_pg = 0; |
| 410 | sseu->has_eu_pg = 0; |
| 411 | } |
| 412 | |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 413 | static u32 read_reference_ts_freq(struct drm_i915_private *dev_priv) |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 414 | { |
| 415 | u32 ts_override = I915_READ(GEN9_TIMESTAMP_OVERRIDE); |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 416 | u32 base_freq, frac_freq; |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 417 | |
| 418 | base_freq = ((ts_override & GEN9_TIMESTAMP_OVERRIDE_US_COUNTER_DIVIDER_MASK) >> |
| 419 | GEN9_TIMESTAMP_OVERRIDE_US_COUNTER_DIVIDER_SHIFT) + 1; |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 420 | base_freq *= 1000; |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 421 | |
| 422 | frac_freq = ((ts_override & |
| 423 | GEN9_TIMESTAMP_OVERRIDE_US_COUNTER_DENOMINATOR_MASK) >> |
| 424 | GEN9_TIMESTAMP_OVERRIDE_US_COUNTER_DENOMINATOR_SHIFT); |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 425 | frac_freq = 1000 / (frac_freq + 1); |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 426 | |
| 427 | return base_freq + frac_freq; |
| 428 | } |
| 429 | |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 430 | static u32 read_timestamp_frequency(struct drm_i915_private *dev_priv) |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 431 | { |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 432 | u32 f12_5_mhz = 12500; |
| 433 | u32 f19_2_mhz = 19200; |
| 434 | u32 f24_mhz = 24000; |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 435 | |
| 436 | if (INTEL_GEN(dev_priv) <= 4) { |
| 437 | /* PRMs say: |
| 438 | * |
| 439 | * "The value in this register increments once every 16 |
| 440 | * hclks." (through the “Clocking Configuration” |
| 441 | * (“CLKCFG”) MCHBAR register) |
| 442 | */ |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 443 | return dev_priv->rawclk_freq / 16; |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 444 | } else if (INTEL_GEN(dev_priv) <= 8) { |
| 445 | /* PRMs say: |
| 446 | * |
| 447 | * "The PCU TSC counts 10ns increments; this timestamp |
| 448 | * reflects bits 38:3 of the TSC (i.e. 80ns granularity, |
| 449 | * rolling over every 1.5 hours). |
| 450 | */ |
| 451 | return f12_5_mhz; |
| 452 | } else if (INTEL_GEN(dev_priv) <= 9) { |
| 453 | u32 ctc_reg = I915_READ(CTC_MODE); |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 454 | u32 freq = 0; |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 455 | |
| 456 | if ((ctc_reg & CTC_SOURCE_PARAMETER_MASK) == CTC_SOURCE_DIVIDE_LOGIC) { |
| 457 | freq = read_reference_ts_freq(dev_priv); |
| 458 | } else { |
| 459 | freq = IS_GEN9_LP(dev_priv) ? f19_2_mhz : f24_mhz; |
| 460 | |
| 461 | /* Now figure out how the command stream's timestamp |
| 462 | * register increments from this frequency (it might |
| 463 | * increment only every few clock cycle). |
| 464 | */ |
| 465 | freq >>= 3 - ((ctc_reg & CTC_SHIFT_PARAMETER_MASK) >> |
| 466 | CTC_SHIFT_PARAMETER_SHIFT); |
| 467 | } |
| 468 | |
| 469 | return freq; |
| 470 | } else if (INTEL_GEN(dev_priv) <= 10) { |
| 471 | u32 ctc_reg = I915_READ(CTC_MODE); |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 472 | u32 freq = 0; |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 473 | u32 rpm_config_reg = 0; |
| 474 | |
| 475 | /* First figure out the reference frequency. There are 2 ways |
| 476 | * we can compute the frequency, either through the |
| 477 | * TIMESTAMP_OVERRIDE register or through RPM_CONFIG. CTC_MODE |
| 478 | * tells us which one we should use. |
| 479 | */ |
| 480 | if ((ctc_reg & CTC_SOURCE_PARAMETER_MASK) == CTC_SOURCE_DIVIDE_LOGIC) { |
| 481 | freq = read_reference_ts_freq(dev_priv); |
| 482 | } else { |
| 483 | u32 crystal_clock; |
| 484 | |
| 485 | rpm_config_reg = I915_READ(RPM_CONFIG0); |
| 486 | crystal_clock = (rpm_config_reg & |
| 487 | GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_MASK) >> |
| 488 | GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT; |
| 489 | switch (crystal_clock) { |
| 490 | case GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_19_2_MHZ: |
| 491 | freq = f19_2_mhz; |
| 492 | break; |
| 493 | case GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_24_MHZ: |
| 494 | freq = f24_mhz; |
| 495 | break; |
| 496 | } |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 497 | |
Lionel Landwerlin | 53ff264 | 2017-11-13 23:34:55 +0000 | [diff] [blame] | 498 | /* Now figure out how the command stream's timestamp |
| 499 | * register increments from this frequency (it might |
| 500 | * increment only every few clock cycle). |
| 501 | */ |
| 502 | freq >>= 3 - ((rpm_config_reg & |
| 503 | GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK) >> |
| 504 | GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT); |
| 505 | } |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 506 | |
| 507 | return freq; |
| 508 | } |
| 509 | |
Lionel Landwerlin | fe66e92 | 2017-12-13 17:11:54 +0000 | [diff] [blame] | 510 | MISSING_CASE("Unknown gen, unable to read command streamer timestamp frequency\n"); |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 511 | return 0; |
| 512 | } |
| 513 | |
Michal Wajdeczko | 6a7e51f | 2017-12-21 21:57:33 +0000 | [diff] [blame] | 514 | /** |
| 515 | * intel_device_info_runtime_init - initialize runtime info |
| 516 | * @info: intel device info struct |
| 517 | * |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 518 | * Determine various intel_device_info fields at runtime. |
| 519 | * |
| 520 | * Use it when either: |
| 521 | * - it's judged too laborious to fill n static structures with the limit |
| 522 | * when a simple if statement does the job, |
| 523 | * - run-time checks (eg read fuse/strap registers) are needed. |
| 524 | * |
| 525 | * This function needs to be called: |
| 526 | * - after the MMIO has been setup as we are reading registers, |
| 527 | * - after the PCH has been detected, |
| 528 | * - before the first usage of the fields it can tweak. |
| 529 | */ |
Michal Wajdeczko | 6a7e51f | 2017-12-21 21:57:33 +0000 | [diff] [blame] | 530 | void intel_device_info_runtime_init(struct intel_device_info *info) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 531 | { |
Michal Wajdeczko | 6a7e51f | 2017-12-21 21:57:33 +0000 | [diff] [blame] | 532 | struct drm_i915_private *dev_priv = |
| 533 | container_of(info, struct drm_i915_private, info); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 534 | enum pipe pipe; |
| 535 | |
Mika Kahola | 6e7406d | 2017-11-01 12:08:50 +0200 | [diff] [blame] | 536 | if (INTEL_GEN(dev_priv) >= 10) { |
| 537 | for_each_pipe(dev_priv, pipe) |
| 538 | info->num_scalers[pipe] = 2; |
| 539 | } else if (INTEL_GEN(dev_priv) == 9) { |
Ander Conselvan de Oliveira | 0bf0230 | 2017-01-02 15:54:41 +0200 | [diff] [blame] | 540 | info->num_scalers[PIPE_A] = 2; |
| 541 | info->num_scalers[PIPE_B] = 2; |
| 542 | info->num_scalers[PIPE_C] = 1; |
| 543 | } |
| 544 | |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 545 | /* |
| 546 | * Skylake and Broxton currently don't expose the topmost plane as its |
| 547 | * use is exclusive with the legacy cursor and we only want to expose |
| 548 | * one of those, not both. Until we can safely expose the topmost plane |
| 549 | * as a DRM_PLANE_TYPE_CURSOR with all the features exposed/supported, |
| 550 | * we don't expose the topmost plane at all to prevent ABI breakage |
| 551 | * down the line. |
| 552 | */ |
James Irwin | 8366be9 | 2017-06-06 13:30:35 -0700 | [diff] [blame] | 553 | if (IS_GEN10(dev_priv) || IS_GEMINILAKE(dev_priv)) |
Ander Conselvan de Oliveira | e9c9882 | 2016-12-02 10:23:57 +0200 | [diff] [blame] | 554 | for_each_pipe(dev_priv, pipe) |
| 555 | info->num_sprites[pipe] = 3; |
| 556 | else if (IS_BROXTON(dev_priv)) { |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 557 | info->num_sprites[PIPE_A] = 2; |
| 558 | info->num_sprites[PIPE_B] = 2; |
| 559 | info->num_sprites[PIPE_C] = 1; |
Ville Syrjälä | 33edc24 | 2016-10-25 18:58:00 +0300 | [diff] [blame] | 560 | } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 561 | for_each_pipe(dev_priv, pipe) |
| 562 | info->num_sprites[pipe] = 2; |
Ville Syrjälä | ab33081 | 2017-04-21 21:14:32 +0300 | [diff] [blame] | 563 | } else if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) { |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 564 | for_each_pipe(dev_priv, pipe) |
| 565 | info->num_sprites[pipe] = 1; |
Ville Syrjälä | 33edc24 | 2016-10-25 18:58:00 +0300 | [diff] [blame] | 566 | } |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 567 | |
Michal Wajdeczko | 4f044a8 | 2017-09-19 19:38:44 +0000 | [diff] [blame] | 568 | if (i915_modparams.disable_display) { |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 569 | DRM_INFO("Display disabled (module parameter)\n"); |
| 570 | info->num_pipes = 0; |
| 571 | } else if (info->num_pipes > 0 && |
| 572 | (IS_GEN7(dev_priv) || IS_GEN8(dev_priv)) && |
| 573 | HAS_PCH_SPLIT(dev_priv)) { |
| 574 | u32 fuse_strap = I915_READ(FUSE_STRAP); |
| 575 | u32 sfuse_strap = I915_READ(SFUSE_STRAP); |
| 576 | |
| 577 | /* |
| 578 | * SFUSE_STRAP is supposed to have a bit signalling the display |
| 579 | * is fused off. Unfortunately it seems that, at least in |
| 580 | * certain cases, fused off display means that PCH display |
| 581 | * reads don't land anywhere. In that case, we read 0s. |
| 582 | * |
| 583 | * On CPT/PPT, we can detect this case as SFUSE_STRAP_FUSE_LOCK |
| 584 | * should be set when taking over after the firmware. |
| 585 | */ |
| 586 | if (fuse_strap & ILK_INTERNAL_DISPLAY_DISABLE || |
| 587 | sfuse_strap & SFUSE_STRAP_DISPLAY_DISABLED || |
Ville Syrjälä | b9eb89b | 2017-06-20 16:03:06 +0300 | [diff] [blame] | 588 | (HAS_PCH_CPT(dev_priv) && |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 589 | !(sfuse_strap & SFUSE_STRAP_FUSE_LOCK))) { |
| 590 | DRM_INFO("Display fused off, disabling\n"); |
| 591 | info->num_pipes = 0; |
| 592 | } else if (fuse_strap & IVB_PIPE_C_DISABLE) { |
| 593 | DRM_INFO("PipeC fused off\n"); |
| 594 | info->num_pipes -= 1; |
| 595 | } |
| 596 | } else if (info->num_pipes > 0 && IS_GEN9(dev_priv)) { |
| 597 | u32 dfsm = I915_READ(SKL_DFSM); |
| 598 | u8 disabled_mask = 0; |
| 599 | bool invalid; |
| 600 | int num_bits; |
| 601 | |
| 602 | if (dfsm & SKL_DFSM_PIPE_A_DISABLE) |
| 603 | disabled_mask |= BIT(PIPE_A); |
| 604 | if (dfsm & SKL_DFSM_PIPE_B_DISABLE) |
| 605 | disabled_mask |= BIT(PIPE_B); |
| 606 | if (dfsm & SKL_DFSM_PIPE_C_DISABLE) |
| 607 | disabled_mask |= BIT(PIPE_C); |
| 608 | |
| 609 | num_bits = hweight8(disabled_mask); |
| 610 | |
| 611 | switch (disabled_mask) { |
| 612 | case BIT(PIPE_A): |
| 613 | case BIT(PIPE_B): |
| 614 | case BIT(PIPE_A) | BIT(PIPE_B): |
| 615 | case BIT(PIPE_A) | BIT(PIPE_C): |
| 616 | invalid = true; |
| 617 | break; |
| 618 | default: |
| 619 | invalid = false; |
| 620 | } |
| 621 | |
| 622 | if (num_bits > info->num_pipes || invalid) |
| 623 | DRM_ERROR("invalid pipe fuse configuration: 0x%x\n", |
| 624 | disabled_mask); |
| 625 | else |
| 626 | info->num_pipes -= num_bits; |
| 627 | } |
| 628 | |
| 629 | /* Initialize slice/subslice/EU info */ |
Lionel Landwerlin | b8ec759 | 2018-02-21 20:49:02 +0000 | [diff] [blame^] | 630 | if (IS_HASWELL(dev_priv)) |
| 631 | haswell_sseu_info_init(dev_priv); |
| 632 | else if (IS_CHERRYVIEW(dev_priv)) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 633 | cherryview_sseu_info_init(dev_priv); |
| 634 | else if (IS_BROADWELL(dev_priv)) |
| 635 | broadwell_sseu_info_init(dev_priv); |
Ben Widawsky | 4e9767b | 2017-09-20 11:35:24 -0700 | [diff] [blame] | 636 | else if (INTEL_GEN(dev_priv) == 9) |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 637 | gen9_sseu_info_init(dev_priv); |
Ben Widawsky | 4e9767b | 2017-09-20 11:35:24 -0700 | [diff] [blame] | 638 | else if (INTEL_GEN(dev_priv) >= 10) |
| 639 | gen10_sseu_info_init(dev_priv); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 640 | |
Lionel Landwerlin | dab9178 | 2017-11-10 19:08:44 +0000 | [diff] [blame] | 641 | /* Initialize command stream timestamp frequency */ |
Lionel Landwerlin | f577a03 | 2017-11-13 23:34:53 +0000 | [diff] [blame] | 642 | info->cs_timestamp_frequency_khz = read_timestamp_frequency(dev_priv); |
Chris Wilson | 94b4f3b | 2016-07-05 10:40:20 +0100 | [diff] [blame] | 643 | } |
Chris Wilson | 3fed180 | 2018-02-07 21:05:43 +0000 | [diff] [blame] | 644 | |
| 645 | void intel_driver_caps_print(const struct intel_driver_caps *caps, |
| 646 | struct drm_printer *p) |
| 647 | { |
| 648 | drm_printf(p, "scheduler: %x\n", caps->scheduler); |
| 649 | } |