Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-intel-next-2021-08-10-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

drm/i915 changes for v5.15:

Features:
- Basic DG2 platform enabling (Matt, Animesh, Gwan-gyeong, José)
- Add PSF GV point support for display bandwidth calculation (Stan)
- Add platform release id version support (Lucas)
- Add support for forcing DSC BPP for testing (Vandita, Patnana)

Refactoring and cleanups:
- Remove CNL support completely (Lucas)
- Revid/stepping cleanup (Matt, Anusha)
- Make display stepping check upper bounds exclusive (Matt)
- Remove old GEN macros (Lucas)
- Refactor DG1 interrupt handler (Paulo)
- Refactor DMC stepping info (Anusha)

Fixes:
- Fix XELPD color capability reporting; it's not yet enabled (Uma)
- Fix DG1 memory bandwidth computation (Clint)
- Fix mux on certain HP laptops (Kai-Heng)
- Various display workarounds (José, Matt, Imre)
- Fix error state dumps wrt SFC_DONE (Matt)
- Fix DG1 and XEPLD audio power domains (Anshuman)
- Fix ADL-P and ADL-S ddi buf translation tables (Matt)
- Fix DP/HDMI modeset sequences causing issues on ADL-P (José)
- PSR2 fixes (José)
- Fix DP MST modeset with FEC on TGL+
- Fix MBUS DBOX A credits on ADL-P (José)
- Fix DP PHY test training set programming (Khaled)
- Fix dgfx pcode uncore init done wait (Badal)
- Fix DSC disable fuse check on GLK (Lucas)
- Fix shared dpll mismatch for bigjoiner secondary pipe (Manasi)
- Fix ADL-P underrun recovery (Matt)
- Fix permissions on FEC support debugfs file (Vandita)

Misc:
- Backmerge drm-next (Rodrigo)
- Bump RKL and TGL DMC firmware version (Anusha)

Signed-off-by: Dave Airlie <airlied@redhat.com>

# Conflicts:
# drivers/gpu/drm/i915/i915_drv.h
# drivers/gpu/drm/i915/intel_device_info.h
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87a6lpo1a9.fsf@intel.com

+3046 -2301
+1
drivers/gpu/drm/i915/Makefile
··· 269 269 display/intel_pps.o \ 270 270 display/intel_qp_tables.o \ 271 271 display/intel_sdvo.o \ 272 + display/intel_snps_phy.o \ 272 273 display/intel_tv.o \ 273 274 display/intel_vdsc.o \ 274 275 display/intel_vrr.o \
+1 -1
drivers/gpu/drm/i915/display/i9xx_plane.c
··· 912 912 zpos = 0; 913 913 drm_plane_create_zpos_immutable_property(&plane->base, zpos); 914 914 915 - drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs); 915 + intel_plane_helper_add(plane); 916 916 917 917 return plane; 918 918
+19
drivers/gpu/drm/i915/display/intel_acpi.c
··· 19 19 GUID_INIT(0x7ed873d3, 0xc2d0, 0x4e4f, 20 20 0xa8, 0x54, 0x0f, 0x13, 0x17, 0xb0, 0x1c, 0x2c); 21 21 22 + #define INTEL_DSM_FN_GET_BIOS_DATA_FUNCS_SUPPORTED 0 /* No args */ 23 + 24 + static const guid_t intel_dsm_guid2 = 25 + GUID_INIT(0x3e5b41c6, 0xeb1d, 0x4260, 26 + 0x9d, 0x15, 0xc7, 0x1f, 0xba, 0xda, 0xe4, 0x14); 27 + 22 28 static char *intel_dsm_port_name(u8 id) 23 29 { 24 30 switch (id) { ··· 180 174 181 175 void intel_unregister_dsm_handler(void) 182 176 { 177 + } 178 + 179 + void intel_dsm_get_bios_data_funcs_supported(struct drm_i915_private *i915) 180 + { 181 + struct pci_dev *pdev = to_pci_dev(i915->drm.dev); 182 + acpi_handle dhandle; 183 + 184 + dhandle = ACPI_HANDLE(&pdev->dev); 185 + if (!dhandle) 186 + return; 187 + 188 + acpi_evaluate_dsm(dhandle, &intel_dsm_guid2, INTEL_DSM_REVISION_ID, 189 + INTEL_DSM_FN_GET_BIOS_DATA_FUNCS_SUPPORTED, NULL); 183 190 } 184 191 185 192 /*
+3
drivers/gpu/drm/i915/display/intel_acpi.h
··· 11 11 #ifdef CONFIG_ACPI 12 12 void intel_register_dsm_handler(void); 13 13 void intel_unregister_dsm_handler(void); 14 + void intel_dsm_get_bios_data_funcs_supported(struct drm_i915_private *i915); 14 15 void intel_acpi_device_id_update(struct drm_i915_private *i915); 15 16 #else 16 17 static inline void intel_register_dsm_handler(void) { return; } 17 18 static inline void intel_unregister_dsm_handler(void) { return; } 19 + static inline 20 + void intel_dsm_get_bios_data_funcs_supported(struct drm_i915_private *i915) { return; } 18 21 static inline 19 22 void intel_acpi_device_id_update(struct drm_i915_private *i915) { return; } 20 23 #endif /* CONFIG_ACPI */
+6 -1
drivers/gpu/drm/i915/display/intel_atomic_plane.c
··· 601 601 return 0; 602 602 } 603 603 604 - const struct drm_plane_helper_funcs intel_plane_helper_funcs = { 604 + static const struct drm_plane_helper_funcs intel_plane_helper_funcs = { 605 605 .prepare_fb = intel_prepare_plane_fb, 606 606 .cleanup_fb = intel_cleanup_plane_fb, 607 607 }; 608 + 609 + void intel_plane_helper_add(struct intel_plane *plane) 610 + { 611 + drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs); 612 + }
+1 -2
drivers/gpu/drm/i915/display/intel_atomic_plane.h
··· 17 17 struct intel_plane; 18 18 struct intel_plane_state; 19 19 20 - extern const struct drm_plane_helper_funcs intel_plane_helper_funcs; 21 - 22 20 unsigned int intel_adjusted_rate(const struct drm_rect *src, 23 21 const struct drm_rect *dst, 24 22 unsigned int rate); ··· 63 65 bool can_position); 64 66 void intel_plane_set_invisible(struct intel_crtc_state *crtc_state, 65 67 struct intel_plane_state *plane_state); 68 + void intel_plane_helper_add(struct intel_plane *plane); 66 69 67 70 #endif /* __INTEL_ATOMIC_PLANE_H__ */
+2 -2
drivers/gpu/drm/i915/display/intel_audio.c
··· 1001 1001 /* Catch potential impedance mismatches before they occur! */ 1002 1002 BUILD_BUG_ON(sizeof(intel_wakeref_t) > sizeof(unsigned long)); 1003 1003 1004 - ret = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); 1004 + ret = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO_PLAYBACK); 1005 1005 1006 1006 if (dev_priv->audio_power_refcount++ == 0) { 1007 1007 if (DISPLAY_VER(dev_priv) >= 9) { ··· 1034 1034 if (IS_GEMINILAKE(dev_priv)) 1035 1035 glk_force_audio_cdclk(dev_priv, false); 1036 1036 1037 - intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie); 1037 + intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO_PLAYBACK, cookie); 1038 1038 } 1039 1039 1040 1040 static void i915_audio_component_codec_wake_override(struct device *kdev,
+6 -5
drivers/gpu/drm/i915/display/intel_bios.c
··· 1871 1871 static bool is_port_valid(struct drm_i915_private *i915, enum port port) 1872 1872 { 1873 1873 /* 1874 - * On some ICL/CNL SKUs port F is not present, but broken VBTs mark 1874 + * On some ICL SKUs port F is not present, but broken VBTs mark 1875 1875 * the port as present. Only try to initialize port F for the 1876 1876 * SKUs that may actually have it. 1877 1877 */ 1878 - if (port == PORT_F && (IS_ICELAKE(i915) || IS_CANNONLAKE(i915))) 1879 - return IS_ICL_WITH_PORT_F(i915) || IS_CNL_WITH_PORT_F(i915); 1878 + if (port == PORT_F && IS_ICELAKE(i915)) 1879 + return IS_ICL_WITH_PORT_F(i915); 1880 1880 1881 1881 return true; 1882 1882 } ··· 1998 1998 "Port %c VBT HDMI boost level: %d\n", 1999 1999 port_name(port), hdmi_boost_level); 2000 2000 2001 - /* DP max link rate for CNL+ */ 2001 + /* DP max link rate for GLK+ */ 2002 2002 if (i915->vbt.version >= 216) { 2003 2003 if (i915->vbt.version >= 230) 2004 2004 info->dp_max_link_rate = parse_bdb_230_dp_max_link_rate(child->dp_max_link_rate); ··· 2166 2166 init_vbt_missing_defaults(struct drm_i915_private *i915) 2167 2167 { 2168 2168 enum port port; 2169 - int ports = PORT_A | PORT_B | PORT_C | PORT_D | PORT_E | PORT_F; 2169 + int ports = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | 2170 + BIT(PORT_D) | BIT(PORT_E) | BIT(PORT_F); 2170 2171 2171 2172 if (!HAS_DDI(i915) && !IS_CHERRYVIEW(i915)) 2172 2173 return;
+172 -6
drivers/gpu/drm/i915/display/intel_bw.c
··· 17 17 u16 dclk, t_rp, t_rdpre, t_rc, t_ras, t_rcd; 18 18 }; 19 19 20 + struct intel_psf_gv_point { 21 + u8 clk; /* clock in multiples of 16.6666 MHz */ 22 + }; 23 + 20 24 struct intel_qgv_info { 21 25 struct intel_qgv_point points[I915_NUM_QGV_POINTS]; 26 + struct intel_psf_gv_point psf_points[I915_NUM_PSF_GV_POINTS]; 22 27 u8 num_points; 28 + u8 num_psf_points; 23 29 u8 t_bl; 24 30 }; 31 + 32 + static int dg1_mchbar_read_qgv_point_info(struct drm_i915_private *dev_priv, 33 + struct intel_qgv_point *sp, 34 + int point) 35 + { 36 + u32 dclk_ratio, dclk_reference; 37 + u32 val; 38 + 39 + val = intel_uncore_read(&dev_priv->uncore, SA_PERF_STATUS_0_0_0_MCHBAR_PC); 40 + dclk_ratio = REG_FIELD_GET(DG1_QCLK_RATIO_MASK, val); 41 + if (val & DG1_QCLK_REFERENCE) 42 + dclk_reference = 6; /* 6 * 16.666 MHz = 100 MHz */ 43 + else 44 + dclk_reference = 8; /* 8 * 16.666 MHz = 133 MHz */ 45 + sp->dclk = dclk_ratio * dclk_reference; 46 + 47 + val = intel_uncore_read(&dev_priv->uncore, SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU); 48 + if (val & DG1_GEAR_TYPE) 49 + sp->dclk *= 2; 50 + 51 + if (sp->dclk == 0) 52 + return -EINVAL; 53 + 54 + val = intel_uncore_read(&dev_priv->uncore, MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR); 55 + sp->t_rp = REG_FIELD_GET(DG1_DRAM_T_RP_MASK, val); 56 + sp->t_rdpre = REG_FIELD_GET(DG1_DRAM_T_RDPRE_MASK, val); 57 + 58 + val = intel_uncore_read(&dev_priv->uncore, MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR_HIGH); 59 + sp->t_rcd = REG_FIELD_GET(DG1_DRAM_T_RCD_MASK, val); 60 + sp->t_ras = REG_FIELD_GET(DG1_DRAM_T_RAS_MASK, val); 61 + 62 + sp->t_rc = sp->t_rp + sp->t_ras; 63 + 64 + return 0; 65 + } 25 66 26 67 static int icl_pcode_read_qgv_point_info(struct drm_i915_private *dev_priv, 27 68 struct intel_qgv_point *sp, ··· 90 49 return 0; 91 50 } 92 51 52 + static int adls_pcode_read_psf_gv_point_info(struct drm_i915_private *dev_priv, 53 + struct intel_psf_gv_point *points) 54 + { 55 + u32 val = 0; 56 + int ret; 57 + int i; 58 + 59 + ret = sandybridge_pcode_read(dev_priv, 60 + ICL_PCODE_MEM_SUBSYSYSTEM_INFO | 61 + ADL_PCODE_MEM_SS_READ_PSF_GV_INFO, 62 + &val, NULL); 63 + if (ret) 64 + return ret; 65 + 66 + for (i = 0; i < I915_NUM_PSF_GV_POINTS; i++) { 67 + points[i].clk = val & 0xff; 68 + val >>= 8; 69 + } 70 + 71 + return 0; 72 + } 73 + 93 74 int icl_pcode_restrict_qgv_points(struct drm_i915_private *dev_priv, 94 75 u32 points_mask) 95 76 { ··· 125 62 1); 126 63 127 64 if (ret < 0) { 128 - drm_err(&dev_priv->drm, "Failed to disable qgv points (%d)\n", ret); 65 + drm_err(&dev_priv->drm, "Failed to disable qgv points (%d) points: 0x%x\n", ret, points_mask); 129 66 return ret; 130 67 } 131 68 ··· 139 76 int i, ret; 140 77 141 78 qi->num_points = dram_info->num_qgv_points; 79 + qi->num_psf_points = dram_info->num_psf_gv_points; 142 80 143 81 if (DISPLAY_VER(dev_priv) == 12) 144 82 switch (dram_info->type) { ··· 163 99 for (i = 0; i < qi->num_points; i++) { 164 100 struct intel_qgv_point *sp = &qi->points[i]; 165 101 166 - ret = icl_pcode_read_qgv_point_info(dev_priv, sp, i); 102 + if (IS_DG1(dev_priv)) 103 + ret = dg1_mchbar_read_qgv_point_info(dev_priv, sp, i); 104 + else 105 + ret = icl_pcode_read_qgv_point_info(dev_priv, sp, i); 106 + 167 107 if (ret) 168 108 return ret; 169 109 ··· 177 109 sp->t_rcd, sp->t_rc); 178 110 } 179 111 112 + if (qi->num_psf_points > 0) { 113 + ret = adls_pcode_read_psf_gv_point_info(dev_priv, qi->psf_points); 114 + if (ret) { 115 + drm_err(&dev_priv->drm, "Failed to read PSF point data; PSF points will not be considered in bandwidth calculations.\n"); 116 + qi->num_psf_points = 0; 117 + } 118 + 119 + for (i = 0; i < qi->num_psf_points; i++) 120 + drm_dbg_kms(&dev_priv->drm, 121 + "PSF GV %d: CLK=%d \n", 122 + i, qi->psf_points[i].clk); 123 + } 124 + 180 125 return 0; 181 126 } 182 127 ··· 197 116 { 198 117 /* multiples of 16.666MHz (100/6) */ 199 118 return DIV_ROUND_CLOSEST(num * dclk * 100, den * 6); 119 + } 120 + 121 + static int adl_calc_psf_bw(int clk) 122 + { 123 + /* 124 + * clk is multiples of 16.666MHz (100/6) 125 + * According to BSpec PSF GV bandwidth is 126 + * calculated as BW = 64 * clk * 16.666Mhz 127 + */ 128 + return DIV_ROUND_CLOSEST(64 * clk * 100, 6); 200 129 } 201 130 202 131 static int icl_sagv_max_dclk(const struct intel_qgv_info *qi) ··· 285 194 bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1; 286 195 287 196 bi->num_qgv_points = qi.num_points; 197 + bi->num_psf_gv_points = qi.num_psf_points; 288 198 289 199 for (j = 0; j < qi.num_points; j++) { 290 200 const struct intel_qgv_point *sp = &qi.points[j]; ··· 309 217 i, j, bi->num_planes, bi->deratedbw[j]); 310 218 } 311 219 220 + for (j = 0; j < qi.num_psf_points; j++) { 221 + const struct intel_psf_gv_point *sp = &qi.psf_points[j]; 222 + 223 + bi->psf_bw[j] = adl_calc_psf_bw(sp->clk); 224 + 225 + drm_dbg_kms(&dev_priv->drm, 226 + "BW%d / PSF GV %d: num_planes=%d bw=%u\n", 227 + i, j, bi->num_planes, bi->psf_bw[j]); 228 + } 229 + 312 230 if (bi->num_planes == 1) 313 231 break; 314 232 } ··· 334 232 dev_priv->sagv_status = I915_SAGV_ENABLED; 335 233 336 234 return 0; 235 + } 236 + 237 + static void dg2_get_bw_info(struct drm_i915_private *i915) 238 + { 239 + struct intel_bw_info *bi = &i915->max_bw[0]; 240 + 241 + /* 242 + * DG2 doesn't have SAGV or QGV points, just a constant max bandwidth 243 + * that doesn't depend on the number of planes enabled. Create a 244 + * single dummy QGV point to reflect that. DG2-G10 platforms have a 245 + * constant 50 GB/s bandwidth, whereas DG2-G11 platforms have 38 GB/s. 246 + */ 247 + bi->num_planes = 1; 248 + bi->num_qgv_points = 1; 249 + if (IS_DG2_G11(i915)) 250 + bi->deratedbw[0] = 38000; 251 + else 252 + bi->deratedbw[0] = 50000; 253 + 254 + i915->sagv_status = I915_SAGV_NOT_CONTROLLED; 337 255 } 338 256 339 257 static unsigned int icl_max_bw(struct drm_i915_private *dev_priv, ··· 384 262 return 0; 385 263 } 386 264 265 + static unsigned int adl_psf_bw(struct drm_i915_private *dev_priv, 266 + int psf_gv_point) 267 + { 268 + const struct intel_bw_info *bi = 269 + &dev_priv->max_bw[0]; 270 + 271 + return bi->psf_bw[psf_gv_point]; 272 + } 273 + 387 274 void intel_bw_init_hw(struct drm_i915_private *dev_priv) 388 275 { 389 276 if (!HAS_DISPLAY(dev_priv)) 390 277 return; 391 278 392 - if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv)) 279 + if (IS_DG2(dev_priv)) 280 + dg2_get_bw_info(dev_priv); 281 + else if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv)) 393 282 icl_get_bw_info(dev_priv, &adls_sa_info); 394 283 else if (IS_ROCKETLAKE(dev_priv)) 395 284 icl_get_bw_info(dev_priv, &rkl_sa_info); ··· 667 534 u32 allowed_points = 0; 668 535 unsigned int max_bw_point = 0, max_bw = 0; 669 536 unsigned int num_qgv_points = dev_priv->max_bw[0].num_qgv_points; 670 - u32 mask = (1 << num_qgv_points) - 1; 537 + unsigned int num_psf_gv_points = dev_priv->max_bw[0].num_psf_gv_points; 538 + u32 mask = 0; 671 539 672 540 /* FIXME earlier gens need some checks too */ 673 541 if (DISPLAY_VER(dev_priv) < 11) 674 542 return 0; 543 + 544 + /* 545 + * We can _not_ use the whole ADLS_QGV_PT_MASK here, as PCode rejects 546 + * it with failure if we try masking any unadvertised points. 547 + * So need to operate only with those returned from PCode. 548 + */ 549 + if (num_qgv_points > 0) 550 + mask |= REG_GENMASK(num_qgv_points - 1, 0); 551 + 552 + if (num_psf_gv_points > 0) 553 + mask |= REG_GENMASK(num_psf_gv_points - 1, 0) << ADLS_PSF_PT_SHIFT; 675 554 676 555 for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, 677 556 new_crtc_state, i) { ··· 747 602 max_bw = max_data_rate; 748 603 } 749 604 if (max_data_rate >= data_rate) 750 - allowed_points |= BIT(i); 605 + allowed_points |= REG_FIELD_PREP(ADLS_QGV_PT_MASK, BIT(i)); 606 + 751 607 drm_dbg_kms(&dev_priv->drm, "QGV point %d: max bw %d required %d\n", 608 + i, max_data_rate, data_rate); 609 + } 610 + 611 + for (i = 0; i < num_psf_gv_points; i++) { 612 + unsigned int max_data_rate = adl_psf_bw(dev_priv, i); 613 + 614 + if (max_data_rate >= data_rate) 615 + allowed_points |= REG_FIELD_PREP(ADLS_PSF_PT_MASK, BIT(i)); 616 + 617 + drm_dbg_kms(&dev_priv->drm, "PSF GV point %d: max bw %d" 618 + " required %d\n", 752 619 i, max_data_rate, data_rate); 753 620 } 754 621 ··· 769 612 * left, so if we couldn't - simply reject the configuration for obvious 770 613 * reasons. 771 614 */ 772 - if (allowed_points == 0) { 615 + if ((allowed_points & ADLS_QGV_PT_MASK) == 0) { 773 616 drm_dbg_kms(&dev_priv->drm, "No QGV points provide sufficient memory" 774 617 " bandwidth %d for display configuration(%d active planes).\n", 775 618 data_rate, num_active_planes); 776 619 return -EINVAL; 620 + } 621 + 622 + if (num_psf_gv_points > 0) { 623 + if ((allowed_points & ADLS_PSF_PT_MASK) == 0) { 624 + drm_dbg_kms(&dev_priv->drm, "No PSF GV points provide sufficient memory" 625 + " bandwidth %d for display configuration(%d active planes).\n", 626 + data_rate, num_active_planes); 627 + return -EINVAL; 628 + } 777 629 } 778 630 779 631 /*
+40 -67
drivers/gpu/drm/i915/display/intel_cdclk.c
··· 1195 1195 {} 1196 1196 }; 1197 1197 1198 - static const struct intel_cdclk_vals cnl_cdclk_table[] = { 1199 - { .refclk = 19200, .cdclk = 168000, .divider = 4, .ratio = 35 }, 1200 - { .refclk = 19200, .cdclk = 336000, .divider = 2, .ratio = 35 }, 1201 - { .refclk = 19200, .cdclk = 528000, .divider = 2, .ratio = 55 }, 1202 - 1203 - { .refclk = 24000, .cdclk = 168000, .divider = 4, .ratio = 28 }, 1204 - { .refclk = 24000, .cdclk = 336000, .divider = 2, .ratio = 28 }, 1205 - { .refclk = 24000, .cdclk = 528000, .divider = 2, .ratio = 44 }, 1206 - {} 1207 - }; 1208 - 1209 1198 static const struct intel_cdclk_vals icl_cdclk_table[] = { 1210 1199 { .refclk = 19200, .cdclk = 172800, .divider = 2, .ratio = 18 }, 1211 1200 { .refclk = 19200, .cdclk = 192000, .divider = 2, .ratio = 20 }, ··· 1279 1290 {} 1280 1291 }; 1281 1292 1293 + static const struct intel_cdclk_vals dg2_cdclk_table[] = { 1294 + { .refclk = 38400, .cdclk = 172800, .divider = 2, .ratio = 9 }, 1295 + { .refclk = 38400, .cdclk = 192000, .divider = 2, .ratio = 10 }, 1296 + { .refclk = 38400, .cdclk = 307200, .divider = 2, .ratio = 16 }, 1297 + { .refclk = 38400, .cdclk = 326400, .divider = 4, .ratio = 34 }, 1298 + { .refclk = 38400, .cdclk = 556800, .divider = 2, .ratio = 29 }, 1299 + { .refclk = 38400, .cdclk = 652800, .divider = 2, .ratio = 34 }, 1300 + {} 1301 + }; 1302 + 1282 1303 static int bxt_calc_cdclk(struct drm_i915_private *dev_priv, int min_cdclk) 1283 1304 { 1284 1305 const struct intel_cdclk_vals *table = dev_priv->cdclk.table; ··· 1328 1329 return DIV_ROUND_UP(cdclk, 25000); 1329 1330 } 1330 1331 1331 - static u8 cnl_calc_voltage_level(int cdclk) 1332 - { 1333 - if (cdclk > 336000) 1334 - return 2; 1335 - else if (cdclk > 168000) 1336 - return 1; 1337 - else 1338 - return 0; 1339 - } 1340 - 1341 1332 static u8 icl_calc_voltage_level(int cdclk) 1342 1333 { 1343 1334 if (cdclk > 556800) ··· 1362 1373 return 0; 1363 1374 } 1364 1375 1365 - static void cnl_readout_refclk(struct drm_i915_private *dev_priv, 1366 - struct intel_cdclk_config *cdclk_config) 1367 - { 1368 - if (intel_de_read(dev_priv, SKL_DSSM) & CNL_DSSM_CDCLK_PLL_REFCLK_24MHz) 1369 - cdclk_config->ref = 24000; 1370 - else 1371 - cdclk_config->ref = 19200; 1372 - } 1373 - 1374 1376 static void icl_readout_refclk(struct drm_i915_private *dev_priv, 1375 1377 struct intel_cdclk_config *cdclk_config) 1376 1378 { ··· 1388 1408 { 1389 1409 u32 val, ratio; 1390 1410 1391 - if (DISPLAY_VER(dev_priv) >= 11) 1411 + if (IS_DG2(dev_priv)) 1412 + cdclk_config->ref = 38400; 1413 + else if (DISPLAY_VER(dev_priv) >= 11) 1392 1414 icl_readout_refclk(dev_priv, cdclk_config); 1393 - else if (IS_CANNONLAKE(dev_priv)) 1394 - cnl_readout_refclk(dev_priv, cdclk_config); 1395 1415 else 1396 1416 cdclk_config->ref = 19200; 1397 1417 ··· 1407 1427 } 1408 1428 1409 1429 /* 1410 - * CNL+ have the ratio directly in the PLL enable register, gen9lp had 1411 - * it in a separate PLL control register. 1430 + * DISPLAY_VER >= 11 have the ratio directly in the PLL enable register, 1431 + * gen9lp had it in a separate PLL control register. 1412 1432 */ 1413 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 1414 - ratio = val & CNL_CDCLK_PLL_RATIO_MASK; 1433 + if (DISPLAY_VER(dev_priv) >= 11) 1434 + ratio = val & ICL_CDCLK_PLL_RATIO_MASK; 1415 1435 else 1416 1436 ratio = intel_de_read(dev_priv, BXT_DE_PLL_CTL) & BXT_DE_PLL_RATIO_MASK; 1417 1437 ··· 1498 1518 dev_priv->cdclk.hw.vco = vco; 1499 1519 } 1500 1520 1501 - static void cnl_cdclk_pll_disable(struct drm_i915_private *dev_priv) 1521 + static void icl_cdclk_pll_disable(struct drm_i915_private *dev_priv) 1502 1522 { 1503 1523 intel_de_rmw(dev_priv, BXT_DE_PLL_ENABLE, 1504 1524 BXT_DE_PLL_PLL_ENABLE, 0); ··· 1510 1530 dev_priv->cdclk.hw.vco = 0; 1511 1531 } 1512 1532 1513 - static void cnl_cdclk_pll_enable(struct drm_i915_private *dev_priv, int vco) 1533 + static void icl_cdclk_pll_enable(struct drm_i915_private *dev_priv, int vco) 1514 1534 { 1515 1535 int ratio = DIV_ROUND_CLOSEST(vco, dev_priv->cdclk.hw.ref); 1516 1536 u32 val; 1517 1537 1518 - val = CNL_CDCLK_PLL_RATIO(ratio); 1538 + val = ICL_CDCLK_PLL_RATIO(ratio); 1519 1539 intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, val); 1520 1540 1521 1541 val |= BXT_DE_PLL_PLL_ENABLE; ··· 1528 1548 dev_priv->cdclk.hw.vco = vco; 1529 1549 } 1530 1550 1531 - static bool has_cdclk_crawl(struct drm_i915_private *i915) 1532 - { 1533 - return INTEL_INFO(i915)->has_cdclk_crawl; 1534 - } 1535 - 1536 1551 static void adlp_cdclk_pll_crawl(struct drm_i915_private *dev_priv, int vco) 1537 1552 { 1538 1553 int ratio = DIV_ROUND_CLOSEST(vco, dev_priv->cdclk.hw.ref); 1539 1554 u32 val; 1540 1555 1541 1556 /* Write PLL ratio without disabling */ 1542 - val = CNL_CDCLK_PLL_RATIO(ratio) | BXT_DE_PLL_PLL_ENABLE; 1557 + val = ICL_CDCLK_PLL_RATIO(ratio) | BXT_DE_PLL_PLL_ENABLE; 1543 1558 intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, val); 1544 1559 1545 1560 /* Submit freq change request */ ··· 1603 1628 int ret; 1604 1629 1605 1630 /* Inform power controller of upcoming frequency change. */ 1606 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 1631 + if (DISPLAY_VER(dev_priv) >= 11) 1607 1632 ret = skl_pcode_request(dev_priv, SKL_PCODE_CDCLK_CONTROL, 1608 1633 SKL_CDCLK_PREPARE_FOR_CHANGE, 1609 1634 SKL_CDCLK_READY_FOR_CHANGE, ··· 1624 1649 return; 1625 1650 } 1626 1651 1627 - if (has_cdclk_crawl(dev_priv) && dev_priv->cdclk.hw.vco > 0 && vco > 0) { 1652 + if (HAS_CDCLK_CRAWL(dev_priv) && dev_priv->cdclk.hw.vco > 0 && vco > 0) { 1628 1653 if (dev_priv->cdclk.hw.vco != vco) 1629 1654 adlp_cdclk_pll_crawl(dev_priv, vco); 1630 - } else if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) { 1655 + } else if (DISPLAY_VER(dev_priv) >= 11) { 1631 1656 if (dev_priv->cdclk.hw.vco != 0 && 1632 1657 dev_priv->cdclk.hw.vco != vco) 1633 - cnl_cdclk_pll_disable(dev_priv); 1658 + icl_cdclk_pll_disable(dev_priv); 1634 1659 1635 1660 if (dev_priv->cdclk.hw.vco != vco) 1636 - cnl_cdclk_pll_enable(dev_priv, vco); 1661 + icl_cdclk_pll_enable(dev_priv, vco); 1637 1662 } else { 1638 1663 if (dev_priv->cdclk.hw.vco != 0 && 1639 1664 dev_priv->cdclk.hw.vco != vco) ··· 1659 1684 if (pipe != INVALID_PIPE) 1660 1685 intel_wait_for_vblank(dev_priv, pipe); 1661 1686 1662 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) { 1687 + if (DISPLAY_VER(dev_priv) >= 11) { 1663 1688 ret = sandybridge_pcode_write(dev_priv, SKL_PCODE_CDCLK_CONTROL, 1664 1689 cdclk_config->voltage_level); 1665 1690 } else { ··· 1684 1709 1685 1710 intel_update_cdclk(dev_priv); 1686 1711 1687 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 1712 + if (DISPLAY_VER(dev_priv) >= 11) 1688 1713 /* 1689 1714 * Can't read out the voltage level :( 1690 1715 * Let's just assume everything is as expected. ··· 1832 1857 { 1833 1858 int a_div, b_div; 1834 1859 1835 - if (!has_cdclk_crawl(dev_priv)) 1860 + if (!HAS_CDCLK_CRAWL(dev_priv)) 1836 1861 return false; 1837 1862 1838 1863 /* ··· 2093 2118 crtc_state->port_clock >= 540000 && 2094 2119 crtc_state->lane_count == 4) { 2095 2120 if (DISPLAY_VER(dev_priv) == 10) { 2096 - /* Display WA #1145: glk,cnl */ 2121 + /* Display WA #1145: glk */ 2097 2122 min_cdclk = max(316800, min_cdclk); 2098 2123 } else if (DISPLAY_VER(dev_priv) == 9 || IS_BROADWELL(dev_priv)) { 2099 2124 /* Display WA #1144: skl,bxt */ ··· 2214 2239 2215 2240 /* 2216 2241 * Account for port clock min voltage level requirements. 2217 - * This only really does something on CNL+ but can be 2242 + * This only really does something on DISPLA_VER >= 11 but can be 2218 2243 * called on earlier platforms as well. 2219 2244 * 2220 2245 * Note that this functions assumes that 0 is ··· 2628 2653 dev_priv->max_cdclk_freq = 648000; 2629 2654 else 2630 2655 dev_priv->max_cdclk_freq = 652800; 2631 - } else if (IS_CANNONLAKE(dev_priv)) { 2632 - dev_priv->max_cdclk_freq = 528000; 2633 2656 } else if (IS_GEMINILAKE(dev_priv)) { 2634 2657 dev_priv->max_cdclk_freq = 316800; 2635 2658 } else if (IS_BROXTON(dev_priv)) { ··· 2851 2878 */ 2852 2879 void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv) 2853 2880 { 2854 - if (IS_ALDERLAKE_P(dev_priv)) { 2881 + if (IS_DG2(dev_priv)) { 2855 2882 dev_priv->display.set_cdclk = bxt_set_cdclk; 2856 2883 dev_priv->display.bw_calc_min_cdclk = skl_bw_calc_min_cdclk; 2857 2884 dev_priv->display.modeset_calc_cdclk = bxt_modeset_calc_cdclk; 2858 2885 dev_priv->display.calc_voltage_level = tgl_calc_voltage_level; 2859 - /* Wa_22011320316:adlp[a0] */ 2860 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 2886 + dev_priv->cdclk.table = dg2_cdclk_table; 2887 + } else if (IS_ALDERLAKE_P(dev_priv)) { 2888 + dev_priv->display.set_cdclk = bxt_set_cdclk; 2889 + dev_priv->display.bw_calc_min_cdclk = skl_bw_calc_min_cdclk; 2890 + dev_priv->display.modeset_calc_cdclk = bxt_modeset_calc_cdclk; 2891 + dev_priv->display.calc_voltage_level = tgl_calc_voltage_level; 2892 + /* Wa_22011320316:adl-p[a0] */ 2893 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 2861 2894 dev_priv->cdclk.table = adlp_a_step_cdclk_table; 2862 2895 else 2863 2896 dev_priv->cdclk.table = adlp_cdclk_table; ··· 2891 2912 dev_priv->display.modeset_calc_cdclk = bxt_modeset_calc_cdclk; 2892 2913 dev_priv->display.calc_voltage_level = icl_calc_voltage_level; 2893 2914 dev_priv->cdclk.table = icl_cdclk_table; 2894 - } else if (IS_CANNONLAKE(dev_priv)) { 2895 - dev_priv->display.bw_calc_min_cdclk = skl_bw_calc_min_cdclk; 2896 - dev_priv->display.set_cdclk = bxt_set_cdclk; 2897 - dev_priv->display.modeset_calc_cdclk = bxt_modeset_calc_cdclk; 2898 - dev_priv->display.calc_voltage_level = cnl_calc_voltage_level; 2899 - dev_priv->cdclk.table = cnl_cdclk_table; 2900 2915 } else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) { 2901 2916 dev_priv->display.bw_calc_min_cdclk = skl_bw_calc_min_cdclk; 2902 2917 dev_priv->display.set_cdclk = bxt_set_cdclk;
+2 -3
drivers/gpu/drm/i915/display/intel_color.c
··· 305 305 ilk_csc_postoff_limited_range); 306 306 } else if (crtc_state->csc_enable) { 307 307 /* 308 - * On GLK+ both pipe CSC and degamma LUT are controlled 308 + * On GLK both pipe CSC and degamma LUT are controlled 309 309 * by csc_enable. Hence for the cases where the degama 310 310 * LUT is needed but CSC is not we need to load an 311 311 * identity matrix. 312 312 */ 313 - drm_WARN_ON(&dev_priv->drm, !IS_CANNONLAKE(dev_priv) && 314 - !IS_GEMINILAKE(dev_priv)); 313 + drm_WARN_ON(&dev_priv->drm, !IS_GEMINILAKE(dev_priv)); 315 314 316 315 ilk_update_pipe_csc(crtc, ilk_csc_off_zero, 317 316 ilk_csc_coeff_identity,
+20 -86
drivers/gpu/drm/i915/display/intel_combo_phy.c
··· 23 23 PROCMON_1_05V_DOT_1, 24 24 }; 25 25 26 - static const struct cnl_procmon { 26 + static const struct icl_procmon { 27 27 u32 dw1, dw9, dw10; 28 - } cnl_procmon_values[] = { 28 + } icl_procmon_values[] = { 29 29 [PROCMON_0_85V_DOT_0] = 30 30 { .dw1 = 0x00000000, .dw9 = 0x62AB67BB, .dw10 = 0x51914F96, }, 31 31 [PROCMON_0_95V_DOT_0] = ··· 38 38 { .dw1 = 0x00440000, .dw9 = 0x9A00AB25, .dw10 = 0x8AE38FF1, }, 39 39 }; 40 40 41 - /* 42 - * CNL has just one set of registers, while gen11 has a set for each combo PHY. 43 - * The CNL registers are equivalent to the gen11 PHY A registers, that's why we 44 - * call the ICL macros even though the function has CNL on its name. 45 - */ 46 - static const struct cnl_procmon * 47 - cnl_get_procmon_ref_values(struct drm_i915_private *dev_priv, enum phy phy) 41 + static const struct icl_procmon * 42 + icl_get_procmon_ref_values(struct drm_i915_private *dev_priv, enum phy phy) 48 43 { 49 - const struct cnl_procmon *procmon; 44 + const struct icl_procmon *procmon; 50 45 u32 val; 51 46 52 47 val = intel_de_read(dev_priv, ICL_PORT_COMP_DW3(phy)); ··· 50 55 MISSING_CASE(val); 51 56 fallthrough; 52 57 case VOLTAGE_INFO_0_85V | PROCESS_INFO_DOT_0: 53 - procmon = &cnl_procmon_values[PROCMON_0_85V_DOT_0]; 58 + procmon = &icl_procmon_values[PROCMON_0_85V_DOT_0]; 54 59 break; 55 60 case VOLTAGE_INFO_0_95V | PROCESS_INFO_DOT_0: 56 - procmon = &cnl_procmon_values[PROCMON_0_95V_DOT_0]; 61 + procmon = &icl_procmon_values[PROCMON_0_95V_DOT_0]; 57 62 break; 58 63 case VOLTAGE_INFO_0_95V | PROCESS_INFO_DOT_1: 59 - procmon = &cnl_procmon_values[PROCMON_0_95V_DOT_1]; 64 + procmon = &icl_procmon_values[PROCMON_0_95V_DOT_1]; 60 65 break; 61 66 case VOLTAGE_INFO_1_05V | PROCESS_INFO_DOT_0: 62 - procmon = &cnl_procmon_values[PROCMON_1_05V_DOT_0]; 67 + procmon = &icl_procmon_values[PROCMON_1_05V_DOT_0]; 63 68 break; 64 69 case VOLTAGE_INFO_1_05V | PROCESS_INFO_DOT_1: 65 - procmon = &cnl_procmon_values[PROCMON_1_05V_DOT_1]; 70 + procmon = &icl_procmon_values[PROCMON_1_05V_DOT_1]; 66 71 break; 67 72 } 68 73 69 74 return procmon; 70 75 } 71 76 72 - static void cnl_set_procmon_ref_values(struct drm_i915_private *dev_priv, 77 + static void icl_set_procmon_ref_values(struct drm_i915_private *dev_priv, 73 78 enum phy phy) 74 79 { 75 - const struct cnl_procmon *procmon; 80 + const struct icl_procmon *procmon; 76 81 u32 val; 77 82 78 - procmon = cnl_get_procmon_ref_values(dev_priv, phy); 83 + procmon = icl_get_procmon_ref_values(dev_priv, phy); 79 84 80 85 val = intel_de_read(dev_priv, ICL_PORT_COMP_DW1(phy)); 81 86 val &= ~((0xff << 16) | 0xff); ··· 104 109 return true; 105 110 } 106 111 107 - static bool cnl_verify_procmon_ref_values(struct drm_i915_private *dev_priv, 112 + static bool icl_verify_procmon_ref_values(struct drm_i915_private *dev_priv, 108 113 enum phy phy) 109 114 { 110 - const struct cnl_procmon *procmon; 115 + const struct icl_procmon *procmon; 111 116 bool ret; 112 117 113 - procmon = cnl_get_procmon_ref_values(dev_priv, phy); 118 + procmon = icl_get_procmon_ref_values(dev_priv, phy); 114 119 115 120 ret = check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW1(phy), 116 121 (0xff << 16) | 0xff, procmon->dw1); ··· 120 125 -1U, procmon->dw10); 121 126 122 127 return ret; 123 - } 124 - 125 - static bool cnl_combo_phy_enabled(struct drm_i915_private *dev_priv) 126 - { 127 - return !(intel_de_read(dev_priv, CHICKEN_MISC_2) & CNL_COMP_PWR_DOWN) && 128 - (intel_de_read(dev_priv, CNL_PORT_COMP_DW0) & COMP_INIT); 129 - } 130 - 131 - static bool cnl_combo_phy_verify_state(struct drm_i915_private *dev_priv) 132 - { 133 - enum phy phy = PHY_A; 134 - bool ret; 135 - 136 - if (!cnl_combo_phy_enabled(dev_priv)) 137 - return false; 138 - 139 - ret = cnl_verify_procmon_ref_values(dev_priv, phy); 140 - 141 - ret &= check_phy_reg(dev_priv, phy, CNL_PORT_CL1CM_DW5, 142 - CL_POWER_DOWN_ENABLE, CL_POWER_DOWN_ENABLE); 143 - 144 - return ret; 145 - } 146 - 147 - static void cnl_combo_phys_init(struct drm_i915_private *dev_priv) 148 - { 149 - u32 val; 150 - 151 - val = intel_de_read(dev_priv, CHICKEN_MISC_2); 152 - val &= ~CNL_COMP_PWR_DOWN; 153 - intel_de_write(dev_priv, CHICKEN_MISC_2, val); 154 - 155 - /* Dummy PORT_A to get the correct CNL register from the ICL macro */ 156 - cnl_set_procmon_ref_values(dev_priv, PHY_A); 157 - 158 - val = intel_de_read(dev_priv, CNL_PORT_COMP_DW0); 159 - val |= COMP_INIT; 160 - intel_de_write(dev_priv, CNL_PORT_COMP_DW0, val); 161 - 162 - val = intel_de_read(dev_priv, CNL_PORT_CL1CM_DW5); 163 - val |= CL_POWER_DOWN_ENABLE; 164 - intel_de_write(dev_priv, CNL_PORT_CL1CM_DW5, val); 165 - } 166 - 167 - static void cnl_combo_phys_uninit(struct drm_i915_private *dev_priv) 168 - { 169 - u32 val; 170 - 171 - if (!cnl_combo_phy_verify_state(dev_priv)) 172 - drm_warn(&dev_priv->drm, 173 - "Combo PHY HW state changed unexpectedly.\n"); 174 - 175 - val = intel_de_read(dev_priv, CHICKEN_MISC_2); 176 - val |= CNL_COMP_PWR_DOWN; 177 - intel_de_write(dev_priv, CHICKEN_MISC_2, val); 178 128 } 179 129 180 130 static bool has_phy_misc(struct drm_i915_private *i915, enum phy phy) ··· 231 291 DCC_MODE_SELECT_CONTINUOSLY); 232 292 } 233 293 234 - ret &= cnl_verify_procmon_ref_values(dev_priv, phy); 294 + ret &= icl_verify_procmon_ref_values(dev_priv, phy); 235 295 236 296 if (phy_is_master(dev_priv, phy)) { 237 297 ret &= check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW8(phy), ··· 355 415 intel_de_write(dev_priv, ICL_PORT_PCS_DW1_GRP(phy), val); 356 416 } 357 417 358 - cnl_set_procmon_ref_values(dev_priv, phy); 418 + icl_set_procmon_ref_values(dev_priv, phy); 359 419 360 420 if (phy_is_master(dev_priv, phy)) { 361 421 val = intel_de_read(dev_priv, ICL_PORT_COMP_DW8(phy)); ··· 414 474 415 475 void intel_combo_phy_init(struct drm_i915_private *i915) 416 476 { 417 - if (DISPLAY_VER(i915) >= 11) 418 - icl_combo_phys_init(i915); 419 - else if (IS_CANNONLAKE(i915)) 420 - cnl_combo_phys_init(i915); 477 + icl_combo_phys_init(i915); 421 478 } 422 479 423 480 void intel_combo_phy_uninit(struct drm_i915_private *i915) 424 481 { 425 - if (DISPLAY_VER(i915) >= 11) 426 - icl_combo_phys_uninit(i915); 427 - else if (IS_CANNONLAKE(i915)) 428 - cnl_combo_phys_uninit(i915); 482 + icl_combo_phys_uninit(i915); 429 483 }
+1 -1
drivers/gpu/drm/i915/display/intel_crtc.c
··· 335 335 dev_priv->plane_to_crtc_mapping[i9xx_plane] = crtc; 336 336 } 337 337 338 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 338 + if (DISPLAY_VER(dev_priv) >= 11) 339 339 drm_crtc_create_scaling_filter_property(&crtc->base, 340 340 BIT(DRM_SCALING_FILTER_DEFAULT) | 341 341 BIT(DRM_SCALING_FILTER_NEAREST_NEIGHBOR));
+8 -4
drivers/gpu/drm/i915/display/intel_cursor.c
··· 383 383 if (plane_state->hw.rotation & DRM_MODE_ROTATE_180) 384 384 cntl |= MCURSOR_ROTATE_180; 385 385 386 - /* Wa_22012358565:adlp */ 386 + /* Wa_22012358565:adl-p */ 387 387 if (DISPLAY_VER(dev_priv) == 13) 388 388 cntl |= MCURSOR_ARB_SLOTS(1); 389 389 ··· 629 629 630 630 /* 631 631 * When crtc is inactive or there is a modeset pending, 632 - * wait for it to complete in the slowpath 632 + * wait for it to complete in the slowpath. 633 + * PSR2 selective fetch also requires the slow path as 634 + * PSR2 plane and transcoder registers can only be updated during 635 + * vblank. 633 636 * 634 637 * FIXME bigjoiner fastpath would be good 635 638 */ 636 639 if (!crtc_state->hw.active || intel_crtc_needs_modeset(crtc_state) || 637 - crtc_state->update_pipe || crtc_state->bigjoiner) 640 + crtc_state->update_pipe || crtc_state->bigjoiner || 641 + crtc_state->enable_psr2_sel_fetch) 638 642 goto slow; 639 643 640 644 /* ··· 805 801 if (DISPLAY_VER(dev_priv) >= 12) 806 802 drm_plane_enable_fb_damage_clips(&cursor->base); 807 803 808 - drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs); 804 + intel_plane_helper_add(cursor); 809 805 810 806 return cursor; 811 807
+198 -258
drivers/gpu/drm/i915/display/intel_ddi.c
··· 51 51 #include "intel_panel.h" 52 52 #include "intel_pps.h" 53 53 #include "intel_psr.h" 54 + #include "intel_snps_phy.h" 54 55 #include "intel_sprite.h" 55 56 #include "intel_tc.h" 56 57 #include "intel_vdsc.h" ··· 172 171 static void intel_wait_ddi_buf_active(struct drm_i915_private *dev_priv, 173 172 enum port port) 174 173 { 174 + int ret; 175 + 175 176 /* Wait > 518 usecs for DDI_BUF_CTL to be non idle */ 176 177 if (DISPLAY_VER(dev_priv) < 10) { 177 178 usleep_range(518, 1000); 178 179 return; 179 180 } 180 181 181 - if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & 182 - DDI_BUF_IS_IDLE), 500)) 182 + ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & 183 + DDI_BUF_IS_IDLE), IS_DG2(dev_priv) ? 1200 : 500, 10, 10); 184 + 185 + if (ret) 183 186 drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get active\n", 184 187 port_name(port)); 185 188 } ··· 827 822 static enum intel_display_power_domain 828 823 intel_ddi_main_link_aux_domain(struct intel_digital_port *dig_port) 829 824 { 830 - /* CNL+ HW requires corresponding AUX IOs to be powered up for PSR with 825 + /* ICL+ HW requires corresponding AUX IOs to be powered up for PSR with 831 826 * DC states enabled at the same time, while for driver initiated AUX 832 827 * transfers we need the same AUX IOs to be powered but with DC states 833 828 * disabled. Accordingly use the AUX power domain here which leaves DC ··· 1022 1017 return DP_TRAIN_PRE_EMPH_LEVEL_3; 1023 1018 } 1024 1019 1025 - static void cnl_ddi_vswing_program(struct intel_encoder *encoder, 1026 - const struct intel_crtc_state *crtc_state, 1027 - int level) 1028 - { 1029 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1030 - const struct intel_ddi_buf_trans *ddi_translations; 1031 - enum port port = encoder->port; 1032 - int n_entries, ln; 1033 - u32 val; 1034 - 1035 - ddi_translations = encoder->get_buf_trans(encoder, crtc_state, &n_entries); 1036 - if (drm_WARN_ON_ONCE(&dev_priv->drm, !ddi_translations)) 1037 - return; 1038 - if (drm_WARN_ON_ONCE(&dev_priv->drm, level >= n_entries)) 1039 - level = n_entries - 1; 1040 - 1041 - /* Set PORT_TX_DW5 Scaling Mode Sel to 010b. */ 1042 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW5_LN0(port)); 1043 - val &= ~SCALING_MODE_SEL_MASK; 1044 - val |= SCALING_MODE_SEL(2); 1045 - intel_de_write(dev_priv, CNL_PORT_TX_DW5_GRP(port), val); 1046 - 1047 - /* Program PORT_TX_DW2 */ 1048 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW2_LN0(port)); 1049 - val &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK | 1050 - RCOMP_SCALAR_MASK); 1051 - val |= SWING_SEL_UPPER(ddi_translations->entries[level].cnl.dw2_swing_sel); 1052 - val |= SWING_SEL_LOWER(ddi_translations->entries[level].cnl.dw2_swing_sel); 1053 - /* Rcomp scalar is fixed as 0x98 for every table entry */ 1054 - val |= RCOMP_SCALAR(0x98); 1055 - intel_de_write(dev_priv, CNL_PORT_TX_DW2_GRP(port), val); 1056 - 1057 - /* Program PORT_TX_DW4 */ 1058 - /* We cannot write to GRP. It would overrite individual loadgen */ 1059 - for (ln = 0; ln < 4; ln++) { 1060 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW4_LN(ln, port)); 1061 - val &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK | 1062 - CURSOR_COEFF_MASK); 1063 - val |= POST_CURSOR_1(ddi_translations->entries[level].cnl.dw4_post_cursor_1); 1064 - val |= POST_CURSOR_2(ddi_translations->entries[level].cnl.dw4_post_cursor_2); 1065 - val |= CURSOR_COEFF(ddi_translations->entries[level].cnl.dw4_cursor_coeff); 1066 - intel_de_write(dev_priv, CNL_PORT_TX_DW4_LN(ln, port), val); 1067 - } 1068 - 1069 - /* Program PORT_TX_DW5 */ 1070 - /* All DW5 values are fixed for every table entry */ 1071 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW5_LN0(port)); 1072 - val &= ~RTERM_SELECT_MASK; 1073 - val |= RTERM_SELECT(6); 1074 - val |= TAP3_DISABLE; 1075 - intel_de_write(dev_priv, CNL_PORT_TX_DW5_GRP(port), val); 1076 - 1077 - /* Program PORT_TX_DW7 */ 1078 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW7_LN0(port)); 1079 - val &= ~N_SCALAR_MASK; 1080 - val |= N_SCALAR(ddi_translations->entries[level].cnl.dw7_n_scalar); 1081 - intel_de_write(dev_priv, CNL_PORT_TX_DW7_GRP(port), val); 1082 - } 1083 - 1084 - static void cnl_ddi_vswing_sequence(struct intel_encoder *encoder, 1085 - const struct intel_crtc_state *crtc_state, 1086 - int level) 1087 - { 1088 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1089 - enum port port = encoder->port; 1090 - int width, rate, ln; 1091 - u32 val; 1092 - 1093 - width = crtc_state->lane_count; 1094 - rate = crtc_state->port_clock; 1095 - 1096 - /* 1097 - * 1. If port type is eDP or DP, 1098 - * set PORT_PCS_DW1 cmnkeeper_enable to 1b, 1099 - * else clear to 0b. 1100 - */ 1101 - val = intel_de_read(dev_priv, CNL_PORT_PCS_DW1_LN0(port)); 1102 - if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) 1103 - val &= ~COMMON_KEEPER_EN; 1104 - else 1105 - val |= COMMON_KEEPER_EN; 1106 - intel_de_write(dev_priv, CNL_PORT_PCS_DW1_GRP(port), val); 1107 - 1108 - /* 2. Program loadgen select */ 1109 - /* 1110 - * Program PORT_TX_DW4_LN depending on Bit rate and used lanes 1111 - * <= 6 GHz and 4 lanes (LN0=0, LN1=1, LN2=1, LN3=1) 1112 - * <= 6 GHz and 1,2 lanes (LN0=0, LN1=1, LN2=1, LN3=0) 1113 - * > 6 GHz (LN0=0, LN1=0, LN2=0, LN3=0) 1114 - */ 1115 - for (ln = 0; ln <= 3; ln++) { 1116 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW4_LN(ln, port)); 1117 - val &= ~LOADGEN_SELECT; 1118 - 1119 - if ((rate <= 600000 && width == 4 && ln >= 1) || 1120 - (rate <= 600000 && width < 4 && (ln == 1 || ln == 2))) { 1121 - val |= LOADGEN_SELECT; 1122 - } 1123 - intel_de_write(dev_priv, CNL_PORT_TX_DW4_LN(ln, port), val); 1124 - } 1125 - 1126 - /* 3. Set PORT_CL_DW5 SUS Clock Config to 11b */ 1127 - val = intel_de_read(dev_priv, CNL_PORT_CL1CM_DW5); 1128 - val |= SUS_CLOCK_CONFIG; 1129 - intel_de_write(dev_priv, CNL_PORT_CL1CM_DW5, val); 1130 - 1131 - /* 4. Clear training enable to change swing values */ 1132 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW5_LN0(port)); 1133 - val &= ~TX_TRAINING_EN; 1134 - intel_de_write(dev_priv, CNL_PORT_TX_DW5_GRP(port), val); 1135 - 1136 - /* 5. Program swing and de-emphasis */ 1137 - cnl_ddi_vswing_program(encoder, crtc_state, level); 1138 - 1139 - /* 6. Set training enable to trigger update */ 1140 - val = intel_de_read(dev_priv, CNL_PORT_TX_DW5_LN0(port)); 1141 - val |= TX_TRAINING_EN; 1142 - intel_de_write(dev_priv, CNL_PORT_TX_DW5_GRP(port), val); 1143 - } 1144 - 1145 1020 static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder, 1146 1021 const struct intel_crtc_state *crtc_state, 1147 1022 int level) ··· 1060 1175 val = intel_de_read(dev_priv, ICL_PORT_TX_DW2_LN0(phy)); 1061 1176 val &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK | 1062 1177 RCOMP_SCALAR_MASK); 1063 - val |= SWING_SEL_UPPER(ddi_translations->entries[level].cnl.dw2_swing_sel); 1064 - val |= SWING_SEL_LOWER(ddi_translations->entries[level].cnl.dw2_swing_sel); 1178 + val |= SWING_SEL_UPPER(ddi_translations->entries[level].icl.dw2_swing_sel); 1179 + val |= SWING_SEL_LOWER(ddi_translations->entries[level].icl.dw2_swing_sel); 1065 1180 /* Program Rcomp scalar for every table entry */ 1066 1181 val |= RCOMP_SCALAR(0x98); 1067 1182 intel_de_write(dev_priv, ICL_PORT_TX_DW2_GRP(phy), val); ··· 1072 1187 val = intel_de_read(dev_priv, ICL_PORT_TX_DW4_LN(ln, phy)); 1073 1188 val &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK | 1074 1189 CURSOR_COEFF_MASK); 1075 - val |= POST_CURSOR_1(ddi_translations->entries[level].cnl.dw4_post_cursor_1); 1076 - val |= POST_CURSOR_2(ddi_translations->entries[level].cnl.dw4_post_cursor_2); 1077 - val |= CURSOR_COEFF(ddi_translations->entries[level].cnl.dw4_cursor_coeff); 1190 + val |= POST_CURSOR_1(ddi_translations->entries[level].icl.dw4_post_cursor_1); 1191 + val |= POST_CURSOR_2(ddi_translations->entries[level].icl.dw4_post_cursor_2); 1192 + val |= CURSOR_COEFF(ddi_translations->entries[level].icl.dw4_cursor_coeff); 1078 1193 intel_de_write(dev_priv, ICL_PORT_TX_DW4_LN(ln, phy), val); 1079 1194 } 1080 1195 1081 1196 /* Program PORT_TX_DW7 */ 1082 1197 val = intel_de_read(dev_priv, ICL_PORT_TX_DW7_LN0(phy)); 1083 1198 val &= ~N_SCALAR_MASK; 1084 - val |= N_SCALAR(ddi_translations->entries[level].cnl.dw7_n_scalar); 1199 + val |= N_SCALAR(ddi_translations->entries[level].icl.dw7_n_scalar); 1085 1200 intel_de_write(dev_priv, ICL_PORT_TX_DW7_GRP(phy), val); 1086 1201 } 1087 1202 ··· 1381 1496 } 1382 1497 1383 1498 static void 1499 + dg2_set_signal_levels(struct intel_dp *intel_dp, 1500 + const struct intel_crtc_state *crtc_state) 1501 + { 1502 + struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; 1503 + int level = intel_ddi_dp_level(intel_dp); 1504 + 1505 + intel_snps_phy_ddi_vswing_sequence(encoder, level); 1506 + } 1507 + 1508 + static void 1384 1509 tgl_set_signal_levels(struct intel_dp *intel_dp, 1385 1510 const struct intel_crtc_state *crtc_state) 1386 1511 { ··· 1408 1513 int level = intel_ddi_dp_level(intel_dp); 1409 1514 1410 1515 icl_ddi_vswing_sequence(encoder, crtc_state, level); 1411 - } 1412 - 1413 - static void 1414 - cnl_set_signal_levels(struct intel_dp *intel_dp, 1415 - const struct intel_crtc_state *crtc_state) 1416 - { 1417 - struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; 1418 - int level = intel_ddi_dp_level(intel_dp); 1419 - 1420 - cnl_ddi_vswing_sequence(encoder, crtc_state, level); 1421 1516 } 1422 1517 1423 1518 static void ··· 1445 1560 intel_de_posting_read(dev_priv, DDI_BUF_CTL(port)); 1446 1561 } 1447 1562 1448 - static void _cnl_ddi_enable_clock(struct drm_i915_private *i915, i915_reg_t reg, 1563 + static void _icl_ddi_enable_clock(struct drm_i915_private *i915, i915_reg_t reg, 1449 1564 u32 clk_sel_mask, u32 clk_sel, u32 clk_off) 1450 1565 { 1451 1566 mutex_lock(&i915->dpll.lock); ··· 1461 1576 mutex_unlock(&i915->dpll.lock); 1462 1577 } 1463 1578 1464 - static void _cnl_ddi_disable_clock(struct drm_i915_private *i915, i915_reg_t reg, 1579 + static void _icl_ddi_disable_clock(struct drm_i915_private *i915, i915_reg_t reg, 1465 1580 u32 clk_off) 1466 1581 { 1467 1582 mutex_lock(&i915->dpll.lock); ··· 1471 1586 mutex_unlock(&i915->dpll.lock); 1472 1587 } 1473 1588 1474 - static bool _cnl_ddi_is_clock_enabled(struct drm_i915_private *i915, i915_reg_t reg, 1589 + static bool _icl_ddi_is_clock_enabled(struct drm_i915_private *i915, i915_reg_t reg, 1475 1590 u32 clk_off) 1476 1591 { 1477 1592 return !(intel_de_read(i915, reg) & clk_off); 1478 1593 } 1479 1594 1480 1595 static struct intel_shared_dpll * 1481 - _cnl_ddi_get_pll(struct drm_i915_private *i915, i915_reg_t reg, 1596 + _icl_ddi_get_pll(struct drm_i915_private *i915, i915_reg_t reg, 1482 1597 u32 clk_sel_mask, u32 clk_sel_shift) 1483 1598 { 1484 1599 enum intel_dpll_id id; ··· 1498 1613 if (drm_WARN_ON(&i915->drm, !pll)) 1499 1614 return; 1500 1615 1501 - _cnl_ddi_enable_clock(i915, ADLS_DPCLKA_CFGCR(phy), 1616 + _icl_ddi_enable_clock(i915, ADLS_DPCLKA_CFGCR(phy), 1502 1617 ADLS_DPCLKA_CFGCR_DDI_CLK_SEL_MASK(phy), 1503 1618 pll->info->id << ADLS_DPCLKA_CFGCR_DDI_SHIFT(phy), 1504 1619 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); ··· 1509 1624 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1510 1625 enum phy phy = intel_port_to_phy(i915, encoder->port); 1511 1626 1512 - _cnl_ddi_disable_clock(i915, ADLS_DPCLKA_CFGCR(phy), 1627 + _icl_ddi_disable_clock(i915, ADLS_DPCLKA_CFGCR(phy), 1513 1628 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1514 1629 } 1515 1630 ··· 1518 1633 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1519 1634 enum phy phy = intel_port_to_phy(i915, encoder->port); 1520 1635 1521 - return _cnl_ddi_is_clock_enabled(i915, ADLS_DPCLKA_CFGCR(phy), 1636 + return _icl_ddi_is_clock_enabled(i915, ADLS_DPCLKA_CFGCR(phy), 1522 1637 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1523 1638 } 1524 1639 ··· 1527 1642 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1528 1643 enum phy phy = intel_port_to_phy(i915, encoder->port); 1529 1644 1530 - return _cnl_ddi_get_pll(i915, ADLS_DPCLKA_CFGCR(phy), 1645 + return _icl_ddi_get_pll(i915, ADLS_DPCLKA_CFGCR(phy), 1531 1646 ADLS_DPCLKA_CFGCR_DDI_CLK_SEL_MASK(phy), 1532 1647 ADLS_DPCLKA_CFGCR_DDI_SHIFT(phy)); 1533 1648 } ··· 1542 1657 if (drm_WARN_ON(&i915->drm, !pll)) 1543 1658 return; 1544 1659 1545 - _cnl_ddi_enable_clock(i915, ICL_DPCLKA_CFGCR0, 1660 + _icl_ddi_enable_clock(i915, ICL_DPCLKA_CFGCR0, 1546 1661 RKL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy), 1547 1662 RKL_DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, phy), 1548 1663 RKL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); ··· 1553 1668 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1554 1669 enum phy phy = intel_port_to_phy(i915, encoder->port); 1555 1670 1556 - _cnl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0, 1671 + _icl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0, 1557 1672 RKL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1558 1673 } 1559 1674 ··· 1562 1677 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1563 1678 enum phy phy = intel_port_to_phy(i915, encoder->port); 1564 1679 1565 - return _cnl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0, 1680 + return _icl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0, 1566 1681 RKL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1567 1682 } 1568 1683 ··· 1571 1686 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1572 1687 enum phy phy = intel_port_to_phy(i915, encoder->port); 1573 1688 1574 - return _cnl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0, 1689 + return _icl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0, 1575 1690 RKL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy), 1576 1691 RKL_DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(phy)); 1577 1692 } ··· 1595 1710 (pll->info->id >= DPLL_ID_DG1_DPLL2 && phy < PHY_C))) 1596 1711 return; 1597 1712 1598 - _cnl_ddi_enable_clock(i915, DG1_DPCLKA_CFGCR0(phy), 1713 + _icl_ddi_enable_clock(i915, DG1_DPCLKA_CFGCR0(phy), 1599 1714 DG1_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy), 1600 1715 DG1_DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, phy), 1601 1716 DG1_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); ··· 1606 1721 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1607 1722 enum phy phy = intel_port_to_phy(i915, encoder->port); 1608 1723 1609 - _cnl_ddi_disable_clock(i915, DG1_DPCLKA_CFGCR0(phy), 1724 + _icl_ddi_disable_clock(i915, DG1_DPCLKA_CFGCR0(phy), 1610 1725 DG1_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1611 1726 } 1612 1727 ··· 1615 1730 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1616 1731 enum phy phy = intel_port_to_phy(i915, encoder->port); 1617 1732 1618 - return _cnl_ddi_is_clock_enabled(i915, DG1_DPCLKA_CFGCR0(phy), 1733 + return _icl_ddi_is_clock_enabled(i915, DG1_DPCLKA_CFGCR0(phy), 1619 1734 DG1_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1620 1735 } 1621 1736 ··· 1652 1767 if (drm_WARN_ON(&i915->drm, !pll)) 1653 1768 return; 1654 1769 1655 - _cnl_ddi_enable_clock(i915, ICL_DPCLKA_CFGCR0, 1770 + _icl_ddi_enable_clock(i915, ICL_DPCLKA_CFGCR0, 1656 1771 ICL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy), 1657 1772 ICL_DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, phy), 1658 1773 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); ··· 1663 1778 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1664 1779 enum phy phy = intel_port_to_phy(i915, encoder->port); 1665 1780 1666 - _cnl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0, 1781 + _icl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0, 1667 1782 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1668 1783 } 1669 1784 ··· 1672 1787 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1673 1788 enum phy phy = intel_port_to_phy(i915, encoder->port); 1674 1789 1675 - return _cnl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0, 1790 + return _icl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0, 1676 1791 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)); 1677 1792 } 1678 1793 ··· 1681 1796 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1682 1797 enum phy phy = intel_port_to_phy(i915, encoder->port); 1683 1798 1684 - return _cnl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0, 1799 + return _icl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0, 1685 1800 ICL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy), 1686 1801 ICL_DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(phy)); 1687 1802 } ··· 1812 1927 } 1813 1928 1814 1929 return intel_get_shared_dpll_by_id(i915, id); 1815 - } 1816 - 1817 - static void cnl_ddi_enable_clock(struct intel_encoder *encoder, 1818 - const struct intel_crtc_state *crtc_state) 1819 - { 1820 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1821 - const struct intel_shared_dpll *pll = crtc_state->shared_dpll; 1822 - enum port port = encoder->port; 1823 - 1824 - if (drm_WARN_ON(&i915->drm, !pll)) 1825 - return; 1826 - 1827 - _cnl_ddi_enable_clock(i915, DPCLKA_CFGCR0, 1828 - DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port), 1829 - DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, port), 1830 - DPCLKA_CFGCR0_DDI_CLK_OFF(port)); 1831 - } 1832 - 1833 - static void cnl_ddi_disable_clock(struct intel_encoder *encoder) 1834 - { 1835 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1836 - enum port port = encoder->port; 1837 - 1838 - _cnl_ddi_disable_clock(i915, DPCLKA_CFGCR0, 1839 - DPCLKA_CFGCR0_DDI_CLK_OFF(port)); 1840 - } 1841 - 1842 - static bool cnl_ddi_is_clock_enabled(struct intel_encoder *encoder) 1843 - { 1844 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1845 - enum port port = encoder->port; 1846 - 1847 - return _cnl_ddi_is_clock_enabled(i915, DPCLKA_CFGCR0, 1848 - DPCLKA_CFGCR0_DDI_CLK_OFF(port)); 1849 - } 1850 - 1851 - static struct intel_shared_dpll *cnl_ddi_get_pll(struct intel_encoder *encoder) 1852 - { 1853 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1854 - enum port port = encoder->port; 1855 - 1856 - return _cnl_ddi_get_pll(i915, DPCLKA_CFGCR0, 1857 - DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port), 1858 - DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port)); 1859 1930 } 1860 1931 1861 1932 static struct intel_shared_dpll *bxt_ddi_get_pll(struct intel_encoder *encoder) ··· 2037 2196 ddi_clk_needed = false; 2038 2197 } 2039 2198 2040 - if (ddi_clk_needed || !encoder->disable_clock || 2199 + if (ddi_clk_needed || !encoder->is_clock_enabled || 2041 2200 !encoder->is_clock_enabled(encoder)) 2042 2201 return; 2043 2202 ··· 2318 2477 OVERLAP_PIXELS_MASK, dss1); 2319 2478 } 2320 2479 2480 + static void dg2_ddi_pre_enable_dp(struct intel_atomic_state *state, 2481 + struct intel_encoder *encoder, 2482 + const struct intel_crtc_state *crtc_state, 2483 + const struct drm_connector_state *conn_state) 2484 + { 2485 + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 2486 + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 2487 + enum phy phy = intel_port_to_phy(dev_priv, encoder->port); 2488 + struct intel_digital_port *dig_port = enc_to_dig_port(encoder); 2489 + bool is_mst = intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST); 2490 + int level = intel_ddi_dp_level(intel_dp); 2491 + 2492 + intel_dp_set_link_params(intel_dp, crtc_state->port_clock, 2493 + crtc_state->lane_count); 2494 + 2495 + /* 2496 + * 1. Enable Power Wells 2497 + * 2498 + * This was handled at the beginning of intel_atomic_commit_tail(), 2499 + * before we called down into this function. 2500 + */ 2501 + 2502 + /* 2. Enable Panel Power if PPS is required */ 2503 + intel_pps_on(intel_dp); 2504 + 2505 + /* 2506 + * 3. Enable the port PLL. 2507 + */ 2508 + intel_ddi_enable_clock(encoder, crtc_state); 2509 + 2510 + /* 4. Enable IO power */ 2511 + if (!intel_phy_is_tc(dev_priv, phy) || 2512 + dig_port->tc_mode != TC_PORT_TBT_ALT) 2513 + dig_port->ddi_io_wakeref = intel_display_power_get(dev_priv, 2514 + dig_port->ddi_io_power_domain); 2515 + 2516 + /* 2517 + * 5. The rest of the below are substeps under the bspec's "Enable and 2518 + * Train Display Port" step. Note that steps that are specific to 2519 + * MST will be handled by intel_mst_pre_enable_dp() before/after it 2520 + * calls into this function. Also intel_mst_pre_enable_dp() only calls 2521 + * us when active_mst_links==0, so any steps designated for "single 2522 + * stream or multi-stream master transcoder" can just be performed 2523 + * unconditionally here. 2524 + */ 2525 + 2526 + /* 2527 + * 5.a Configure Transcoder Clock Select to direct the Port clock to the 2528 + * Transcoder. 2529 + */ 2530 + intel_ddi_enable_pipe_clock(encoder, crtc_state); 2531 + 2532 + /* 5.b Not relevant to i915 for now */ 2533 + 2534 + /* 2535 + * 5.c Configure TRANS_DDI_FUNC_CTL DDI Select, DDI Mode Select & MST 2536 + * Transport Select 2537 + */ 2538 + intel_ddi_config_transcoder_func(encoder, crtc_state); 2539 + 2540 + /* 2541 + * 5.d Configure & enable DP_TP_CTL with link training pattern 1 2542 + * selected 2543 + * 2544 + * This will be handled by the intel_dp_start_link_train() farther 2545 + * down this function. 2546 + */ 2547 + 2548 + /* 5.e Configure voltage swing and related IO settings */ 2549 + intel_snps_phy_ddi_vswing_sequence(encoder, level); 2550 + 2551 + /* 2552 + * 5.f Configure and enable DDI_BUF_CTL 2553 + * 5.g Wait for DDI_BUF_CTL DDI Idle Status = 0b (Not Idle), timeout 2554 + * after 1200 us. 2555 + * 2556 + * We only configure what the register value will be here. Actual 2557 + * enabling happens during link training farther down. 2558 + */ 2559 + intel_ddi_init_dp_buf_reg(encoder, crtc_state); 2560 + 2561 + if (!is_mst) 2562 + intel_dp_set_power(intel_dp, DP_SET_POWER_D0); 2563 + 2564 + intel_dp_sink_set_decompression_state(intel_dp, crtc_state, true); 2565 + /* 2566 + * DDI FEC: "anticipates enabling FEC encoding sets the FEC_READY bit 2567 + * in the FEC_CONFIGURATION register to 1 before initiating link 2568 + * training 2569 + */ 2570 + intel_dp_sink_set_fec_ready(intel_dp, crtc_state); 2571 + 2572 + /* 2573 + * 5.h Follow DisplayPort specification training sequence (see notes for 2574 + * failure handling) 2575 + * 5.i If DisplayPort multi-stream - Set DP_TP_CTL link training to Idle 2576 + * Pattern, wait for 5 idle patterns (DP_TP_STATUS Min_Idles_Sent) 2577 + * (timeout after 800 us) 2578 + */ 2579 + intel_dp_start_link_train(intel_dp, crtc_state); 2580 + 2581 + /* 5.j Set DP_TP_CTL link training to Normal */ 2582 + if (!is_trans_port_sync_mode(crtc_state)) 2583 + intel_dp_stop_link_train(intel_dp, crtc_state); 2584 + 2585 + /* 5.k Configure and enable FEC if needed */ 2586 + intel_ddi_enable_fec(encoder, crtc_state); 2587 + intel_dsc_enable(encoder, crtc_state); 2588 + } 2589 + 2321 2590 static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state, 2322 2591 struct intel_encoder *encoder, 2323 2592 const struct intel_crtc_state *crtc_state, ··· 2608 2657 2609 2658 if (DISPLAY_VER(dev_priv) >= 11) 2610 2659 icl_ddi_vswing_sequence(encoder, crtc_state, level); 2611 - else if (IS_CANNONLAKE(dev_priv)) 2612 - cnl_ddi_vswing_sequence(encoder, crtc_state, level); 2613 2660 else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 2614 2661 bxt_ddi_vswing_sequence(encoder, crtc_state, level); 2615 2662 else ··· 2643 2694 { 2644 2695 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 2645 2696 2646 - if (DISPLAY_VER(dev_priv) >= 12) 2697 + if (IS_DG2(dev_priv)) 2698 + dg2_ddi_pre_enable_dp(state, encoder, crtc_state, conn_state); 2699 + else if (DISPLAY_VER(dev_priv) >= 12) 2647 2700 tgl_ddi_pre_enable_dp(state, encoder, crtc_state, conn_state); 2648 2701 else 2649 2702 hsw_ddi_pre_enable_dp(state, encoder, crtc_state, conn_state); ··· 3052 3101 "[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n", 3053 3102 connector->base.id, connector->name); 3054 3103 3055 - if (DISPLAY_VER(dev_priv) >= 12) 3104 + if (IS_DG2(dev_priv)) 3105 + intel_snps_phy_ddi_vswing_sequence(encoder, U32_MAX); 3106 + else if (DISPLAY_VER(dev_priv) >= 12) 3056 3107 tgl_ddi_vswing_sequence(encoder, crtc_state, level); 3057 3108 else if (DISPLAY_VER(dev_priv) == 11) 3058 3109 icl_ddi_vswing_sequence(encoder, crtc_state, level); 3059 - else if (IS_CANNONLAKE(dev_priv)) 3060 - cnl_ddi_vswing_sequence(encoder, crtc_state, level); 3061 3110 else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 3062 3111 bxt_ddi_vswing_sequence(encoder, crtc_state, level); 3063 3112 else ··· 3155 3204 3156 3205 intel_dp->link_trained = false; 3157 3206 3158 - if (old_crtc_state->has_audio) 3159 - intel_audio_codec_disable(encoder, 3160 - old_crtc_state, old_conn_state); 3161 - 3162 - intel_edp_drrs_disable(intel_dp, old_crtc_state); 3163 - intel_psr_disable(intel_dp, old_crtc_state); 3164 3207 intel_edp_backlight_off(old_conn_state); 3165 3208 /* Disable the decompression in DP Sink */ 3166 3209 intel_dp_sink_set_decompression_state(intel_dp, old_crtc_state, ··· 3172 3227 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 3173 3228 struct drm_connector *connector = old_conn_state->connector; 3174 3229 3175 - if (old_crtc_state->has_audio) 3176 - intel_audio_codec_disable(encoder, 3177 - old_crtc_state, old_conn_state); 3178 - 3179 3230 if (!intel_hdmi_handle_sink_scrambling(encoder, connector, 3180 3231 false, false)) 3181 3232 drm_dbg_kms(&i915->drm, 3182 3233 "[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n", 3183 3234 connector->base.id, connector->name); 3235 + } 3236 + 3237 + static void intel_pre_disable_ddi(struct intel_atomic_state *state, 3238 + struct intel_encoder *encoder, 3239 + const struct intel_crtc_state *old_crtc_state, 3240 + const struct drm_connector_state *old_conn_state) 3241 + { 3242 + struct intel_dp *intel_dp; 3243 + 3244 + if (old_crtc_state->has_audio) 3245 + intel_audio_codec_disable(encoder, old_crtc_state, 3246 + old_conn_state); 3247 + 3248 + if (intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_HDMI)) 3249 + return; 3250 + 3251 + intel_dp = enc_to_intel_dp(encoder); 3252 + intel_edp_drrs_disable(intel_dp, old_crtc_state); 3253 + intel_psr_disable(intel_dp, old_crtc_state); 3184 3254 } 3185 3255 3186 3256 static void intel_disable_ddi(struct intel_atomic_state *state, ··· 3414 3454 if (cpu_transcoder == TRANSCODER_EDP) 3415 3455 return false; 3416 3456 3417 - if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO)) 3457 + if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO_MMIO)) 3418 3458 return false; 3419 3459 3420 3460 return intel_de_read(dev_priv, HSW_AUD_PIN_ELD_CP_VLD) & ··· 3430 3470 crtc_state->min_voltage_level = 3; 3431 3471 else if (DISPLAY_VER(dev_priv) >= 11 && crtc_state->port_clock > 594000) 3432 3472 crtc_state->min_voltage_level = 1; 3433 - else if (IS_CANNONLAKE(dev_priv) && crtc_state->port_clock > 594000) 3434 - crtc_state->min_voltage_level = 2; 3435 3473 } 3436 3474 3437 3475 static enum transcoder bdw_transcoder_master_readout(struct drm_i915_private *dev_priv, ··· 3703 3745 &crtc_state->dpll_hw_state); 3704 3746 } 3705 3747 3748 + static void dg2_ddi_get_config(struct intel_encoder *encoder, 3749 + struct intel_crtc_state *crtc_state) 3750 + { 3751 + intel_mpllb_readout_hw_state(encoder, &crtc_state->mpllb_state); 3752 + crtc_state->port_clock = intel_mpllb_calc_port_clock(encoder, &crtc_state->mpllb_state); 3753 + 3754 + intel_ddi_get_config(encoder, crtc_state); 3755 + } 3756 + 3706 3757 static void adls_ddi_get_config(struct intel_encoder *encoder, 3707 3758 struct intel_crtc_state *crtc_state) 3708 3759 { ··· 3776 3809 struct intel_crtc_state *crtc_state) 3777 3810 { 3778 3811 icl_ddi_tc_get_clock(encoder, crtc_state, icl_ddi_tc_get_pll(encoder)); 3779 - intel_ddi_get_config(encoder, crtc_state); 3780 - } 3781 - 3782 - static void cnl_ddi_get_config(struct intel_encoder *encoder, 3783 - struct intel_crtc_state *crtc_state) 3784 - { 3785 - intel_ddi_get_clock(encoder, crtc_state, cnl_ddi_get_pll(encoder)); 3786 3812 intel_ddi_get_config(encoder, crtc_state); 3787 3813 } 3788 3814 ··· 4025 4065 dig_port->dp.set_link_train = intel_ddi_set_link_train; 4026 4066 dig_port->dp.set_idle_link_train = intel_ddi_set_idle_link_train; 4027 4067 4028 - if (DISPLAY_VER(dev_priv) >= 12) 4068 + if (IS_DG2(dev_priv)) 4069 + dig_port->dp.set_signal_levels = dg2_set_signal_levels; 4070 + else if (DISPLAY_VER(dev_priv) >= 12) 4029 4071 dig_port->dp.set_signal_levels = tgl_set_signal_levels; 4030 4072 else if (DISPLAY_VER(dev_priv) >= 11) 4031 4073 dig_port->dp.set_signal_levels = icl_set_signal_levels; 4032 - else if (IS_CANNONLAKE(dev_priv)) 4033 - dig_port->dp.set_signal_levels = cnl_set_signal_levels; 4034 4074 else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 4035 4075 dig_port->dp.set_signal_levels = bxt_set_signal_levels; 4036 4076 else ··· 4277 4317 if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 4278 4318 return true; 4279 4319 4280 - /* Cannonlake: Most of SKUs don't support DDI_E, and the only 4281 - * one who does also have a full A/E split called 4282 - * DDI_F what makes DDI_E useless. However for this 4283 - * case let's trust VBT info. 4284 - */ 4285 - if (IS_CANNONLAKE(dev_priv) && 4286 - !intel_bios_is_port_present(dev_priv, PORT_E)) 4287 - return true; 4288 - 4289 4320 return false; 4290 4321 } 4291 4322 ··· 4377 4426 4378 4427 if (HAS_PCH_MCC(dev_priv)) 4379 4428 return icl_hpd_pin(dev_priv, port); 4380 - 4381 - return HPD_PORT_A + port - PORT_A; 4382 - } 4383 - 4384 - static enum hpd_pin cnl_hpd_pin(struct drm_i915_private *dev_priv, 4385 - enum port port) 4386 - { 4387 - if (port == PORT_F) 4388 - return HPD_PORT_E; 4389 4429 4390 4430 return HPD_PORT_A + port - PORT_A; 4391 4431 } ··· 4532 4590 encoder->enable = intel_enable_ddi; 4533 4591 encoder->pre_pll_enable = intel_ddi_pre_pll_enable; 4534 4592 encoder->pre_enable = intel_ddi_pre_enable; 4593 + encoder->pre_disable = intel_pre_disable_ddi; 4535 4594 encoder->disable = intel_disable_ddi; 4536 4595 encoder->post_disable = intel_ddi_post_disable; 4537 4596 encoder->update_pipe = intel_ddi_update_pipe; ··· 4549 4606 encoder->cloneable = 0; 4550 4607 encoder->pipe_mask = ~0; 4551 4608 4552 - if (IS_ALDERLAKE_S(dev_priv)) { 4609 + if (IS_DG2(dev_priv)) { 4610 + encoder->enable_clock = intel_mpllb_enable; 4611 + encoder->disable_clock = intel_mpllb_disable; 4612 + encoder->get_config = dg2_ddi_get_config; 4613 + } else if (IS_ALDERLAKE_S(dev_priv)) { 4553 4614 encoder->enable_clock = adls_ddi_enable_clock; 4554 4615 encoder->disable_clock = adls_ddi_disable_clock; 4555 4616 encoder->is_clock_enabled = adls_ddi_is_clock_enabled; ··· 4592 4645 encoder->is_clock_enabled = icl_ddi_combo_is_clock_enabled; 4593 4646 encoder->get_config = icl_ddi_combo_get_config; 4594 4647 } 4595 - } else if (IS_CANNONLAKE(dev_priv)) { 4596 - encoder->enable_clock = cnl_ddi_enable_clock; 4597 - encoder->disable_clock = cnl_ddi_disable_clock; 4598 - encoder->is_clock_enabled = cnl_ddi_is_clock_enabled; 4599 - encoder->get_config = cnl_ddi_get_config; 4600 4648 } else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) { 4601 4649 /* BXT/GLK have fixed PLL->port mapping */ 4602 4650 encoder->get_config = bxt_ddi_get_config; ··· 4621 4679 encoder->hpd_pin = ehl_hpd_pin(dev_priv, port); 4622 4680 else if (DISPLAY_VER(dev_priv) == 11) 4623 4681 encoder->hpd_pin = icl_hpd_pin(dev_priv, port); 4624 - else if (IS_CANNONLAKE(dev_priv)) 4625 - encoder->hpd_pin = cnl_hpd_pin(dev_priv, port); 4626 4682 else if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv)) 4627 4683 encoder->hpd_pin = skl_hpd_pin(dev_priv, port); 4628 4684 else
+291 -441
drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
··· 417 417 .hdmi_default_entry = ARRAY_SIZE(_bxt_ddi_translations_hdmi) - 1, 418 418 }; 419 419 420 - /* Voltage Swing Programming for VccIO 0.85V for DP */ 421 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_dp_0_85V[] = { 422 - /* NT mV Trans mV db */ 423 - { .cnl = { 0xA, 0x5D, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 424 - { .cnl = { 0xA, 0x6A, 0x38, 0x00, 0x07 } }, /* 350 500 3.1 */ 425 - { .cnl = { 0xB, 0x7A, 0x32, 0x00, 0x0D } }, /* 350 700 6.0 */ 426 - { .cnl = { 0x6, 0x7C, 0x2D, 0x00, 0x12 } }, /* 350 900 8.2 */ 427 - { .cnl = { 0xA, 0x69, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 428 - { .cnl = { 0xB, 0x7A, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 429 - { .cnl = { 0x6, 0x7C, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 430 - { .cnl = { 0xB, 0x7D, 0x3C, 0x00, 0x03 } }, /* 650 725 0.9 */ 431 - { .cnl = { 0x6, 0x7C, 0x34, 0x00, 0x0B } }, /* 600 900 3.5 */ 432 - { .cnl = { 0x6, 0x7B, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 433 - }; 434 - 435 - static const struct intel_ddi_buf_trans cnl_ddi_translations_dp_0_85V = { 436 - .entries = _cnl_ddi_translations_dp_0_85V, 437 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_dp_0_85V), 438 - }; 439 - 440 - /* Voltage Swing Programming for VccIO 0.85V for HDMI */ 441 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_hdmi_0_85V[] = { 442 - /* NT mV Trans mV db */ 443 - { .cnl = { 0xA, 0x60, 0x3F, 0x00, 0x00 } }, /* 450 450 0.0 */ 444 - { .cnl = { 0xB, 0x73, 0x36, 0x00, 0x09 } }, /* 450 650 3.2 */ 445 - { .cnl = { 0x6, 0x7F, 0x31, 0x00, 0x0E } }, /* 450 850 5.5 */ 446 - { .cnl = { 0xB, 0x73, 0x3F, 0x00, 0x00 } }, /* 650 650 0.0 */ 447 - { .cnl = { 0x6, 0x7F, 0x37, 0x00, 0x08 } }, /* 650 850 2.3 */ 448 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 850 850 0.0 */ 449 - { .cnl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 850 3.0 */ 450 - }; 451 - 452 - static const struct intel_ddi_buf_trans cnl_ddi_translations_hdmi_0_85V = { 453 - .entries = _cnl_ddi_translations_hdmi_0_85V, 454 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_hdmi_0_85V), 455 - .hdmi_default_entry = ARRAY_SIZE(_cnl_ddi_translations_hdmi_0_85V) - 1, 456 - }; 457 - 458 - /* Voltage Swing Programming for VccIO 0.85V for eDP */ 459 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_edp_0_85V[] = { 460 - /* NT mV Trans mV db */ 461 - { .cnl = { 0xA, 0x66, 0x3A, 0x00, 0x05 } }, /* 384 500 2.3 */ 462 - { .cnl = { 0x0, 0x7F, 0x38, 0x00, 0x07 } }, /* 153 200 2.3 */ 463 - { .cnl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 192 250 2.3 */ 464 - { .cnl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 230 300 2.3 */ 465 - { .cnl = { 0x9, 0x7F, 0x38, 0x00, 0x07 } }, /* 269 350 2.3 */ 466 - { .cnl = { 0xA, 0x66, 0x3C, 0x00, 0x03 } }, /* 446 500 1.0 */ 467 - { .cnl = { 0xB, 0x70, 0x3C, 0x00, 0x03 } }, /* 460 600 2.3 */ 468 - { .cnl = { 0xC, 0x75, 0x3C, 0x00, 0x03 } }, /* 537 700 2.3 */ 469 - { .cnl = { 0x2, 0x7F, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 470 - }; 471 - 472 - static const struct intel_ddi_buf_trans cnl_ddi_translations_edp_0_85V = { 473 - .entries = _cnl_ddi_translations_edp_0_85V, 474 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_edp_0_85V), 475 - }; 476 - 477 - /* Voltage Swing Programming for VccIO 0.95V for DP */ 478 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_dp_0_95V[] = { 479 - /* NT mV Trans mV db */ 480 - { .cnl = { 0xA, 0x5D, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 481 - { .cnl = { 0xA, 0x6A, 0x38, 0x00, 0x07 } }, /* 350 500 3.1 */ 482 - { .cnl = { 0xB, 0x7A, 0x32, 0x00, 0x0D } }, /* 350 700 6.0 */ 483 - { .cnl = { 0x6, 0x7C, 0x2D, 0x00, 0x12 } }, /* 350 900 8.2 */ 484 - { .cnl = { 0xA, 0x69, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 485 - { .cnl = { 0xB, 0x7A, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 486 - { .cnl = { 0x6, 0x7C, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 487 - { .cnl = { 0xB, 0x7D, 0x3C, 0x00, 0x03 } }, /* 650 725 0.9 */ 488 - { .cnl = { 0x6, 0x7C, 0x34, 0x00, 0x0B } }, /* 600 900 3.5 */ 489 - { .cnl = { 0x6, 0x7B, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 490 - }; 491 - 492 - static const struct intel_ddi_buf_trans cnl_ddi_translations_dp_0_95V = { 493 - .entries = _cnl_ddi_translations_dp_0_95V, 494 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_dp_0_95V), 495 - }; 496 - 497 - /* Voltage Swing Programming for VccIO 0.95V for HDMI */ 498 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_hdmi_0_95V[] = { 499 - /* NT mV Trans mV db */ 500 - { .cnl = { 0xA, 0x5C, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 501 - { .cnl = { 0xB, 0x69, 0x37, 0x00, 0x08 } }, /* 400 600 3.5 */ 502 - { .cnl = { 0x5, 0x76, 0x31, 0x00, 0x0E } }, /* 400 800 6.0 */ 503 - { .cnl = { 0xA, 0x5E, 0x3F, 0x00, 0x00 } }, /* 450 450 0.0 */ 504 - { .cnl = { 0xB, 0x69, 0x3F, 0x00, 0x00 } }, /* 600 600 0.0 */ 505 - { .cnl = { 0xB, 0x79, 0x35, 0x00, 0x0A } }, /* 600 850 3.0 */ 506 - { .cnl = { 0x6, 0x7D, 0x32, 0x00, 0x0D } }, /* 600 1000 4.4 */ 507 - { .cnl = { 0x5, 0x76, 0x3F, 0x00, 0x00 } }, /* 800 800 0.0 */ 508 - { .cnl = { 0x6, 0x7D, 0x39, 0x00, 0x06 } }, /* 800 1000 1.9 */ 509 - { .cnl = { 0x6, 0x7F, 0x39, 0x00, 0x06 } }, /* 850 1050 1.8 */ 510 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1050 1050 0.0 */ 511 - }; 512 - 513 - static const struct intel_ddi_buf_trans cnl_ddi_translations_hdmi_0_95V = { 514 - .entries = _cnl_ddi_translations_hdmi_0_95V, 515 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_hdmi_0_95V), 516 - .hdmi_default_entry = ARRAY_SIZE(_cnl_ddi_translations_hdmi_0_95V) - 1, 517 - }; 518 - 519 - /* Voltage Swing Programming for VccIO 0.95V for eDP */ 520 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_edp_0_95V[] = { 521 - /* NT mV Trans mV db */ 522 - { .cnl = { 0xA, 0x61, 0x3A, 0x00, 0x05 } }, /* 384 500 2.3 */ 523 - { .cnl = { 0x0, 0x7F, 0x38, 0x00, 0x07 } }, /* 153 200 2.3 */ 524 - { .cnl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 192 250 2.3 */ 525 - { .cnl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 230 300 2.3 */ 526 - { .cnl = { 0x9, 0x7F, 0x38, 0x00, 0x07 } }, /* 269 350 2.3 */ 527 - { .cnl = { 0xA, 0x61, 0x3C, 0x00, 0x03 } }, /* 446 500 1.0 */ 528 - { .cnl = { 0xB, 0x68, 0x39, 0x00, 0x06 } }, /* 460 600 2.3 */ 529 - { .cnl = { 0xC, 0x6E, 0x39, 0x00, 0x06 } }, /* 537 700 2.3 */ 530 - { .cnl = { 0x4, 0x7F, 0x3A, 0x00, 0x05 } }, /* 460 600 2.3 */ 531 - { .cnl = { 0x2, 0x7F, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 532 - }; 533 - 534 - static const struct intel_ddi_buf_trans cnl_ddi_translations_edp_0_95V = { 535 - .entries = _cnl_ddi_translations_edp_0_95V, 536 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_edp_0_95V), 537 - }; 538 - 539 - /* Voltage Swing Programming for VccIO 1.05V for DP */ 540 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_dp_1_05V[] = { 541 - /* NT mV Trans mV db */ 542 - { .cnl = { 0xA, 0x58, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 543 - { .cnl = { 0xB, 0x64, 0x37, 0x00, 0x08 } }, /* 400 600 3.5 */ 544 - { .cnl = { 0x5, 0x70, 0x31, 0x00, 0x0E } }, /* 400 800 6.0 */ 545 - { .cnl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 400 1050 8.4 */ 546 - { .cnl = { 0xB, 0x64, 0x3F, 0x00, 0x00 } }, /* 600 600 0.0 */ 547 - { .cnl = { 0x5, 0x73, 0x35, 0x00, 0x0A } }, /* 600 850 3.0 */ 548 - { .cnl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 550 1050 5.6 */ 549 - { .cnl = { 0x5, 0x76, 0x3E, 0x00, 0x01 } }, /* 850 900 0.5 */ 550 - { .cnl = { 0x6, 0x7F, 0x36, 0x00, 0x09 } }, /* 750 1050 2.9 */ 551 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1050 1050 0.0 */ 552 - }; 553 - 554 - static const struct intel_ddi_buf_trans cnl_ddi_translations_dp_1_05V = { 555 - .entries = _cnl_ddi_translations_dp_1_05V, 556 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_dp_1_05V), 557 - }; 558 - 559 - /* Voltage Swing Programming for VccIO 1.05V for HDMI */ 560 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_hdmi_1_05V[] = { 561 - /* NT mV Trans mV db */ 562 - { .cnl = { 0xA, 0x58, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 563 - { .cnl = { 0xB, 0x64, 0x37, 0x00, 0x08 } }, /* 400 600 3.5 */ 564 - { .cnl = { 0x5, 0x70, 0x31, 0x00, 0x0E } }, /* 400 800 6.0 */ 565 - { .cnl = { 0xA, 0x5B, 0x3F, 0x00, 0x00 } }, /* 450 450 0.0 */ 566 - { .cnl = { 0xB, 0x64, 0x3F, 0x00, 0x00 } }, /* 600 600 0.0 */ 567 - { .cnl = { 0x5, 0x73, 0x35, 0x00, 0x0A } }, /* 600 850 3.0 */ 568 - { .cnl = { 0x6, 0x7C, 0x32, 0x00, 0x0D } }, /* 600 1000 4.4 */ 569 - { .cnl = { 0x5, 0x70, 0x3F, 0x00, 0x00 } }, /* 800 800 0.0 */ 570 - { .cnl = { 0x6, 0x7C, 0x39, 0x00, 0x06 } }, /* 800 1000 1.9 */ 571 - { .cnl = { 0x6, 0x7F, 0x39, 0x00, 0x06 } }, /* 850 1050 1.8 */ 572 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1050 1050 0.0 */ 573 - }; 574 - 575 - static const struct intel_ddi_buf_trans cnl_ddi_translations_hdmi_1_05V = { 576 - .entries = _cnl_ddi_translations_hdmi_1_05V, 577 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_hdmi_1_05V), 578 - .hdmi_default_entry = ARRAY_SIZE(_cnl_ddi_translations_hdmi_1_05V) - 1, 579 - }; 580 - 581 - /* Voltage Swing Programming for VccIO 1.05V for eDP */ 582 - static const union intel_ddi_buf_trans_entry _cnl_ddi_translations_edp_1_05V[] = { 583 - /* NT mV Trans mV db */ 584 - { .cnl = { 0xA, 0x5E, 0x3A, 0x00, 0x05 } }, /* 384 500 2.3 */ 585 - { .cnl = { 0x0, 0x7F, 0x38, 0x00, 0x07 } }, /* 153 200 2.3 */ 586 - { .cnl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 192 250 2.3 */ 587 - { .cnl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 230 300 2.3 */ 588 - { .cnl = { 0x9, 0x7F, 0x38, 0x00, 0x07 } }, /* 269 350 2.3 */ 589 - { .cnl = { 0xA, 0x5E, 0x3C, 0x00, 0x03 } }, /* 446 500 1.0 */ 590 - { .cnl = { 0xB, 0x64, 0x39, 0x00, 0x06 } }, /* 460 600 2.3 */ 591 - { .cnl = { 0xE, 0x6A, 0x39, 0x00, 0x06 } }, /* 537 700 2.3 */ 592 - { .cnl = { 0x2, 0x7F, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 593 - }; 594 - 595 - static const struct intel_ddi_buf_trans cnl_ddi_translations_edp_1_05V = { 596 - .entries = _cnl_ddi_translations_edp_1_05V, 597 - .num_entries = ARRAY_SIZE(_cnl_ddi_translations_edp_1_05V), 598 - }; 599 - 600 420 /* icl_combo_phy_ddi_translations */ 601 421 static const union intel_ddi_buf_trans_entry _icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3[] = { 602 422 /* NT mV Trans mV db */ 603 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 604 - { .cnl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 605 - { .cnl = { 0xC, 0x71, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 606 - { .cnl = { 0x6, 0x7F, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 607 - { .cnl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 608 - { .cnl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 609 - { .cnl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 610 - { .cnl = { 0xC, 0x6C, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 611 - { .cnl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 612 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 423 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 424 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 425 + { .icl = { 0xC, 0x71, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 426 + { .icl = { 0x6, 0x7F, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 427 + { .icl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 428 + { .icl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 429 + { .icl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 430 + { .icl = { 0xC, 0x6C, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 431 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 432 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 613 433 }; 614 434 615 435 static const struct intel_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3 = { ··· 439 619 440 620 static const union intel_ddi_buf_trans_entry _icl_combo_phy_ddi_translations_edp_hbr2[] = { 441 621 /* NT mV Trans mV db */ 442 - { .cnl = { 0x0, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 443 - { .cnl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 200 250 1.9 */ 444 - { .cnl = { 0x1, 0x7F, 0x33, 0x00, 0x0C } }, /* 200 300 3.5 */ 445 - { .cnl = { 0x9, 0x7F, 0x31, 0x00, 0x0E } }, /* 200 350 4.9 */ 446 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 447 - { .cnl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 250 300 1.6 */ 448 - { .cnl = { 0x9, 0x7F, 0x35, 0x00, 0x0A } }, /* 250 350 2.9 */ 449 - { .cnl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 450 - { .cnl = { 0x9, 0x7F, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 451 - { .cnl = { 0x9, 0x7F, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 622 + { .icl = { 0x0, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 623 + { .icl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 200 250 1.9 */ 624 + { .icl = { 0x1, 0x7F, 0x33, 0x00, 0x0C } }, /* 200 300 3.5 */ 625 + { .icl = { 0x9, 0x7F, 0x31, 0x00, 0x0E } }, /* 200 350 4.9 */ 626 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 627 + { .icl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 250 300 1.6 */ 628 + { .icl = { 0x9, 0x7F, 0x35, 0x00, 0x0A } }, /* 250 350 2.9 */ 629 + { .icl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 630 + { .icl = { 0x9, 0x7F, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 631 + { .icl = { 0x9, 0x7F, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 452 632 }; 453 633 454 634 static const struct intel_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr2 = { ··· 458 638 459 639 static const union intel_ddi_buf_trans_entry _icl_combo_phy_ddi_translations_hdmi[] = { 460 640 /* NT mV Trans mV db */ 461 - { .cnl = { 0xA, 0x60, 0x3F, 0x00, 0x00 } }, /* 450 450 0.0 */ 462 - { .cnl = { 0xB, 0x73, 0x36, 0x00, 0x09 } }, /* 450 650 3.2 */ 463 - { .cnl = { 0x6, 0x7F, 0x31, 0x00, 0x0E } }, /* 450 850 5.5 */ 464 - { .cnl = { 0xB, 0x73, 0x3F, 0x00, 0x00 } }, /* 650 650 0.0 ALS */ 465 - { .cnl = { 0x6, 0x7F, 0x37, 0x00, 0x08 } }, /* 650 850 2.3 */ 466 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 850 850 0.0 */ 467 - { .cnl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 850 3.0 */ 641 + { .icl = { 0xA, 0x60, 0x3F, 0x00, 0x00 } }, /* 450 450 0.0 */ 642 + { .icl = { 0xB, 0x73, 0x36, 0x00, 0x09 } }, /* 450 650 3.2 */ 643 + { .icl = { 0x6, 0x7F, 0x31, 0x00, 0x0E } }, /* 450 850 5.5 */ 644 + { .icl = { 0xB, 0x73, 0x3F, 0x00, 0x00 } }, /* 650 650 0.0 ALS */ 645 + { .icl = { 0x6, 0x7F, 0x37, 0x00, 0x08 } }, /* 650 850 2.3 */ 646 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 850 850 0.0 */ 647 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 850 3.0 */ 468 648 }; 469 649 470 650 static const struct intel_ddi_buf_trans icl_combo_phy_ddi_translations_hdmi = { ··· 475 655 476 656 static const union intel_ddi_buf_trans_entry _ehl_combo_phy_ddi_translations_dp[] = { 477 657 /* NT mV Trans mV db */ 478 - { .cnl = { 0xA, 0x33, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 479 - { .cnl = { 0xA, 0x47, 0x36, 0x00, 0x09 } }, /* 350 500 3.1 */ 480 - { .cnl = { 0xC, 0x64, 0x34, 0x00, 0x0B } }, /* 350 700 6.0 */ 481 - { .cnl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 350 900 8.2 */ 482 - { .cnl = { 0xA, 0x46, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 483 - { .cnl = { 0xC, 0x64, 0x38, 0x00, 0x07 } }, /* 500 700 2.9 */ 484 - { .cnl = { 0x6, 0x7F, 0x32, 0x00, 0x0D } }, /* 500 900 5.1 */ 485 - { .cnl = { 0xC, 0x61, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 486 - { .cnl = { 0x6, 0x7F, 0x38, 0x00, 0x07 } }, /* 600 900 3.5 */ 487 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 658 + { .icl = { 0xA, 0x33, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 659 + { .icl = { 0xA, 0x47, 0x36, 0x00, 0x09 } }, /* 350 500 3.1 */ 660 + { .icl = { 0xC, 0x64, 0x34, 0x00, 0x0B } }, /* 350 700 6.0 */ 661 + { .icl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 350 900 8.2 */ 662 + { .icl = { 0xA, 0x46, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 663 + { .icl = { 0xC, 0x64, 0x38, 0x00, 0x07 } }, /* 500 700 2.9 */ 664 + { .icl = { 0x6, 0x7F, 0x32, 0x00, 0x0D } }, /* 500 900 5.1 */ 665 + { .icl = { 0xC, 0x61, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 666 + { .icl = { 0x6, 0x7F, 0x38, 0x00, 0x07 } }, /* 600 900 3.5 */ 667 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 488 668 }; 489 669 490 670 static const struct intel_ddi_buf_trans ehl_combo_phy_ddi_translations_dp = { ··· 494 674 495 675 static const union intel_ddi_buf_trans_entry _ehl_combo_phy_ddi_translations_edp_hbr2[] = { 496 676 /* NT mV Trans mV db */ 497 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 498 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 250 1.9 */ 499 - { .cnl = { 0x1, 0x7F, 0x3D, 0x00, 0x02 } }, /* 200 300 3.5 */ 500 - { .cnl = { 0xA, 0x35, 0x39, 0x00, 0x06 } }, /* 200 350 4.9 */ 501 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 502 - { .cnl = { 0x1, 0x7F, 0x3C, 0x00, 0x03 } }, /* 250 300 1.6 */ 503 - { .cnl = { 0xA, 0x35, 0x39, 0x00, 0x06 } }, /* 250 350 2.9 */ 504 - { .cnl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 505 - { .cnl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 506 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 677 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 678 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 250 1.9 */ 679 + { .icl = { 0x1, 0x7F, 0x3D, 0x00, 0x02 } }, /* 200 300 3.5 */ 680 + { .icl = { 0xA, 0x35, 0x39, 0x00, 0x06 } }, /* 200 350 4.9 */ 681 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 682 + { .icl = { 0x1, 0x7F, 0x3C, 0x00, 0x03 } }, /* 250 300 1.6 */ 683 + { .icl = { 0xA, 0x35, 0x39, 0x00, 0x06 } }, /* 250 350 2.9 */ 684 + { .icl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 685 + { .icl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 686 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 507 687 }; 508 688 509 689 static const struct intel_ddi_buf_trans ehl_combo_phy_ddi_translations_edp_hbr2 = { ··· 513 693 514 694 static const union intel_ddi_buf_trans_entry _jsl_combo_phy_ddi_translations_edp_hbr[] = { 515 695 /* NT mV Trans mV db */ 516 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 517 - { .cnl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 200 250 1.9 */ 518 - { .cnl = { 0x1, 0x7F, 0x33, 0x00, 0x0C } }, /* 200 300 3.5 */ 519 - { .cnl = { 0xA, 0x35, 0x36, 0x00, 0x09 } }, /* 200 350 4.9 */ 520 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 521 - { .cnl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 250 300 1.6 */ 522 - { .cnl = { 0xA, 0x35, 0x35, 0x00, 0x0A } }, /* 250 350 2.9 */ 523 - { .cnl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 524 - { .cnl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 525 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 696 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 697 + { .icl = { 0x8, 0x7F, 0x38, 0x00, 0x07 } }, /* 200 250 1.9 */ 698 + { .icl = { 0x1, 0x7F, 0x33, 0x00, 0x0C } }, /* 200 300 3.5 */ 699 + { .icl = { 0xA, 0x35, 0x36, 0x00, 0x09 } }, /* 200 350 4.9 */ 700 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 701 + { .icl = { 0x1, 0x7F, 0x38, 0x00, 0x07 } }, /* 250 300 1.6 */ 702 + { .icl = { 0xA, 0x35, 0x35, 0x00, 0x0A } }, /* 250 350 2.9 */ 703 + { .icl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 704 + { .icl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 705 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 526 706 }; 527 707 528 708 static const struct intel_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr = { ··· 532 712 533 713 static const union intel_ddi_buf_trans_entry _jsl_combo_phy_ddi_translations_edp_hbr2[] = { 534 714 /* NT mV Trans mV db */ 535 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 536 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 250 1.9 */ 537 - { .cnl = { 0x1, 0x7F, 0x3D, 0x00, 0x02 } }, /* 200 300 3.5 */ 538 - { .cnl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 200 350 4.9 */ 539 - { .cnl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 540 - { .cnl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 300 1.6 */ 541 - { .cnl = { 0xA, 0x35, 0x3A, 0x00, 0x05 } }, /* 250 350 2.9 */ 542 - { .cnl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 543 - { .cnl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 544 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 715 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 200 0.0 */ 716 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 200 250 1.9 */ 717 + { .icl = { 0x1, 0x7F, 0x3D, 0x00, 0x02 } }, /* 200 300 3.5 */ 718 + { .icl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 200 350 4.9 */ 719 + { .icl = { 0x8, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 250 0.0 */ 720 + { .icl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 250 300 1.6 */ 721 + { .icl = { 0xA, 0x35, 0x3A, 0x00, 0x05 } }, /* 250 350 2.9 */ 722 + { .icl = { 0x1, 0x7F, 0x3F, 0x00, 0x00 } }, /* 300 300 0.0 */ 723 + { .icl = { 0xA, 0x35, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 724 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 545 725 }; 546 726 547 727 static const struct intel_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr2 = { ··· 551 731 552 732 static const union intel_ddi_buf_trans_entry _dg1_combo_phy_ddi_translations_dp_rbr_hbr[] = { 553 733 /* NT mV Trans mV db */ 554 - { .cnl = { 0xA, 0x32, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 555 - { .cnl = { 0xA, 0x48, 0x35, 0x00, 0x0A } }, /* 350 500 3.1 */ 556 - { .cnl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 557 - { .cnl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 558 - { .cnl = { 0xA, 0x43, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 559 - { .cnl = { 0xC, 0x60, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 560 - { .cnl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 561 - { .cnl = { 0xC, 0x60, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 562 - { .cnl = { 0x6, 0x7F, 0x37, 0x00, 0x08 } }, /* 600 900 3.5 */ 563 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 734 + { .icl = { 0xA, 0x32, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 735 + { .icl = { 0xA, 0x48, 0x35, 0x00, 0x0A } }, /* 350 500 3.1 */ 736 + { .icl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 737 + { .icl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 738 + { .icl = { 0xA, 0x43, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 739 + { .icl = { 0xC, 0x60, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 740 + { .icl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 741 + { .icl = { 0xC, 0x60, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 742 + { .icl = { 0x6, 0x7F, 0x37, 0x00, 0x08 } }, /* 600 900 3.5 */ 743 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 564 744 }; 565 745 566 746 static const struct intel_ddi_buf_trans dg1_combo_phy_ddi_translations_dp_rbr_hbr = { ··· 570 750 571 751 static const union intel_ddi_buf_trans_entry _dg1_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { 572 752 /* NT mV Trans mV db */ 573 - { .cnl = { 0xA, 0x32, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 574 - { .cnl = { 0xA, 0x48, 0x35, 0x00, 0x0A } }, /* 350 500 3.1 */ 575 - { .cnl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 576 - { .cnl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 577 - { .cnl = { 0xA, 0x43, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 578 - { .cnl = { 0xC, 0x60, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 579 - { .cnl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 580 - { .cnl = { 0xC, 0x58, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 581 - { .cnl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 582 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 753 + { .icl = { 0xA, 0x32, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 754 + { .icl = { 0xA, 0x48, 0x35, 0x00, 0x0A } }, /* 350 500 3.1 */ 755 + { .icl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 756 + { .icl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 757 + { .icl = { 0xA, 0x43, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 758 + { .icl = { 0xC, 0x60, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 759 + { .icl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 760 + { .icl = { 0xC, 0x58, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 761 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 762 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 583 763 }; 584 764 585 765 static const struct intel_ddi_buf_trans dg1_combo_phy_ddi_translations_dp_hbr2_hbr3 = { ··· 705 885 706 886 static const union intel_ddi_buf_trans_entry _tgl_combo_phy_ddi_translations_dp_hbr[] = { 707 887 /* NT mV Trans mV db */ 708 - { .cnl = { 0xA, 0x32, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 709 - { .cnl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 710 - { .cnl = { 0xC, 0x71, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 711 - { .cnl = { 0x6, 0x7D, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 712 - { .cnl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 713 - { .cnl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 714 - { .cnl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 715 - { .cnl = { 0xC, 0x6C, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 716 - { .cnl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 717 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 888 + { .icl = { 0xA, 0x32, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 889 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 890 + { .icl = { 0xC, 0x71, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 891 + { .icl = { 0x6, 0x7D, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 892 + { .icl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 893 + { .icl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 894 + { .icl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 895 + { .icl = { 0xC, 0x6C, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 896 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 897 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 718 898 }; 719 899 720 900 static const struct intel_ddi_buf_trans tgl_combo_phy_ddi_translations_dp_hbr = { ··· 724 904 725 905 static const union intel_ddi_buf_trans_entry _tgl_combo_phy_ddi_translations_dp_hbr2[] = { 726 906 /* NT mV Trans mV db */ 727 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 728 - { .cnl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 729 - { .cnl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 730 - { .cnl = { 0x6, 0x7F, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 731 - { .cnl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 732 - { .cnl = { 0xC, 0x63, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 733 - { .cnl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 734 - { .cnl = { 0xC, 0x61, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 735 - { .cnl = { 0x6, 0x7B, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 736 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 907 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 908 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 909 + { .icl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 910 + { .icl = { 0x6, 0x7F, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 911 + { .icl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 912 + { .icl = { 0xC, 0x63, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 913 + { .icl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 914 + { .icl = { 0xC, 0x61, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 915 + { .icl = { 0x6, 0x7B, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 916 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 737 917 }; 738 918 739 919 static const struct intel_ddi_buf_trans tgl_combo_phy_ddi_translations_dp_hbr2 = { ··· 743 923 744 924 static const union intel_ddi_buf_trans_entry _tgl_uy_combo_phy_ddi_translations_dp_hbr2[] = { 745 925 /* NT mV Trans mV db */ 746 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 747 - { .cnl = { 0xA, 0x4F, 0x36, 0x00, 0x09 } }, /* 350 500 3.1 */ 748 - { .cnl = { 0xC, 0x60, 0x32, 0x00, 0x0D } }, /* 350 700 6.0 */ 749 - { .cnl = { 0xC, 0x7F, 0x2D, 0x00, 0x12 } }, /* 350 900 8.2 */ 750 - { .cnl = { 0xC, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 751 - { .cnl = { 0xC, 0x6F, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 752 - { .cnl = { 0x6, 0x7D, 0x32, 0x00, 0x0D } }, /* 500 900 5.1 */ 753 - { .cnl = { 0x6, 0x60, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 754 - { .cnl = { 0x6, 0x7F, 0x34, 0x00, 0x0B } }, /* 600 900 3.5 */ 755 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 926 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 927 + { .icl = { 0xA, 0x4F, 0x36, 0x00, 0x09 } }, /* 350 500 3.1 */ 928 + { .icl = { 0xC, 0x60, 0x32, 0x00, 0x0D } }, /* 350 700 6.0 */ 929 + { .icl = { 0xC, 0x7F, 0x2D, 0x00, 0x12 } }, /* 350 900 8.2 */ 930 + { .icl = { 0xC, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 931 + { .icl = { 0xC, 0x6F, 0x36, 0x00, 0x09 } }, /* 500 700 2.9 */ 932 + { .icl = { 0x6, 0x7D, 0x32, 0x00, 0x0D } }, /* 500 900 5.1 */ 933 + { .icl = { 0x6, 0x60, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 934 + { .icl = { 0x6, 0x7F, 0x34, 0x00, 0x0B } }, /* 600 900 3.5 */ 935 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 756 936 }; 757 937 758 938 static const struct intel_ddi_buf_trans tgl_uy_combo_phy_ddi_translations_dp_hbr2 = { ··· 766 946 */ 767 947 static const union intel_ddi_buf_trans_entry _tgl_combo_phy_ddi_translations_edp_hbr2_hobl[] = { 768 948 /* VS pre-emp */ 769 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 0 */ 770 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 1 */ 771 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 2 */ 772 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 3 */ 773 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1 0 */ 774 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1 1 */ 775 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1 2 */ 776 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 2 0 */ 777 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 2 1 */ 949 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 0 */ 950 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 1 */ 951 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 2 */ 952 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 0 3 */ 953 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1 0 */ 954 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1 1 */ 955 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1 2 */ 956 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 2 0 */ 957 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 2 1 */ 778 958 }; 779 959 780 960 static const struct intel_ddi_buf_trans tgl_combo_phy_ddi_translations_edp_hbr2_hobl = { ··· 784 964 785 965 static const union intel_ddi_buf_trans_entry _rkl_combo_phy_ddi_translations_dp_hbr[] = { 786 966 /* NT mV Trans mV db */ 787 - { .cnl = { 0xA, 0x2F, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 788 - { .cnl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 789 - { .cnl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 790 - { .cnl = { 0x6, 0x7D, 0x2A, 0x00, 0x15 } }, /* 350 900 8.2 */ 791 - { .cnl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 792 - { .cnl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 793 - { .cnl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 794 - { .cnl = { 0xC, 0x6E, 0x3E, 0x00, 0x01 } }, /* 650 700 0.6 */ 795 - { .cnl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 796 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 967 + { .icl = { 0xA, 0x2F, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 968 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 969 + { .icl = { 0xC, 0x63, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 970 + { .icl = { 0x6, 0x7D, 0x2A, 0x00, 0x15 } }, /* 350 900 8.2 */ 971 + { .icl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 972 + { .icl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 973 + { .icl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 974 + { .icl = { 0xC, 0x6E, 0x3E, 0x00, 0x01 } }, /* 650 700 0.6 */ 975 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 976 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 797 977 }; 798 978 799 979 static const struct intel_ddi_buf_trans rkl_combo_phy_ddi_translations_dp_hbr = { ··· 803 983 804 984 static const union intel_ddi_buf_trans_entry _rkl_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { 805 985 /* NT mV Trans mV db */ 806 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 807 - { .cnl = { 0xA, 0x50, 0x38, 0x00, 0x07 } }, /* 350 500 3.1 */ 808 - { .cnl = { 0xC, 0x61, 0x33, 0x00, 0x0C } }, /* 350 700 6.0 */ 809 - { .cnl = { 0x6, 0x7F, 0x2E, 0x00, 0x11 } }, /* 350 900 8.2 */ 810 - { .cnl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 811 - { .cnl = { 0xC, 0x5F, 0x38, 0x00, 0x07 } }, /* 500 700 2.9 */ 812 - { .cnl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 813 - { .cnl = { 0xC, 0x5F, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 814 - { .cnl = { 0x6, 0x7E, 0x36, 0x00, 0x09 } }, /* 600 900 3.5 */ 815 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 986 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 987 + { .icl = { 0xA, 0x50, 0x38, 0x00, 0x07 } }, /* 350 500 3.1 */ 988 + { .icl = { 0xC, 0x61, 0x33, 0x00, 0x0C } }, /* 350 700 6.0 */ 989 + { .icl = { 0x6, 0x7F, 0x2E, 0x00, 0x11 } }, /* 350 900 8.2 */ 990 + { .icl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 991 + { .icl = { 0xC, 0x5F, 0x38, 0x00, 0x07 } }, /* 500 700 2.9 */ 992 + { .icl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 993 + { .icl = { 0xC, 0x5F, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 994 + { .icl = { 0x6, 0x7E, 0x36, 0x00, 0x09 } }, /* 600 900 3.5 */ 995 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 816 996 }; 817 997 818 998 static const struct intel_ddi_buf_trans rkl_combo_phy_ddi_translations_dp_hbr2_hbr3 = { ··· 822 1002 823 1003 static const union intel_ddi_buf_trans_entry _adls_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { 824 1004 /* NT mV Trans mV db */ 825 - { .cnl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 826 - { .cnl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 827 - { .cnl = { 0xC, 0x63, 0x30, 0x00, 0x0F } }, /* 350 700 6.0 */ 828 - { .cnl = { 0x6, 0x7F, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 829 - { .cnl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 830 - { .cnl = { 0xC, 0x63, 0x37, 0x00, 0x08 } }, /* 500 700 2.9 */ 831 - { .cnl = { 0x6, 0x7F, 0x31, 0x00, 0x0E } }, /* 500 900 5.1 */ 832 - { .cnl = { 0xC, 0x61, 0x3C, 0x00, 0x03 } }, /* 650 700 0.6 */ 833 - { .cnl = { 0x6, 0x7B, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 834 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 1005 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 1006 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 1007 + { .icl = { 0xC, 0x63, 0x31, 0x00, 0x0E } }, /* 350 700 6.0 */ 1008 + { .icl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 1009 + { .icl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 1010 + { .icl = { 0xC, 0x63, 0x37, 0x00, 0x08 } }, /* 500 700 2.9 */ 1011 + { .icl = { 0x6, 0x73, 0x32, 0x00, 0x0D } }, /* 500 900 5.1 */ 1012 + { .icl = { 0xC, 0x58, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 1013 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 1014 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 835 1015 }; 836 1016 837 1017 static const struct intel_ddi_buf_trans adls_combo_phy_ddi_translations_dp_hbr2_hbr3 = { ··· 841 1021 842 1022 static const union intel_ddi_buf_trans_entry _adls_combo_phy_ddi_translations_edp_hbr2[] = { 843 1023 /* NT mV Trans mV db */ 844 - { .cnl = { 0x9, 0x70, 0x3C, 0x00, 0x03 } }, /* 200 200 0.0 */ 845 - { .cnl = { 0x9, 0x6D, 0x3A, 0x00, 0x05 } }, /* 200 250 1.9 */ 846 - { .cnl = { 0x9, 0x7F, 0x36, 0x00, 0x09 } }, /* 200 300 3.5 */ 847 - { .cnl = { 0x4, 0x59, 0x32, 0x00, 0x0D } }, /* 200 350 4.9 */ 848 - { .cnl = { 0x2, 0x77, 0x3A, 0x00, 0x05 } }, /* 250 250 0.0 */ 849 - { .cnl = { 0x2, 0x7F, 0x38, 0x00, 0x07 } }, /* 250 300 1.6 */ 850 - { .cnl = { 0x4, 0x5A, 0x36, 0x00, 0x09 } }, /* 250 350 2.9 */ 851 - { .cnl = { 0x4, 0x5E, 0x3D, 0x00, 0x04 } }, /* 300 300 0.0 */ 852 - { .cnl = { 0x4, 0x65, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 853 - { .cnl = { 0x4, 0x6F, 0x3A, 0x00, 0x05 } }, /* 350 350 0.0 */ 1024 + { .icl = { 0x9, 0x73, 0x3D, 0x00, 0x02 } }, /* 200 200 0.0 */ 1025 + { .icl = { 0x9, 0x7A, 0x3C, 0x00, 0x03 } }, /* 200 250 1.9 */ 1026 + { .icl = { 0x9, 0x7F, 0x3B, 0x00, 0x04 } }, /* 200 300 3.5 */ 1027 + { .icl = { 0x4, 0x6C, 0x33, 0x00, 0x0C } }, /* 200 350 4.9 */ 1028 + { .icl = { 0x2, 0x73, 0x3A, 0x00, 0x05 } }, /* 250 250 0.0 */ 1029 + { .icl = { 0x2, 0x7C, 0x38, 0x00, 0x07 } }, /* 250 300 1.6 */ 1030 + { .icl = { 0x4, 0x5A, 0x36, 0x00, 0x09 } }, /* 250 350 2.9 */ 1031 + { .icl = { 0x4, 0x57, 0x3D, 0x00, 0x02 } }, /* 300 300 0.0 */ 1032 + { .icl = { 0x4, 0x65, 0x38, 0x00, 0x07 } }, /* 300 350 1.3 */ 1033 + { .icl = { 0x4, 0x6C, 0x3A, 0x00, 0x05 } }, /* 350 350 0.0 */ 854 1034 }; 855 1035 856 1036 static const struct intel_ddi_buf_trans adls_combo_phy_ddi_translations_edp_hbr2 = { ··· 860 1040 861 1041 static const union intel_ddi_buf_trans_entry _adls_combo_phy_ddi_translations_edp_hbr3[] = { 862 1042 /* NT mV Trans mV db */ 863 - { .cnl = { 0xA, 0x5E, 0x34, 0x00, 0x0B } }, /* 350 350 0.0 */ 864 - { .cnl = { 0xA, 0x69, 0x32, 0x00, 0x0D } }, /* 350 500 3.1 */ 865 - { .cnl = { 0xC, 0x74, 0x31, 0x00, 0x0E } }, /* 350 700 6.0 */ 866 - { .cnl = { 0x6, 0x7F, 0x2E, 0x00, 0x11 } }, /* 350 900 8.2 */ 867 - { .cnl = { 0xA, 0x5C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 868 - { .cnl = { 0xC, 0x7F, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 869 - { .cnl = { 0x6, 0x7F, 0x33, 0x00, 0x0C } }, /* 500 900 5.1 */ 870 - { .cnl = { 0xC, 0x7F, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 871 - { .cnl = { 0x6, 0x7F, 0x3C, 0x00, 0x03 } }, /* 600 900 3.5 */ 872 - { .cnl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 1043 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 1044 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 1045 + { .icl = { 0xC, 0x63, 0x31, 0x00, 0x0E } }, /* 350 700 6.0 */ 1046 + { .icl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 1047 + { .icl = { 0xA, 0x47, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 1048 + { .icl = { 0xC, 0x63, 0x37, 0x00, 0x08 } }, /* 500 700 2.9 */ 1049 + { .icl = { 0x6, 0x73, 0x32, 0x00, 0x0D } }, /* 500 900 5.1 */ 1050 + { .icl = { 0xC, 0x58, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 1051 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 1052 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 873 1053 }; 874 1054 875 1055 static const struct intel_ddi_buf_trans adls_combo_phy_ddi_translations_edp_hbr3 = { 876 1056 .entries = _adls_combo_phy_ddi_translations_edp_hbr3, 877 1057 .num_entries = ARRAY_SIZE(_adls_combo_phy_ddi_translations_edp_hbr3), 1058 + }; 1059 + 1060 + static const union intel_ddi_buf_trans_entry _adlp_combo_phy_ddi_translations_hdmi[] = { 1061 + /* NT mV Trans mV db */ 1062 + { .icl = { 0x6, 0x60, 0x3F, 0x00, 0x00 } }, /* 400 400 0.0 */ 1063 + { .icl = { 0x6, 0x68, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 1064 + { .icl = { 0xA, 0x73, 0x3F, 0x00, 0x00 } }, /* 650 650 0.0 ALS */ 1065 + { .icl = { 0xA, 0x78, 0x3F, 0x00, 0x00 } }, /* 800 800 0.0 */ 1066 + { .icl = { 0xB, 0x7F, 0x3F, 0x00, 0x00 } }, /* 1000 1000 0.0 Re-timer */ 1067 + { .icl = { 0xB, 0x7F, 0x3B, 0x00, 0x04 } }, /* Full Red -1.5 */ 1068 + { .icl = { 0xB, 0x7F, 0x39, 0x00, 0x06 } }, /* Full Red -1.8 */ 1069 + { .icl = { 0xB, 0x7F, 0x37, 0x00, 0x08 } }, /* Full Red -2.0 CRLS */ 1070 + { .icl = { 0xB, 0x7F, 0x35, 0x00, 0x0A } }, /* Full Red -2.5 */ 1071 + { .icl = { 0xB, 0x7F, 0x33, 0x00, 0x0C } }, /* Full Red -3.0 */ 1072 + }; 1073 + 1074 + static const struct intel_ddi_buf_trans adlp_combo_phy_ddi_translations_hdmi = { 1075 + .entries = _adlp_combo_phy_ddi_translations_hdmi, 1076 + .num_entries = ARRAY_SIZE(_adlp_combo_phy_ddi_translations_hdmi), 1077 + .hdmi_default_entry = ARRAY_SIZE(_adlp_combo_phy_ddi_translations_hdmi) - 1, 1078 + }; 1079 + 1080 + static const union intel_ddi_buf_trans_entry _adlp_combo_phy_ddi_translations_dp_hbr[] = { 1081 + /* NT mV Trans mV db */ 1082 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 1083 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 1084 + { .icl = { 0xC, 0x71, 0x31, 0x00, 0x0E } }, /* 350 700 6.0 */ 1085 + { .icl = { 0x6, 0x7F, 0x2C, 0x00, 0x13 } }, /* 350 900 8.2 */ 1086 + { .icl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 1087 + { .icl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 1088 + { .icl = { 0x6, 0x7F, 0x2F, 0x00, 0x10 } }, /* 500 900 5.1 */ 1089 + { .icl = { 0xC, 0x73, 0x3E, 0x00, 0x01 } }, /* 650 700 0.6 */ 1090 + { .icl = { 0x6, 0x7F, 0x35, 0x00, 0x0A } }, /* 600 900 3.5 */ 1091 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 1092 + }; 1093 + 1094 + static const struct intel_ddi_buf_trans adlp_combo_phy_ddi_translations_dp_hbr = { 1095 + .entries = _adlp_combo_phy_ddi_translations_dp_hbr, 1096 + .num_entries = ARRAY_SIZE(_adlp_combo_phy_ddi_translations_dp_hbr), 1097 + }; 1098 + 1099 + static const union intel_ddi_buf_trans_entry _adlp_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { 1100 + /* NT mV Trans mV db */ 1101 + { .icl = { 0xA, 0x35, 0x3F, 0x00, 0x00 } }, /* 350 350 0.0 */ 1102 + { .icl = { 0xA, 0x4F, 0x37, 0x00, 0x08 } }, /* 350 500 3.1 */ 1103 + { .icl = { 0xC, 0x71, 0x2F, 0x00, 0x10 } }, /* 350 700 6.0 */ 1104 + { .icl = { 0x6, 0x7F, 0x2B, 0x00, 0x14 } }, /* 350 900 8.2 */ 1105 + { .icl = { 0xA, 0x4C, 0x3F, 0x00, 0x00 } }, /* 500 500 0.0 */ 1106 + { .icl = { 0xC, 0x73, 0x34, 0x00, 0x0B } }, /* 500 700 2.9 */ 1107 + { .icl = { 0x6, 0x7F, 0x30, 0x00, 0x0F } }, /* 500 900 5.1 */ 1108 + { .icl = { 0xC, 0x63, 0x3F, 0x00, 0x00 } }, /* 650 700 0.6 */ 1109 + { .icl = { 0x6, 0x7F, 0x38, 0x00, 0x07 } }, /* 600 900 3.5 */ 1110 + { .icl = { 0x6, 0x7F, 0x3F, 0x00, 0x00 } }, /* 900 900 0.0 */ 1111 + }; 1112 + 1113 + static const struct intel_ddi_buf_trans adlp_combo_phy_ddi_translations_dp_hbr2_hbr3 = { 1114 + .entries = _adlp_combo_phy_ddi_translations_dp_hbr2_hbr3, 1115 + .num_entries = ARRAY_SIZE(_adlp_combo_phy_ddi_translations_dp_hbr2_hbr3), 1116 + }; 1117 + 1118 + static const struct intel_ddi_buf_trans adlp_combo_phy_ddi_translations_edp_hbr3 = { 1119 + .entries = _icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3, 1120 + .num_entries = ARRAY_SIZE(_icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3), 1121 + }; 1122 + 1123 + static const struct intel_ddi_buf_trans adlp_combo_phy_ddi_translations_edp_up_to_hbr2 = { 1124 + .entries = _icl_combo_phy_ddi_translations_edp_hbr2, 1125 + .num_entries = ARRAY_SIZE(_icl_combo_phy_ddi_translations_edp_hbr2), 878 1126 }; 879 1127 880 1128 static const union intel_ddi_buf_trans_entry _adlp_dkl_phy_ddi_translations_dp_hbr[] = { ··· 1155 1267 return intel_get_buf_trans(&bxt_ddi_translations_edp, n_entries); 1156 1268 else 1157 1269 return intel_get_buf_trans(&bxt_ddi_translations_dp, n_entries); 1158 - } 1159 - 1160 - static const struct intel_ddi_buf_trans * 1161 - cnl_get_buf_trans_hdmi(struct intel_encoder *encoder, int *n_entries) 1162 - { 1163 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1164 - u32 voltage = intel_de_read(dev_priv, CNL_PORT_COMP_DW3) & VOLTAGE_INFO_MASK; 1165 - 1166 - if (voltage == VOLTAGE_INFO_0_85V) { 1167 - return intel_get_buf_trans(&cnl_ddi_translations_hdmi_0_85V, 1168 - n_entries); 1169 - } else if (voltage == VOLTAGE_INFO_0_95V) { 1170 - return intel_get_buf_trans(&cnl_ddi_translations_hdmi_0_95V, 1171 - n_entries); 1172 - } else if (voltage == VOLTAGE_INFO_1_05V) { 1173 - return intel_get_buf_trans(&cnl_ddi_translations_hdmi_1_05V, 1174 - n_entries); 1175 - } else { 1176 - *n_entries = 1; /* shut up gcc */ 1177 - MISSING_CASE(voltage); 1178 - } 1179 - return NULL; 1180 - } 1181 - 1182 - static const struct intel_ddi_buf_trans * 1183 - cnl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries) 1184 - { 1185 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1186 - u32 voltage = intel_de_read(dev_priv, CNL_PORT_COMP_DW3) & VOLTAGE_INFO_MASK; 1187 - 1188 - if (voltage == VOLTAGE_INFO_0_85V) { 1189 - return intel_get_buf_trans(&cnl_ddi_translations_dp_0_85V, 1190 - n_entries); 1191 - } else if (voltage == VOLTAGE_INFO_0_95V) { 1192 - return intel_get_buf_trans(&cnl_ddi_translations_dp_0_95V, 1193 - n_entries); 1194 - } else if (voltage == VOLTAGE_INFO_1_05V) { 1195 - return intel_get_buf_trans(&cnl_ddi_translations_dp_1_05V, 1196 - n_entries); 1197 - } else { 1198 - *n_entries = 1; /* shut up gcc */ 1199 - MISSING_CASE(voltage); 1200 - } 1201 - return NULL; 1202 - } 1203 - 1204 - static const struct intel_ddi_buf_trans * 1205 - cnl_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries) 1206 - { 1207 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1208 - u32 voltage = intel_de_read(dev_priv, CNL_PORT_COMP_DW3) & VOLTAGE_INFO_MASK; 1209 - 1210 - if (dev_priv->vbt.edp.low_vswing) { 1211 - if (voltage == VOLTAGE_INFO_0_85V) { 1212 - return intel_get_buf_trans(&cnl_ddi_translations_edp_0_85V, 1213 - n_entries); 1214 - } else if (voltage == VOLTAGE_INFO_0_95V) { 1215 - return intel_get_buf_trans(&cnl_ddi_translations_edp_0_95V, 1216 - n_entries); 1217 - } else if (voltage == VOLTAGE_INFO_1_05V) { 1218 - return intel_get_buf_trans(&cnl_ddi_translations_edp_1_05V, 1219 - n_entries); 1220 - } else { 1221 - *n_entries = 1; /* shut up gcc */ 1222 - MISSING_CASE(voltage); 1223 - } 1224 - return NULL; 1225 - } else { 1226 - return cnl_get_buf_trans_dp(encoder, n_entries); 1227 - } 1228 - } 1229 - 1230 - static const struct intel_ddi_buf_trans * 1231 - cnl_get_buf_trans(struct intel_encoder *encoder, 1232 - const struct intel_crtc_state *crtc_state, 1233 - int *n_entries) 1234 - { 1235 - if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) 1236 - return cnl_get_buf_trans_hdmi(encoder, n_entries); 1237 - if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) 1238 - return cnl_get_buf_trans_edp(encoder, n_entries); 1239 - return cnl_get_buf_trans_dp(encoder, n_entries); 1240 1270 } 1241 1271 1242 1272 static const struct intel_ddi_buf_trans * ··· 1468 1662 } 1469 1663 1470 1664 static const struct intel_ddi_buf_trans * 1665 + adlp_get_combo_buf_trans_dp(struct intel_encoder *encoder, 1666 + const struct intel_crtc_state *crtc_state, 1667 + int *n_entries) 1668 + { 1669 + if (crtc_state->port_clock > 270000) 1670 + return intel_get_buf_trans(&adlp_combo_phy_ddi_translations_dp_hbr2_hbr3, n_entries); 1671 + else 1672 + return intel_get_buf_trans(&adlp_combo_phy_ddi_translations_dp_hbr, n_entries); 1673 + } 1674 + 1675 + static const struct intel_ddi_buf_trans * 1676 + adlp_get_combo_buf_trans_edp(struct intel_encoder *encoder, 1677 + const struct intel_crtc_state *crtc_state, 1678 + int *n_entries) 1679 + { 1680 + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1681 + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 1682 + 1683 + if (crtc_state->port_clock > 540000) { 1684 + return intel_get_buf_trans(&adlp_combo_phy_ddi_translations_edp_hbr3, 1685 + n_entries); 1686 + } else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed) { 1687 + return intel_get_buf_trans(&tgl_combo_phy_ddi_translations_edp_hbr2_hobl, 1688 + n_entries); 1689 + } else if (dev_priv->vbt.edp.low_vswing) { 1690 + return intel_get_buf_trans(&adlp_combo_phy_ddi_translations_edp_up_to_hbr2, 1691 + n_entries); 1692 + } 1693 + 1694 + return adlp_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); 1695 + } 1696 + 1697 + static const struct intel_ddi_buf_trans * 1698 + adlp_get_combo_buf_trans(struct intel_encoder *encoder, 1699 + const struct intel_crtc_state *crtc_state, 1700 + int *n_entries) 1701 + { 1702 + if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) 1703 + return intel_get_buf_trans(&adlp_combo_phy_ddi_translations_hdmi, n_entries); 1704 + else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) 1705 + return adlp_get_combo_buf_trans_edp(encoder, crtc_state, n_entries); 1706 + else 1707 + return adlp_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); 1708 + } 1709 + 1710 + static const struct intel_ddi_buf_trans * 1471 1711 tgl_get_dkl_buf_trans_dp(struct intel_encoder *encoder, 1472 1712 const struct intel_crtc_state *crtc_state, 1473 1713 int *n_entries) ··· 1590 1738 1591 1739 if (IS_ALDERLAKE_P(i915)) { 1592 1740 if (intel_phy_is_combo(i915, phy)) 1593 - encoder->get_buf_trans = tgl_get_combo_buf_trans; 1741 + encoder->get_buf_trans = adlp_get_combo_buf_trans; 1594 1742 else 1595 1743 encoder->get_buf_trans = adlp_get_dkl_buf_trans; 1596 1744 } else if (IS_ALDERLAKE_S(i915)) { ··· 1613 1761 encoder->get_buf_trans = icl_get_combo_buf_trans; 1614 1762 else 1615 1763 encoder->get_buf_trans = icl_get_mg_buf_trans; 1616 - } else if (IS_CANNONLAKE(i915)) { 1617 - encoder->get_buf_trans = cnl_get_buf_trans; 1618 1764 } else if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) { 1619 1765 encoder->get_buf_trans = bxt_get_buf_trans; 1620 1766 } else if (IS_CML_ULX(i915) || IS_CFL_ULX(i915) || IS_KBL_ULX(i915)) {
+2 -2
drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h
··· 25 25 u8 deemphasis; 26 26 }; 27 27 28 - struct cnl_ddi_buf_trans { 28 + struct icl_ddi_buf_trans { 29 29 u8 dw2_swing_sel; 30 30 u8 dw7_n_scalar; 31 31 u8 dw4_cursor_coeff; ··· 48 48 union intel_ddi_buf_trans_entry { 49 49 struct hsw_ddi_buf_trans hsw; 50 50 struct bxt_ddi_buf_trans bxt; 51 - struct cnl_ddi_buf_trans cnl; 51 + struct icl_ddi_buf_trans icl; 52 52 struct icl_mg_phy_ddi_buf_trans mg; 53 53 struct tgl_dkl_phy_ddi_buf_trans dkl; 54 54 };
+172 -31
drivers/gpu/drm/i915/display/intel_display.c
··· 59 59 #include "display/intel_hdmi.h" 60 60 #include "display/intel_lvds.h" 61 61 #include "display/intel_sdvo.h" 62 + #include "display/intel_snps_phy.h" 62 63 #include "display/intel_tv.h" 63 64 #include "display/intel_vdsc.h" 64 65 #include "display/intel_vrr.h" ··· 976 975 /* FIXME: assert CPU port conditions for SNB+ */ 977 976 } 978 977 979 - /* Wa_22012358565:adlp */ 978 + /* Wa_22012358565:adl-p */ 980 979 if (DISPLAY_VER(dev_priv) == 13) 981 980 intel_de_rmw(dev_priv, PIPE_ARB_CTL(pipe), 982 981 0, PIPE_ARB_USE_PROG_SLOTS); ··· 1035 1034 /* Don't disable pipe or pipe PLLs if needed */ 1036 1035 if (!IS_I830(dev_priv)) 1037 1036 val &= ~PIPECONF_ENABLE; 1037 + 1038 + if (DISPLAY_VER(dev_priv) >= 12) 1039 + intel_de_rmw(dev_priv, CHICKEN_TRANS(cpu_transcoder), 1040 + FECSTALL_DIS_DPTSTREAM_DPTTG, 0); 1038 1041 1039 1042 intel_de_write(dev_priv, reg, val); 1040 1043 if ((val & PIPECONF_ENABLE) == 0) ··· 2212 2207 clear_bit_unlock(I915_RESET_MODESET, &dev_priv->gt.reset.flags); 2213 2208 } 2214 2209 2215 - static void icl_set_pipe_chicken(struct intel_crtc *crtc) 2210 + static bool underrun_recovery_supported(const struct intel_crtc_state *crtc_state) 2216 2211 { 2212 + if (crtc_state->pch_pfit.enabled && 2213 + (crtc_state->pipe_src_w > drm_rect_width(&crtc_state->pch_pfit.dst) || 2214 + crtc_state->pipe_src_h > drm_rect_height(&crtc_state->pch_pfit.dst) || 2215 + crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420)) 2216 + return false; 2217 + 2218 + if (crtc_state->dsc.compression_enable) 2219 + return false; 2220 + 2221 + if (crtc_state->has_psr2) 2222 + return false; 2223 + 2224 + return true; 2225 + } 2226 + 2227 + static void icl_set_pipe_chicken(const struct intel_crtc_state *crtc_state) 2228 + { 2229 + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 2217 2230 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 2218 2231 enum pipe pipe = crtc->pipe; 2219 2232 u32 tmp; ··· 2252 2229 */ 2253 2230 tmp |= PIXEL_ROUNDING_TRUNC_FB_PASSTHRU; 2254 2231 2255 - /* 2256 - * "The underrun recovery mechanism should be disabled 2257 - * when the following is enabled for this pipe: 2258 - * WiDi 2259 - * Downscaling (this includes YUV420 fullblend) 2260 - * COG 2261 - * DSC 2262 - * PSR2" 2263 - * 2264 - * FIXME: enable whenever possible... 2265 - */ 2266 - if (IS_ALDERLAKE_P(dev_priv)) 2267 - tmp |= UNDERRUN_RECOVERY_DISABLE; 2232 + if (IS_DG2(dev_priv)) { 2233 + /* 2234 + * Underrun recovery must always be disabled on DG2. However 2235 + * the chicken bit meaning is inverted compared to other 2236 + * platforms. 2237 + */ 2238 + tmp &= ~UNDERRUN_RECOVERY_ENABLE_DG2; 2239 + } else if (DISPLAY_VER(dev_priv) >= 13) { 2240 + if (underrun_recovery_supported(crtc_state)) 2241 + tmp &= ~UNDERRUN_RECOVERY_DISABLE_ADLP; 2242 + else 2243 + tmp |= UNDERRUN_RECOVERY_DISABLE_ADLP; 2244 + } 2268 2245 2269 2246 intel_de_write(dev_priv, PIPE_CHICKEN(pipe), tmp); 2270 2247 } ··· 3214 3191 } 3215 3192 } 3216 3193 3194 + static void intel_encoders_pre_disable(struct intel_atomic_state *state, 3195 + struct intel_crtc *crtc) 3196 + { 3197 + const struct intel_crtc_state *old_crtc_state = 3198 + intel_atomic_get_old_crtc_state(state, crtc); 3199 + const struct drm_connector_state *old_conn_state; 3200 + struct drm_connector *conn; 3201 + int i; 3202 + 3203 + for_each_old_connector_in_state(&state->base, conn, old_conn_state, i) { 3204 + struct intel_encoder *encoder = 3205 + to_intel_encoder(old_conn_state->best_encoder); 3206 + 3207 + if (old_conn_state->crtc != &crtc->base) 3208 + continue; 3209 + 3210 + if (encoder->pre_disable) 3211 + encoder->pre_disable(state, encoder, old_crtc_state, 3212 + old_conn_state); 3213 + } 3214 + } 3215 + 3217 3216 static void intel_encoders_disable(struct intel_atomic_state *state, 3218 3217 struct intel_crtc *crtc) 3219 3218 { ··· 3445 3400 intel_de_write(dev_priv, CLKGATE_DIS_PSL(pipe), val); 3446 3401 } 3447 3402 3448 - static void icl_pipe_mbus_enable(struct intel_crtc *crtc) 3403 + static void icl_pipe_mbus_enable(struct intel_crtc *crtc, bool joined_mbus) 3449 3404 { 3450 3405 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 3451 3406 enum pipe pipe = crtc->pipe; 3452 3407 u32 val; 3453 3408 3454 - val = MBUS_DBOX_A_CREDIT(2); 3409 + /* Wa_22010947358:adl-p */ 3410 + if (IS_ALDERLAKE_P(dev_priv)) 3411 + val = joined_mbus ? MBUS_DBOX_A_CREDIT(6) : MBUS_DBOX_A_CREDIT(4); 3412 + else 3413 + val = MBUS_DBOX_A_CREDIT(2); 3455 3414 3456 3415 if (DISPLAY_VER(dev_priv) >= 12) { 3457 3416 val |= MBUS_DBOX_BW_CREDIT(2); ··· 3523 3474 * Enable sequence steps 1-7 on bigjoiner master 3524 3475 */ 3525 3476 intel_encoders_pre_pll_enable(state, master); 3526 - intel_enable_shared_dpll(master_crtc_state); 3477 + if (master_crtc_state->shared_dpll) 3478 + intel_enable_shared_dpll(master_crtc_state); 3527 3479 intel_encoders_pre_enable(state, master); 3528 3480 3529 3481 /* and DSC on slave */ ··· 3582 3532 3583 3533 crtc->active = true; 3584 3534 3585 - /* Display WA #1180: WaDisableScalarClockGating: glk, cnl */ 3535 + /* Display WA #1180: WaDisableScalarClockGating: glk */ 3586 3536 psl_clkgate_wa = DISPLAY_VER(dev_priv) == 10 && 3587 3537 new_crtc_state->pch_pfit.enabled; 3588 3538 if (psl_clkgate_wa) ··· 3606 3556 hsw_set_linetime_wm(new_crtc_state); 3607 3557 3608 3558 if (DISPLAY_VER(dev_priv) >= 11) 3609 - icl_set_pipe_chicken(crtc); 3559 + icl_set_pipe_chicken(new_crtc_state); 3610 3560 3611 3561 if (dev_priv->display.initial_watermarks) 3612 3562 dev_priv->display.initial_watermarks(state, crtc); 3613 3563 3614 - if (DISPLAY_VER(dev_priv) >= 11) 3615 - icl_pipe_mbus_enable(crtc); 3564 + if (DISPLAY_VER(dev_priv) >= 11) { 3565 + const struct intel_dbuf_state *dbuf_state = 3566 + intel_atomic_get_new_dbuf_state(state); 3567 + 3568 + icl_pipe_mbus_enable(crtc, dbuf_state->joined_mbus); 3569 + } 3616 3570 3617 3571 if (new_crtc_state->bigjoiner_slave) 3618 3572 intel_crtc_vblank_on(new_crtc_state); ··· 3750 3696 { 3751 3697 if (phy == PHY_NONE) 3752 3698 return false; 3699 + else if (IS_DG2(dev_priv)) 3700 + /* 3701 + * DG2 outputs labelled as "combo PHY" in the bspec use 3702 + * SNPS PHYs with completely different programming, 3703 + * hence we always return false here. 3704 + */ 3705 + return false; 3753 3706 else if (IS_ALDERLAKE_S(dev_priv)) 3754 3707 return phy <= PHY_E; 3755 3708 else if (IS_DG1(dev_priv) || IS_ROCKETLAKE(dev_priv)) ··· 3771 3710 3772 3711 bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy) 3773 3712 { 3774 - if (IS_ALDERLAKE_P(dev_priv)) 3713 + if (IS_DG2(dev_priv)) 3714 + /* DG2's "TC1" output uses a SNPS PHY */ 3715 + return false; 3716 + else if (IS_ALDERLAKE_P(dev_priv)) 3775 3717 return phy >= PHY_F && phy <= PHY_I; 3776 3718 else if (IS_TIGERLAKE(dev_priv)) 3777 3719 return phy >= PHY_D && phy <= PHY_I; ··· 3782 3718 return phy >= PHY_C && phy <= PHY_F; 3783 3719 else 3784 3720 return false; 3721 + } 3722 + 3723 + bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy) 3724 + { 3725 + if (phy == PHY_NONE) 3726 + return false; 3727 + else if (IS_DG2(dev_priv)) 3728 + /* 3729 + * All four "combo" ports and the TC1 port (PHY E) use 3730 + * Synopsis PHYs. 3731 + */ 3732 + return phy <= PHY_E; 3733 + 3734 + return false; 3785 3735 } 3786 3736 3787 3737 enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port) ··· 3942 3864 } 3943 3865 3944 3866 if (HAS_DDI(dev_priv) && crtc_state->has_audio) 3945 - mask |= BIT_ULL(POWER_DOMAIN_AUDIO); 3867 + mask |= BIT_ULL(POWER_DOMAIN_AUDIO_MMIO); 3946 3868 3947 3869 if (crtc_state->shared_dpll) 3948 3870 mask |= BIT_ULL(POWER_DOMAIN_DISPLAY_CORE); ··· 8711 8633 8712 8634 PIPE_CONF_CHECK_BOOL(double_wide); 8713 8635 8714 - PIPE_CONF_CHECK_P(shared_dpll); 8636 + if (dev_priv->dpll.mgr) 8637 + PIPE_CONF_CHECK_P(shared_dpll); 8715 8638 8716 8639 /* FIXME do the readout properly and get rid of this quirk */ 8717 - if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE)) { 8640 + if (dev_priv->dpll.mgr && !PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE)) { 8718 8641 PIPE_CONF_CHECK_X(dpll_hw_state.dpll); 8719 8642 PIPE_CONF_CHECK_X(dpll_hw_state.dpll_md); 8720 8643 PIPE_CONF_CHECK_X(dpll_hw_state.fp0); ··· 8747 8668 PIPE_CONF_CHECK_X(dpll_hw_state.mg_pll_ssc); 8748 8669 PIPE_CONF_CHECK_X(dpll_hw_state.mg_pll_bias); 8749 8670 PIPE_CONF_CHECK_X(dpll_hw_state.mg_pll_tdc_coldst_bias); 8671 + } 8750 8672 8673 + if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE)) { 8751 8674 PIPE_CONF_CHECK_X(dsi_pll.ctrl); 8752 8675 PIPE_CONF_CHECK_X(dsi_pll.div); 8753 8676 ··· 9087 9006 if (!new_crtc_state->hw.active) 9088 9007 return; 9089 9008 9009 + if (new_crtc_state->bigjoiner_slave) 9010 + /* No PLLs set for slave */ 9011 + pipe_config->shared_dpll = NULL; 9012 + 9090 9013 intel_pipe_config_sanity_check(dev_priv, pipe_config); 9091 9014 9092 9015 if (!intel_pipe_config_compare(new_crtc_state, ··· 9194 9109 } 9195 9110 9196 9111 static void 9112 + verify_mpllb_state(struct intel_atomic_state *state, 9113 + struct intel_crtc_state *new_crtc_state) 9114 + { 9115 + struct drm_i915_private *i915 = to_i915(state->base.dev); 9116 + struct intel_mpllb_state mpllb_hw_state = { 0 }; 9117 + struct intel_mpllb_state *mpllb_sw_state = &new_crtc_state->mpllb_state; 9118 + struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); 9119 + struct intel_encoder *encoder; 9120 + 9121 + if (!IS_DG2(i915)) 9122 + return; 9123 + 9124 + if (!new_crtc_state->hw.active) 9125 + return; 9126 + 9127 + if (new_crtc_state->bigjoiner_slave) 9128 + return; 9129 + 9130 + encoder = intel_get_crtc_new_encoder(state, new_crtc_state); 9131 + intel_mpllb_readout_hw_state(encoder, &mpllb_hw_state); 9132 + 9133 + #define MPLLB_CHECK(name) do { \ 9134 + if (mpllb_sw_state->name != mpllb_hw_state.name) { \ 9135 + pipe_config_mismatch(false, crtc, "MPLLB:" __stringify(name), \ 9136 + "(expected 0x%08x, found 0x%08x)", \ 9137 + mpllb_sw_state->name, \ 9138 + mpllb_hw_state.name); \ 9139 + } \ 9140 + } while (0) 9141 + 9142 + MPLLB_CHECK(mpllb_cp); 9143 + MPLLB_CHECK(mpllb_div); 9144 + MPLLB_CHECK(mpllb_div2); 9145 + MPLLB_CHECK(mpllb_fracn1); 9146 + MPLLB_CHECK(mpllb_fracn2); 9147 + MPLLB_CHECK(mpllb_sscen); 9148 + MPLLB_CHECK(mpllb_sscstep); 9149 + 9150 + /* 9151 + * ref_control is handled by the hardware/firemware and never 9152 + * programmed by the software, but the proper values are supplied 9153 + * in the bspec for verification purposes. 9154 + */ 9155 + MPLLB_CHECK(ref_control); 9156 + 9157 + #undef MPLLB_CHECK 9158 + } 9159 + 9160 + static void 9197 9161 intel_modeset_verify_crtc(struct intel_crtc *crtc, 9198 9162 struct intel_atomic_state *state, 9199 9163 struct intel_crtc_state *old_crtc_state, ··· 9255 9121 verify_connector_state(state, crtc); 9256 9122 verify_crtc_state(crtc, old_crtc_state, new_crtc_state); 9257 9123 verify_shared_dpll_state(crtc, old_crtc_state, new_crtc_state); 9124 + verify_mpllb_state(state, new_crtc_state); 9258 9125 } 9259 9126 9260 9127 static void ··· 9881 9746 9882 9747 /* 9883 9748 * FIXME: This check is kept generic for all platforms. 9884 - * Need to verify this for all gen9 and gen10 platforms to enable 9749 + * Need to verify this for all gen9 platforms to enable 9885 9750 * this selectively if required. 9886 9751 */ 9887 9752 switch (new_plane_state->hw.fb->modifier) { ··· 10292 10157 hsw_set_linetime_wm(new_crtc_state); 10293 10158 10294 10159 if (DISPLAY_VER(dev_priv) >= 11) 10295 - icl_set_pipe_chicken(crtc); 10160 + icl_set_pipe_chicken(new_crtc_state); 10296 10161 } 10297 10162 10298 10163 static void commit_pipe_pre_planes(struct intel_atomic_state *state, ··· 10425 10290 struct drm_i915_private *dev_priv = to_i915(state->base.dev); 10426 10291 10427 10292 drm_WARN_ON(&dev_priv->drm, old_crtc_state->bigjoiner_slave); 10293 + 10294 + intel_encoders_pre_disable(state, crtc); 10428 10295 10429 10296 intel_crtc_disable_planes(state, crtc); 10430 10297 ··· 11462 11325 if (!HAS_DISPLAY(dev_priv)) 11463 11326 return; 11464 11327 11465 - if (IS_ALDERLAKE_P(dev_priv)) { 11328 + if (IS_DG2(dev_priv)) { 11329 + intel_ddi_init(dev_priv, PORT_A); 11330 + intel_ddi_init(dev_priv, PORT_B); 11331 + intel_ddi_init(dev_priv, PORT_C); 11332 + intel_ddi_init(dev_priv, PORT_D_XELPD); 11333 + } else if (IS_ALDERLAKE_P(dev_priv)) { 11466 11334 intel_ddi_init(dev_priv, PORT_A); 11467 11335 intel_ddi_init(dev_priv, PORT_B); 11468 11336 intel_ddi_init(dev_priv, PORT_TC1); ··· 11520 11378 intel_ddi_init(dev_priv, PORT_C); 11521 11379 intel_ddi_init(dev_priv, PORT_D); 11522 11380 intel_ddi_init(dev_priv, PORT_E); 11523 - intel_ddi_init(dev_priv, PORT_F); 11524 11381 } else if (HAS_DDI(dev_priv)) { 11525 11382 u32 found; 11526 11383 ··· 13268 13127 static void intel_early_display_was(struct drm_i915_private *dev_priv) 13269 13128 { 13270 13129 /* 13271 - * Display WA #1185 WaDisableDARBFClkGating:cnl,glk,icl,ehl,tgl 13130 + * Display WA #1185 WaDisableDARBFClkGating:glk,icl,ehl,tgl 13272 13131 * Also known as Wa_14010480278. 13273 13132 */ 13274 13133 if (IS_DISPLAY_VER(dev_priv, 10, 12))
+1
drivers/gpu/drm/i915/display/intel_display.h
··· 561 561 intel_encoder_current_mode(struct intel_encoder *encoder); 562 562 bool intel_phy_is_combo(struct drm_i915_private *dev_priv, enum phy phy); 563 563 bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy); 564 + bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy); 564 565 enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, 565 566 enum port port); 566 567 int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
+81 -2
drivers/gpu/drm/i915/display/intel_display_debugfs.c
··· 2256 2256 if (connector->status != connector_status_connected) 2257 2257 return -ENODEV; 2258 2258 2259 + if (DISPLAY_VER(i915) >= 13) { 2260 + LPSP_CAPABLE(encoder->port <= PORT_B); 2261 + return 0; 2262 + } 2263 + 2259 2264 switch (DISPLAY_VER(i915)) { 2260 2265 case 12: 2261 2266 /* ··· 2395 2390 .write = i915_dsc_fec_support_write 2396 2391 }; 2397 2392 2393 + static int i915_dsc_bpp_show(struct seq_file *m, void *data) 2394 + { 2395 + struct drm_connector *connector = m->private; 2396 + struct drm_device *dev = connector->dev; 2397 + struct drm_crtc *crtc; 2398 + struct intel_crtc_state *crtc_state; 2399 + struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); 2400 + int ret; 2401 + 2402 + if (!encoder) 2403 + return -ENODEV; 2404 + 2405 + ret = drm_modeset_lock_single_interruptible(&dev->mode_config.connection_mutex); 2406 + if (ret) 2407 + return ret; 2408 + 2409 + crtc = connector->state->crtc; 2410 + if (connector->status != connector_status_connected || !crtc) { 2411 + ret = -ENODEV; 2412 + goto out; 2413 + } 2414 + 2415 + crtc_state = to_intel_crtc_state(crtc->state); 2416 + seq_printf(m, "Compressed_BPP: %d\n", crtc_state->dsc.compressed_bpp); 2417 + 2418 + out: drm_modeset_unlock(&dev->mode_config.connection_mutex); 2419 + 2420 + return ret; 2421 + } 2422 + 2423 + static ssize_t i915_dsc_bpp_write(struct file *file, 2424 + const char __user *ubuf, 2425 + size_t len, loff_t *offp) 2426 + { 2427 + struct drm_connector *connector = 2428 + ((struct seq_file *)file->private_data)->private; 2429 + struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); 2430 + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 2431 + int dsc_bpp = 0; 2432 + int ret; 2433 + 2434 + ret = kstrtoint_from_user(ubuf, len, 0, &dsc_bpp); 2435 + if (ret < 0) 2436 + return ret; 2437 + 2438 + intel_dp->force_dsc_bpp = dsc_bpp; 2439 + *offp += len; 2440 + 2441 + return len; 2442 + } 2443 + 2444 + static int i915_dsc_bpp_open(struct inode *inode, 2445 + struct file *file) 2446 + { 2447 + return single_open(file, i915_dsc_bpp_show, 2448 + inode->i_private); 2449 + } 2450 + 2451 + static const struct file_operations i915_dsc_bpp_fops = { 2452 + .owner = THIS_MODULE, 2453 + .open = i915_dsc_bpp_open, 2454 + .read = seq_read, 2455 + .llseek = seq_lseek, 2456 + .release = single_release, 2457 + .write = i915_dsc_bpp_write 2458 + }; 2459 + 2398 2460 /** 2399 2461 * intel_connector_debugfs_add - add i915 specific connector debugfs files 2400 2462 * @connector: pointer to a registered drm_connector ··· 2500 2428 connector, &i915_hdcp_sink_capability_fops); 2501 2429 } 2502 2430 2503 - if ((DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) && ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort && !to_intel_connector(connector)->mst_port) || connector->connector_type == DRM_MODE_CONNECTOR_eDP)) 2504 - debugfs_create_file("i915_dsc_fec_support", S_IRUGO, root, 2431 + if (DISPLAY_VER(dev_priv) >= 11 && 2432 + ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort && 2433 + !to_intel_connector(connector)->mst_port) || 2434 + connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { 2435 + debugfs_create_file("i915_dsc_fec_support", 0644, root, 2505 2436 connector, &i915_dsc_fec_support_fops); 2437 + 2438 + debugfs_create_file("i915_dsc_bpp", 0644, root, 2439 + connector, &i915_dsc_bpp_fops); 2440 + } 2506 2441 2507 2442 /* Legacy panels doesn't lpsp on any platform */ 2508 2443 if ((DISPLAY_VER(dev_priv) >= 9 || IS_HASWELL(dev_priv) ||
+252 -311
drivers/gpu/drm/i915/display/intel_display_power.c
··· 18 18 #include "intel_pm.h" 19 19 #include "intel_pps.h" 20 20 #include "intel_sideband.h" 21 + #include "intel_snps_phy.h" 21 22 #include "intel_tc.h" 22 23 #include "intel_vga.h" 23 24 ··· 107 106 return "PORT_OTHER"; 108 107 case POWER_DOMAIN_VGA: 109 108 return "VGA"; 110 - case POWER_DOMAIN_AUDIO: 111 - return "AUDIO"; 109 + case POWER_DOMAIN_AUDIO_MMIO: 110 + return "AUDIO_MMIO"; 111 + case POWER_DOMAIN_AUDIO_PLAYBACK: 112 + return "AUDIO_PLAYBACK"; 112 113 case POWER_DOMAIN_AUX_A: 113 114 return "AUX_A"; 114 115 case POWER_DOMAIN_AUX_B: ··· 344 341 { 345 342 const struct i915_power_well_regs *regs = power_well->desc->hsw.regs; 346 343 int pw_idx = power_well->desc->hsw.idx; 344 + int enable_delay = power_well->desc->hsw.fixed_enable_delay; 345 + 346 + /* 347 + * For some power wells we're not supposed to watch the status bit for 348 + * an ack, but rather just wait a fixed amount of time and then 349 + * proceed. This is only used on DG2. 350 + */ 351 + if (IS_DG2(dev_priv) && enable_delay) { 352 + usleep_range(enable_delay, 2 * enable_delay); 353 + return; 354 + } 347 355 348 356 /* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us. */ 349 357 if (intel_de_wait_for_set(dev_priv, regs->driver, ··· 449 435 val | HSW_PWR_WELL_CTL_REQ(pw_idx)); 450 436 451 437 hsw_wait_for_power_well_enable(dev_priv, power_well, false); 452 - 453 - /* Display WA #1178: cnl */ 454 - if (IS_CANNONLAKE(dev_priv) && 455 - pw_idx >= GLK_PW_CTL_IDX_AUX_B && 456 - pw_idx <= CNL_PW_CTL_IDX_AUX_F) { 457 - u32 val; 458 - 459 - val = intel_de_read(dev_priv, CNL_AUX_ANAOVRD1(pw_idx)); 460 - val |= CNL_AUX_ANAOVRD1_ENABLE | CNL_AUX_ANAOVRD1_LDO_BYPASS; 461 - intel_de_write(dev_priv, CNL_AUX_ANAOVRD1(pw_idx), val); 462 - } 463 438 464 439 if (power_well->desc->hsw.has_fuses) { 465 440 enum skl_power_gate pg; ··· 2511 2508 BIT_ULL(POWER_DOMAIN_PORT_DSI) | \ 2512 2509 BIT_ULL(POWER_DOMAIN_PORT_CRT) | \ 2513 2510 BIT_ULL(POWER_DOMAIN_VGA) | \ 2514 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2511 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2512 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2515 2513 BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2516 2514 BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2517 2515 BIT_ULL(POWER_DOMAIN_GMBUS) | \ ··· 2562 2558 BIT_ULL(POWER_DOMAIN_PORT_DDI_D_LANES) | \ 2563 2559 BIT_ULL(POWER_DOMAIN_PORT_DSI) | \ 2564 2560 BIT_ULL(POWER_DOMAIN_VGA) | \ 2565 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2561 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2562 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2566 2563 BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2567 2564 BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2568 2565 BIT_ULL(POWER_DOMAIN_AUX_D) | \ ··· 2596 2591 BIT_ULL(POWER_DOMAIN_PORT_DDI_D_LANES) | \ 2597 2592 BIT_ULL(POWER_DOMAIN_PORT_CRT) | /* DDI E */ \ 2598 2593 BIT_ULL(POWER_DOMAIN_VGA) | \ 2599 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2594 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2595 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2600 2596 BIT_ULL(POWER_DOMAIN_INIT)) 2601 2597 2602 2598 #define BDW_DISPLAY_POWER_DOMAINS ( \ ··· 2613 2607 BIT_ULL(POWER_DOMAIN_PORT_DDI_D_LANES) | \ 2614 2608 BIT_ULL(POWER_DOMAIN_PORT_CRT) | /* DDI E */ \ 2615 2609 BIT_ULL(POWER_DOMAIN_VGA) | \ 2616 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2610 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2611 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2617 2612 BIT_ULL(POWER_DOMAIN_INIT)) 2618 2613 2619 2614 #define SKL_DISPLAY_POWERWELL_2_POWER_DOMAINS ( \ ··· 2632 2625 BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2633 2626 BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2634 2627 BIT_ULL(POWER_DOMAIN_AUX_D) | \ 2635 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2628 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2629 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2636 2630 BIT_ULL(POWER_DOMAIN_VGA) | \ 2637 2631 BIT_ULL(POWER_DOMAIN_INIT)) 2638 2632 #define SKL_DISPLAY_DDI_IO_A_E_POWER_DOMAINS ( \ ··· 2668 2660 BIT_ULL(POWER_DOMAIN_PORT_DDI_C_LANES) | \ 2669 2661 BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2670 2662 BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2671 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2663 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2664 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2672 2665 BIT_ULL(POWER_DOMAIN_VGA) | \ 2673 2666 BIT_ULL(POWER_DOMAIN_INIT)) 2674 2667 #define BXT_DISPLAY_DC_OFF_POWER_DOMAINS ( \ ··· 2702 2693 BIT_ULL(POWER_DOMAIN_PORT_DDI_C_LANES) | \ 2703 2694 BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2704 2695 BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2705 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2696 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2697 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2706 2698 BIT_ULL(POWER_DOMAIN_VGA) | \ 2707 2699 BIT_ULL(POWER_DOMAIN_INIT)) 2708 2700 #define GLK_DISPLAY_DDI_IO_A_POWER_DOMAINS ( \ ··· 2740 2730 BIT_ULL(POWER_DOMAIN_MODESET) | \ 2741 2731 BIT_ULL(POWER_DOMAIN_AUX_A) | \ 2742 2732 BIT_ULL(POWER_DOMAIN_GMBUS) | \ 2743 - BIT_ULL(POWER_DOMAIN_INIT)) 2744 - 2745 - #define CNL_DISPLAY_POWERWELL_2_POWER_DOMAINS ( \ 2746 - BIT_ULL(POWER_DOMAIN_TRANSCODER_A) | \ 2747 - BIT_ULL(POWER_DOMAIN_PIPE_B) | \ 2748 - BIT_ULL(POWER_DOMAIN_TRANSCODER_B) | \ 2749 - BIT_ULL(POWER_DOMAIN_PIPE_C) | \ 2750 - BIT_ULL(POWER_DOMAIN_TRANSCODER_C) | \ 2751 - BIT_ULL(POWER_DOMAIN_PIPE_B_PANEL_FITTER) | \ 2752 - BIT_ULL(POWER_DOMAIN_PIPE_C_PANEL_FITTER) | \ 2753 - BIT_ULL(POWER_DOMAIN_PORT_DDI_B_LANES) | \ 2754 - BIT_ULL(POWER_DOMAIN_PORT_DDI_C_LANES) | \ 2755 - BIT_ULL(POWER_DOMAIN_PORT_DDI_D_LANES) | \ 2756 - BIT_ULL(POWER_DOMAIN_PORT_DDI_F_LANES) | \ 2757 - BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2758 - BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2759 - BIT_ULL(POWER_DOMAIN_AUX_D) | \ 2760 - BIT_ULL(POWER_DOMAIN_AUX_F) | \ 2761 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2762 - BIT_ULL(POWER_DOMAIN_VGA) | \ 2763 - BIT_ULL(POWER_DOMAIN_INIT)) 2764 - #define CNL_DISPLAY_DDI_A_IO_POWER_DOMAINS ( \ 2765 - BIT_ULL(POWER_DOMAIN_PORT_DDI_A_IO) | \ 2766 - BIT_ULL(POWER_DOMAIN_INIT)) 2767 - #define CNL_DISPLAY_DDI_B_IO_POWER_DOMAINS ( \ 2768 - BIT_ULL(POWER_DOMAIN_PORT_DDI_B_IO) | \ 2769 - BIT_ULL(POWER_DOMAIN_INIT)) 2770 - #define CNL_DISPLAY_DDI_C_IO_POWER_DOMAINS ( \ 2771 - BIT_ULL(POWER_DOMAIN_PORT_DDI_C_IO) | \ 2772 - BIT_ULL(POWER_DOMAIN_INIT)) 2773 - #define CNL_DISPLAY_DDI_D_IO_POWER_DOMAINS ( \ 2774 - BIT_ULL(POWER_DOMAIN_PORT_DDI_D_IO) | \ 2775 - BIT_ULL(POWER_DOMAIN_INIT)) 2776 - #define CNL_DISPLAY_AUX_A_POWER_DOMAINS ( \ 2777 - BIT_ULL(POWER_DOMAIN_AUX_A) | \ 2778 - BIT_ULL(POWER_DOMAIN_AUX_IO_A) | \ 2779 - BIT_ULL(POWER_DOMAIN_INIT)) 2780 - #define CNL_DISPLAY_AUX_B_POWER_DOMAINS ( \ 2781 - BIT_ULL(POWER_DOMAIN_AUX_B) | \ 2782 - BIT_ULL(POWER_DOMAIN_INIT)) 2783 - #define CNL_DISPLAY_AUX_C_POWER_DOMAINS ( \ 2784 - BIT_ULL(POWER_DOMAIN_AUX_C) | \ 2785 - BIT_ULL(POWER_DOMAIN_INIT)) 2786 - #define CNL_DISPLAY_AUX_D_POWER_DOMAINS ( \ 2787 - BIT_ULL(POWER_DOMAIN_AUX_D) | \ 2788 - BIT_ULL(POWER_DOMAIN_INIT)) 2789 - #define CNL_DISPLAY_AUX_F_POWER_DOMAINS ( \ 2790 - BIT_ULL(POWER_DOMAIN_AUX_F) | \ 2791 - BIT_ULL(POWER_DOMAIN_INIT)) 2792 - #define CNL_DISPLAY_DDI_F_IO_POWER_DOMAINS ( \ 2793 - BIT_ULL(POWER_DOMAIN_PORT_DDI_F_IO) | \ 2794 - BIT_ULL(POWER_DOMAIN_INIT)) 2795 - #define CNL_DISPLAY_DC_OFF_POWER_DOMAINS ( \ 2796 - CNL_DISPLAY_POWERWELL_2_POWER_DOMAINS | \ 2797 - BIT_ULL(POWER_DOMAIN_GT_IRQ) | \ 2798 - BIT_ULL(POWER_DOMAIN_MODESET) | \ 2799 - BIT_ULL(POWER_DOMAIN_AUX_A) | \ 2800 2733 BIT_ULL(POWER_DOMAIN_INIT)) 2801 2734 2802 2735 /* ··· 2783 2830 BIT_ULL(POWER_DOMAIN_AUX_E_TBT) | \ 2784 2831 BIT_ULL(POWER_DOMAIN_AUX_F_TBT) | \ 2785 2832 BIT_ULL(POWER_DOMAIN_VGA) | \ 2786 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2833 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2834 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2787 2835 BIT_ULL(POWER_DOMAIN_INIT)) 2788 2836 /* 2789 2837 * - transcoder WD ··· 2876 2922 BIT_ULL(POWER_DOMAIN_AUX_TBT5) | \ 2877 2923 BIT_ULL(POWER_DOMAIN_AUX_TBT6) | \ 2878 2924 BIT_ULL(POWER_DOMAIN_VGA) | \ 2879 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2925 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2926 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2880 2927 BIT_ULL(POWER_DOMAIN_INIT)) 2881 2928 2882 2929 #define TGL_PW_2_POWER_DOMAINS ( \ ··· 2947 2992 RKL_PW_4_POWER_DOMAINS | \ 2948 2993 BIT_ULL(POWER_DOMAIN_PIPE_B) | \ 2949 2994 BIT_ULL(POWER_DOMAIN_PIPE_B_PANEL_FITTER) | \ 2950 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 2995 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2996 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 2951 2997 BIT_ULL(POWER_DOMAIN_VGA) | \ 2952 2998 BIT_ULL(POWER_DOMAIN_TRANSCODER_B) | \ 2953 2999 BIT_ULL(POWER_DOMAIN_PORT_DDI_LANES_TC1) | \ ··· 2980 3024 2981 3025 #define RKL_DISPLAY_DC_OFF_POWER_DOMAINS ( \ 2982 3026 RKL_PW_3_POWER_DOMAINS | \ 3027 + BIT_ULL(POWER_DOMAIN_MODESET) | \ 3028 + BIT_ULL(POWER_DOMAIN_AUX_A) | \ 3029 + BIT_ULL(POWER_DOMAIN_AUX_B) | \ 3030 + BIT_ULL(POWER_DOMAIN_INIT)) 3031 + 3032 + /* 3033 + * DG1 onwards Audio MMIO/VERBS lies in PG0 power well. 3034 + */ 3035 + #define DG1_PW_3_POWER_DOMAINS ( \ 3036 + TGL_PW_4_POWER_DOMAINS | \ 3037 + BIT_ULL(POWER_DOMAIN_PIPE_B) | \ 3038 + BIT_ULL(POWER_DOMAIN_TRANSCODER_B) | \ 3039 + BIT_ULL(POWER_DOMAIN_PIPE_B_PANEL_FITTER) | \ 3040 + BIT_ULL(POWER_DOMAIN_PORT_DDI_LANES_TC1) | \ 3041 + BIT_ULL(POWER_DOMAIN_PORT_DDI_LANES_TC2) | \ 3042 + BIT_ULL(POWER_DOMAIN_AUX_USBC1) | \ 3043 + BIT_ULL(POWER_DOMAIN_AUX_USBC2) | \ 3044 + BIT_ULL(POWER_DOMAIN_VGA) | \ 3045 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 3046 + BIT_ULL(POWER_DOMAIN_INIT)) 3047 + 3048 + #define DG1_PW_2_POWER_DOMAINS ( \ 3049 + DG1_PW_3_POWER_DOMAINS | \ 3050 + BIT_ULL(POWER_DOMAIN_TRANSCODER_VDSC_PW2) | \ 3051 + BIT_ULL(POWER_DOMAIN_INIT)) 3052 + 3053 + #define DG1_DISPLAY_DC_OFF_POWER_DOMAINS ( \ 3054 + DG1_PW_3_POWER_DOMAINS | \ 3055 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 2983 3056 BIT_ULL(POWER_DOMAIN_MODESET) | \ 2984 3057 BIT_ULL(POWER_DOMAIN_AUX_A) | \ 2985 3058 BIT_ULL(POWER_DOMAIN_AUX_B) | \ ··· 3059 3074 XELPD_PW_B_POWER_DOMAINS | \ 3060 3075 XELPD_PW_C_POWER_DOMAINS | \ 3061 3076 XELPD_PW_D_POWER_DOMAINS | \ 3062 - BIT_ULL(POWER_DOMAIN_AUDIO) | \ 3077 + BIT_ULL(POWER_DOMAIN_AUDIO_PLAYBACK) | \ 3063 3078 BIT_ULL(POWER_DOMAIN_VGA) | \ 3064 3079 BIT_ULL(POWER_DOMAIN_PORT_DDI_C_LANES) | \ 3065 3080 BIT_ULL(POWER_DOMAIN_PORT_DDI_LANES_D_XELPD) | \ ··· 3100 3115 3101 3116 #define XELPD_DISPLAY_DC_OFF_POWER_DOMAINS ( \ 3102 3117 XELPD_PW_2_POWER_DOMAINS | \ 3118 + BIT_ULL(POWER_DOMAIN_AUDIO_MMIO) | \ 3103 3119 BIT_ULL(POWER_DOMAIN_MODESET) | \ 3104 3120 BIT_ULL(POWER_DOMAIN_AUX_A) | \ 3105 3121 BIT_ULL(POWER_DOMAIN_AUX_B) | \ ··· 3677 3691 { 3678 3692 .hsw.regs = &hsw_power_well_regs, 3679 3693 .hsw.idx = SKL_PW_CTL_IDX_DDI_C, 3680 - }, 3681 - }, 3682 - }; 3683 - 3684 - static const struct i915_power_well_desc cnl_power_wells[] = { 3685 - { 3686 - .name = "always-on", 3687 - .always_on = true, 3688 - .domains = POWER_DOMAIN_MASK, 3689 - .ops = &i9xx_always_on_power_well_ops, 3690 - .id = DISP_PW_ID_NONE, 3691 - }, 3692 - { 3693 - .name = "power well 1", 3694 - /* Handled by the DMC firmware */ 3695 - .always_on = true, 3696 - .domains = 0, 3697 - .ops = &hsw_power_well_ops, 3698 - .id = SKL_DISP_PW_1, 3699 - { 3700 - .hsw.regs = &hsw_power_well_regs, 3701 - .hsw.idx = SKL_PW_CTL_IDX_PW_1, 3702 - .hsw.has_fuses = true, 3703 - }, 3704 - }, 3705 - { 3706 - .name = "AUX A", 3707 - .domains = CNL_DISPLAY_AUX_A_POWER_DOMAINS, 3708 - .ops = &hsw_power_well_ops, 3709 - .id = DISP_PW_ID_NONE, 3710 - { 3711 - .hsw.regs = &hsw_power_well_regs, 3712 - .hsw.idx = GLK_PW_CTL_IDX_AUX_A, 3713 - }, 3714 - }, 3715 - { 3716 - .name = "AUX B", 3717 - .domains = CNL_DISPLAY_AUX_B_POWER_DOMAINS, 3718 - .ops = &hsw_power_well_ops, 3719 - .id = DISP_PW_ID_NONE, 3720 - { 3721 - .hsw.regs = &hsw_power_well_regs, 3722 - .hsw.idx = GLK_PW_CTL_IDX_AUX_B, 3723 - }, 3724 - }, 3725 - { 3726 - .name = "AUX C", 3727 - .domains = CNL_DISPLAY_AUX_C_POWER_DOMAINS, 3728 - .ops = &hsw_power_well_ops, 3729 - .id = DISP_PW_ID_NONE, 3730 - { 3731 - .hsw.regs = &hsw_power_well_regs, 3732 - .hsw.idx = GLK_PW_CTL_IDX_AUX_C, 3733 - }, 3734 - }, 3735 - { 3736 - .name = "AUX D", 3737 - .domains = CNL_DISPLAY_AUX_D_POWER_DOMAINS, 3738 - .ops = &hsw_power_well_ops, 3739 - .id = DISP_PW_ID_NONE, 3740 - { 3741 - .hsw.regs = &hsw_power_well_regs, 3742 - .hsw.idx = CNL_PW_CTL_IDX_AUX_D, 3743 - }, 3744 - }, 3745 - { 3746 - .name = "DC off", 3747 - .domains = CNL_DISPLAY_DC_OFF_POWER_DOMAINS, 3748 - .ops = &gen9_dc_off_power_well_ops, 3749 - .id = SKL_DISP_DC_OFF, 3750 - }, 3751 - { 3752 - .name = "power well 2", 3753 - .domains = CNL_DISPLAY_POWERWELL_2_POWER_DOMAINS, 3754 - .ops = &hsw_power_well_ops, 3755 - .id = SKL_DISP_PW_2, 3756 - { 3757 - .hsw.regs = &hsw_power_well_regs, 3758 - .hsw.idx = SKL_PW_CTL_IDX_PW_2, 3759 - .hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C), 3760 - .hsw.has_vga = true, 3761 - .hsw.has_fuses = true, 3762 - }, 3763 - }, 3764 - { 3765 - .name = "DDI A IO power well", 3766 - .domains = CNL_DISPLAY_DDI_A_IO_POWER_DOMAINS, 3767 - .ops = &hsw_power_well_ops, 3768 - .id = DISP_PW_ID_NONE, 3769 - { 3770 - .hsw.regs = &hsw_power_well_regs, 3771 - .hsw.idx = GLK_PW_CTL_IDX_DDI_A, 3772 - }, 3773 - }, 3774 - { 3775 - .name = "DDI B IO power well", 3776 - .domains = CNL_DISPLAY_DDI_B_IO_POWER_DOMAINS, 3777 - .ops = &hsw_power_well_ops, 3778 - .id = DISP_PW_ID_NONE, 3779 - { 3780 - .hsw.regs = &hsw_power_well_regs, 3781 - .hsw.idx = SKL_PW_CTL_IDX_DDI_B, 3782 - }, 3783 - }, 3784 - { 3785 - .name = "DDI C IO power well", 3786 - .domains = CNL_DISPLAY_DDI_C_IO_POWER_DOMAINS, 3787 - .ops = &hsw_power_well_ops, 3788 - .id = DISP_PW_ID_NONE, 3789 - { 3790 - .hsw.regs = &hsw_power_well_regs, 3791 - .hsw.idx = SKL_PW_CTL_IDX_DDI_C, 3792 - }, 3793 - }, 3794 - { 3795 - .name = "DDI D IO power well", 3796 - .domains = CNL_DISPLAY_DDI_D_IO_POWER_DOMAINS, 3797 - .ops = &hsw_power_well_ops, 3798 - .id = DISP_PW_ID_NONE, 3799 - { 3800 - .hsw.regs = &hsw_power_well_regs, 3801 - .hsw.idx = SKL_PW_CTL_IDX_DDI_D, 3802 - }, 3803 - }, 3804 - { 3805 - .name = "DDI F IO power well", 3806 - .domains = CNL_DISPLAY_DDI_F_IO_POWER_DOMAINS, 3807 - .ops = &hsw_power_well_ops, 3808 - .id = CNL_DISP_PW_DDI_F_IO, 3809 - { 3810 - .hsw.regs = &hsw_power_well_regs, 3811 - .hsw.idx = CNL_PW_CTL_IDX_DDI_F, 3812 - }, 3813 - }, 3814 - { 3815 - .name = "AUX F", 3816 - .domains = CNL_DISPLAY_AUX_F_POWER_DOMAINS, 3817 - .ops = &hsw_power_well_ops, 3818 - .id = CNL_DISP_PW_DDI_F_AUX, 3819 - { 3820 - .hsw.regs = &hsw_power_well_regs, 3821 - .hsw.idx = CNL_PW_CTL_IDX_AUX_F, 3822 3694 }, 3823 3695 }, 3824 3696 }; ··· 4487 4643 }, 4488 4644 }; 4489 4645 4646 + static const struct i915_power_well_desc dg1_power_wells[] = { 4647 + { 4648 + .name = "always-on", 4649 + .always_on = true, 4650 + .domains = POWER_DOMAIN_MASK, 4651 + .ops = &i9xx_always_on_power_well_ops, 4652 + .id = DISP_PW_ID_NONE, 4653 + }, 4654 + { 4655 + .name = "power well 1", 4656 + /* Handled by the DMC firmware */ 4657 + .always_on = true, 4658 + .domains = 0, 4659 + .ops = &hsw_power_well_ops, 4660 + .id = SKL_DISP_PW_1, 4661 + { 4662 + .hsw.regs = &hsw_power_well_regs, 4663 + .hsw.idx = ICL_PW_CTL_IDX_PW_1, 4664 + .hsw.has_fuses = true, 4665 + }, 4666 + }, 4667 + { 4668 + .name = "DC off", 4669 + .domains = DG1_DISPLAY_DC_OFF_POWER_DOMAINS, 4670 + .ops = &gen9_dc_off_power_well_ops, 4671 + .id = SKL_DISP_DC_OFF, 4672 + }, 4673 + { 4674 + .name = "power well 2", 4675 + .domains = DG1_PW_2_POWER_DOMAINS, 4676 + .ops = &hsw_power_well_ops, 4677 + .id = SKL_DISP_PW_2, 4678 + { 4679 + .hsw.regs = &hsw_power_well_regs, 4680 + .hsw.idx = ICL_PW_CTL_IDX_PW_2, 4681 + .hsw.has_fuses = true, 4682 + }, 4683 + }, 4684 + { 4685 + .name = "power well 3", 4686 + .domains = DG1_PW_3_POWER_DOMAINS, 4687 + .ops = &hsw_power_well_ops, 4688 + .id = ICL_DISP_PW_3, 4689 + { 4690 + .hsw.regs = &hsw_power_well_regs, 4691 + .hsw.idx = ICL_PW_CTL_IDX_PW_3, 4692 + .hsw.irq_pipe_mask = BIT(PIPE_B), 4693 + .hsw.has_vga = true, 4694 + .hsw.has_fuses = true, 4695 + }, 4696 + }, 4697 + { 4698 + .name = "DDI A IO", 4699 + .domains = ICL_DDI_IO_A_POWER_DOMAINS, 4700 + .ops = &hsw_power_well_ops, 4701 + .id = DISP_PW_ID_NONE, 4702 + { 4703 + .hsw.regs = &icl_ddi_power_well_regs, 4704 + .hsw.idx = ICL_PW_CTL_IDX_DDI_A, 4705 + } 4706 + }, 4707 + { 4708 + .name = "DDI B IO", 4709 + .domains = ICL_DDI_IO_B_POWER_DOMAINS, 4710 + .ops = &hsw_power_well_ops, 4711 + .id = DISP_PW_ID_NONE, 4712 + { 4713 + .hsw.regs = &icl_ddi_power_well_regs, 4714 + .hsw.idx = ICL_PW_CTL_IDX_DDI_B, 4715 + } 4716 + }, 4717 + { 4718 + .name = "DDI IO TC1", 4719 + .domains = TGL_DDI_IO_TC1_POWER_DOMAINS, 4720 + .ops = &hsw_power_well_ops, 4721 + .id = DISP_PW_ID_NONE, 4722 + { 4723 + .hsw.regs = &icl_ddi_power_well_regs, 4724 + .hsw.idx = TGL_PW_CTL_IDX_DDI_TC1, 4725 + }, 4726 + }, 4727 + { 4728 + .name = "DDI IO TC2", 4729 + .domains = TGL_DDI_IO_TC2_POWER_DOMAINS, 4730 + .ops = &hsw_power_well_ops, 4731 + .id = DISP_PW_ID_NONE, 4732 + { 4733 + .hsw.regs = &icl_ddi_power_well_regs, 4734 + .hsw.idx = TGL_PW_CTL_IDX_DDI_TC2, 4735 + }, 4736 + }, 4737 + { 4738 + .name = "AUX A", 4739 + .domains = TGL_AUX_A_IO_POWER_DOMAINS, 4740 + .ops = &icl_aux_power_well_ops, 4741 + .id = DISP_PW_ID_NONE, 4742 + { 4743 + .hsw.regs = &icl_aux_power_well_regs, 4744 + .hsw.idx = ICL_PW_CTL_IDX_AUX_A, 4745 + }, 4746 + }, 4747 + { 4748 + .name = "AUX B", 4749 + .domains = TGL_AUX_B_IO_POWER_DOMAINS, 4750 + .ops = &icl_aux_power_well_ops, 4751 + .id = DISP_PW_ID_NONE, 4752 + { 4753 + .hsw.regs = &icl_aux_power_well_regs, 4754 + .hsw.idx = ICL_PW_CTL_IDX_AUX_B, 4755 + }, 4756 + }, 4757 + { 4758 + .name = "AUX USBC1", 4759 + .domains = TGL_AUX_IO_USBC1_POWER_DOMAINS, 4760 + .ops = &icl_aux_power_well_ops, 4761 + .id = DISP_PW_ID_NONE, 4762 + { 4763 + .hsw.regs = &icl_aux_power_well_regs, 4764 + .hsw.idx = TGL_PW_CTL_IDX_AUX_TC1, 4765 + .hsw.is_tc_tbt = false, 4766 + }, 4767 + }, 4768 + { 4769 + .name = "AUX USBC2", 4770 + .domains = TGL_AUX_IO_USBC2_POWER_DOMAINS, 4771 + .ops = &icl_aux_power_well_ops, 4772 + .id = DISP_PW_ID_NONE, 4773 + { 4774 + .hsw.regs = &icl_aux_power_well_regs, 4775 + .hsw.idx = TGL_PW_CTL_IDX_AUX_TC2, 4776 + .hsw.is_tc_tbt = false, 4777 + }, 4778 + }, 4779 + { 4780 + .name = "power well 4", 4781 + .domains = TGL_PW_4_POWER_DOMAINS, 4782 + .ops = &hsw_power_well_ops, 4783 + .id = DISP_PW_ID_NONE, 4784 + { 4785 + .hsw.regs = &hsw_power_well_regs, 4786 + .hsw.idx = ICL_PW_CTL_IDX_PW_4, 4787 + .hsw.has_fuses = true, 4788 + .hsw.irq_pipe_mask = BIT(PIPE_C), 4789 + } 4790 + }, 4791 + { 4792 + .name = "power well 5", 4793 + .domains = TGL_PW_5_POWER_DOMAINS, 4794 + .ops = &hsw_power_well_ops, 4795 + .id = DISP_PW_ID_NONE, 4796 + { 4797 + .hsw.regs = &hsw_power_well_regs, 4798 + .hsw.idx = TGL_PW_CTL_IDX_PW_5, 4799 + .hsw.has_fuses = true, 4800 + .hsw.irq_pipe_mask = BIT(PIPE_D), 4801 + }, 4802 + }, 4803 + }; 4804 + 4490 4805 static const struct i915_power_well_desc xelpd_power_wells[] = { 4491 4806 { 4492 4807 .name = "always-on", ··· 4831 4828 { 4832 4829 .hsw.regs = &icl_aux_power_well_regs, 4833 4830 .hsw.idx = ICL_PW_CTL_IDX_AUX_A, 4831 + .hsw.fixed_enable_delay = 600, 4834 4832 }, 4835 4833 }, 4836 4834 { ··· 4842 4838 { 4843 4839 .hsw.regs = &icl_aux_power_well_regs, 4844 4840 .hsw.idx = ICL_PW_CTL_IDX_AUX_B, 4841 + .hsw.fixed_enable_delay = 600, 4845 4842 }, 4846 4843 }, 4847 4844 { ··· 4853 4848 { 4854 4849 .hsw.regs = &icl_aux_power_well_regs, 4855 4850 .hsw.idx = ICL_PW_CTL_IDX_AUX_C, 4851 + .hsw.fixed_enable_delay = 600, 4856 4852 }, 4857 4853 }, 4858 4854 { ··· 4864 4858 { 4865 4859 .hsw.regs = &icl_aux_power_well_regs, 4866 4860 .hsw.idx = XELPD_PW_CTL_IDX_AUX_D, 4861 + .hsw.fixed_enable_delay = 600, 4867 4862 }, 4868 4863 }, 4869 4864 { ··· 4885 4878 { 4886 4879 .hsw.regs = &icl_aux_power_well_regs, 4887 4880 .hsw.idx = TGL_PW_CTL_IDX_AUX_TC1, 4881 + .hsw.fixed_enable_delay = 600, 4888 4882 }, 4889 4883 }, 4890 4884 { ··· 5130 5122 err = 0; 5131 5123 } else if (DISPLAY_VER(dev_priv) >= 13) { 5132 5124 err = set_power_wells(power_domains, xelpd_power_wells); 5133 - } else if (IS_ALDERLAKE_S(dev_priv) || IS_DG1(dev_priv)) { 5125 + } else if (IS_DG1(dev_priv)) { 5126 + err = set_power_wells(power_domains, dg1_power_wells); 5127 + } else if (IS_ALDERLAKE_S(dev_priv)) { 5134 5128 err = set_power_wells_mask(power_domains, tgl_power_wells, 5135 5129 BIT_ULL(TGL_DISP_PW_TC_COLD_OFF)); 5136 5130 } else if (IS_ROCKETLAKE(dev_priv)) { ··· 5141 5131 err = set_power_wells(power_domains, tgl_power_wells); 5142 5132 } else if (DISPLAY_VER(dev_priv) == 11) { 5143 5133 err = set_power_wells(power_domains, icl_power_wells); 5144 - } else if (IS_CNL_WITH_PORT_F(dev_priv)) { 5145 - err = set_power_wells(power_domains, cnl_power_wells); 5146 - } else if (IS_CANNONLAKE(dev_priv)) { 5147 - err = set_power_wells_mask(power_domains, cnl_power_wells, 5148 - BIT_ULL(CNL_DISP_PW_DDI_F_IO) | 5149 - BIT_ULL(CNL_DISP_PW_DDI_F_AUX)); 5150 5134 } else if (IS_GEMINILAKE(dev_priv)) { 5151 5135 err = set_power_wells(power_domains, glk_power_wells); 5152 5136 } else if (IS_BROXTON(dev_priv)) { ··· 5695 5691 usleep_range(10, 30); /* 10 us delay per Bspec */ 5696 5692 } 5697 5693 5698 - static void cnl_display_core_init(struct drm_i915_private *dev_priv, bool resume) 5699 - { 5700 - struct i915_power_domains *power_domains = &dev_priv->power_domains; 5701 - struct i915_power_well *well; 5702 - 5703 - gen9_set_dc_state(dev_priv, DC_STATE_DISABLE); 5704 - 5705 - /* 1. Enable PCH Reset Handshake */ 5706 - intel_pch_reset_handshake(dev_priv, !HAS_PCH_NOP(dev_priv)); 5707 - 5708 - if (!HAS_DISPLAY(dev_priv)) 5709 - return; 5710 - 5711 - /* 2-3. */ 5712 - intel_combo_phy_init(dev_priv); 5713 - 5714 - /* 5715 - * 4. Enable Power Well 1 (PG1). 5716 - * The AUX IO power wells will be enabled on demand. 5717 - */ 5718 - mutex_lock(&power_domains->lock); 5719 - well = lookup_power_well(dev_priv, SKL_DISP_PW_1); 5720 - intel_power_well_enable(dev_priv, well); 5721 - mutex_unlock(&power_domains->lock); 5722 - 5723 - /* 5. Enable CD clock */ 5724 - intel_cdclk_init_hw(dev_priv); 5725 - 5726 - /* 6. Enable DBUF */ 5727 - gen9_dbuf_enable(dev_priv); 5728 - 5729 - if (resume && intel_dmc_has_payload(dev_priv)) 5730 - intel_dmc_load_program(dev_priv); 5731 - } 5732 - 5733 - static void cnl_display_core_uninit(struct drm_i915_private *dev_priv) 5734 - { 5735 - struct i915_power_domains *power_domains = &dev_priv->power_domains; 5736 - struct i915_power_well *well; 5737 - 5738 - if (!HAS_DISPLAY(dev_priv)) 5739 - return; 5740 - 5741 - gen9_disable_dc_states(dev_priv); 5742 - 5743 - /* 1. Disable all display engine functions -> aready done */ 5744 - 5745 - /* 2. Disable DBUF */ 5746 - gen9_dbuf_disable(dev_priv); 5747 - 5748 - /* 3. Disable CD clock */ 5749 - intel_cdclk_uninit_hw(dev_priv); 5750 - 5751 - /* 5752 - * 4. Disable Power Well 1 (PG1). 5753 - * The AUX IO power wells are toggled on demand, so they are already 5754 - * disabled at this point. 5755 - */ 5756 - mutex_lock(&power_domains->lock); 5757 - well = lookup_power_well(dev_priv, SKL_DISP_PW_1); 5758 - intel_power_well_disable(dev_priv, well); 5759 - mutex_unlock(&power_domains->lock); 5760 - 5761 - usleep_range(10, 30); /* 10 us delay per Bspec */ 5762 - 5763 - /* 5. */ 5764 - intel_combo_phy_uninit(dev_priv); 5765 - } 5766 - 5767 5694 struct buddy_page_mask { 5768 5695 u32 page_mask; 5769 5696 u8 type; ··· 5733 5798 unsigned long abox_mask = INTEL_INFO(dev_priv)->abox_mask; 5734 5799 int config, i; 5735 5800 5801 + /* BW_BUDDY registers are not used on dgpu's beyond DG1 */ 5802 + if (IS_DGFX(dev_priv) && !IS_DG1(dev_priv)) 5803 + return; 5804 + 5736 5805 if (IS_ALDERLAKE_S(dev_priv) || 5737 - IS_DG1_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0) || 5738 - IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 5806 + IS_DG1_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0) || 5807 + IS_RKL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0) || 5808 + IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) 5739 5809 /* Wa_1409767108:tgl,dg1,adl-s */ 5740 5810 table = wa_1409767108_buddy_page_masks; 5741 5811 else ··· 5762 5822 intel_de_write(dev_priv, BW_BUDDY_PAGE_MASK(i), 5763 5823 table[config].page_mask); 5764 5824 5765 - /* Wa_22010178259:tgl,rkl */ 5766 - intel_de_rmw(dev_priv, BW_BUDDY_CTL(i), 5767 - BW_BUDDY_TLB_REQ_TIMER_MASK, 5768 - BW_BUDDY_TLB_REQ_TIMER(0x8)); 5825 + /* Wa_22010178259:tgl,dg1,rkl,adl-s */ 5826 + if (DISPLAY_VER(dev_priv) == 12) 5827 + intel_de_rmw(dev_priv, BW_BUDDY_CTL(i), 5828 + BW_BUDDY_TLB_REQ_TIMER_MASK, 5829 + BW_BUDDY_TLB_REQ_TIMER(0x8)); 5769 5830 } 5770 5831 } 5771 5832 } ··· 5820 5879 if (DISPLAY_VER(dev_priv) >= 12) 5821 5880 tgl_bw_buddy_init(dev_priv); 5822 5881 5882 + /* 8. Ensure PHYs have completed calibration and adaptation */ 5883 + if (IS_DG2(dev_priv)) 5884 + intel_snps_phy_wait_for_calibration(dev_priv); 5885 + 5823 5886 if (resume && intel_dmc_has_payload(dev_priv)) 5824 5887 intel_dmc_load_program(dev_priv); 5825 5888 5826 - /* Wa_14011508470 */ 5827 - if (DISPLAY_VER(dev_priv) == 12) { 5889 + /* Wa_14011508470:tgl,dg1,rkl,adl-s,adl-p */ 5890 + if (DISPLAY_VER(dev_priv) >= 12) { 5828 5891 val = DCPR_CLEAR_MEMSTAT_DIS | DCPR_SEND_RESP_IMM | 5829 5892 DCPR_MASK_LPMODE | DCPR_MASK_MAXLATENCY_MEMUP_CLR; 5830 5893 intel_uncore_rmw(&dev_priv->uncore, GEN11_CHICKEN_DCPR_2, 0, val); ··· 6043 6098 6044 6099 if (DISPLAY_VER(i915) >= 11) { 6045 6100 icl_display_core_init(i915, resume); 6046 - } else if (IS_CANNONLAKE(i915)) { 6047 - cnl_display_core_init(i915, resume); 6048 6101 } else if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) { 6049 6102 bxt_display_core_init(i915, resume); 6050 6103 } else if (DISPLAY_VER(i915) == 9) { ··· 6202 6259 6203 6260 if (DISPLAY_VER(i915) >= 11) 6204 6261 icl_display_core_uninit(i915); 6205 - else if (IS_CANNONLAKE(i915)) 6206 - cnl_display_core_uninit(i915); 6207 6262 else if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) 6208 6263 bxt_display_core_uninit(i915); 6209 6264 else if (DISPLAY_VER(i915) == 9)
+12 -3
drivers/gpu/drm/i915/display/intel_display_power.h
··· 76 76 POWER_DOMAIN_PORT_CRT, 77 77 POWER_DOMAIN_PORT_OTHER, 78 78 POWER_DOMAIN_VGA, 79 - POWER_DOMAIN_AUDIO, 79 + POWER_DOMAIN_AUDIO_MMIO, 80 + POWER_DOMAIN_AUDIO_PLAYBACK, 80 81 POWER_DOMAIN_AUX_A, 81 82 POWER_DOMAIN_AUX_B, 82 83 POWER_DOMAIN_AUX_C, ··· 143 142 SKL_DISP_PW_MISC_IO, 144 143 SKL_DISP_PW_1, 145 144 SKL_DISP_PW_2, 146 - CNL_DISP_PW_DDI_F_IO, 147 - CNL_DISP_PW_DDI_F_AUX, 148 145 ICL_DISP_PW_3, 149 146 SKL_DISP_DC_OFF, 150 147 TGL_DISP_PW_TC_COLD_OFF, ··· 222 223 u8 idx; 223 224 /* Mask of pipes whose IRQ logic is backed by the pw */ 224 225 u8 irq_pipe_mask; 226 + /* 227 + * Instead of waiting for the status bit to ack enables, 228 + * just wait a specific amount of time and then consider 229 + * the well enabled. 230 + */ 231 + u16 fixed_enable_delay; 225 232 /* The pw is backing the VGA functionality */ 226 233 bool has_vga:1; 227 234 bool has_fuses:1; ··· 391 386 intel_display_power_put_mask_in_set(i915, power_domain_set, power_domain_set->mask); 392 387 } 393 388 389 + /* 390 + * FIXME: We should probably switch this to a 0-based scheme to be consistent 391 + * with how we now name/number DBUF_CTL instances. 392 + */ 394 393 enum dbuf_slice { 395 394 DBUF_S1, 396 395 DBUF_S2,
+21 -1
drivers/gpu/drm/i915/display/intel_display_types.h
··· 196 196 void (*update_complete)(struct intel_atomic_state *, 197 197 struct intel_encoder *, 198 198 struct intel_crtc *); 199 + void (*pre_disable)(struct intel_atomic_state *, 200 + struct intel_encoder *, 201 + const struct intel_crtc_state *, 202 + const struct drm_connector_state *); 199 203 void (*disable)(struct intel_atomic_state *, 200 204 struct intel_encoder *, 201 205 const struct intel_crtc_state *, ··· 888 884 INTEL_OUTPUT_FORMAT_YCBCR444, 889 885 }; 890 886 887 + struct intel_mpllb_state { 888 + u32 clock; /* in KHz */ 889 + u32 ref_control; 890 + u32 mpllb_cp; 891 + u32 mpllb_div; 892 + u32 mpllb_div2; 893 + u32 mpllb_fracn1; 894 + u32 mpllb_fracn2; 895 + u32 mpllb_sscen; 896 + u32 mpllb_sscstep; 897 + }; 898 + 891 899 struct intel_crtc_state { 892 900 /* 893 901 * uapi (drm) state. This is the software state shown to userspace. ··· 1034 1018 struct intel_shared_dpll *shared_dpll; 1035 1019 1036 1020 /* Actual register state of the dpll, for shared dpll cross-checking. */ 1037 - struct intel_dpll_hw_state dpll_hw_state; 1021 + union { 1022 + struct intel_dpll_hw_state dpll_hw_state; 1023 + struct intel_mpllb_state mpllb_state; 1024 + }; 1038 1025 1039 1026 /* 1040 1027 * ICL reserved DPLLs for the CRTC/port. The active PLL is selected by ··· 1631 1612 1632 1613 /* Display stream compression testing */ 1633 1614 bool force_dsc_en; 1615 + int force_dsc_bpp; 1634 1616 1635 1617 bool hobl_failed; 1636 1618 bool hobl_active;
+12 -55
drivers/gpu/drm/i915/display/intel_dmc.c
··· 57 57 #define DG1_DMC_VERSION_REQUIRED DMC_VERSION(2, 2) 58 58 MODULE_FIRMWARE(DG1_DMC_PATH); 59 59 60 - #define RKL_DMC_PATH DMC_PATH(rkl, 2, 02) 61 - #define RKL_DMC_VERSION_REQUIRED DMC_VERSION(2, 2) 60 + #define RKL_DMC_PATH DMC_PATH(rkl, 2, 03) 61 + #define RKL_DMC_VERSION_REQUIRED DMC_VERSION(2, 3) 62 62 MODULE_FIRMWARE(RKL_DMC_PATH); 63 63 64 - #define TGL_DMC_PATH DMC_PATH(tgl, 2, 08) 65 - #define TGL_DMC_VERSION_REQUIRED DMC_VERSION(2, 8) 64 + #define TGL_DMC_PATH DMC_PATH(tgl, 2, 12) 65 + #define TGL_DMC_VERSION_REQUIRED DMC_VERSION(2, 12) 66 66 MODULE_FIRMWARE(TGL_DMC_PATH); 67 67 68 68 #define ICL_DMC_PATH DMC_PATH(icl, 1, 09) 69 69 #define ICL_DMC_VERSION_REQUIRED DMC_VERSION(1, 9) 70 70 #define ICL_DMC_MAX_FW_SIZE 0x6000 71 71 MODULE_FIRMWARE(ICL_DMC_PATH); 72 - 73 - #define CNL_DMC_PATH DMC_PATH(cnl, 1, 07) 74 - #define CNL_DMC_VERSION_REQUIRED DMC_VERSION(1, 7) 75 - #define CNL_DMC_MAX_FW_SIZE GLK_DMC_MAX_FW_SIZE 76 - MODULE_FIRMWARE(CNL_DMC_PATH); 77 72 78 73 #define GLK_DMC_PATH DMC_PATH(glk, 1, 04) 79 74 #define GLK_DMC_VERSION_REQUIRED DMC_VERSION(1, 4) ··· 242 247 return i915->dmc.dmc_info[DMC_FW_MAIN].payload; 243 248 } 244 249 245 - static const struct stepping_info skl_stepping_info[] = { 246 - {'A', '0'}, {'B', '0'}, {'C', '0'}, 247 - {'D', '0'}, {'E', '0'}, {'F', '0'}, 248 - {'G', '0'}, {'H', '0'}, {'I', '0'}, 249 - {'J', '0'}, {'K', '0'} 250 - }; 251 - 252 - static const struct stepping_info bxt_stepping_info[] = { 253 - {'A', '0'}, {'A', '1'}, {'A', '2'}, 254 - {'B', '0'}, {'B', '1'}, {'B', '2'} 255 - }; 256 - 257 - static const struct stepping_info icl_stepping_info[] = { 258 - {'A', '0'}, {'A', '1'}, {'A', '2'}, 259 - {'B', '0'}, {'B', '2'}, 260 - {'C', '0'} 261 - }; 262 - 263 - static const struct stepping_info no_stepping_info = { '*', '*' }; 264 - 265 250 static const struct stepping_info * 266 - intel_get_stepping_info(struct drm_i915_private *dev_priv) 251 + intel_get_stepping_info(struct drm_i915_private *i915, 252 + struct stepping_info *si) 267 253 { 268 - const struct stepping_info *si; 269 - unsigned int size; 254 + const char *step_name = intel_step_name(RUNTIME_INFO(i915)->step.display_step); 270 255 271 - if (IS_ICELAKE(dev_priv)) { 272 - size = ARRAY_SIZE(icl_stepping_info); 273 - si = icl_stepping_info; 274 - } else if (IS_SKYLAKE(dev_priv)) { 275 - size = ARRAY_SIZE(skl_stepping_info); 276 - si = skl_stepping_info; 277 - } else if (IS_BROXTON(dev_priv)) { 278 - size = ARRAY_SIZE(bxt_stepping_info); 279 - si = bxt_stepping_info; 280 - } else { 281 - size = 0; 282 - si = NULL; 283 - } 284 - 285 - if (INTEL_REVID(dev_priv) < size) 286 - return si + INTEL_REVID(dev_priv); 287 - 288 - return &no_stepping_info; 256 + si->stepping = step_name[0]; 257 + si->substepping = step_name[1]; 258 + return si; 289 259 } 290 260 291 261 static void gen9_set_dc_state_debugmask(struct drm_i915_private *dev_priv) ··· 576 616 struct intel_package_header *package_header; 577 617 struct intel_dmc_header_base *dmc_header; 578 618 struct intel_dmc *dmc = &dev_priv->dmc; 579 - const struct stepping_info *si = intel_get_stepping_info(dev_priv); 619 + struct stepping_info display_info = { '*', '*'}; 620 + const struct stepping_info *si = intel_get_stepping_info(dev_priv, &display_info); 580 621 u32 readcount = 0; 581 622 u32 r, offset; 582 623 int id; ··· 713 752 dmc->fw_path = ICL_DMC_PATH; 714 753 dmc->required_version = ICL_DMC_VERSION_REQUIRED; 715 754 dmc->max_fw_size = ICL_DMC_MAX_FW_SIZE; 716 - } else if (IS_CANNONLAKE(dev_priv)) { 717 - dmc->fw_path = CNL_DMC_PATH; 718 - dmc->required_version = CNL_DMC_VERSION_REQUIRED; 719 - dmc->max_fw_size = CNL_DMC_MAX_FW_SIZE; 720 755 } else if (IS_GEMINILAKE(dev_priv)) { 721 756 dmc->fw_path = GLK_DMC_PATH; 722 757 dmc->required_version = GLK_DMC_VERSION_REQUIRED;
+25 -30
drivers/gpu/drm/i915/display/intel_dp.c
··· 222 222 encoder->port != PORT_A); 223 223 } 224 224 225 - static int cnl_max_source_rate(struct intel_dp *intel_dp) 226 - { 227 - struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); 228 - struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); 229 - enum port port = dig_port->base.port; 230 - 231 - u32 voltage = intel_de_read(dev_priv, CNL_PORT_COMP_DW3) & VOLTAGE_INFO_MASK; 232 - 233 - /* Low voltage SKUs are limited to max of 5.4G */ 234 - if (voltage == VOLTAGE_INFO_0_85V) 235 - return 540000; 236 - 237 - /* For this SKU 8.1G is supported in all ports */ 238 - if (IS_CNL_WITH_PORT_F(dev_priv)) 239 - return 810000; 240 - 241 - /* For other SKUs, max rate on ports A and D is 5.4G */ 242 - if (port == PORT_A || port == PORT_D) 243 - return 540000; 244 - 245 - return 810000; 246 - } 247 - 248 225 static int icl_max_source_rate(struct intel_dp *intel_dp) 249 226 { 250 227 struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); ··· 247 270 intel_dp_set_source_rates(struct intel_dp *intel_dp) 248 271 { 249 272 /* The values must be in increasing order */ 250 - static const int cnl_rates[] = { 273 + static const int icl_rates[] = { 251 274 162000, 216000, 270000, 324000, 432000, 540000, 648000, 810000 252 275 }; 253 276 static const int bxt_rates[] = { ··· 272 295 drm_WARN_ON(&dev_priv->drm, 273 296 intel_dp->source_rates || intel_dp->num_source_rates); 274 297 275 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) { 276 - source_rates = cnl_rates; 277 - size = ARRAY_SIZE(cnl_rates); 278 - if (DISPLAY_VER(dev_priv) == 10) 279 - max_rate = cnl_max_source_rate(intel_dp); 280 - else if (IS_JSL_EHL(dev_priv)) 298 + if (DISPLAY_VER(dev_priv) >= 11) { 299 + source_rates = icl_rates; 300 + size = ARRAY_SIZE(icl_rates); 301 + if (IS_JSL_EHL(dev_priv)) 281 302 max_rate = ehl_max_source_rate(intel_dp); 282 303 else 283 304 max_rate = icl_max_source_rate(intel_dp); ··· 1249 1274 pipe_config->pipe_bpp); 1250 1275 pipe_config->dsc.slice_count = dsc_dp_slice_count; 1251 1276 } 1277 + 1278 + /* As of today we support DSC for only RGB */ 1279 + if (intel_dp->force_dsc_bpp) { 1280 + if (intel_dp->force_dsc_bpp >= 8 && 1281 + intel_dp->force_dsc_bpp < pipe_bpp) { 1282 + drm_dbg_kms(&dev_priv->drm, 1283 + "DSC BPP forced to %d", 1284 + intel_dp->force_dsc_bpp); 1285 + pipe_config->dsc.compressed_bpp = 1286 + intel_dp->force_dsc_bpp; 1287 + } else { 1288 + drm_dbg_kms(&dev_priv->drm, 1289 + "Invalid DSC BPP %d", 1290 + intel_dp->force_dsc_bpp); 1291 + } 1292 + } 1293 + 1252 1294 /* 1253 1295 * VDSC engine operates at 1 Pixel per clock, so if peak pixel rate 1254 1296 * is greater than the maximum Cdclock and if slice count is even ··· 3330 3338 intel_dp_phy_pattern_update(intel_dp, crtc_state); 3331 3339 3332 3340 intel_dp_autotest_phy_ddi_enable(intel_dp, crtc_state); 3341 + 3342 + drm_dp_dpcd_write(&intel_dp->aux, DP_TRAINING_LANE0_SET, 3343 + intel_dp->train_set, crtc_state->lane_count); 3333 3344 3334 3345 drm_dp_set_phy_test_pattern(&intel_dp->aux, data, 3335 3346 link_status[DP_DPCD_REV]);
-1
drivers/gpu/drm/i915/display/intel_dp_aux.c
··· 158 158 /* 159 159 * Max timeout values: 160 160 * SKL-GLK: 1.6ms 161 - * CNL: 3.2ms 162 161 * ICL+: 4ms 163 162 */ 164 163 ret = DP_AUX_CH_CTL_SEND_BUSY |
+18 -10
drivers/gpu/drm/i915/display/intel_dp_mst.c
··· 348 348 drm_dp_check_act_status(&intel_dp->mst_mgr); 349 349 } 350 350 351 + static void intel_mst_pre_disable_dp(struct intel_atomic_state *state, 352 + struct intel_encoder *encoder, 353 + const struct intel_crtc_state *old_crtc_state, 354 + const struct drm_connector_state *old_conn_state) 355 + { 356 + if (old_crtc_state->has_audio) 357 + intel_audio_codec_disable(encoder, old_crtc_state, 358 + old_conn_state); 359 + } 360 + 351 361 static void intel_mst_disable_dp(struct intel_atomic_state *state, 352 362 struct intel_encoder *encoder, 353 363 const struct intel_crtc_state *old_crtc_state, ··· 382 372 if (ret) { 383 373 drm_dbg_kms(&i915->drm, "failed to update payload %d\n", ret); 384 374 } 385 - if (old_crtc_state->has_audio) 386 - intel_audio_codec_disable(encoder, 387 - old_crtc_state, old_conn_state); 388 375 } 389 376 390 377 static void intel_mst_post_disable_dp(struct intel_atomic_state *state, ··· 549 542 struct intel_digital_port *dig_port = intel_mst->primary; 550 543 struct intel_dp *intel_dp = &dig_port->dp; 551 544 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 552 - u32 val; 545 + enum transcoder trans = pipe_config->cpu_transcoder; 553 546 554 547 drm_WARN_ON(&dev_priv->drm, pipe_config->has_pch_encoder); 555 548 ··· 557 550 558 551 intel_ddi_enable_transcoder_func(encoder, pipe_config); 559 552 560 - val = intel_de_read(dev_priv, 561 - TRANS_DDI_FUNC_CTL(pipe_config->cpu_transcoder)); 562 - val |= TRANS_DDI_DP_VC_PAYLOAD_ALLOC; 563 - intel_de_write(dev_priv, 564 - TRANS_DDI_FUNC_CTL(pipe_config->cpu_transcoder), 565 - val); 553 + intel_de_rmw(dev_priv, TRANS_DDI_FUNC_CTL(trans), 0, 554 + TRANS_DDI_DP_VC_PAYLOAD_ALLOC); 566 555 567 556 drm_dbg_kms(&dev_priv->drm, "active links %d\n", 568 557 intel_dp->active_mst_links); ··· 566 563 wait_for_act_sent(encoder, pipe_config); 567 564 568 565 drm_dp_update_payload_part2(&intel_dp->mst_mgr); 566 + 567 + if (DISPLAY_VER(dev_priv) >= 12 && pipe_config->fec_enable) 568 + intel_de_rmw(dev_priv, CHICKEN_TRANS(trans), 0, 569 + FECSTALL_DIS_DPTSTREAM_DPTTG); 569 570 570 571 intel_enable_pipe(pipe_config); 571 572 ··· 910 903 911 904 intel_encoder->compute_config = intel_dp_mst_compute_config; 912 905 intel_encoder->compute_config_late = intel_dp_mst_compute_config_late; 906 + intel_encoder->pre_disable = intel_mst_pre_disable_dp; 913 907 intel_encoder->disable = intel_mst_disable_dp; 914 908 intel_encoder->post_disable = intel_mst_post_disable_dp; 915 909 intel_encoder->update_pipe = intel_ddi_update_pipe;
+7 -5
drivers/gpu/drm/i915/display/intel_dpll.c
··· 11 11 #include "intel_lvds.h" 12 12 #include "intel_panel.h" 13 13 #include "intel_sideband.h" 14 + #include "display/intel_snps_phy.h" 14 15 15 16 struct intel_limit { 16 17 struct { ··· 924 923 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 925 924 struct intel_atomic_state *state = 926 925 to_intel_atomic_state(crtc_state->uapi.state); 926 + struct intel_encoder *encoder = 927 + intel_get_crtc_new_encoder(state, crtc_state); 927 928 928 - if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) || 929 - DISPLAY_VER(dev_priv) >= 11) { 930 - struct intel_encoder *encoder = 931 - intel_get_crtc_new_encoder(state, crtc_state); 932 - 929 + if (IS_DG2(dev_priv)) { 930 + return intel_mpllb_calc_state(crtc_state, encoder); 931 + } else if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) || 932 + DISPLAY_VER(dev_priv) >= 11) { 933 933 if (!intel_reserve_shared_dplls(state, crtc, encoder)) { 934 934 drm_dbg_kms(&dev_priv->drm, 935 935 "failed to find PLL for pipe %c\n",
+131 -494
drivers/gpu/drm/i915/display/intel_dpll_mgr.c
··· 168 168 else if (IS_JSL_EHL(i915) && (pll->info->id == DPLL_ID_EHL_DPLL4)) 169 169 return MG_PLL_ENABLE(0); 170 170 171 - return CNL_DPLL_ENABLE(pll->info->id); 171 + return ICL_DPLL_ENABLE(pll->info->id); 172 172 } 173 173 174 174 static i915_reg_t ··· 2346 2346 .dump_hw_state = bxt_dump_hw_state, 2347 2347 }; 2348 2348 2349 - static void cnl_ddi_pll_enable(struct drm_i915_private *dev_priv, 2350 - struct intel_shared_dpll *pll) 2351 - { 2352 - const enum intel_dpll_id id = pll->info->id; 2353 - u32 val; 2354 - 2355 - /* 1. Enable DPLL power in DPLL_ENABLE. */ 2356 - val = intel_de_read(dev_priv, CNL_DPLL_ENABLE(id)); 2357 - val |= PLL_POWER_ENABLE; 2358 - intel_de_write(dev_priv, CNL_DPLL_ENABLE(id), val); 2359 - 2360 - /* 2. Wait for DPLL power state enabled in DPLL_ENABLE. */ 2361 - if (intel_de_wait_for_set(dev_priv, CNL_DPLL_ENABLE(id), 2362 - PLL_POWER_STATE, 5)) 2363 - drm_err(&dev_priv->drm, "PLL %d Power not enabled\n", id); 2364 - 2365 - /* 2366 - * 3. Configure DPLL_CFGCR0 to set SSC enable/disable, 2367 - * select DP mode, and set DP link rate. 2368 - */ 2369 - val = pll->state.hw_state.cfgcr0; 2370 - intel_de_write(dev_priv, CNL_DPLL_CFGCR0(id), val); 2371 - 2372 - /* 4. Reab back to ensure writes completed */ 2373 - intel_de_posting_read(dev_priv, CNL_DPLL_CFGCR0(id)); 2374 - 2375 - /* 3. Configure DPLL_CFGCR0 */ 2376 - /* Avoid touch CFGCR1 if HDMI mode is not enabled */ 2377 - if (pll->state.hw_state.cfgcr0 & DPLL_CFGCR0_HDMI_MODE) { 2378 - val = pll->state.hw_state.cfgcr1; 2379 - intel_de_write(dev_priv, CNL_DPLL_CFGCR1(id), val); 2380 - /* 4. Reab back to ensure writes completed */ 2381 - intel_de_posting_read(dev_priv, CNL_DPLL_CFGCR1(id)); 2382 - } 2383 - 2384 - /* 2385 - * 5. If the frequency will result in a change to the voltage 2386 - * requirement, follow the Display Voltage Frequency Switching 2387 - * Sequence Before Frequency Change 2388 - * 2389 - * Note: DVFS is actually handled via the cdclk code paths, 2390 - * hence we do nothing here. 2391 - */ 2392 - 2393 - /* 6. Enable DPLL in DPLL_ENABLE. */ 2394 - val = intel_de_read(dev_priv, CNL_DPLL_ENABLE(id)); 2395 - val |= PLL_ENABLE; 2396 - intel_de_write(dev_priv, CNL_DPLL_ENABLE(id), val); 2397 - 2398 - /* 7. Wait for PLL lock status in DPLL_ENABLE. */ 2399 - if (intel_de_wait_for_set(dev_priv, CNL_DPLL_ENABLE(id), PLL_LOCK, 5)) 2400 - drm_err(&dev_priv->drm, "PLL %d not locked\n", id); 2401 - 2402 - /* 2403 - * 8. If the frequency will result in a change to the voltage 2404 - * requirement, follow the Display Voltage Frequency Switching 2405 - * Sequence After Frequency Change 2406 - * 2407 - * Note: DVFS is actually handled via the cdclk code paths, 2408 - * hence we do nothing here. 2409 - */ 2410 - 2411 - /* 2412 - * 9. turn on the clock for the DDI and map the DPLL to the DDI 2413 - * Done at intel_ddi_clk_select 2414 - */ 2415 - } 2416 - 2417 - static void cnl_ddi_pll_disable(struct drm_i915_private *dev_priv, 2418 - struct intel_shared_dpll *pll) 2419 - { 2420 - const enum intel_dpll_id id = pll->info->id; 2421 - u32 val; 2422 - 2423 - /* 2424 - * 1. Configure DPCLKA_CFGCR0 to turn off the clock for the DDI. 2425 - * Done at intel_ddi_post_disable 2426 - */ 2427 - 2428 - /* 2429 - * 2. If the frequency will result in a change to the voltage 2430 - * requirement, follow the Display Voltage Frequency Switching 2431 - * Sequence Before Frequency Change 2432 - * 2433 - * Note: DVFS is actually handled via the cdclk code paths, 2434 - * hence we do nothing here. 2435 - */ 2436 - 2437 - /* 3. Disable DPLL through DPLL_ENABLE. */ 2438 - val = intel_de_read(dev_priv, CNL_DPLL_ENABLE(id)); 2439 - val &= ~PLL_ENABLE; 2440 - intel_de_write(dev_priv, CNL_DPLL_ENABLE(id), val); 2441 - 2442 - /* 4. Wait for PLL not locked status in DPLL_ENABLE. */ 2443 - if (intel_de_wait_for_clear(dev_priv, CNL_DPLL_ENABLE(id), PLL_LOCK, 5)) 2444 - drm_err(&dev_priv->drm, "PLL %d locked\n", id); 2445 - 2446 - /* 2447 - * 5. If the frequency will result in a change to the voltage 2448 - * requirement, follow the Display Voltage Frequency Switching 2449 - * Sequence After Frequency Change 2450 - * 2451 - * Note: DVFS is actually handled via the cdclk code paths, 2452 - * hence we do nothing here. 2453 - */ 2454 - 2455 - /* 6. Disable DPLL power in DPLL_ENABLE. */ 2456 - val = intel_de_read(dev_priv, CNL_DPLL_ENABLE(id)); 2457 - val &= ~PLL_POWER_ENABLE; 2458 - intel_de_write(dev_priv, CNL_DPLL_ENABLE(id), val); 2459 - 2460 - /* 7. Wait for DPLL power state disabled in DPLL_ENABLE. */ 2461 - if (intel_de_wait_for_clear(dev_priv, CNL_DPLL_ENABLE(id), 2462 - PLL_POWER_STATE, 5)) 2463 - drm_err(&dev_priv->drm, "PLL %d Power not disabled\n", id); 2464 - } 2465 - 2466 - static bool cnl_ddi_pll_get_hw_state(struct drm_i915_private *dev_priv, 2467 - struct intel_shared_dpll *pll, 2468 - struct intel_dpll_hw_state *hw_state) 2469 - { 2470 - const enum intel_dpll_id id = pll->info->id; 2471 - intel_wakeref_t wakeref; 2472 - u32 val; 2473 - bool ret; 2474 - 2475 - wakeref = intel_display_power_get_if_enabled(dev_priv, 2476 - POWER_DOMAIN_DISPLAY_CORE); 2477 - if (!wakeref) 2478 - return false; 2479 - 2480 - ret = false; 2481 - 2482 - val = intel_de_read(dev_priv, CNL_DPLL_ENABLE(id)); 2483 - if (!(val & PLL_ENABLE)) 2484 - goto out; 2485 - 2486 - val = intel_de_read(dev_priv, CNL_DPLL_CFGCR0(id)); 2487 - hw_state->cfgcr0 = val; 2488 - 2489 - /* avoid reading back stale values if HDMI mode is not enabled */ 2490 - if (val & DPLL_CFGCR0_HDMI_MODE) { 2491 - hw_state->cfgcr1 = intel_de_read(dev_priv, 2492 - CNL_DPLL_CFGCR1(id)); 2493 - } 2494 - ret = true; 2495 - 2496 - out: 2497 - intel_display_power_put(dev_priv, POWER_DOMAIN_DISPLAY_CORE, wakeref); 2498 - 2499 - return ret; 2500 - } 2501 - 2502 - static void cnl_wrpll_get_multipliers(int bestdiv, int *pdiv, 2349 + static void icl_wrpll_get_multipliers(int bestdiv, int *pdiv, 2503 2350 int *qdiv, int *kdiv) 2504 2351 { 2505 2352 /* even dividers */ ··· 2385 2538 } 2386 2539 } 2387 2540 2388 - static void cnl_wrpll_params_populate(struct skl_wrpll_params *params, 2541 + static void icl_wrpll_params_populate(struct skl_wrpll_params *params, 2389 2542 u32 dco_freq, u32 ref_freq, 2390 2543 int pdiv, int qdiv, int kdiv) 2391 2544 { ··· 2433 2586 params->dco_fraction = dco & 0x7fff; 2434 2587 } 2435 2588 2436 - static bool 2437 - __cnl_ddi_calculate_wrpll(struct intel_crtc_state *crtc_state, 2438 - struct skl_wrpll_params *wrpll_params, 2439 - int ref_clock) 2440 - { 2441 - u32 afe_clock = crtc_state->port_clock * 5; 2442 - u32 dco_min = 7998000; 2443 - u32 dco_max = 10000000; 2444 - u32 dco_mid = (dco_min + dco_max) / 2; 2445 - static const int dividers[] = { 2, 4, 6, 8, 10, 12, 14, 16, 2446 - 18, 20, 24, 28, 30, 32, 36, 40, 2447 - 42, 44, 48, 50, 52, 54, 56, 60, 2448 - 64, 66, 68, 70, 72, 76, 78, 80, 2449 - 84, 88, 90, 92, 96, 98, 100, 102, 2450 - 3, 5, 7, 9, 15, 21 }; 2451 - u32 dco, best_dco = 0, dco_centrality = 0; 2452 - u32 best_dco_centrality = U32_MAX; /* Spec meaning of 999999 MHz */ 2453 - int d, best_div = 0, pdiv = 0, qdiv = 0, kdiv = 0; 2454 - 2455 - for (d = 0; d < ARRAY_SIZE(dividers); d++) { 2456 - dco = afe_clock * dividers[d]; 2457 - 2458 - if ((dco <= dco_max) && (dco >= dco_min)) { 2459 - dco_centrality = abs(dco - dco_mid); 2460 - 2461 - if (dco_centrality < best_dco_centrality) { 2462 - best_dco_centrality = dco_centrality; 2463 - best_div = dividers[d]; 2464 - best_dco = dco; 2465 - } 2466 - } 2467 - } 2468 - 2469 - if (best_div == 0) 2470 - return false; 2471 - 2472 - cnl_wrpll_get_multipliers(best_div, &pdiv, &qdiv, &kdiv); 2473 - cnl_wrpll_params_populate(wrpll_params, best_dco, ref_clock, 2474 - pdiv, qdiv, kdiv); 2475 - 2476 - return true; 2477 - } 2478 - 2479 - static bool 2480 - cnl_ddi_calculate_wrpll(struct intel_crtc_state *crtc_state, 2481 - struct skl_wrpll_params *wrpll_params) 2482 - { 2483 - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); 2484 - 2485 - return __cnl_ddi_calculate_wrpll(crtc_state, wrpll_params, 2486 - i915->dpll.ref_clks.nssc); 2487 - } 2488 - 2489 - static bool cnl_ddi_hdmi_pll_dividers(struct intel_crtc_state *crtc_state) 2490 - { 2491 - u32 cfgcr0, cfgcr1; 2492 - struct skl_wrpll_params wrpll_params = { 0, }; 2493 - 2494 - cfgcr0 = DPLL_CFGCR0_HDMI_MODE; 2495 - 2496 - if (!cnl_ddi_calculate_wrpll(crtc_state, &wrpll_params)) 2497 - return false; 2498 - 2499 - cfgcr0 |= DPLL_CFGCR0_DCO_FRACTION(wrpll_params.dco_fraction) | 2500 - wrpll_params.dco_integer; 2501 - 2502 - cfgcr1 = DPLL_CFGCR1_QDIV_RATIO(wrpll_params.qdiv_ratio) | 2503 - DPLL_CFGCR1_QDIV_MODE(wrpll_params.qdiv_mode) | 2504 - DPLL_CFGCR1_KDIV(wrpll_params.kdiv) | 2505 - DPLL_CFGCR1_PDIV(wrpll_params.pdiv) | 2506 - DPLL_CFGCR1_CENTRAL_FREQ; 2507 - 2508 - memset(&crtc_state->dpll_hw_state, 0, 2509 - sizeof(crtc_state->dpll_hw_state)); 2510 - 2511 - crtc_state->dpll_hw_state.cfgcr0 = cfgcr0; 2512 - crtc_state->dpll_hw_state.cfgcr1 = cfgcr1; 2513 - return true; 2514 - } 2515 - 2516 2589 /* 2517 2590 * Display WA #22010492432: ehl, tgl, adl-p 2518 2591 * Program half of the nominal DCO divider fraction value. ··· 2445 2678 IS_TIGERLAKE(i915) || IS_ALDERLAKE_P(i915)) && 2446 2679 i915->dpll.ref_clks.nssc == 38400; 2447 2680 } 2448 - 2449 - static int __cnl_ddi_wrpll_get_freq(struct drm_i915_private *dev_priv, 2450 - const struct intel_shared_dpll *pll, 2451 - const struct intel_dpll_hw_state *pll_state, 2452 - int ref_clock) 2453 - { 2454 - u32 dco_fraction; 2455 - u32 p0, p1, p2, dco_freq; 2456 - 2457 - p0 = pll_state->cfgcr1 & DPLL_CFGCR1_PDIV_MASK; 2458 - p2 = pll_state->cfgcr1 & DPLL_CFGCR1_KDIV_MASK; 2459 - 2460 - if (pll_state->cfgcr1 & DPLL_CFGCR1_QDIV_MODE(1)) 2461 - p1 = (pll_state->cfgcr1 & DPLL_CFGCR1_QDIV_RATIO_MASK) >> 2462 - DPLL_CFGCR1_QDIV_RATIO_SHIFT; 2463 - else 2464 - p1 = 1; 2465 - 2466 - 2467 - switch (p0) { 2468 - case DPLL_CFGCR1_PDIV_2: 2469 - p0 = 2; 2470 - break; 2471 - case DPLL_CFGCR1_PDIV_3: 2472 - p0 = 3; 2473 - break; 2474 - case DPLL_CFGCR1_PDIV_5: 2475 - p0 = 5; 2476 - break; 2477 - case DPLL_CFGCR1_PDIV_7: 2478 - p0 = 7; 2479 - break; 2480 - } 2481 - 2482 - switch (p2) { 2483 - case DPLL_CFGCR1_KDIV_1: 2484 - p2 = 1; 2485 - break; 2486 - case DPLL_CFGCR1_KDIV_2: 2487 - p2 = 2; 2488 - break; 2489 - case DPLL_CFGCR1_KDIV_3: 2490 - p2 = 3; 2491 - break; 2492 - } 2493 - 2494 - dco_freq = (pll_state->cfgcr0 & DPLL_CFGCR0_DCO_INTEGER_MASK) * 2495 - ref_clock; 2496 - 2497 - dco_fraction = (pll_state->cfgcr0 & DPLL_CFGCR0_DCO_FRACTION_MASK) >> 2498 - DPLL_CFGCR0_DCO_FRACTION_SHIFT; 2499 - 2500 - if (ehl_combo_pll_div_frac_wa_needed(dev_priv)) 2501 - dco_fraction *= 2; 2502 - 2503 - dco_freq += (dco_fraction * ref_clock) / 0x8000; 2504 - 2505 - if (drm_WARN_ON(&dev_priv->drm, p0 == 0 || p1 == 0 || p2 == 0)) 2506 - return 0; 2507 - 2508 - return dco_freq / (p0 * p1 * p2 * 5); 2509 - } 2510 - 2511 - static int cnl_ddi_wrpll_get_freq(struct drm_i915_private *i915, 2512 - const struct intel_shared_dpll *pll, 2513 - const struct intel_dpll_hw_state *pll_state) 2514 - { 2515 - return __cnl_ddi_wrpll_get_freq(i915, pll, pll_state, 2516 - i915->dpll.ref_clks.nssc); 2517 - } 2518 - 2519 - static bool 2520 - cnl_ddi_dp_set_dpll_hw_state(struct intel_crtc_state *crtc_state) 2521 - { 2522 - u32 cfgcr0; 2523 - 2524 - cfgcr0 = DPLL_CFGCR0_SSC_ENABLE; 2525 - 2526 - switch (crtc_state->port_clock / 2) { 2527 - case 81000: 2528 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_810; 2529 - break; 2530 - case 135000: 2531 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_1350; 2532 - break; 2533 - case 270000: 2534 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_2700; 2535 - break; 2536 - /* eDP 1.4 rates */ 2537 - case 162000: 2538 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_1620; 2539 - break; 2540 - case 108000: 2541 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_1080; 2542 - break; 2543 - case 216000: 2544 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_2160; 2545 - break; 2546 - case 324000: 2547 - /* Some SKUs may require elevated I/O voltage to support this */ 2548 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_3240; 2549 - break; 2550 - case 405000: 2551 - /* Some SKUs may require elevated I/O voltage to support this */ 2552 - cfgcr0 |= DPLL_CFGCR0_LINK_RATE_4050; 2553 - break; 2554 - } 2555 - 2556 - memset(&crtc_state->dpll_hw_state, 0, 2557 - sizeof(crtc_state->dpll_hw_state)); 2558 - 2559 - crtc_state->dpll_hw_state.cfgcr0 = cfgcr0; 2560 - 2561 - return true; 2562 - } 2563 - 2564 - static int cnl_ddi_lcpll_get_freq(struct drm_i915_private *i915, 2565 - const struct intel_shared_dpll *pll, 2566 - const struct intel_dpll_hw_state *pll_state) 2567 - { 2568 - int link_clock = 0; 2569 - 2570 - switch (pll_state->cfgcr0 & DPLL_CFGCR0_LINK_RATE_MASK) { 2571 - case DPLL_CFGCR0_LINK_RATE_810: 2572 - link_clock = 81000; 2573 - break; 2574 - case DPLL_CFGCR0_LINK_RATE_1080: 2575 - link_clock = 108000; 2576 - break; 2577 - case DPLL_CFGCR0_LINK_RATE_1350: 2578 - link_clock = 135000; 2579 - break; 2580 - case DPLL_CFGCR0_LINK_RATE_1620: 2581 - link_clock = 162000; 2582 - break; 2583 - case DPLL_CFGCR0_LINK_RATE_2160: 2584 - link_clock = 216000; 2585 - break; 2586 - case DPLL_CFGCR0_LINK_RATE_2700: 2587 - link_clock = 270000; 2588 - break; 2589 - case DPLL_CFGCR0_LINK_RATE_3240: 2590 - link_clock = 324000; 2591 - break; 2592 - case DPLL_CFGCR0_LINK_RATE_4050: 2593 - link_clock = 405000; 2594 - break; 2595 - default: 2596 - drm_WARN(&i915->drm, 1, "Unsupported link rate\n"); 2597 - break; 2598 - } 2599 - 2600 - return link_clock * 2; 2601 - } 2602 - 2603 - static bool cnl_get_dpll(struct intel_atomic_state *state, 2604 - struct intel_crtc *crtc, 2605 - struct intel_encoder *encoder) 2606 - { 2607 - struct intel_crtc_state *crtc_state = 2608 - intel_atomic_get_new_crtc_state(state, crtc); 2609 - struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); 2610 - struct intel_shared_dpll *pll; 2611 - bool bret; 2612 - 2613 - if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) { 2614 - bret = cnl_ddi_hdmi_pll_dividers(crtc_state); 2615 - if (!bret) { 2616 - drm_dbg_kms(&i915->drm, 2617 - "Could not get HDMI pll dividers.\n"); 2618 - return false; 2619 - } 2620 - } else if (intel_crtc_has_dp_encoder(crtc_state)) { 2621 - bret = cnl_ddi_dp_set_dpll_hw_state(crtc_state); 2622 - if (!bret) { 2623 - drm_dbg_kms(&i915->drm, 2624 - "Could not set DP dpll HW state.\n"); 2625 - return false; 2626 - } 2627 - } else { 2628 - drm_dbg_kms(&i915->drm, 2629 - "Skip DPLL setup for output_types 0x%x\n", 2630 - crtc_state->output_types); 2631 - return false; 2632 - } 2633 - 2634 - pll = intel_find_shared_dpll(state, crtc, 2635 - &crtc_state->dpll_hw_state, 2636 - BIT(DPLL_ID_SKL_DPLL2) | 2637 - BIT(DPLL_ID_SKL_DPLL1) | 2638 - BIT(DPLL_ID_SKL_DPLL0)); 2639 - if (!pll) { 2640 - drm_dbg_kms(&i915->drm, "No PLL selected\n"); 2641 - return false; 2642 - } 2643 - 2644 - intel_reference_shared_dpll(state, crtc, 2645 - pll, &crtc_state->dpll_hw_state); 2646 - 2647 - crtc_state->shared_dpll = pll; 2648 - 2649 - return true; 2650 - } 2651 - 2652 - static int cnl_ddi_pll_get_freq(struct drm_i915_private *i915, 2653 - const struct intel_shared_dpll *pll, 2654 - const struct intel_dpll_hw_state *pll_state) 2655 - { 2656 - if (pll_state->cfgcr0 & DPLL_CFGCR0_HDMI_MODE) 2657 - return cnl_ddi_wrpll_get_freq(i915, pll, pll_state); 2658 - else 2659 - return cnl_ddi_lcpll_get_freq(i915, pll, pll_state); 2660 - } 2661 - 2662 - static void cnl_update_dpll_ref_clks(struct drm_i915_private *i915) 2663 - { 2664 - /* No SSC reference */ 2665 - i915->dpll.ref_clks.nssc = i915->cdclk.hw.ref; 2666 - } 2667 - 2668 - static void cnl_dump_hw_state(struct drm_i915_private *dev_priv, 2669 - const struct intel_dpll_hw_state *hw_state) 2670 - { 2671 - drm_dbg_kms(&dev_priv->drm, "dpll_hw_state: " 2672 - "cfgcr0: 0x%x, cfgcr1: 0x%x\n", 2673 - hw_state->cfgcr0, 2674 - hw_state->cfgcr1); 2675 - } 2676 - 2677 - static const struct intel_shared_dpll_funcs cnl_ddi_pll_funcs = { 2678 - .enable = cnl_ddi_pll_enable, 2679 - .disable = cnl_ddi_pll_disable, 2680 - .get_hw_state = cnl_ddi_pll_get_hw_state, 2681 - .get_freq = cnl_ddi_pll_get_freq, 2682 - }; 2683 - 2684 - static const struct dpll_info cnl_plls[] = { 2685 - { "DPLL 0", &cnl_ddi_pll_funcs, DPLL_ID_SKL_DPLL0, 0 }, 2686 - { "DPLL 1", &cnl_ddi_pll_funcs, DPLL_ID_SKL_DPLL1, 0 }, 2687 - { "DPLL 2", &cnl_ddi_pll_funcs, DPLL_ID_SKL_DPLL2, 0 }, 2688 - { }, 2689 - }; 2690 - 2691 - static const struct intel_dpll_mgr cnl_pll_mgr = { 2692 - .dpll_info = cnl_plls, 2693 - .get_dplls = cnl_get_dpll, 2694 - .put_dplls = intel_put_dpll, 2695 - .update_ref_clks = cnl_update_dpll_ref_clks, 2696 - .dump_hw_state = cnl_dump_hw_state, 2697 - }; 2698 2681 2699 2682 struct icl_combo_pll_params { 2700 2683 int clock; ··· 2622 3105 struct skl_wrpll_params *wrpll_params) 2623 3106 { 2624 3107 struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); 3108 + int ref_clock = icl_wrpll_ref_clock(i915); 3109 + u32 afe_clock = crtc_state->port_clock * 5; 3110 + u32 dco_min = 7998000; 3111 + u32 dco_max = 10000000; 3112 + u32 dco_mid = (dco_min + dco_max) / 2; 3113 + static const int dividers[] = { 2, 4, 6, 8, 10, 12, 14, 16, 3114 + 18, 20, 24, 28, 30, 32, 36, 40, 3115 + 42, 44, 48, 50, 52, 54, 56, 60, 3116 + 64, 66, 68, 70, 72, 76, 78, 80, 3117 + 84, 88, 90, 92, 96, 98, 100, 102, 3118 + 3, 5, 7, 9, 15, 21 }; 3119 + u32 dco, best_dco = 0, dco_centrality = 0; 3120 + u32 best_dco_centrality = U32_MAX; /* Spec meaning of 999999 MHz */ 3121 + int d, best_div = 0, pdiv = 0, qdiv = 0, kdiv = 0; 2625 3122 2626 - return __cnl_ddi_calculate_wrpll(crtc_state, wrpll_params, 2627 - icl_wrpll_ref_clock(i915)); 3123 + for (d = 0; d < ARRAY_SIZE(dividers); d++) { 3124 + dco = afe_clock * dividers[d]; 3125 + 3126 + if (dco <= dco_max && dco >= dco_min) { 3127 + dco_centrality = abs(dco - dco_mid); 3128 + 3129 + if (dco_centrality < best_dco_centrality) { 3130 + best_dco_centrality = dco_centrality; 3131 + best_div = dividers[d]; 3132 + best_dco = dco; 3133 + } 3134 + } 3135 + } 3136 + 3137 + if (best_div == 0) 3138 + return false; 3139 + 3140 + icl_wrpll_get_multipliers(best_div, &pdiv, &qdiv, &kdiv); 3141 + icl_wrpll_params_populate(wrpll_params, best_dco, ref_clock, 3142 + pdiv, qdiv, kdiv); 3143 + 3144 + return true; 2628 3145 } 2629 3146 2630 3147 static int icl_ddi_combo_pll_get_freq(struct drm_i915_private *i915, 2631 3148 const struct intel_shared_dpll *pll, 2632 3149 const struct intel_dpll_hw_state *pll_state) 2633 3150 { 2634 - return __cnl_ddi_wrpll_get_freq(i915, pll, pll_state, 2635 - icl_wrpll_ref_clock(i915)); 3151 + int ref_clock = icl_wrpll_ref_clock(i915); 3152 + u32 dco_fraction; 3153 + u32 p0, p1, p2, dco_freq; 3154 + 3155 + p0 = pll_state->cfgcr1 & DPLL_CFGCR1_PDIV_MASK; 3156 + p2 = pll_state->cfgcr1 & DPLL_CFGCR1_KDIV_MASK; 3157 + 3158 + if (pll_state->cfgcr1 & DPLL_CFGCR1_QDIV_MODE(1)) 3159 + p1 = (pll_state->cfgcr1 & DPLL_CFGCR1_QDIV_RATIO_MASK) >> 3160 + DPLL_CFGCR1_QDIV_RATIO_SHIFT; 3161 + else 3162 + p1 = 1; 3163 + 3164 + switch (p0) { 3165 + case DPLL_CFGCR1_PDIV_2: 3166 + p0 = 2; 3167 + break; 3168 + case DPLL_CFGCR1_PDIV_3: 3169 + p0 = 3; 3170 + break; 3171 + case DPLL_CFGCR1_PDIV_5: 3172 + p0 = 5; 3173 + break; 3174 + case DPLL_CFGCR1_PDIV_7: 3175 + p0 = 7; 3176 + break; 3177 + } 3178 + 3179 + switch (p2) { 3180 + case DPLL_CFGCR1_KDIV_1: 3181 + p2 = 1; 3182 + break; 3183 + case DPLL_CFGCR1_KDIV_2: 3184 + p2 = 2; 3185 + break; 3186 + case DPLL_CFGCR1_KDIV_3: 3187 + p2 = 3; 3188 + break; 3189 + } 3190 + 3191 + dco_freq = (pll_state->cfgcr0 & DPLL_CFGCR0_DCO_INTEGER_MASK) * 3192 + ref_clock; 3193 + 3194 + dco_fraction = (pll_state->cfgcr0 & DPLL_CFGCR0_DCO_FRACTION_MASK) >> 3195 + DPLL_CFGCR0_DCO_FRACTION_SHIFT; 3196 + 3197 + if (ehl_combo_pll_div_frac_wa_needed(i915)) 3198 + dco_fraction *= 2; 3199 + 3200 + dco_freq += (dco_fraction * ref_clock) / 0x8000; 3201 + 3202 + if (drm_WARN_ON(&i915->drm, p0 == 0 || p1 == 0 || p2 == 0)) 3203 + return 0; 3204 + 3205 + return dco_freq / (p0 * p1 * p2 * 5); 2636 3206 } 2637 3207 2638 3208 static void icl_calc_dpll_state(struct drm_i915_private *i915, ··· 3735 4131 drm_err(&dev_priv->drm, "PLL %d not locked\n", pll->info->id); 3736 4132 } 3737 4133 4134 + static void adlp_cmtg_clock_gating_wa(struct drm_i915_private *i915, struct intel_shared_dpll *pll) 4135 + { 4136 + u32 val; 4137 + 4138 + if (!IS_ADLP_DISPLAY_STEP(i915, STEP_A0, STEP_B0) || 4139 + pll->info->id != DPLL_ID_ICL_DPLL0) 4140 + return; 4141 + /* 4142 + * Wa_16011069516:adl-p[a0] 4143 + * 4144 + * All CMTG regs are unreliable until CMTG clock gating is disabled, 4145 + * so we can only assume the default TRANS_CMTG_CHICKEN reg value and 4146 + * sanity check this assumption with a double read, which presumably 4147 + * returns the correct value even with clock gating on. 4148 + * 4149 + * Instead of the usual place for workarounds we apply this one here, 4150 + * since TRANS_CMTG_CHICKEN is only accessible while DPLL0 is enabled. 4151 + */ 4152 + val = intel_de_read(i915, TRANS_CMTG_CHICKEN); 4153 + val = intel_de_read(i915, TRANS_CMTG_CHICKEN); 4154 + intel_de_write(i915, TRANS_CMTG_CHICKEN, DISABLE_DPT_CLK_GATING); 4155 + if (drm_WARN_ON(&i915->drm, val & ~DISABLE_DPT_CLK_GATING)) 4156 + drm_dbg_kms(&i915->drm, "Unexpected flags in TRANS_CMTG_CHICKEN: %08x\n", val); 4157 + } 4158 + 3738 4159 static void combo_pll_enable(struct drm_i915_private *dev_priv, 3739 4160 struct intel_shared_dpll *pll) 3740 4161 { ··· 3788 4159 */ 3789 4160 3790 4161 icl_pll_enable(dev_priv, pll, enable_reg); 4162 + 4163 + adlp_cmtg_clock_gating_wa(dev_priv, pll); 3791 4164 3792 4165 /* DVFS post sequence would be here. See the comment above. */ 3793 4166 } ··· 4093 4462 const struct dpll_info *dpll_info; 4094 4463 int i; 4095 4464 4096 - if (IS_ALDERLAKE_P(dev_priv)) 4465 + if (IS_DG2(dev_priv)) 4466 + /* No shared DPLLs on DG2; port PLLs are part of the PHY */ 4467 + dpll_mgr = NULL; 4468 + else if (IS_ALDERLAKE_P(dev_priv)) 4097 4469 dpll_mgr = &adlp_pll_mgr; 4098 4470 else if (IS_ALDERLAKE_S(dev_priv)) 4099 4471 dpll_mgr = &adls_pll_mgr; ··· 4110 4476 dpll_mgr = &ehl_pll_mgr; 4111 4477 else if (DISPLAY_VER(dev_priv) >= 11) 4112 4478 dpll_mgr = &icl_pll_mgr; 4113 - else if (IS_CANNONLAKE(dev_priv)) 4114 - dpll_mgr = &cnl_pll_mgr; 4115 4479 else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 4116 4480 dpll_mgr = &bxt_pll_mgr; 4117 4481 else if (DISPLAY_VER(dev_priv) == 9) ··· 4300 4668 static void sanitize_dpll_state(struct drm_i915_private *i915, 4301 4669 struct intel_shared_dpll *pll) 4302 4670 { 4303 - if (!pll->on || pll->active_mask) 4671 + if (!pll->on) 4672 + return; 4673 + 4674 + adlp_cmtg_clock_gating_wa(i915, pll); 4675 + 4676 + if (pll->active_mask) 4304 4677 return; 4305 4678 4306 4679 drm_dbg_kms(&i915->drm,
+1 -2
drivers/gpu/drm/i915/display/intel_dpll_mgr.h
··· 204 204 /* HDMI only, 0 when used for DP */ 205 205 u32 cfgcr1, cfgcr2; 206 206 207 - /* cnl */ 207 + /* icl */ 208 208 u32 cfgcr0; 209 - /* CNL also uses cfgcr1 */ 210 209 211 210 /* bxt */ 212 211 u32 ebb0, ebb4, pll0, pll1, pll2, pll3, pll6, pll8, pll9, pll10, pcsdw12;
+2 -2
drivers/gpu/drm/i915/display/intel_fbc.c
··· 912 912 } 913 913 914 914 /* 915 - * Tigerlake is not supporting FBC with PSR2. 915 + * Display 12+ is not supporting FBC with PSR2. 916 916 * Recommendation is to keep this combination disabled 917 917 * Bspec: 50422 HSD: 14010260002 918 918 */ 919 - if (fbc->state_cache.psr2_active && IS_TIGERLAKE(dev_priv)) { 919 + if (fbc->state_cache.psr2_active && DISPLAY_VER(dev_priv) >= 12) { 920 920 fbc->no_fbc_reason = "not supported with PSR2"; 921 921 return false; 922 922 }
+2 -2
drivers/gpu/drm/i915/display/intel_gmbus.c
··· 600 600 int i = 0, inc, try = 0; 601 601 int ret = 0; 602 602 603 - /* Display WA #0868: skl,bxt,kbl,cfl,glk,cnl */ 603 + /* Display WA #0868: skl,bxt,kbl,cfl,glk */ 604 604 if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 605 605 bxt_gmbus_clock_gating(dev_priv, false); 606 606 else if (HAS_PCH_SPT(dev_priv) || HAS_PCH_CNP(dev_priv)) ··· 713 713 ret = -EAGAIN; 714 714 715 715 out: 716 - /* Display WA #0868: skl,bxt,kbl,cfl,glk,cnl */ 716 + /* Display WA #0868: skl,bxt,kbl,cfl,glk */ 717 717 if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) 718 718 bxt_gmbus_clock_gating(dev_priv, true); 719 719 else if (HAS_PCH_SPT(dev_priv) || HAS_PCH_CNP(dev_priv))
+11
drivers/gpu/drm/i915/display/intel_hdmi.c
··· 51 51 #include "intel_hdmi.h" 52 52 #include "intel_lspcon.h" 53 53 #include "intel_panel.h" 54 + #include "intel_snps_phy.h" 54 55 55 56 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi) 56 57 { ··· 1850 1849 /* CHV DPLL can't generate 216-240 MHz */ 1851 1850 if (IS_CHERRYVIEW(dev_priv) && clock > 216000 && clock < 240000) 1852 1851 return MODE_CLOCK_RANGE; 1852 + 1853 + /* 1854 + * SNPS PHYs' MPLLB table-based programming can only handle a fixed 1855 + * set of link rates. 1856 + * 1857 + * FIXME: We will hopefully get an algorithmic way of programming 1858 + * the MPLLB for HDMI in the future. 1859 + */ 1860 + if (IS_DG2(dev_priv)) 1861 + return intel_snps_phy_check_hdmi_link_rate(clock); 1853 1862 1854 1863 return MODE_OK; 1855 1864 }
+3
drivers/gpu/drm/i915/display/intel_opregion.c
··· 1078 1078 opregion->asle->ardy = ASLE_ARDY_READY; 1079 1079 } 1080 1080 1081 + /* Some platforms abuse the _DSM to enable MUX */ 1082 + intel_dsm_get_bios_data_funcs_supported(i915); 1083 + 1081 1084 intel_opregion_notify_adapter(i915, PCI_D0); 1082 1085 } 1083 1086
+58 -30
drivers/gpu/drm/i915/display/intel_psr.c
··· 32 32 #include "intel_dp_aux.h" 33 33 #include "intel_hdmi.h" 34 34 #include "intel_psr.h" 35 + #include "intel_snps_phy.h" 35 36 #include "intel_sprite.h" 36 37 #include "skl_universal_plane.h" 37 38 ··· 535 534 static void hsw_activate_psr2(struct intel_dp *intel_dp) 536 535 { 537 536 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); 538 - u32 val; 537 + u32 val = EDP_PSR2_ENABLE; 539 538 540 - val = psr_compute_idle_frames(intel_dp) << EDP_PSR2_IDLE_FRAME_SHIFT; 539 + val |= psr_compute_idle_frames(intel_dp) << EDP_PSR2_IDLE_FRAME_SHIFT; 541 540 542 - val |= EDP_PSR2_ENABLE | EDP_SU_TRACK_ENABLE; 541 + if (!IS_ALDERLAKE_P(dev_priv)) 542 + val |= EDP_SU_TRACK_ENABLE; 543 + 543 544 if (DISPLAY_VER(dev_priv) >= 10 && DISPLAY_VER(dev_priv) <= 12) 544 545 val |= EDP_Y_COORDINATE_ENABLE; 545 546 546 547 val |= EDP_PSR2_FRAME_BEFORE_SU(intel_dp->psr.sink_sync_latency + 1); 547 548 val |= intel_psr2_get_tp_time(intel_dp); 548 549 549 - /* Wa_22012278275:adlp */ 550 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_D1)) { 550 + /* Wa_22012278275:adl-p */ 551 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_E0)) { 551 552 static const u8 map[] = { 552 553 2, /* 5 lines */ 553 554 1, /* 6 lines */ ··· 595 592 val |= EDP_PSR2_SU_SDP_SCANLINE; 596 593 597 594 if (intel_dp->psr.psr2_sel_fetch_enabled) { 598 - /* WA 1408330847 */ 599 - if (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0) || 600 - IS_RKL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 595 + /* Wa_1408330847 */ 596 + if (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 601 597 intel_de_rmw(dev_priv, CHICKEN_PAR1_1, 602 598 DIS_RAM_BYPASS_PSR2_MAN_TRACK, 603 599 DIS_RAM_BYPASS_PSR2_MAN_TRACK); ··· 735 733 if (!dc3co_is_pipe_port_compatible(intel_dp, crtc_state)) 736 734 return; 737 735 738 - /* Wa_16011303918:adlp */ 739 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 736 + /* Wa_16011303918:adl-p */ 737 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 740 738 return; 741 739 742 740 /* ··· 783 781 } 784 782 785 783 /* Wa_14010254185 Wa_14010103792 */ 786 - if (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B1)) { 784 + if (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) { 787 785 drm_dbg_kms(&dev_priv->drm, 788 786 "PSR2 sel fetch not enabled, missing the implementation of WAs\n"); 789 787 return false; ··· 795 793 static bool psr2_granularity_check(struct intel_dp *intel_dp, 796 794 struct intel_crtc_state *crtc_state) 797 795 { 796 + struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); 798 797 const int crtc_hdisplay = crtc_state->hw.adjusted_mode.crtc_hdisplay; 799 798 const int crtc_vdisplay = crtc_state->hw.adjusted_mode.crtc_vdisplay; 800 799 u16 y_granularity = 0; ··· 812 809 return intel_dp->psr.su_y_granularity == 4; 813 810 814 811 /* 815 - * For SW tracking we can adjust the y to match sink requirement if 816 - * multiple of 4 812 + * adl_p has 1 line granularity. For other platforms with SW tracking we 813 + * can adjust the y coordinates to match sink requirement if multiple of 814 + * 4. 817 815 */ 818 - if (intel_dp->psr.su_y_granularity <= 2) 816 + if (IS_ALDERLAKE_P(dev_priv)) 817 + y_granularity = intel_dp->psr.su_y_granularity; 818 + else if (intel_dp->psr.su_y_granularity <= 2) 819 819 y_granularity = 4; 820 820 else if ((intel_dp->psr.su_y_granularity % 4) == 0) 821 821 y_granularity = intel_dp->psr.su_y_granularity; ··· 871 865 } 872 866 873 867 /* Wa_16011181250 */ 874 - if (IS_ROCKETLAKE(dev_priv) || IS_ALDERLAKE_S(dev_priv)) { 868 + if (IS_ROCKETLAKE(dev_priv) || IS_ALDERLAKE_S(dev_priv) || 869 + IS_DG2(dev_priv)) { 875 870 drm_dbg_kms(&dev_priv->drm, "PSR2 is defeatured for this platform\n"); 876 871 return false; 877 872 } ··· 947 940 948 941 /* Wa_2209313811 */ 949 942 if (!crtc_state->enable_psr2_sel_fetch && 950 - IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B1)) { 943 + IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) { 951 944 drm_dbg_kms(&dev_priv->drm, "PSR2 HW tracking is not supported this Display stepping\n"); 952 945 return false; 953 946 } ··· 972 965 return false; 973 966 } 974 967 975 - /* Wa_16011303918:adlp */ 968 + /* Wa_16011303918:adl-p */ 976 969 if (crtc_state->vrr.enable && 977 - IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) { 970 + IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) { 978 971 drm_dbg_kms(&dev_priv->drm, 979 972 "PSR2 not enabled, not compatible with HW stepping + VRR\n"); 980 973 return false; ··· 1167 1160 intel_dp->psr.psr2_sel_fetch_enabled ? 1168 1161 IGNORE_PSR2_HW_TRACKING : 0); 1169 1162 1170 - /* Wa_16011168373:adlp */ 1171 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0) && 1163 + /* Wa_16011168373:adl-p */ 1164 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0) && 1172 1165 intel_dp->psr.psr2_enabled) 1173 1166 intel_de_rmw(dev_priv, 1174 1167 TRANS_SET_CONTEXT_LATENCY(intel_dp->psr.transcoder), ··· 1213 1206 { 1214 1207 struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); 1215 1208 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); 1209 + enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port); 1216 1210 struct intel_encoder *encoder = &dig_port->base; 1217 1211 u32 val; 1218 1212 ··· 1239 1231 intel_dp_compute_psr_vsc_sdp(intel_dp, crtc_state, conn_state, 1240 1232 &intel_dp->psr.vsc); 1241 1233 intel_write_dp_vsc_sdp(encoder, crtc_state, &intel_dp->psr.vsc); 1234 + intel_snps_phy_update_psr_power_state(dev_priv, phy, true); 1242 1235 intel_psr_enable_sink(intel_dp); 1243 1236 intel_psr_enable_source(intel_dp); 1244 1237 intel_dp->psr.enabled = true; ··· 1336 1327 static void intel_psr_disable_locked(struct intel_dp *intel_dp) 1337 1328 { 1338 1329 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); 1330 + enum phy phy = intel_port_to_phy(dev_priv, 1331 + dp_to_dig_port(intel_dp)->base.port); 1339 1332 1340 1333 lockdep_assert_held(&intel_dp->psr.lock); 1341 1334 ··· 1350 1339 intel_psr_exit(intel_dp); 1351 1340 intel_psr_wait_exit_locked(intel_dp); 1352 1341 1353 - /* WA 1408330847 */ 1342 + /* Wa_1408330847 */ 1354 1343 if (intel_dp->psr.psr2_sel_fetch_enabled && 1355 - (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0) || 1356 - IS_RKL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0))) 1344 + IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 1357 1345 intel_de_rmw(dev_priv, CHICKEN_PAR1_1, 1358 1346 DIS_RAM_BYPASS_PSR2_MAN_TRACK, 0); 1359 1347 1360 - /* Wa_16011168373:adlp */ 1361 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0) && 1348 + /* Wa_16011168373:adl-p */ 1349 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0) && 1362 1350 intel_dp->psr.psr2_enabled) 1363 1351 intel_de_rmw(dev_priv, 1364 1352 TRANS_SET_CONTEXT_LATENCY(intel_dp->psr.transcoder), 1365 1353 TRANS_SET_CONTEXT_LATENCY_MASK, 0); 1354 + 1355 + intel_snps_phy_update_psr_power_state(dev_priv, phy, false); 1366 1356 1367 1357 /* Disable PSR on Sink */ 1368 1358 drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0); ··· 1537 1525 static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state, 1538 1526 struct drm_rect *clip, bool full_update) 1539 1527 { 1528 + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 1529 + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 1540 1530 u32 val = PSR2_MAN_TRK_CTL_ENABLE; 1541 1531 1542 1532 if (full_update) { 1543 - val |= PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME; 1533 + if (IS_ALDERLAKE_P(dev_priv)) 1534 + val |= ADLP_PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME; 1535 + else 1536 + val |= PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME; 1537 + 1544 1538 goto exit; 1545 1539 } 1546 1540 1547 1541 if (clip->y1 == -1) 1548 1542 goto exit; 1549 1543 1550 - drm_WARN_ON(crtc_state->uapi.crtc->dev, clip->y1 % 4 || clip->y2 % 4); 1544 + if (IS_ALDERLAKE_P(dev_priv)) { 1545 + val |= ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(clip->y1); 1546 + val |= ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(clip->y2); 1547 + } else { 1548 + drm_WARN_ON(crtc_state->uapi.crtc->dev, clip->y1 % 4 || clip->y2 % 4); 1551 1549 1552 - val |= PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE; 1553 - val |= PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(clip->y1 / 4 + 1); 1554 - val |= PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(clip->y2 / 4 + 1); 1550 + val |= PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE; 1551 + val |= PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(clip->y1 / 4 + 1); 1552 + val |= PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(clip->y2 / 4 + 1); 1553 + } 1555 1554 exit: 1556 1555 crtc_state->psr2_man_track_ctl = val; 1557 1556 } ··· 1586 1563 static void intel_psr2_sel_fetch_pipe_alignment(const struct intel_crtc_state *crtc_state, 1587 1564 struct drm_rect *pipe_clip) 1588 1565 { 1566 + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); 1589 1567 const u16 y_alignment = crtc_state->su_y_granularity; 1590 1568 1591 1569 pipe_clip->y1 -= pipe_clip->y1 % y_alignment; 1592 1570 if (pipe_clip->y2 % y_alignment) 1593 1571 pipe_clip->y2 = ((pipe_clip->y2 / y_alignment) + 1) * y_alignment; 1572 + 1573 + if (IS_ALDERLAKE_P(dev_priv) && crtc_state->dsc.compression_enable) 1574 + drm_warn(&dev_priv->drm, "Missing PSR2 sel fetch alignment with DSC\n"); 1594 1575 } 1595 1576 1596 1577 int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, ··· 1726 1699 sel_fetch_area = &new_plane_state->psr2_sel_fetch_area; 1727 1700 sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; 1728 1701 sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1; 1702 + crtc_state->update_planes |= BIT(plane->id); 1729 1703 } 1730 1704 1731 1705 skip_sel_fetch_set_loop:
+862
drivers/gpu/drm/i915/display/intel_snps_phy.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright © 2019 Intel Corporation 4 + */ 5 + 6 + #include <linux/util_macros.h> 7 + 8 + #include "intel_de.h" 9 + #include "intel_display_types.h" 10 + #include "intel_snps_phy.h" 11 + 12 + /** 13 + * DOC: Synopsis PHY support 14 + * 15 + * Synopsis PHYs are primarily programmed by looking up magic register values 16 + * in tables rather than calculating the necessary values at runtime. 17 + * 18 + * Of special note is that the SNPS PHYs include a dedicated port PLL, known as 19 + * an "MPLLB." The MPLLB replaces the shared DPLL functionality used on other 20 + * platforms and must be programming directly during the modeset sequence 21 + * since it is not handled by the shared DPLL framework as on other platforms. 22 + */ 23 + 24 + void intel_snps_phy_wait_for_calibration(struct drm_i915_private *dev_priv) 25 + { 26 + enum phy phy; 27 + 28 + for_each_phy_masked(phy, ~0) { 29 + if (!intel_phy_is_snps(dev_priv, phy)) 30 + continue; 31 + 32 + if (intel_de_wait_for_clear(dev_priv, ICL_PHY_MISC(phy), 33 + DG2_PHY_DP_TX_ACK_MASK, 25)) 34 + DRM_ERROR("SNPS PHY %c failed to calibrate after 25ms.\n", 35 + phy); 36 + } 37 + } 38 + 39 + void intel_snps_phy_update_psr_power_state(struct drm_i915_private *dev_priv, 40 + enum phy phy, bool enable) 41 + { 42 + u32 val; 43 + 44 + if (!intel_phy_is_snps(dev_priv, phy)) 45 + return; 46 + 47 + val = REG_FIELD_PREP(SNPS_PHY_TX_REQ_LN_DIS_PWR_STATE_PSR, 48 + enable ? 2 : 3); 49 + intel_uncore_rmw(&dev_priv->uncore, SNPS_PHY_TX_REQ(phy), 50 + SNPS_PHY_TX_REQ_LN_DIS_PWR_STATE_PSR, val); 51 + } 52 + 53 + static const u32 dg2_ddi_translations[] = { 54 + /* VS 0, pre-emph 0 */ 55 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 26), 56 + 57 + /* VS 0, pre-emph 1 */ 58 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 33) | 59 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_POST, 6), 60 + 61 + /* VS 0, pre-emph 2 */ 62 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 38) | 63 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_POST, 12), 64 + 65 + /* VS 0, pre-emph 3 */ 66 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 43) | 67 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_POST, 19), 68 + 69 + /* VS 1, pre-emph 0 */ 70 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 39), 71 + 72 + /* VS 1, pre-emph 1 */ 73 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 44) | 74 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_POST, 8), 75 + 76 + /* VS 1, pre-emph 2 */ 77 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 47) | 78 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_POST, 15), 79 + 80 + /* VS 2, pre-emph 0 */ 81 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 52), 82 + 83 + /* VS 2, pre-emph 1 */ 84 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 51) | 85 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_POST, 10), 86 + 87 + /* VS 3, pre-emph 0 */ 88 + REG_FIELD_PREP(SNPS_PHY_TX_EQ_MAIN, 62), 89 + }; 90 + 91 + void intel_snps_phy_ddi_vswing_sequence(struct intel_encoder *encoder, 92 + u32 level) 93 + { 94 + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 95 + enum phy phy = intel_port_to_phy(dev_priv, encoder->port); 96 + int n_entries, ln; 97 + 98 + n_entries = ARRAY_SIZE(dg2_ddi_translations); 99 + if (level >= n_entries) 100 + level = n_entries - 1; 101 + 102 + for (ln = 0; ln < 4; ln++) 103 + intel_de_write(dev_priv, SNPS_PHY_TX_EQ(ln, phy), 104 + dg2_ddi_translations[level]); 105 + } 106 + 107 + /* 108 + * Basic DP link rates with 100 MHz reference clock. 109 + */ 110 + 111 + static const struct intel_mpllb_state dg2_dp_rbr_100 = { 112 + .clock = 162000, 113 + .ref_control = 114 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 115 + .mpllb_cp = 116 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 117 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 20) | 118 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 119 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 120 + .mpllb_div = 121 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 122 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 2) | 123 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 124 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 125 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 2), 126 + .mpllb_div2 = 127 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 128 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 226), 129 + .mpllb_fracn1 = 130 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 131 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 132 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 133 + .mpllb_fracn2 = 134 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 39321) | 135 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 3), 136 + }; 137 + 138 + static const struct intel_mpllb_state dg2_dp_hbr1_100 = { 139 + .clock = 270000, 140 + .ref_control = 141 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 142 + .mpllb_cp = 143 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 144 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 20) | 145 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 146 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 147 + .mpllb_div = 148 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 149 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 1) | 150 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 151 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 152 + .mpllb_div2 = 153 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 154 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 184), 155 + .mpllb_fracn1 = 156 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 157 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 158 + }; 159 + 160 + static const struct intel_mpllb_state dg2_dp_hbr2_100 = { 161 + .clock = 540000, 162 + .ref_control = 163 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 164 + .mpllb_cp = 165 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 166 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 20) | 167 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 168 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 169 + .mpllb_div = 170 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 171 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 172 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 173 + .mpllb_div2 = 174 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 175 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 184), 176 + .mpllb_fracn1 = 177 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 178 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 179 + }; 180 + 181 + static const struct intel_mpllb_state dg2_dp_hbr3_100 = { 182 + .clock = 810000, 183 + .ref_control = 184 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 185 + .mpllb_cp = 186 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 187 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 19) | 188 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 189 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 190 + .mpllb_div = 191 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 192 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 193 + .mpllb_div2 = 194 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 195 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 292), 196 + .mpllb_fracn1 = 197 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 198 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 199 + }; 200 + 201 + static const struct intel_mpllb_state *dg2_dp_100_tables[] = { 202 + &dg2_dp_rbr_100, 203 + &dg2_dp_hbr1_100, 204 + &dg2_dp_hbr2_100, 205 + &dg2_dp_hbr3_100, 206 + NULL, 207 + }; 208 + 209 + /* 210 + * Basic DP link rates with 38.4 MHz reference clock. 211 + */ 212 + 213 + static const struct intel_mpllb_state dg2_dp_rbr_38_4 = { 214 + .clock = 162000, 215 + .ref_control = 216 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 1), 217 + .mpllb_cp = 218 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 5) | 219 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 25) | 220 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 221 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 222 + .mpllb_div = 223 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 224 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 2) | 225 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 226 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 227 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 2), 228 + .mpllb_div2 = 229 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 230 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 304), 231 + .mpllb_fracn1 = 232 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 233 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 234 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 235 + .mpllb_fracn2 = 236 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 49152), 237 + }; 238 + 239 + static const struct intel_mpllb_state dg2_dp_hbr1_38_4 = { 240 + .clock = 270000, 241 + .ref_control = 242 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 1), 243 + .mpllb_cp = 244 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 5) | 245 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 25) | 246 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 247 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 248 + .mpllb_div = 249 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 250 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 1) | 251 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 252 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 253 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 254 + .mpllb_div2 = 255 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 256 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 248), 257 + .mpllb_fracn1 = 258 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 259 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 260 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 261 + .mpllb_fracn2 = 262 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 40960), 263 + }; 264 + 265 + static const struct intel_mpllb_state dg2_dp_hbr2_38_4 = { 266 + .clock = 540000, 267 + .ref_control = 268 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 1), 269 + .mpllb_cp = 270 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 5) | 271 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 25) | 272 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 273 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 274 + .mpllb_div = 275 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 276 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 277 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 278 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 279 + .mpllb_div2 = 280 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 281 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 248), 282 + .mpllb_fracn1 = 283 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 284 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 285 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 286 + .mpllb_fracn2 = 287 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 40960), 288 + }; 289 + 290 + static const struct intel_mpllb_state dg2_dp_hbr3_38_4 = { 291 + .clock = 810000, 292 + .ref_control = 293 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 1), 294 + .mpllb_cp = 295 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 6) | 296 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 26) | 297 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 298 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 299 + .mpllb_div = 300 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 301 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 302 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 303 + .mpllb_div2 = 304 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 305 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 388), 306 + .mpllb_fracn1 = 307 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 308 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 309 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 1), 310 + .mpllb_fracn2 = 311 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 61440), 312 + }; 313 + 314 + static const struct intel_mpllb_state *dg2_dp_38_4_tables[] = { 315 + &dg2_dp_rbr_38_4, 316 + &dg2_dp_hbr1_38_4, 317 + &dg2_dp_hbr2_38_4, 318 + &dg2_dp_hbr3_38_4, 319 + NULL, 320 + }; 321 + 322 + /* 323 + * eDP link rates with 100 MHz reference clock. 324 + */ 325 + 326 + static const struct intel_mpllb_state dg2_edp_r216 = { 327 + .clock = 216000, 328 + .ref_control = 329 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 330 + .mpllb_cp = 331 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 332 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 19) | 333 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 334 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 335 + .mpllb_div = 336 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 337 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 2) | 338 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 339 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 340 + .mpllb_div2 = 341 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 342 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 312), 343 + .mpllb_fracn1 = 344 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 345 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 346 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 347 + .mpllb_fracn2 = 348 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 52428) | 349 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 4), 350 + .mpllb_sscen = 351 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_EN, 1) | 352 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_PEAK, 50961), 353 + .mpllb_sscstep = 354 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_STEPSIZE, 65752), 355 + }; 356 + 357 + static const struct intel_mpllb_state dg2_edp_r243 = { 358 + .clock = 243000, 359 + .ref_control = 360 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 361 + .mpllb_cp = 362 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 363 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 20) | 364 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 365 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 366 + .mpllb_div = 367 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 368 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 2) | 369 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 370 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 371 + .mpllb_div2 = 372 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 373 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 356), 374 + .mpllb_fracn1 = 375 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 376 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 377 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 378 + .mpllb_fracn2 = 379 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 26214) | 380 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 2), 381 + .mpllb_sscen = 382 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_EN, 1) | 383 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_PEAK, 57331), 384 + .mpllb_sscstep = 385 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_STEPSIZE, 73971), 386 + }; 387 + 388 + static const struct intel_mpllb_state dg2_edp_r324 = { 389 + .clock = 324000, 390 + .ref_control = 391 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 392 + .mpllb_cp = 393 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 394 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 20) | 395 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 396 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 397 + .mpllb_div = 398 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 399 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 1) | 400 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 401 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 402 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 2), 403 + .mpllb_div2 = 404 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 405 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 226), 406 + .mpllb_fracn1 = 407 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 408 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 409 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 410 + .mpllb_fracn2 = 411 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 39321) | 412 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 3), 413 + .mpllb_sscen = 414 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_EN, 1) | 415 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_PEAK, 38221), 416 + .mpllb_sscstep = 417 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_STEPSIZE, 49314), 418 + }; 419 + 420 + static const struct intel_mpllb_state dg2_edp_r432 = { 421 + .clock = 432000, 422 + .ref_control = 423 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 424 + .mpllb_cp = 425 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 426 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 19) | 427 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 65) | 428 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 127), 429 + .mpllb_div = 430 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 431 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 1) | 432 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 433 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 434 + .mpllb_div2 = 435 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) | 436 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 312), 437 + .mpllb_fracn1 = 438 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 439 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 440 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 441 + .mpllb_fracn2 = 442 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 52428) | 443 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 4), 444 + .mpllb_sscen = 445 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_EN, 1) | 446 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_PEAK, 50961), 447 + .mpllb_sscstep = 448 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_STEPSIZE, 65752), 449 + }; 450 + 451 + static const struct intel_mpllb_state *dg2_edp_tables[] = { 452 + &dg2_dp_rbr_100, 453 + &dg2_edp_r216, 454 + &dg2_edp_r243, 455 + &dg2_dp_hbr1_100, 456 + &dg2_edp_r324, 457 + &dg2_edp_r432, 458 + &dg2_dp_hbr2_100, 459 + &dg2_dp_hbr3_100, 460 + NULL, 461 + }; 462 + 463 + /* 464 + * HDMI link rates with 100 MHz reference clock. 465 + */ 466 + 467 + static const struct intel_mpllb_state dg2_hdmi_25_175 = { 468 + .clock = 25175, 469 + .ref_control = 470 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 471 + .mpllb_cp = 472 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 5) | 473 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 15) | 474 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 64) | 475 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 124), 476 + .mpllb_div = 477 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 478 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 5) | 479 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 480 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 481 + .mpllb_div2 = 482 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 483 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 128) | 484 + REG_FIELD_PREP(SNPS_PHY_MPLLB_HDMI_DIV, 1), 485 + .mpllb_fracn1 = 486 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 487 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 488 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 143), 489 + .mpllb_fracn2 = 490 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 36663) | 491 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 71), 492 + .mpllb_sscen = 493 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_UP_SPREAD, 1), 494 + }; 495 + 496 + static const struct intel_mpllb_state dg2_hdmi_27_0 = { 497 + .clock = 27000, 498 + .ref_control = 499 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 500 + .mpllb_cp = 501 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 5) | 502 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 15) | 503 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 64) | 504 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 124), 505 + .mpllb_div = 506 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 507 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 5) | 508 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 509 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2), 510 + .mpllb_div2 = 511 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 512 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 140) | 513 + REG_FIELD_PREP(SNPS_PHY_MPLLB_HDMI_DIV, 1), 514 + .mpllb_fracn1 = 515 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 516 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 517 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 518 + .mpllb_fracn2 = 519 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 26214) | 520 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 2), 521 + .mpllb_sscen = 522 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_UP_SPREAD, 1), 523 + }; 524 + 525 + static const struct intel_mpllb_state dg2_hdmi_74_25 = { 526 + .clock = 74250, 527 + .ref_control = 528 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 529 + .mpllb_cp = 530 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 531 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 15) | 532 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 64) | 533 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 124), 534 + .mpllb_div = 535 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 536 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 3) | 537 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 538 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 539 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 540 + .mpllb_div2 = 541 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 542 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 86) | 543 + REG_FIELD_PREP(SNPS_PHY_MPLLB_HDMI_DIV, 1), 544 + .mpllb_fracn1 = 545 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 546 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 547 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 548 + .mpllb_fracn2 = 549 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 26214) | 550 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 2), 551 + .mpllb_sscen = 552 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_UP_SPREAD, 1), 553 + }; 554 + 555 + static const struct intel_mpllb_state dg2_hdmi_148_5 = { 556 + .clock = 148500, 557 + .ref_control = 558 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 559 + .mpllb_cp = 560 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 561 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 15) | 562 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 64) | 563 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 124), 564 + .mpllb_div = 565 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 566 + REG_FIELD_PREP(SNPS_PHY_MPLLB_TX_CLK_DIV, 2) | 567 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 568 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 569 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 570 + .mpllb_div2 = 571 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 572 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 86) | 573 + REG_FIELD_PREP(SNPS_PHY_MPLLB_HDMI_DIV, 1), 574 + .mpllb_fracn1 = 575 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 576 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 577 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 578 + .mpllb_fracn2 = 579 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 26214) | 580 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 2), 581 + .mpllb_sscen = 582 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_UP_SPREAD, 1), 583 + }; 584 + 585 + static const struct intel_mpllb_state dg2_hdmi_594 = { 586 + .clock = 594000, 587 + .ref_control = 588 + REG_FIELD_PREP(SNPS_PHY_REF_CONTROL_REF_RANGE, 3), 589 + .mpllb_cp = 590 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT, 4) | 591 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP, 15) | 592 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_INT_GS, 64) | 593 + REG_FIELD_PREP(SNPS_PHY_MPLLB_CP_PROP_GS, 124), 594 + .mpllb_div = 595 + REG_FIELD_PREP(SNPS_PHY_MPLLB_DIV5_CLK_EN, 1) | 596 + REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) | 597 + REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2) | 598 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FREQ_VCO, 3), 599 + .mpllb_div2 = 600 + REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) | 601 + REG_FIELD_PREP(SNPS_PHY_MPLLB_MULTIPLIER, 86) | 602 + REG_FIELD_PREP(SNPS_PHY_MPLLB_HDMI_DIV, 1), 603 + .mpllb_fracn1 = 604 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN, 1) | 605 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_EN, 1) | 606 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_DEN, 5), 607 + .mpllb_fracn2 = 608 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_QUOT, 26214) | 609 + REG_FIELD_PREP(SNPS_PHY_MPLLB_FRACN_REM, 2), 610 + .mpllb_sscen = 611 + REG_FIELD_PREP(SNPS_PHY_MPLLB_SSC_UP_SPREAD, 1), 612 + }; 613 + 614 + static const struct intel_mpllb_state *dg2_hdmi_tables[] = { 615 + &dg2_hdmi_25_175, 616 + &dg2_hdmi_27_0, 617 + &dg2_hdmi_74_25, 618 + &dg2_hdmi_148_5, 619 + &dg2_hdmi_594, 620 + NULL, 621 + }; 622 + 623 + static const struct intel_mpllb_state ** 624 + intel_mpllb_tables_get(struct intel_crtc_state *crtc_state, 625 + struct intel_encoder *encoder) 626 + { 627 + if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) { 628 + return dg2_edp_tables; 629 + } else if (intel_crtc_has_dp_encoder(crtc_state)) { 630 + /* 631 + * FIXME: Initially we're just enabling the "combo" outputs on 632 + * port A-D. The MPLLB for those ports takes an input from the 633 + * "Display Filter PLL" which always has an output frequency 634 + * of 100 MHz, hence the use of the _100 tables below. 635 + * 636 + * Once we enable port TC1 it will either use the same 100 MHz 637 + * "Display Filter PLL" (when strapped to support a native 638 + * display connection) or different 38.4 MHz "Filter PLL" when 639 + * strapped to support a USB connection, so we'll need to check 640 + * that to determine which table to use. 641 + */ 642 + if (0) 643 + return dg2_dp_38_4_tables; 644 + else 645 + return dg2_dp_100_tables; 646 + } else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) { 647 + return dg2_hdmi_tables; 648 + } 649 + 650 + MISSING_CASE(encoder->type); 651 + return NULL; 652 + } 653 + 654 + int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state, 655 + struct intel_encoder *encoder) 656 + { 657 + const struct intel_mpllb_state **tables; 658 + int i; 659 + 660 + if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) { 661 + if (intel_snps_phy_check_hdmi_link_rate(crtc_state->port_clock) 662 + != MODE_OK) { 663 + /* 664 + * FIXME: Can only support fixed HDMI frequencies 665 + * until we have a proper algorithm under a valid 666 + * license. 667 + */ 668 + DRM_DEBUG_KMS("Can't support HDMI link rate %d\n", 669 + crtc_state->port_clock); 670 + return -EINVAL; 671 + } 672 + } 673 + 674 + tables = intel_mpllb_tables_get(crtc_state, encoder); 675 + if (!tables) 676 + return -EINVAL; 677 + 678 + for (i = 0; tables[i]; i++) { 679 + if (crtc_state->port_clock <= tables[i]->clock) { 680 + crtc_state->mpllb_state = *tables[i]; 681 + return 0; 682 + } 683 + } 684 + 685 + return -EINVAL; 686 + } 687 + 688 + void intel_mpllb_enable(struct intel_encoder *encoder, 689 + const struct intel_crtc_state *crtc_state) 690 + { 691 + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 692 + const struct intel_mpllb_state *pll_state = &crtc_state->mpllb_state; 693 + enum phy phy = intel_port_to_phy(dev_priv, encoder->port); 694 + i915_reg_t enable_reg = (phy <= PHY_D ? 695 + DG2_PLL_ENABLE(phy) : MG_PLL_ENABLE(0)); 696 + 697 + /* 698 + * 3. Software programs the following PLL registers for the desired 699 + * frequency. 700 + */ 701 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_CP(phy), pll_state->mpllb_cp); 702 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_DIV(phy), pll_state->mpllb_div); 703 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_DIV2(phy), pll_state->mpllb_div2); 704 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_SSCEN(phy), pll_state->mpllb_sscen); 705 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_SSCSTEP(phy), pll_state->mpllb_sscstep); 706 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_FRACN1(phy), pll_state->mpllb_fracn1); 707 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_FRACN2(phy), pll_state->mpllb_fracn2); 708 + 709 + /* 710 + * 4. If the frequency will result in a change to the voltage 711 + * requirement, follow the Display Voltage Frequency Switching - 712 + * Sequence Before Frequency Change. 713 + * 714 + * We handle this step in bxt_set_cdclk(). 715 + */ 716 + 717 + /* 5. Software sets DPLL_ENABLE [PLL Enable] to "1". */ 718 + intel_uncore_rmw(&dev_priv->uncore, enable_reg, 0, PLL_ENABLE); 719 + 720 + /* 721 + * 9. Software sets SNPS_PHY_MPLLB_DIV dp_mpllb_force_en to "1". This 722 + * will keep the PLL running during the DDI lane programming and any 723 + * typeC DP cable disconnect. Do not set the force before enabling the 724 + * PLL because that will start the PLL before it has sampled the 725 + * divider values. 726 + */ 727 + intel_de_write(dev_priv, SNPS_PHY_MPLLB_DIV(phy), 728 + pll_state->mpllb_div | SNPS_PHY_MPLLB_FORCE_EN); 729 + 730 + /* 731 + * 10. Software polls on register DPLL_ENABLE [PLL Lock] to confirm PLL 732 + * is locked at new settings. This register bit is sampling PHY 733 + * dp_mpllb_state interface signal. 734 + */ 735 + if (intel_de_wait_for_set(dev_priv, enable_reg, PLL_LOCK, 5)) 736 + DRM_ERROR("Port %c PLL not locked\n", phy_name(phy)); 737 + 738 + /* 739 + * 11. If the frequency will result in a change to the voltage 740 + * requirement, follow the Display Voltage Frequency Switching - 741 + * Sequence After Frequency Change. 742 + * 743 + * We handle this step in bxt_set_cdclk(). 744 + */ 745 + } 746 + 747 + void intel_mpllb_disable(struct intel_encoder *encoder) 748 + { 749 + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 750 + enum phy phy = intel_port_to_phy(dev_priv, encoder->port); 751 + i915_reg_t enable_reg = (phy <= PHY_D ? 752 + DG2_PLL_ENABLE(phy) : MG_PLL_ENABLE(0)); 753 + 754 + /* 755 + * 1. If the frequency will result in a change to the voltage 756 + * requirement, follow the Display Voltage Frequency Switching - 757 + * Sequence Before Frequency Change. 758 + * 759 + * We handle this step in bxt_set_cdclk(). 760 + */ 761 + 762 + /* 2. Software programs DPLL_ENABLE [PLL Enable] to "0" */ 763 + intel_uncore_rmw(&dev_priv->uncore, enable_reg, PLL_ENABLE, 0); 764 + 765 + /* 766 + * 4. Software programs SNPS_PHY_MPLLB_DIV dp_mpllb_force_en to "0". 767 + * This will allow the PLL to stop running. 768 + */ 769 + intel_uncore_rmw(&dev_priv->uncore, SNPS_PHY_MPLLB_DIV(phy), 770 + SNPS_PHY_MPLLB_FORCE_EN, 0); 771 + 772 + /* 773 + * 5. Software polls DPLL_ENABLE [PLL Lock] for PHY acknowledgment 774 + * (dp_txX_ack) that the new transmitter setting request is completed. 775 + */ 776 + if (intel_de_wait_for_clear(dev_priv, enable_reg, PLL_LOCK, 5)) 777 + DRM_ERROR("Port %c PLL not locked\n", phy_name(phy)); 778 + 779 + /* 780 + * 6. If the frequency will result in a change to the voltage 781 + * requirement, follow the Display Voltage Frequency Switching - 782 + * Sequence After Frequency Change. 783 + * 784 + * We handle this step in bxt_set_cdclk(). 785 + */ 786 + } 787 + 788 + int intel_mpllb_calc_port_clock(struct intel_encoder *encoder, 789 + const struct intel_mpllb_state *pll_state) 790 + { 791 + unsigned int frac_quot = 0, frac_rem = 0, frac_den = 1; 792 + unsigned int multiplier, tx_clk_div, refclk; 793 + bool frac_en; 794 + 795 + if (0) 796 + refclk = 38400; 797 + else 798 + refclk = 100000; 799 + 800 + refclk >>= REG_FIELD_GET(SNPS_PHY_MPLLB_REF_CLK_DIV, pll_state->mpllb_div2) - 1; 801 + 802 + frac_en = REG_FIELD_GET(SNPS_PHY_MPLLB_FRACN_EN, pll_state->mpllb_fracn1); 803 + 804 + if (frac_en) { 805 + frac_quot = REG_FIELD_GET(SNPS_PHY_MPLLB_FRACN_QUOT, pll_state->mpllb_fracn2); 806 + frac_rem = REG_FIELD_GET(SNPS_PHY_MPLLB_FRACN_REM, pll_state->mpllb_fracn2); 807 + frac_den = REG_FIELD_GET(SNPS_PHY_MPLLB_FRACN_DEN, pll_state->mpllb_fracn1); 808 + } 809 + 810 + multiplier = REG_FIELD_GET(SNPS_PHY_MPLLB_MULTIPLIER, pll_state->mpllb_div2) / 2 + 16; 811 + 812 + tx_clk_div = REG_FIELD_GET(SNPS_PHY_MPLLB_TX_CLK_DIV, pll_state->mpllb_div); 813 + 814 + return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(refclk, (multiplier << 16) + frac_quot) + 815 + DIV_ROUND_CLOSEST(refclk * frac_rem, frac_den), 816 + 10 << (tx_clk_div + 16)); 817 + } 818 + 819 + void intel_mpllb_readout_hw_state(struct intel_encoder *encoder, 820 + struct intel_mpllb_state *pll_state) 821 + { 822 + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 823 + enum phy phy = intel_port_to_phy(dev_priv, encoder->port); 824 + 825 + pll_state->mpllb_cp = intel_de_read(dev_priv, SNPS_PHY_MPLLB_CP(phy)); 826 + pll_state->mpllb_div = intel_de_read(dev_priv, SNPS_PHY_MPLLB_DIV(phy)); 827 + pll_state->mpllb_div2 = intel_de_read(dev_priv, SNPS_PHY_MPLLB_DIV2(phy)); 828 + pll_state->mpllb_sscen = intel_de_read(dev_priv, SNPS_PHY_MPLLB_SSCEN(phy)); 829 + pll_state->mpllb_sscstep = intel_de_read(dev_priv, SNPS_PHY_MPLLB_SSCSTEP(phy)); 830 + pll_state->mpllb_fracn1 = intel_de_read(dev_priv, SNPS_PHY_MPLLB_FRACN1(phy)); 831 + pll_state->mpllb_fracn2 = intel_de_read(dev_priv, SNPS_PHY_MPLLB_FRACN2(phy)); 832 + 833 + /* 834 + * REF_CONTROL is under firmware control and never programmed by the 835 + * driver; we read it only for sanity checking purposes. The bspec 836 + * only tells us the expected value for one field in this register, 837 + * so we'll only read out those specific bits here. 838 + */ 839 + pll_state->ref_control = intel_de_read(dev_priv, SNPS_PHY_REF_CONTROL(phy)) & 840 + SNPS_PHY_REF_CONTROL_REF_RANGE; 841 + 842 + /* 843 + * MPLLB_DIV is programmed twice, once with the software-computed 844 + * state, then again with the MPLLB_FORCE_EN bit added. Drop that 845 + * extra bit during readout so that we return the actual expected 846 + * software state. 847 + */ 848 + pll_state->mpllb_div &= ~SNPS_PHY_MPLLB_FORCE_EN; 849 + } 850 + 851 + int intel_snps_phy_check_hdmi_link_rate(int clock) 852 + { 853 + const struct intel_mpllb_state **tables = dg2_hdmi_tables; 854 + int i; 855 + 856 + for (i = 0; tables[i]; i++) { 857 + if (clock == tables[i]->clock) 858 + return MODE_OK; 859 + } 860 + 861 + return MODE_CLOCK_RANGE; 862 + }
+35
drivers/gpu/drm/i915/display/intel_snps_phy.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2019 Intel Corporation 4 + */ 5 + 6 + #ifndef __INTEL_SNPS_PHY_H__ 7 + #define __INTEL_SNPS_PHY_H__ 8 + 9 + #include <linux/types.h> 10 + 11 + struct drm_i915_private; 12 + struct intel_encoder; 13 + struct intel_crtc_state; 14 + struct intel_mpllb_state; 15 + enum phy; 16 + 17 + void intel_snps_phy_wait_for_calibration(struct drm_i915_private *dev_priv); 18 + void intel_snps_phy_update_psr_power_state(struct drm_i915_private *dev_priv, 19 + enum phy phy, bool enable); 20 + 21 + int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state, 22 + struct intel_encoder *encoder); 23 + void intel_mpllb_enable(struct intel_encoder *encoder, 24 + const struct intel_crtc_state *crtc_state); 25 + void intel_mpllb_disable(struct intel_encoder *encoder); 26 + void intel_mpllb_readout_hw_state(struct intel_encoder *encoder, 27 + struct intel_mpllb_state *pll_state); 28 + int intel_mpllb_calc_port_clock(struct intel_encoder *encoder, 29 + const struct intel_mpllb_state *pll_state); 30 + 31 + int intel_snps_phy_check_hdmi_link_rate(int clock); 32 + void intel_snps_phy_ddi_vswing_sequence(struct intel_encoder *encoder, 33 + u32 level); 34 + 35 + #endif /* __INTEL_SNPS_PHY_H__ */
+1 -1
drivers/gpu/drm/i915/display/intel_sprite.c
··· 1856 1856 zpos = sprite + 1; 1857 1857 drm_plane_create_zpos_immutable_property(&plane->base, zpos); 1858 1858 1859 - drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs); 1859 + intel_plane_helper_add(plane); 1860 1860 1861 1861 return plane; 1862 1862
+1 -1
drivers/gpu/drm/i915/display/intel_vbt_defs.h
··· 456 456 u16 dp_gpio_pin_num; /* 195 */ 457 457 u8 dp_iboost_level:4; /* 196 */ 458 458 u8 hdmi_iboost_level:4; /* 196 */ 459 - u8 dp_max_link_rate:3; /* 216/230 CNL+ */ 459 + u8 dp_max_link_rate:3; /* 216/230 GLK+ */ 460 460 u8 dp_max_link_rate_reserved:5; /* 216/230 */ 461 461 } __packed; 462 462
+4 -1
drivers/gpu/drm/i915/display/intel_vdsc.c
··· 348 348 if (DISPLAY_VER(i915) >= 12) 349 349 return true; 350 350 351 - if ((DISPLAY_VER(i915) >= 11 || IS_CANNONLAKE(i915)) && (pipe != PIPE_A || (cpu_transcoder == TRANSCODER_EDP || cpu_transcoder == TRANSCODER_DSI_0 || cpu_transcoder == TRANSCODER_DSI_1))) 351 + if (DISPLAY_VER(i915) >= 11 && 352 + (pipe != PIPE_A || cpu_transcoder == TRANSCODER_EDP || 353 + cpu_transcoder == TRANSCODER_DSI_0 || 354 + cpu_transcoder == TRANSCODER_DSI_1)) 352 355 return true; 353 356 354 357 return false;
+11 -11
drivers/gpu/drm/i915/display/skl_scaler.c
··· 294 294 return 0; 295 295 } 296 296 297 - static int cnl_coef_tap(int i) 297 + static int glk_coef_tap(int i) 298 298 { 299 299 return i % 7; 300 300 } 301 301 302 - static u16 cnl_nearest_filter_coef(int t) 302 + static u16 glk_nearest_filter_coef(int t) 303 303 { 304 304 return t == 3 ? 0x0800 : 0x3000; 305 305 } ··· 341 341 * 342 342 */ 343 343 344 - static void cnl_program_nearest_filter_coefs(struct drm_i915_private *dev_priv, 344 + static void glk_program_nearest_filter_coefs(struct drm_i915_private *dev_priv, 345 345 enum pipe pipe, int id, int set) 346 346 { 347 347 int i; 348 348 349 - intel_de_write_fw(dev_priv, CNL_PS_COEF_INDEX_SET(pipe, id, set), 349 + intel_de_write_fw(dev_priv, GLK_PS_COEF_INDEX_SET(pipe, id, set), 350 350 PS_COEE_INDEX_AUTO_INC); 351 351 352 352 for (i = 0; i < 17 * 7; i += 2) { 353 353 u32 tmp; 354 354 int t; 355 355 356 - t = cnl_coef_tap(i); 357 - tmp = cnl_nearest_filter_coef(t); 356 + t = glk_coef_tap(i); 357 + tmp = glk_nearest_filter_coef(t); 358 358 359 - t = cnl_coef_tap(i + 1); 360 - tmp |= cnl_nearest_filter_coef(t) << 16; 359 + t = glk_coef_tap(i + 1); 360 + tmp |= glk_nearest_filter_coef(t) << 16; 361 361 362 - intel_de_write_fw(dev_priv, CNL_PS_COEF_DATA_SET(pipe, id, set), 362 + intel_de_write_fw(dev_priv, GLK_PS_COEF_DATA_SET(pipe, id, set), 363 363 tmp); 364 364 } 365 365 366 - intel_de_write_fw(dev_priv, CNL_PS_COEF_INDEX_SET(pipe, id, set), 0); 366 + intel_de_write_fw(dev_priv, GLK_PS_COEF_INDEX_SET(pipe, id, set), 0); 367 367 } 368 368 369 369 static u32 skl_scaler_get_filter_select(enum drm_scaling_filter filter, int set) ··· 386 386 case DRM_SCALING_FILTER_DEFAULT: 387 387 break; 388 388 case DRM_SCALING_FILTER_NEAREST_NEIGHBOR: 389 - cnl_program_nearest_filter_coefs(dev_priv, pipe, id, set); 389 + glk_program_nearest_filter_coefs(dev_priv, pipe, id, set); 390 390 break; 391 391 default: 392 392 MISSING_CASE(filter);
+14 -14
drivers/gpu/drm/i915/display/skl_universal_plane.c
··· 835 835 return 0; 836 836 } 837 837 838 - static u32 cnl_plane_ctl_flip(unsigned int reflect) 838 + static u32 icl_plane_ctl_flip(unsigned int reflect) 839 839 { 840 840 switch (reflect) { 841 841 case 0: ··· 917 917 plane_ctl |= skl_plane_ctl_tiling(fb->modifier); 918 918 plane_ctl |= skl_plane_ctl_rotate(rotation & DRM_MODE_ROTATE_MASK); 919 919 920 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 921 - plane_ctl |= cnl_plane_ctl_flip(rotation & 920 + if (DISPLAY_VER(dev_priv) >= 11) 921 + plane_ctl |= icl_plane_ctl_flip(rotation & 922 922 DRM_MODE_REFLECT_MASK); 923 923 924 924 if (key->flags & I915_SET_COLORKEY_DESTINATION) ··· 926 926 else if (key->flags & I915_SET_COLORKEY_SOURCE) 927 927 plane_ctl |= PLANE_CTL_KEY_ENABLE_SOURCE; 928 928 929 - /* Wa_22012358565:adlp */ 929 + /* Wa_22012358565:adl-p */ 930 930 if (DISPLAY_VER(dev_priv) == 13) 931 931 plane_ctl |= adlp_plane_ctl_arb_slots(plane_state); 932 932 ··· 1270 1270 int pipe_src_w = crtc_state->pipe_src_w; 1271 1271 1272 1272 /* 1273 - * Display WA #1175: cnl,glk 1273 + * Display WA #1175: glk 1274 1274 * Planes other than the cursor may cause FIFO underflow and display 1275 1275 * corruption if starting less than 4 pixels from the right edge of 1276 1276 * the screen. ··· 1828 1828 if (plane_id == PLANE_CURSOR) 1829 1829 return false; 1830 1830 1831 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 1831 + if (DISPLAY_VER(dev_priv) >= 11) 1832 1832 return true; 1833 1833 1834 1834 if (IS_GEMINILAKE(dev_priv)) ··· 1910 1910 { 1911 1911 /* Wa_14010477008:tgl[a0..c0],rkl[all],dg1[all] */ 1912 1912 if (IS_DG1(dev_priv) || IS_ROCKETLAKE(dev_priv) || 1913 - IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) 1913 + IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_D0)) 1914 1914 return false; 1915 1915 1916 1916 /* Wa_22011186057 */ 1917 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 1917 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 1918 1918 return false; 1919 1919 1920 1920 return plane_id < PLANE_SPRITE4; ··· 1938 1938 case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS: 1939 1939 case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC: 1940 1940 /* Wa_22011186057 */ 1941 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 1941 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 1942 1942 return false; 1943 1943 break; 1944 1944 default: ··· 1995 1995 enum plane_id plane_id) 1996 1996 { 1997 1997 /* Wa_22011186057 */ 1998 - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 1998 + if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) 1999 1999 return adlp_step_a_plane_format_modifiers; 2000 2000 else if (gen12_plane_supports_mc_ccs(dev_priv, plane_id)) 2001 2001 return gen12_plane_format_modifiers_mc_ccs; ··· 2144 2144 DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 | 2145 2145 DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270; 2146 2146 2147 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 2147 + if (DISPLAY_VER(dev_priv) >= 11) 2148 2148 supported_rotations |= DRM_MODE_REFLECT_X; 2149 2149 2150 2150 drm_plane_create_rotation_property(&plane->base, ··· 2174 2174 if (DISPLAY_VER(dev_priv) >= 12) 2175 2175 drm_plane_enable_fb_damage_clips(&plane->base); 2176 2176 2177 - if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) 2177 + if (DISPLAY_VER(dev_priv) >= 11) 2178 2178 drm_plane_create_scaling_filter_property(&plane->base, 2179 2179 BIT(DRM_SCALING_FILTER_DEFAULT) | 2180 2180 BIT(DRM_SCALING_FILTER_NEAREST_NEIGHBOR)); 2181 2181 2182 - drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs); 2182 + intel_plane_helper_add(plane); 2183 2183 2184 2184 return plane; 2185 2185 ··· 2295 2295 break; 2296 2296 } 2297 2297 2298 - if ((DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) && val & PLANE_CTL_FLIP_HORIZONTAL) 2298 + if (DISPLAY_VER(dev_priv) >= 11 && val & PLANE_CTL_FLIP_HORIZONTAL) 2299 2299 plane_config->rotation |= DRM_MODE_REFLECT_X; 2300 2300 2301 2301 /* 90/270 degree rotation would require extra work */
-1
drivers/gpu/drm/i915/gem/i915_gem_stolen.c
··· 447 447 break; 448 448 case 8: 449 449 case 9: 450 - case 10: 451 450 if (IS_LP(i915)) 452 451 chv_get_stolen_reserved(i915, uncore, 453 452 &reserved_base, &reserved_size);
+1 -1
drivers/gpu/drm/i915/gvt/gtt.c
··· 1055 1055 { 1056 1056 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; 1057 1057 1058 - if (GRAPHICS_VER(dev_priv) == 9 || GRAPHICS_VER(dev_priv) == 10) { 1058 + if (GRAPHICS_VER(dev_priv) == 9) { 1059 1059 u32 ips = vgpu_vreg_t(vgpu, GEN8_GAMW_ECO_DEV_RW_IA) & 1060 1060 GAMW_ECO_ENABLE_64K_IPS_FIELD; 1061 1061
+3 -3
drivers/gpu/drm/i915/i915_debugfs.c
··· 538 538 max_freq = (IS_GEN9_LP(dev_priv) ? rp_state_cap >> 0 : 539 539 rp_state_cap >> 16) & 0xff; 540 540 max_freq *= (IS_GEN9_BC(dev_priv) || 541 - GRAPHICS_VER(dev_priv) >= 10 ? GEN9_FREQ_SCALER : 1); 541 + GRAPHICS_VER(dev_priv) >= 11 ? GEN9_FREQ_SCALER : 1); 542 542 seq_printf(m, "Lowest (RPN) frequency: %dMHz\n", 543 543 intel_gpu_freq(rps, max_freq)); 544 544 545 545 max_freq = (rp_state_cap & 0xff00) >> 8; 546 546 max_freq *= (IS_GEN9_BC(dev_priv) || 547 - GRAPHICS_VER(dev_priv) >= 10 ? GEN9_FREQ_SCALER : 1); 547 + GRAPHICS_VER(dev_priv) >= 11 ? GEN9_FREQ_SCALER : 1); 548 548 seq_printf(m, "Nominal (RP1) frequency: %dMHz\n", 549 549 intel_gpu_freq(rps, max_freq)); 550 550 551 551 max_freq = (IS_GEN9_LP(dev_priv) ? rp_state_cap >> 16 : 552 552 rp_state_cap >> 0) & 0xff; 553 553 max_freq *= (IS_GEN9_BC(dev_priv) || 554 - GRAPHICS_VER(dev_priv) >= 10 ? GEN9_FREQ_SCALER : 1); 554 + GRAPHICS_VER(dev_priv) >= 11 ? GEN9_FREQ_SCALER : 1); 555 555 seq_printf(m, "Max non-overclocked (RP0) frequency: %dMHz\n", 556 556 intel_gpu_freq(rps, max_freq)); 557 557 seq_printf(m, "Max overclocked frequency: %dMHz\n",
+7 -1
drivers/gpu/drm/i915/i915_drv.c
··· 620 620 621 621 intel_opregion_setup(dev_priv); 622 622 623 - intel_pcode_init(dev_priv); 623 + ret = intel_pcode_init(dev_priv); 624 + if (ret) 625 + goto err_msi; 624 626 625 627 /* 626 628 * Fill the dram structure to get the system dram info. This will be ··· 1232 1230 int ret; 1233 1231 1234 1232 disable_rpm_wakeref_asserts(&dev_priv->runtime_pm); 1233 + 1234 + ret = intel_pcode_init(dev_priv); 1235 + if (ret) 1236 + return ret; 1235 1237 1236 1238 sanitize_gpu(dev_priv); 1237 1239
+13 -11
drivers/gpu/drm/i915/i915_drv.h
··· 633 633 634 634 #define HAS_HW_SAGV_WM(i915) (DISPLAY_VER(i915) >= 13 && !IS_DGFX(i915)) 635 635 636 + /* Amount of PSF GV points, BSpec precisely defines this */ 637 + #define I915_NUM_PSF_GV_POINTS 3 638 + 636 639 struct ddi_vbt_port_info { 637 640 /* Non-NULL if port present. */ 638 641 struct intel_bios_encoder_data *devdata; ··· 1149 1146 INTEL_DRAM_LPDDR5, 1150 1147 } type; 1151 1148 u8 num_qgv_points; 1149 + u8 num_psf_gv_points; 1152 1150 } dram_info; 1153 1151 1154 1152 struct intel_bw_info { 1155 1153 /* for each QGV point */ 1156 1154 unsigned int deratedbw[I915_NUM_QGV_POINTS]; 1155 + /* for each PSF GV point */ 1156 + unsigned int psf_bw[I915_NUM_PSF_GV_POINTS]; 1157 1157 u8 num_qgv_points; 1158 + u8 num_psf_gv_points; 1158 1159 u8 num_planes; 1159 1160 } max_bw[6]; 1160 1161 ··· 1303 1296 1304 1297 #define INTEL_DEVID(dev_priv) (RUNTIME_INFO(dev_priv)->device_id) 1305 1298 1306 - #define IP_VER(ver, rel) ((ver) << 8 | (rel)) 1299 + #define IP_VER(ver, rel) ((ver) << 8 | (rel)) 1307 1300 1308 1301 #define GRAPHICS_VER(i915) (INTEL_INFO(i915)->graphics_ver) 1309 1302 #define GRAPHICS_VER_FULL(i915) IP_VER(INTEL_INFO(i915)->graphics_ver, \ ··· 1330 1323 1331 1324 #define IS_DISPLAY_STEP(__i915, since, until) \ 1332 1325 (drm_WARN_ON(&(__i915)->drm, INTEL_DISPLAY_STEP(__i915) == STEP_NONE), \ 1333 - INTEL_DISPLAY_STEP(__i915) >= (since) && INTEL_DISPLAY_STEP(__i915) <= (until)) 1326 + INTEL_DISPLAY_STEP(__i915) >= (since) && INTEL_DISPLAY_STEP(__i915) < (until)) 1334 1327 1335 1328 #define IS_GT_STEP(__i915, since, until) \ 1336 1329 (drm_WARN_ON(&(__i915)->drm, INTEL_GT_STEP(__i915) == STEP_NONE), \ ··· 1433 1426 #define IS_GEMINILAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_GEMINILAKE) 1434 1427 #define IS_COFFEELAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_COFFEELAKE) 1435 1428 #define IS_COMETLAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_COMETLAKE) 1436 - #define IS_CANNONLAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_CANNONLAKE) 1429 + #define IS_CANNONLAKE(dev_priv) 0 1437 1430 #define IS_ICELAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_ICELAKE) 1438 1431 #define IS_JSL_EHL(dev_priv) (IS_PLATFORM(dev_priv, INTEL_JASPERLAKE) || \ 1439 1432 IS_PLATFORM(dev_priv, INTEL_ELKHARTLAKE)) ··· 1499 1492 #define IS_CML_GT2(dev_priv) (IS_COMETLAKE(dev_priv) && \ 1500 1493 INTEL_INFO(dev_priv)->gt == 2) 1501 1494 1502 - #define IS_CNL_WITH_PORT_F(dev_priv) \ 1503 - IS_SUBPLATFORM(dev_priv, INTEL_CANNONLAKE, INTEL_SUBPLATFORM_PORTF) 1504 1495 #define IS_ICL_WITH_PORT_F(dev_priv) \ 1505 1496 IS_SUBPLATFORM(dev_priv, INTEL_ICELAKE, INTEL_SUBPLATFORM_PORTF) 1506 1497 ··· 1618 1613 #define HAS_LOGICAL_RING_ELSQ(dev_priv) \ 1619 1614 (INTEL_INFO(dev_priv)->has_logical_ring_elsq) 1620 1615 1621 - #define HAS_MASTER_UNIT_IRQ(dev_priv) (INTEL_INFO(dev_priv)->has_master_unit_irq) 1622 - 1623 1616 #define HAS_EXECLISTS(dev_priv) HAS_LOGICAL_RING_CONTEXTS(dev_priv) 1624 1617 1625 1618 #define INTEL_PPGTT(dev_priv) (INTEL_INFO(dev_priv)->ppgtt_type) ··· 1643 1640 1644 1641 /* WaRsDisableCoarsePowerGating:skl,cnl */ 1645 1642 #define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \ 1646 - (IS_CANNONLAKE(dev_priv) || \ 1647 - IS_SKL_GT3(dev_priv) || \ 1648 - IS_SKL_GT4(dev_priv)) 1643 + (IS_SKL_GT3(dev_priv) || IS_SKL_GT4(dev_priv)) 1649 1644 1650 1645 #define HAS_GMBUS_IRQ(dev_priv) (GRAPHICS_VER(dev_priv) >= 4) 1651 - #define HAS_GMBUS_BURST_READ(dev_priv) (GRAPHICS_VER(dev_priv) >= 10 || \ 1646 + #define HAS_GMBUS_BURST_READ(dev_priv) (GRAPHICS_VER(dev_priv) >= 11 || \ 1652 1647 IS_GEMINILAKE(dev_priv) || \ 1653 1648 IS_KABYLAKE(dev_priv)) 1654 1649 ··· 1666 1665 1667 1666 #define HAS_DP_MST(dev_priv) (INTEL_INFO(dev_priv)->display.has_dp_mst) 1668 1667 1668 + #define HAS_CDCLK_CRAWL(dev_priv) (INTEL_INFO(dev_priv)->display.has_cdclk_crawl) 1669 1669 #define HAS_DDI(dev_priv) (INTEL_INFO(dev_priv)->display.has_ddi) 1670 1670 #define HAS_FPGA_DBG_UNCLAIMED(dev_priv) (INTEL_INFO(dev_priv)->display.has_fpga_dbg) 1671 1671 #define HAS_PSR(dev_priv) (INTEL_INFO(dev_priv)->display.has_psr)
+96 -52
drivers/gpu/drm/i915/i915_irq.c
··· 207 207 (!HAS_PCH_SPLIT(dev_priv) || HAS_PCH_NOP(dev_priv))) 208 208 return; 209 209 210 - if (HAS_PCH_DG1(dev_priv)) 210 + if (INTEL_PCH_TYPE(dev_priv) >= PCH_DG1) 211 211 hpd->pch_hpd = hpd_sde_dg1; 212 212 else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP) 213 213 hpd->pch_hpd = hpd_icp; ··· 2297 2297 GEN9_AUX_CHANNEL_C | 2298 2298 GEN9_AUX_CHANNEL_D; 2299 2299 2300 - if (IS_CNL_WITH_PORT_F(dev_priv) || DISPLAY_VER(dev_priv) == 11) 2301 - mask |= CNL_AUX_CHANNEL_F; 2302 - 2303 - if (DISPLAY_VER(dev_priv) == 11) 2300 + if (DISPLAY_VER(dev_priv) == 11) { 2301 + mask |= ICL_AUX_CHANNEL_F; 2304 2302 mask |= ICL_AUX_CHANNEL_E; 2303 + } 2305 2304 2306 2305 return mask; 2307 2306 } ··· 2697 2698 enable_rpm_wakeref_asserts(&i915->runtime_pm); 2698 2699 } 2699 2700 2700 - static __always_inline irqreturn_t 2701 - __gen11_irq_handler(struct drm_i915_private * const i915, 2702 - u32 (*intr_disable)(void __iomem * const regs), 2703 - void (*intr_enable)(void __iomem * const regs)) 2701 + static irqreturn_t gen11_irq_handler(int irq, void *arg) 2704 2702 { 2703 + struct drm_i915_private *i915 = arg; 2705 2704 void __iomem * const regs = i915->uncore.regs; 2706 2705 struct intel_gt *gt = &i915->gt; 2707 2706 u32 master_ctl; ··· 2708 2711 if (!intel_irqs_enabled(i915)) 2709 2712 return IRQ_NONE; 2710 2713 2711 - master_ctl = intr_disable(regs); 2714 + master_ctl = gen11_master_intr_disable(regs); 2712 2715 if (!master_ctl) { 2713 - intr_enable(regs); 2716 + gen11_master_intr_enable(regs); 2714 2717 return IRQ_NONE; 2715 2718 } 2716 2719 ··· 2723 2726 2724 2727 gu_misc_iir = gen11_gu_misc_irq_ack(gt, master_ctl); 2725 2728 2726 - intr_enable(regs); 2729 + gen11_master_intr_enable(regs); 2727 2730 2728 2731 gen11_gu_misc_irq_handler(gt, gu_misc_iir); 2729 2732 ··· 2732 2735 return IRQ_HANDLED; 2733 2736 } 2734 2737 2735 - static irqreturn_t gen11_irq_handler(int irq, void *arg) 2736 - { 2737 - return __gen11_irq_handler(arg, 2738 - gen11_master_intr_disable, 2739 - gen11_master_intr_enable); 2740 - } 2741 - 2742 - static u32 dg1_master_intr_disable_and_ack(void __iomem * const regs) 2738 + static inline u32 dg1_master_intr_disable(void __iomem * const regs) 2743 2739 { 2744 2740 u32 val; 2745 2741 2746 2742 /* First disable interrupts */ 2747 - raw_reg_write(regs, DG1_MSTR_UNIT_INTR, 0); 2743 + raw_reg_write(regs, DG1_MSTR_TILE_INTR, 0); 2748 2744 2749 2745 /* Get the indication levels and ack the master unit */ 2750 - val = raw_reg_read(regs, DG1_MSTR_UNIT_INTR); 2746 + val = raw_reg_read(regs, DG1_MSTR_TILE_INTR); 2751 2747 if (unlikely(!val)) 2752 2748 return 0; 2753 2749 2754 - raw_reg_write(regs, DG1_MSTR_UNIT_INTR, val); 2755 - 2756 - /* 2757 - * Now with master disabled, get a sample of level indications 2758 - * for this interrupt and ack them right away - we keep GEN11_MASTER_IRQ 2759 - * out as this bit doesn't exist anymore for DG1 2760 - */ 2761 - val = raw_reg_read(regs, GEN11_GFX_MSTR_IRQ) & ~GEN11_MASTER_IRQ; 2762 - if (unlikely(!val)) 2763 - return 0; 2764 - 2765 - raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, val); 2750 + raw_reg_write(regs, DG1_MSTR_TILE_INTR, val); 2766 2751 2767 2752 return val; 2768 2753 } 2769 2754 2770 2755 static inline void dg1_master_intr_enable(void __iomem * const regs) 2771 2756 { 2772 - raw_reg_write(regs, DG1_MSTR_UNIT_INTR, DG1_MSTR_IRQ); 2757 + raw_reg_write(regs, DG1_MSTR_TILE_INTR, DG1_MSTR_IRQ); 2773 2758 } 2774 2759 2775 2760 static irqreturn_t dg1_irq_handler(int irq, void *arg) 2776 2761 { 2777 - return __gen11_irq_handler(arg, 2778 - dg1_master_intr_disable_and_ack, 2779 - dg1_master_intr_enable); 2762 + struct drm_i915_private * const i915 = arg; 2763 + struct intel_gt *gt = &i915->gt; 2764 + void __iomem * const regs = i915->uncore.regs; 2765 + u32 master_tile_ctl, master_ctl; 2766 + u32 gu_misc_iir; 2767 + 2768 + if (!intel_irqs_enabled(i915)) 2769 + return IRQ_NONE; 2770 + 2771 + master_tile_ctl = dg1_master_intr_disable(regs); 2772 + if (!master_tile_ctl) { 2773 + dg1_master_intr_enable(regs); 2774 + return IRQ_NONE; 2775 + } 2776 + 2777 + /* FIXME: we only support tile 0 for now. */ 2778 + if (master_tile_ctl & DG1_MSTR_TILE(0)) { 2779 + master_ctl = raw_reg_read(regs, GEN11_GFX_MSTR_IRQ); 2780 + raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, master_ctl); 2781 + } else { 2782 + DRM_ERROR("Tile not supported: 0x%08x\n", master_tile_ctl); 2783 + dg1_master_intr_enable(regs); 2784 + return IRQ_NONE; 2785 + } 2786 + 2787 + gen11_gt_irq_handler(gt, master_ctl); 2788 + 2789 + if (master_ctl & GEN11_DISPLAY_IRQ) 2790 + gen11_display_irq_handler(i915); 2791 + 2792 + gu_misc_iir = gen11_gu_misc_irq_ack(gt, master_ctl); 2793 + 2794 + dg1_master_intr_enable(regs); 2795 + 2796 + gen11_gu_misc_irq_handler(gt, gu_misc_iir); 2797 + 2798 + pmu_irq_stats(i915, IRQ_HANDLED); 2799 + 2800 + return IRQ_HANDLED; 2780 2801 } 2781 2802 2782 2803 /* Called from drm generic code, passed 'crtc' which ··· 3182 3167 { 3183 3168 struct intel_uncore *uncore = &dev_priv->uncore; 3184 3169 3185 - if (HAS_MASTER_UNIT_IRQ(dev_priv)) 3186 - dg1_master_intr_disable_and_ack(dev_priv->uncore.regs); 3187 - else 3188 - gen11_master_intr_disable(dev_priv->uncore.regs); 3170 + gen11_master_intr_disable(dev_priv->uncore.regs); 3171 + 3172 + gen11_gt_irq_reset(&dev_priv->gt); 3173 + gen11_display_irq_reset(dev_priv); 3174 + 3175 + GEN3_IRQ_RESET(uncore, GEN11_GU_MISC_); 3176 + GEN3_IRQ_RESET(uncore, GEN8_PCU_); 3177 + } 3178 + 3179 + static void dg1_irq_reset(struct drm_i915_private *dev_priv) 3180 + { 3181 + struct intel_uncore *uncore = &dev_priv->uncore; 3182 + 3183 + dg1_master_intr_disable(dev_priv->uncore.regs); 3189 3184 3190 3185 gen11_gt_irq_reset(&dev_priv->gt); 3191 3186 gen11_display_irq_reset(dev_priv); ··· 3887 3862 3888 3863 GEN3_IRQ_INIT(uncore, GEN11_GU_MISC_, ~gu_misc_masked, gu_misc_masked); 3889 3864 3890 - if (HAS_MASTER_UNIT_IRQ(dev_priv)) { 3891 - dg1_master_intr_enable(uncore->regs); 3892 - intel_uncore_posting_read(&dev_priv->uncore, DG1_MSTR_UNIT_INTR); 3893 - } else { 3894 - gen11_master_intr_enable(uncore->regs); 3895 - intel_uncore_posting_read(&dev_priv->uncore, GEN11_GFX_MSTR_IRQ); 3865 + gen11_master_intr_enable(uncore->regs); 3866 + intel_uncore_posting_read(&dev_priv->uncore, GEN11_GFX_MSTR_IRQ); 3867 + } 3868 + 3869 + static void dg1_irq_postinstall(struct drm_i915_private *dev_priv) 3870 + { 3871 + struct intel_uncore *uncore = &dev_priv->uncore; 3872 + u32 gu_misc_masked = GEN11_GU_MISC_GSE; 3873 + 3874 + gen11_gt_irq_postinstall(&dev_priv->gt); 3875 + 3876 + GEN3_IRQ_INIT(uncore, GEN11_GU_MISC_, ~gu_misc_masked, gu_misc_masked); 3877 + 3878 + if (HAS_DISPLAY(dev_priv)) { 3879 + icp_irq_postinstall(dev_priv); 3880 + gen8_de_irq_postinstall(dev_priv); 3881 + intel_uncore_write(&dev_priv->uncore, GEN11_DISPLAY_INT_CTL, 3882 + GEN11_DISPLAY_IRQ_ENABLE); 3896 3883 } 3884 + 3885 + dg1_master_intr_enable(dev_priv->uncore.regs); 3886 + intel_uncore_posting_read(&dev_priv->uncore, DG1_MSTR_TILE_INTR); 3897 3887 } 3898 3888 3899 3889 static void cherryview_irq_postinstall(struct drm_i915_private *dev_priv) ··· 4447 4407 else 4448 4408 return i8xx_irq_handler; 4449 4409 } else { 4450 - if (HAS_MASTER_UNIT_IRQ(dev_priv)) 4410 + if (GRAPHICS_VER_FULL(dev_priv) >= IP_VER(12, 10)) 4451 4411 return dg1_irq_handler; 4452 - if (GRAPHICS_VER(dev_priv) >= 11) 4412 + else if (GRAPHICS_VER(dev_priv) >= 11) 4453 4413 return gen11_irq_handler; 4454 4414 else if (GRAPHICS_VER(dev_priv) >= 8) 4455 4415 return gen8_irq_handler; ··· 4472 4432 else 4473 4433 i8xx_irq_reset(dev_priv); 4474 4434 } else { 4475 - if (GRAPHICS_VER(dev_priv) >= 11) 4435 + if (GRAPHICS_VER_FULL(dev_priv) >= IP_VER(12, 10)) 4436 + dg1_irq_reset(dev_priv); 4437 + else if (GRAPHICS_VER(dev_priv) >= 11) 4476 4438 gen11_irq_reset(dev_priv); 4477 4439 else if (GRAPHICS_VER(dev_priv) >= 8) 4478 4440 gen8_irq_reset(dev_priv); ··· 4497 4455 else 4498 4456 i8xx_irq_postinstall(dev_priv); 4499 4457 } else { 4500 - if (GRAPHICS_VER(dev_priv) >= 11) 4458 + if (GRAPHICS_VER_FULL(dev_priv) >= IP_VER(12, 10)) 4459 + dg1_irq_postinstall(dev_priv); 4460 + else if (GRAPHICS_VER(dev_priv) >= 11) 4501 4461 gen11_irq_postinstall(dev_priv); 4502 4462 else if (GRAPHICS_VER(dev_priv) >= 8) 4503 4463 gen8_irq_postinstall(dev_priv);
+8 -21
drivers/gpu/drm/i915/i915_pci.c
··· 782 782 .gt = 2, 783 783 }; 784 784 785 - #define GEN10_FEATURES \ 786 - GEN9_FEATURES, \ 787 - GEN(10), \ 788 - .dbuf.size = 1024 - 4, /* 4 blocks for bypass path allocation */ \ 789 - .display.has_dsc = 1, \ 790 - .has_coherent_ggtt = false, \ 791 - GLK_COLORS 792 - 793 - static const struct intel_device_info cnl_info = { 794 - GEN10_FEATURES, 795 - PLATFORM(INTEL_CANNONLAKE), 796 - .gt = 2, 797 - }; 798 - 799 785 #define GEN11_DEFAULT_PAGE_SIZES \ 800 786 .page_sizes = I915_GTT_PAGE_SIZE_4K | \ 801 787 I915_GTT_PAGE_SIZE_64K | \ 802 788 I915_GTT_PAGE_SIZE_2M 803 789 804 790 #define GEN11_FEATURES \ 805 - GEN10_FEATURES, \ 791 + GEN9_FEATURES, \ 806 792 GEN11_DEFAULT_PAGE_SIZES, \ 807 793 .abox_mask = BIT(0), \ 808 794 .cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \ ··· 811 825 [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \ 812 826 }, \ 813 827 GEN(11), \ 828 + .color = { .degamma_lut_size = 33, .gamma_lut_size = 262145 }, \ 814 829 .dbuf.size = 2048, \ 815 830 .dbuf.slice_mask = BIT(DBUF_S1) | BIT(DBUF_S2), \ 816 - .has_logical_ring_elsq = 1, \ 817 - .color = { .degamma_lut_size = 33, .gamma_lut_size = 262145 } 831 + .display.has_dsc = 1, \ 832 + .has_coherent_ggtt = false, \ 833 + .has_logical_ring_elsq = 1 818 834 819 835 static const struct intel_device_info icl_info = { 820 836 GEN11_FEATURES, ··· 890 902 891 903 #define DGFX_FEATURES \ 892 904 .memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \ 893 - .has_master_unit_irq = 1, \ 894 905 .has_llc = 0, \ 895 906 .has_snoop = 1, \ 896 907 .is_dgfx = 1 ··· 897 910 static const struct intel_device_info dg1_info __maybe_unused = { 898 911 GEN12_FEATURES, 899 912 DGFX_FEATURES, 913 + .graphics_rel = 10, 900 914 PLATFORM(INTEL_DG1), 901 915 .pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), 902 916 .require_force_probe = 1, ··· 930 942 931 943 #define XE_LPD_FEATURES \ 932 944 .abox_mask = GENMASK(1, 0), \ 933 - .color = { .degamma_lut_size = 33, .gamma_lut_size = 262145 }, \ 945 + .color = { .degamma_lut_size = 0, .gamma_lut_size = 0 }, \ 934 946 .cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \ 935 947 BIT(TRANSCODER_C) | BIT(TRANSCODER_D), \ 936 948 .dbuf.size = 4096, \ ··· 967 979 GEN12_FEATURES, 968 980 XE_LPD_FEATURES, 969 981 PLATFORM(INTEL_ALDERLAKE_P), 970 - .has_cdclk_crawl = 1, 971 982 .require_force_probe = 1, 983 + .display.has_cdclk_crawl = 1, 972 984 .display.has_modular_fia = 1, 973 985 .display.has_psr_hw_tracking = 0, 974 986 .platform_engine_mask = ··· 1108 1120 INTEL_CML_GT2_IDS(&cml_gt2_info), 1109 1121 INTEL_CML_U_GT1_IDS(&cml_gt1_info), 1110 1122 INTEL_CML_U_GT2_IDS(&cml_gt2_info), 1111 - INTEL_CNL_IDS(&cnl_info), 1112 1123 INTEL_ICL_11_IDS(&icl_info), 1113 1124 INTEL_EHL_IDS(&ehl_info), 1114 1125 INTEL_JSL_IDS(&jsl_info),
+8 -14
drivers/gpu/drm/i915/i915_perf.c
··· 1256 1256 1257 1257 case 8: 1258 1258 case 9: 1259 - case 10: 1260 1259 if (intel_engine_uses_guc(ce->engine)) { 1261 1260 /* 1262 1261 * When using GuC, the context descriptor we write in ··· 2588 2589 intel_uncore_rmw(uncore, GDT_CHICKEN_BITS, GT_NOA_ENABLE, 0); 2589 2590 } 2590 2591 2591 - static void gen10_disable_metric_set(struct i915_perf_stream *stream) 2592 + static void gen11_disable_metric_set(struct i915_perf_stream *stream) 2592 2593 { 2593 2594 struct intel_uncore *uncore = stream->uncore; 2594 2595 ··· 3895 3896 REG_IN_RANGE(addr, RPM_CONFIG0, NOA_CONFIG(8)); 3896 3897 } 3897 3898 3898 - static bool gen10_is_valid_mux_addr(struct i915_perf *perf, u32 addr) 3899 + static bool gen11_is_valid_mux_addr(struct i915_perf *perf, u32 addr) 3899 3900 { 3900 3901 return gen8_is_valid_mux_addr(perf, addr) || 3901 3902 REG_EQUAL(addr, GEN10_NOA_WRITE_HIGH) || ··· 4318 4319 case INTEL_GEMINILAKE: 4319 4320 case INTEL_COFFEELAKE: 4320 4321 case INTEL_COMETLAKE: 4321 - case INTEL_CANNONLAKE: 4322 4322 case INTEL_ICELAKE: 4323 4323 case INTEL_ELKHARTLAKE: 4324 4324 case INTEL_JASPERLAKE: ··· 4402 4404 4403 4405 perf->gen8_valid_ctx_bit = BIT(16); 4404 4406 } 4405 - } else if (IS_GRAPHICS_VER(i915, 10, 11)) { 4407 + } else if (GRAPHICS_VER(i915) == 11) { 4406 4408 perf->ops.is_valid_b_counter_reg = 4407 4409 gen7_is_valid_b_counter_addr; 4408 4410 perf->ops.is_valid_mux_reg = 4409 - gen10_is_valid_mux_addr; 4411 + gen11_is_valid_mux_addr; 4410 4412 perf->ops.is_valid_flex_reg = 4411 4413 gen8_is_valid_flex_addr; 4412 4414 4413 4415 perf->ops.oa_enable = gen8_oa_enable; 4414 4416 perf->ops.oa_disable = gen8_oa_disable; 4415 4417 perf->ops.enable_metric_set = gen8_enable_metric_set; 4416 - perf->ops.disable_metric_set = gen10_disable_metric_set; 4418 + perf->ops.disable_metric_set = gen11_disable_metric_set; 4417 4419 perf->ops.oa_hw_tail_read = gen8_oa_hw_tail_read; 4418 4420 4419 - if (GRAPHICS_VER(i915) == 10) { 4420 - perf->ctx_oactxctrl_offset = 0x128; 4421 - perf->ctx_flexeu0_offset = 0x3de; 4422 - } else { 4423 - perf->ctx_oactxctrl_offset = 0x124; 4424 - perf->ctx_flexeu0_offset = 0x78e; 4425 - } 4421 + perf->ctx_oactxctrl_offset = 0x124; 4422 + perf->ctx_flexeu0_offset = 0x78e; 4423 + 4426 4424 perf->gen8_valid_ctx_bit = BIT(16); 4427 4425 } else if (GRAPHICS_VER(i915) == 12) { 4428 4426 perf->ops.is_valid_b_counter_reg =
+185 -201
drivers/gpu/drm/i915/i915_reg.h
··· 430 430 #define GEN12_HCP_SFC_LOCK_ACK_BIT REG_BIT(1) 431 431 #define GEN12_HCP_SFC_USAGE_BIT REG_BIT(0) 432 432 433 - #define GEN12_SFC_DONE(n) _MMIO(0x1cc00 + (n) * 0x100) 433 + #define GEN12_SFC_DONE(n) _MMIO(0x1cc000 + (n) * 0x1000) 434 434 #define GEN12_SFC_DONE_MAX 4 435 435 436 436 #define RING_PP_DIR_BASE(base) _MMIO((base) + 0x228) ··· 1885 1885 #define BXT_PORT_CL1CM_DW30(phy) _BXT_PHY((phy), _PORT_CL1CM_DW30_BC) 1886 1886 1887 1887 /* 1888 - * CNL/ICL Port/COMBO-PHY Registers 1888 + * ICL Port/COMBO-PHY Registers 1889 1889 */ 1890 1890 #define _ICL_COMBOPHY_A 0x162000 1891 1891 #define _ICL_COMBOPHY_B 0x6C000 ··· 1899 1899 _RKL_COMBOPHY_D, \ 1900 1900 _ADL_COMBOPHY_E) 1901 1901 1902 - /* CNL/ICL Port CL_DW registers */ 1902 + /* ICL Port CL_DW registers */ 1903 1903 #define _ICL_PORT_CL_DW(dw, phy) (_ICL_COMBOPHY(phy) + \ 1904 1904 4 * (dw)) 1905 1905 1906 - #define CNL_PORT_CL1CM_DW5 _MMIO(0x162014) 1907 1906 #define ICL_PORT_CL_DW5(phy) _MMIO(_ICL_PORT_CL_DW(5, phy)) 1908 1907 #define CL_POWER_DOWN_ENABLE (1 << 4) 1909 1908 #define SUS_CLOCK_CONFIG (3 << 0) ··· 1927 1928 #define ICL_PORT_CL_DW12(phy) _MMIO(_ICL_PORT_CL_DW(12, phy)) 1928 1929 #define ICL_LANE_ENABLE_AUX (1 << 0) 1929 1930 1930 - /* CNL/ICL Port COMP_DW registers */ 1931 + /* ICL Port COMP_DW registers */ 1931 1932 #define _ICL_PORT_COMP 0x100 1932 1933 #define _ICL_PORT_COMP_DW(dw, phy) (_ICL_COMBOPHY(phy) + \ 1933 1934 _ICL_PORT_COMP + 4 * (dw)) 1934 1935 1935 - #define CNL_PORT_COMP_DW0 _MMIO(0x162100) 1936 1936 #define ICL_PORT_COMP_DW0(phy) _MMIO(_ICL_PORT_COMP_DW(0, phy)) 1937 1937 #define COMP_INIT (1 << 31) 1938 1938 1939 - #define CNL_PORT_COMP_DW1 _MMIO(0x162104) 1940 1939 #define ICL_PORT_COMP_DW1(phy) _MMIO(_ICL_PORT_COMP_DW(1, phy)) 1941 1940 1942 - #define CNL_PORT_COMP_DW3 _MMIO(0x16210c) 1943 1941 #define ICL_PORT_COMP_DW3(phy) _MMIO(_ICL_PORT_COMP_DW(3, phy)) 1944 1942 #define PROCESS_INFO_DOT_0 (0 << 26) 1945 1943 #define PROCESS_INFO_DOT_1 (1 << 26) ··· 1952 1956 #define ICL_PORT_COMP_DW8(phy) _MMIO(_ICL_PORT_COMP_DW(8, phy)) 1953 1957 #define IREFGEN (1 << 24) 1954 1958 1955 - #define CNL_PORT_COMP_DW9 _MMIO(0x162124) 1956 1959 #define ICL_PORT_COMP_DW9(phy) _MMIO(_ICL_PORT_COMP_DW(9, phy)) 1957 1960 1958 - #define CNL_PORT_COMP_DW10 _MMIO(0x162128) 1959 1961 #define ICL_PORT_COMP_DW10(phy) _MMIO(_ICL_PORT_COMP_DW(10, phy)) 1960 1962 1961 - /* CNL/ICL Port PCS registers */ 1962 - #define _CNL_PORT_PCS_DW1_GRP_AE 0x162304 1963 - #define _CNL_PORT_PCS_DW1_GRP_B 0x162384 1964 - #define _CNL_PORT_PCS_DW1_GRP_C 0x162B04 1965 - #define _CNL_PORT_PCS_DW1_GRP_D 0x162B84 1966 - #define _CNL_PORT_PCS_DW1_GRP_F 0x162A04 1967 - #define _CNL_PORT_PCS_DW1_LN0_AE 0x162404 1968 - #define _CNL_PORT_PCS_DW1_LN0_B 0x162604 1969 - #define _CNL_PORT_PCS_DW1_LN0_C 0x162C04 1970 - #define _CNL_PORT_PCS_DW1_LN0_D 0x162E04 1971 - #define _CNL_PORT_PCS_DW1_LN0_F 0x162804 1972 - #define CNL_PORT_PCS_DW1_GRP(phy) _MMIO(_PICK(phy, \ 1973 - _CNL_PORT_PCS_DW1_GRP_AE, \ 1974 - _CNL_PORT_PCS_DW1_GRP_B, \ 1975 - _CNL_PORT_PCS_DW1_GRP_C, \ 1976 - _CNL_PORT_PCS_DW1_GRP_D, \ 1977 - _CNL_PORT_PCS_DW1_GRP_AE, \ 1978 - _CNL_PORT_PCS_DW1_GRP_F)) 1979 - #define CNL_PORT_PCS_DW1_LN0(phy) _MMIO(_PICK(phy, \ 1980 - _CNL_PORT_PCS_DW1_LN0_AE, \ 1981 - _CNL_PORT_PCS_DW1_LN0_B, \ 1982 - _CNL_PORT_PCS_DW1_LN0_C, \ 1983 - _CNL_PORT_PCS_DW1_LN0_D, \ 1984 - _CNL_PORT_PCS_DW1_LN0_AE, \ 1985 - _CNL_PORT_PCS_DW1_LN0_F)) 1986 - 1963 + /* ICL Port PCS registers */ 1987 1964 #define _ICL_PORT_PCS_AUX 0x300 1988 1965 #define _ICL_PORT_PCS_GRP 0x600 1989 1966 #define _ICL_PORT_PCS_LN(ln) (0x800 + (ln) * 0x100) ··· 1975 2006 #define LATENCY_OPTIM_MASK (0x3 << 2) 1976 2007 #define LATENCY_OPTIM_VAL(x) ((x) << 2) 1977 2008 1978 - /* CNL/ICL Port TX registers */ 1979 - #define _CNL_PORT_TX_AE_GRP_OFFSET 0x162340 1980 - #define _CNL_PORT_TX_B_GRP_OFFSET 0x1623C0 1981 - #define _CNL_PORT_TX_C_GRP_OFFSET 0x162B40 1982 - #define _CNL_PORT_TX_D_GRP_OFFSET 0x162BC0 1983 - #define _CNL_PORT_TX_F_GRP_OFFSET 0x162A40 1984 - #define _CNL_PORT_TX_AE_LN0_OFFSET 0x162440 1985 - #define _CNL_PORT_TX_B_LN0_OFFSET 0x162640 1986 - #define _CNL_PORT_TX_C_LN0_OFFSET 0x162C40 1987 - #define _CNL_PORT_TX_D_LN0_OFFSET 0x162E40 1988 - #define _CNL_PORT_TX_F_LN0_OFFSET 0x162840 1989 - #define _CNL_PORT_TX_DW_GRP(dw, port) (_PICK((port), \ 1990 - _CNL_PORT_TX_AE_GRP_OFFSET, \ 1991 - _CNL_PORT_TX_B_GRP_OFFSET, \ 1992 - _CNL_PORT_TX_B_GRP_OFFSET, \ 1993 - _CNL_PORT_TX_D_GRP_OFFSET, \ 1994 - _CNL_PORT_TX_AE_GRP_OFFSET, \ 1995 - _CNL_PORT_TX_F_GRP_OFFSET) + \ 1996 - 4 * (dw)) 1997 - #define _CNL_PORT_TX_DW_LN0(dw, port) (_PICK((port), \ 1998 - _CNL_PORT_TX_AE_LN0_OFFSET, \ 1999 - _CNL_PORT_TX_B_LN0_OFFSET, \ 2000 - _CNL_PORT_TX_B_LN0_OFFSET, \ 2001 - _CNL_PORT_TX_D_LN0_OFFSET, \ 2002 - _CNL_PORT_TX_AE_LN0_OFFSET, \ 2003 - _CNL_PORT_TX_F_LN0_OFFSET) + \ 2004 - 4 * (dw)) 2005 - 2009 + /* ICL Port TX registers */ 2006 2010 #define _ICL_PORT_TX_AUX 0x380 2007 2011 #define _ICL_PORT_TX_GRP 0x680 2008 2012 #define _ICL_PORT_TX_LN(ln) (0x880 + (ln) * 0x100) ··· 1987 2045 #define _ICL_PORT_TX_DW_LN(dw, ln, phy) (_ICL_COMBOPHY(phy) + \ 1988 2046 _ICL_PORT_TX_LN(ln) + 4 * (dw)) 1989 2047 1990 - #define CNL_PORT_TX_DW2_GRP(port) _MMIO(_CNL_PORT_TX_DW_GRP(2, port)) 1991 - #define CNL_PORT_TX_DW2_LN0(port) _MMIO(_CNL_PORT_TX_DW_LN0(2, port)) 1992 2048 #define ICL_PORT_TX_DW2_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(2, phy)) 1993 2049 #define ICL_PORT_TX_DW2_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(2, phy)) 1994 2050 #define ICL_PORT_TX_DW2_LN0(phy) _MMIO(_ICL_PORT_TX_DW_LN(2, 0, phy)) ··· 1999 2059 #define RCOMP_SCALAR(x) ((x) << 0) 2000 2060 #define RCOMP_SCALAR_MASK (0xFF << 0) 2001 2061 2002 - #define _CNL_PORT_TX_DW4_LN0_AE 0x162450 2003 - #define _CNL_PORT_TX_DW4_LN1_AE 0x1624D0 2004 - #define CNL_PORT_TX_DW4_GRP(port) _MMIO(_CNL_PORT_TX_DW_GRP(4, (port))) 2005 - #define CNL_PORT_TX_DW4_LN0(port) _MMIO(_CNL_PORT_TX_DW_LN0(4, (port))) 2006 - #define CNL_PORT_TX_DW4_LN(ln, port) _MMIO(_CNL_PORT_TX_DW_LN0(4, (port)) + \ 2007 - ((ln) * (_CNL_PORT_TX_DW4_LN1_AE - \ 2008 - _CNL_PORT_TX_DW4_LN0_AE))) 2009 2062 #define ICL_PORT_TX_DW4_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(4, phy)) 2010 2063 #define ICL_PORT_TX_DW4_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(4, phy)) 2011 2064 #define ICL_PORT_TX_DW4_LN0(phy) _MMIO(_ICL_PORT_TX_DW_LN(4, 0, phy)) ··· 2011 2078 #define CURSOR_COEFF(x) ((x) << 0) 2012 2079 #define CURSOR_COEFF_MASK (0x3F << 0) 2013 2080 2014 - #define CNL_PORT_TX_DW5_GRP(port) _MMIO(_CNL_PORT_TX_DW_GRP(5, port)) 2015 - #define CNL_PORT_TX_DW5_LN0(port) _MMIO(_CNL_PORT_TX_DW_LN0(5, port)) 2016 2081 #define ICL_PORT_TX_DW5_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(5, phy)) 2017 2082 #define ICL_PORT_TX_DW5_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(5, phy)) 2018 2083 #define ICL_PORT_TX_DW5_LN0(phy) _MMIO(_ICL_PORT_TX_DW_LN(5, 0, phy)) ··· 2022 2091 #define RTERM_SELECT(x) ((x) << 3) 2023 2092 #define RTERM_SELECT_MASK (0x7 << 3) 2024 2093 2025 - #define CNL_PORT_TX_DW7_GRP(port) _MMIO(_CNL_PORT_TX_DW_GRP(7, (port))) 2026 - #define CNL_PORT_TX_DW7_LN0(port) _MMIO(_CNL_PORT_TX_DW_LN0(7, (port))) 2027 2094 #define ICL_PORT_TX_DW7_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(7, phy)) 2028 2095 #define ICL_PORT_TX_DW7_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(7, phy)) 2029 2096 #define ICL_PORT_TX_DW7_LN0(phy) _MMIO(_ICL_PORT_TX_DW_LN(7, 0, phy)) ··· 2214 2285 MG_DP_MODE_LN1_ACU_PORT1) 2215 2286 #define MG_DP_MODE_CFG_DP_X2_MODE (1 << 7) 2216 2287 #define MG_DP_MODE_CFG_DP_X1_MODE (1 << 6) 2288 + 2289 + /* 2290 + * DG2 SNPS PHY registers (TC1 = PHY_E) 2291 + */ 2292 + #define _SNPS_PHY_A_BASE 0x168000 2293 + #define _SNPS_PHY_B_BASE 0x169000 2294 + #define _SNPS_PHY(phy) _PHY(phy, \ 2295 + _SNPS_PHY_A_BASE, \ 2296 + _SNPS_PHY_B_BASE) 2297 + #define _SNPS2(phy, reg) (_SNPS_PHY(phy) - \ 2298 + _SNPS_PHY_A_BASE + (reg)) 2299 + #define _MMIO_SNPS(phy, reg) _MMIO(_SNPS2(phy, reg)) 2300 + #define _MMIO_SNPS_LN(ln, phy, reg) _MMIO(_SNPS2(phy, \ 2301 + (reg) + (ln) * 0x10)) 2302 + 2303 + #define SNPS_PHY_MPLLB_CP(phy) _MMIO_SNPS(phy, 0x168000) 2304 + #define SNPS_PHY_MPLLB_CP_INT REG_GENMASK(31, 25) 2305 + #define SNPS_PHY_MPLLB_CP_INT_GS REG_GENMASK(23, 17) 2306 + #define SNPS_PHY_MPLLB_CP_PROP REG_GENMASK(15, 9) 2307 + #define SNPS_PHY_MPLLB_CP_PROP_GS REG_GENMASK(7, 1) 2308 + 2309 + #define SNPS_PHY_MPLLB_DIV(phy) _MMIO_SNPS(phy, 0x168004) 2310 + #define SNPS_PHY_MPLLB_FORCE_EN REG_BIT(31) 2311 + #define SNPS_PHY_MPLLB_DIV5_CLK_EN REG_BIT(29) 2312 + #define SNPS_PHY_MPLLB_V2I REG_GENMASK(27, 26) 2313 + #define SNPS_PHY_MPLLB_FREQ_VCO REG_GENMASK(25, 24) 2314 + #define SNPS_PHY_MPLLB_PMIX_EN REG_BIT(10) 2315 + #define SNPS_PHY_MPLLB_TX_CLK_DIV REG_GENMASK(7, 5) 2316 + 2317 + #define SNPS_PHY_MPLLB_FRACN1(phy) _MMIO_SNPS(phy, 0x168008) 2318 + #define SNPS_PHY_MPLLB_FRACN_EN REG_BIT(31) 2319 + #define SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN REG_BIT(30) 2320 + #define SNPS_PHY_MPLLB_FRACN_DEN REG_GENMASK(15, 0) 2321 + 2322 + #define SNPS_PHY_MPLLB_FRACN2(phy) _MMIO_SNPS(phy, 0x16800C) 2323 + #define SNPS_PHY_MPLLB_FRACN_REM REG_GENMASK(31, 16) 2324 + #define SNPS_PHY_MPLLB_FRACN_QUOT REG_GENMASK(15, 0) 2325 + 2326 + #define SNPS_PHY_MPLLB_SSCEN(phy) _MMIO_SNPS(phy, 0x168014) 2327 + #define SNPS_PHY_MPLLB_SSC_EN REG_BIT(31) 2328 + #define SNPS_PHY_MPLLB_SSC_UP_SPREAD REG_BIT(30) 2329 + #define SNPS_PHY_MPLLB_SSC_PEAK REG_GENMASK(29, 10) 2330 + 2331 + #define SNPS_PHY_MPLLB_SSCSTEP(phy) _MMIO_SNPS(phy, 0x168018) 2332 + #define SNPS_PHY_MPLLB_SSC_STEPSIZE REG_GENMASK(31, 11) 2333 + 2334 + #define SNPS_PHY_MPLLB_DIV2(phy) _MMIO_SNPS(phy, 0x16801C) 2335 + #define SNPS_PHY_MPLLB_HDMI_PIXEL_CLK_DIV REG_GENMASK(19, 18) 2336 + #define SNPS_PHY_MPLLB_HDMI_DIV REG_GENMASK(17, 15) 2337 + #define SNPS_PHY_MPLLB_REF_CLK_DIV REG_GENMASK(14, 12) 2338 + #define SNPS_PHY_MPLLB_MULTIPLIER REG_GENMASK(11, 0) 2339 + 2340 + #define SNPS_PHY_REF_CONTROL(phy) _MMIO_SNPS(phy, 0x168188) 2341 + #define SNPS_PHY_REF_CONTROL_REF_RANGE REG_GENMASK(31, 27) 2342 + 2343 + #define SNPS_PHY_TX_REQ(phy) _MMIO_SNPS(phy, 0x168200) 2344 + #define SNPS_PHY_TX_REQ_LN_DIS_PWR_STATE_PSR REG_GENMASK(31, 30) 2345 + 2346 + #define SNPS_PHY_TX_EQ(ln, phy) _MMIO_SNPS_LN(ln, phy, 0x168300) 2347 + #define SNPS_PHY_TX_EQ_MAIN REG_GENMASK(23, 18) 2348 + #define SNPS_PHY_TX_EQ_POST REG_GENMASK(15, 10) 2349 + #define SNPS_PHY_TX_EQ_PRE REG_GENMASK(7, 2) 2217 2350 2218 2351 /* The spec defines this only for BXT PHY0, but lets assume that this 2219 2352 * would exist for PHY1 too if it had a second channel. ··· 4617 4626 #define _PSR2_CTL_EDP 0x6f900 4618 4627 #define EDP_PSR2_CTL(tran) _MMIO_TRANS2(tran, _PSR2_CTL_A) 4619 4628 #define EDP_PSR2_ENABLE (1 << 31) 4620 - #define EDP_SU_TRACK_ENABLE (1 << 30) 4629 + #define EDP_SU_TRACK_ENABLE (1 << 30) /* up to adl-p */ 4621 4630 #define TGL_EDP_PSR2_BLOCK_COUNT_NUM_2 (0 << 28) 4622 4631 #define TGL_EDP_PSR2_BLOCK_COUNT_NUM_3 (1 << 28) 4623 4632 #define EDP_Y_COORDINATE_ENABLE REG_BIT(25) /* display 10, 11 and 12 */ ··· 4686 4695 #define PSR2_SU_STATUS_MASK(frame) (0x3ff << PSR2_SU_STATUS_SHIFT(frame)) 4687 4696 #define PSR2_SU_STATUS_FRAMES 8 4688 4697 4689 - #define _PSR2_MAN_TRK_CTL_A 0x60910 4690 - #define _PSR2_MAN_TRK_CTL_EDP 0x6f910 4691 - #define PSR2_MAN_TRK_CTL(tran) _MMIO_TRANS2(tran, _PSR2_MAN_TRK_CTL_A) 4692 - #define PSR2_MAN_TRK_CTL_ENABLE REG_BIT(31) 4693 - #define PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK REG_GENMASK(30, 21) 4694 - #define PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(val) REG_FIELD_PREP(PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK, val) 4698 + #define _PSR2_MAN_TRK_CTL_A 0x60910 4699 + #define _PSR2_MAN_TRK_CTL_EDP 0x6f910 4700 + #define PSR2_MAN_TRK_CTL(tran) _MMIO_TRANS2(tran, _PSR2_MAN_TRK_CTL_A) 4701 + #define PSR2_MAN_TRK_CTL_ENABLE REG_BIT(31) 4702 + #define PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK REG_GENMASK(30, 21) 4703 + #define PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(val) REG_FIELD_PREP(PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK, val) 4695 4704 #define PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR_MASK REG_GENMASK(20, 11) 4696 4705 #define PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(val) REG_FIELD_PREP(PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR_MASK, val) 4697 - #define PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME REG_BIT(3) 4698 - #define PSR2_MAN_TRK_CTL_SF_CONTINUOS_FULL_FRAME REG_BIT(2) 4699 - #define PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE REG_BIT(1) 4706 + #define PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME REG_BIT(3) 4707 + #define PSR2_MAN_TRK_CTL_SF_CONTINUOS_FULL_FRAME REG_BIT(2) 4708 + #define PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE REG_BIT(1) 4709 + #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK REG_GENMASK(28, 16) 4710 + #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(val) REG_FIELD_PREP(ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR_MASK, val) 4711 + #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR_MASK REG_GENMASK(12, 0) 4712 + #define ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(val) REG_FIELD_PREP(ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR_MASK, val) 4713 + #define ADLP_PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME REG_BIT(14) 4714 + #define ADLP_PSR2_MAN_TRK_CTL_SF_CONTINUOS_FULL_FRAME REG_BIT(13) 4700 4715 4701 4716 /* Icelake DSC Rate Control Range Parameter Registers */ 4702 4717 #define DSCA_RC_RANGE_PARAMETERS_0 _MMIO(0x6B240) ··· 7751 7754 #define SKL_PS_ECC_STAT(pipe, id) _MMIO_PIPE(pipe, \ 7752 7755 _ID(id, _PS_ECC_STAT_1A, _PS_ECC_STAT_2A), \ 7753 7756 _ID(id, _PS_ECC_STAT_1B, _PS_ECC_STAT_2B)) 7754 - #define CNL_PS_COEF_INDEX_SET(pipe, id, set) _MMIO_PIPE(pipe, \ 7757 + #define GLK_PS_COEF_INDEX_SET(pipe, id, set) _MMIO_PIPE(pipe, \ 7755 7758 _ID(id, _PS_COEF_SET0_INDEX_1A, _PS_COEF_SET0_INDEX_2A) + (set) * 8, \ 7756 7759 _ID(id, _PS_COEF_SET0_INDEX_1B, _PS_COEF_SET0_INDEX_2B) + (set) * 8) 7757 7760 7758 - #define CNL_PS_COEF_DATA_SET(pipe, id, set) _MMIO_PIPE(pipe, \ 7761 + #define GLK_PS_COEF_DATA_SET(pipe, id, set) _MMIO_PIPE(pipe, \ 7759 7762 _ID(id, _PS_COEF_SET0_DATA_1A, _PS_COEF_SET0_DATA_2A) + (set) * 8, \ 7760 7763 _ID(id, _PS_COEF_SET0_DATA_1B, _PS_COEF_SET0_DATA_2B) + (set) * 8) 7761 7764 /* legacy palette */ ··· 7970 7973 #define DSI1_NON_TE (1 << 31) 7971 7974 #define DSI0_NON_TE (1 << 30) 7972 7975 #define ICL_AUX_CHANNEL_E (1 << 29) 7973 - #define CNL_AUX_CHANNEL_F (1 << 28) 7976 + #define ICL_AUX_CHANNEL_F (1 << 28) 7974 7977 #define GEN9_AUX_CHANNEL_D (1 << 27) 7975 7978 #define GEN9_AUX_CHANNEL_C (1 << 26) 7976 7979 #define GEN9_AUX_CHANNEL_B (1 << 25) ··· 8022 8025 #define GEN11_GT_DW1_IRQ (1 << 1) 8023 8026 #define GEN11_GT_DW0_IRQ (1 << 0) 8024 8027 8025 - #define DG1_MSTR_UNIT_INTR _MMIO(0x190008) 8028 + #define DG1_MSTR_TILE_INTR _MMIO(0x190008) 8026 8029 #define DG1_MSTR_IRQ REG_BIT(31) 8027 - #define DG1_MSTR_UNIT(u) REG_BIT(u) 8030 + #define DG1_MSTR_TILE(t) REG_BIT(t) 8028 8031 8029 8032 #define GEN11_DISPLAY_INT_CTL _MMIO(0x44200) 8030 8033 #define GEN11_DISPLAY_IRQ_ENABLE (1 << 31) ··· 8163 8166 #define KVM_CONFIG_CHANGE_NOTIFICATION_SELECT (1 << 14) 8164 8167 8165 8168 #define CHICKEN_MISC_2 _MMIO(0x42084) 8166 - #define CNL_COMP_PWR_DOWN (1 << 23) 8167 8169 #define KBL_ARB_FILL_SPARE_14 REG_BIT(14) 8168 8170 #define KBL_ARB_FILL_SPARE_13 REG_BIT(13) 8169 8171 #define GLK_CL2_PWR_DOWN (1 << 12) ··· 8200 8204 [TRANSCODER_B] = _CHICKEN_TRANS_B, \ 8201 8205 [TRANSCODER_C] = _CHICKEN_TRANS_C, \ 8202 8206 [TRANSCODER_D] = _CHICKEN_TRANS_D)) 8203 - #define HSW_FRAME_START_DELAY_MASK (3 << 27) 8204 - #define HSW_FRAME_START_DELAY(x) ((x) << 27) /* 0-3 */ 8205 - #define VSC_DATA_SEL_SOFTWARE_CONTROL (1 << 25) /* GLK and CNL+ */ 8206 - #define DDI_TRAINING_OVERRIDE_ENABLE (1 << 19) 8207 - #define DDI_TRAINING_OVERRIDE_VALUE (1 << 18) 8208 - #define DDIE_TRAINING_OVERRIDE_ENABLE (1 << 17) /* CHICKEN_TRANS_A only */ 8209 - #define DDIE_TRAINING_OVERRIDE_VALUE (1 << 16) /* CHICKEN_TRANS_A only */ 8210 - #define PSR2_ADD_VERTICAL_LINE_COUNT (1 << 15) 8211 - #define PSR2_VSC_ENABLE_PROG_HEADER (1 << 12) 8207 + #define HSW_FRAME_START_DELAY_MASK REG_GENMASK(28, 27) 8208 + #define HSW_FRAME_START_DELAY(x) REG_FIELD_PREP(HSW_FRAME_START_DELAY_MASK, x) 8209 + #define VSC_DATA_SEL_SOFTWARE_CONTROL REG_BIT(25) /* GLK */ 8210 + #define FECSTALL_DIS_DPTSTREAM_DPTTG REG_BIT(23) 8211 + #define DDI_TRAINING_OVERRIDE_ENABLE REG_BIT(19) 8212 + #define DDI_TRAINING_OVERRIDE_VALUE REG_BIT(18) 8213 + #define DDIE_TRAINING_OVERRIDE_ENABLE REG_BIT(17) /* CHICKEN_TRANS_A only */ 8214 + #define DDIE_TRAINING_OVERRIDE_VALUE REG_BIT(16) /* CHICKEN_TRANS_A only */ 8215 + #define PSR2_ADD_VERTICAL_LINE_COUNT REG_BIT(15) 8216 + #define PSR2_VSC_ENABLE_PROG_HEADER REG_BIT(12) 8212 8217 8213 8218 #define DISP_ARB_CTL _MMIO(0x45000) 8214 8219 #define DISP_FBC_MEMORY_WAKE (1 << 31) ··· 8267 8270 8268 8271 #define GEN8_CHICKEN_DCPR_1 _MMIO(0x46430) 8269 8272 #define SKL_SELECT_ALTERNATE_DC_EXIT (1 << 30) 8270 - #define CNL_DELAY_PMRSP (1 << 22) 8273 + #define ICL_DELAY_PMRSP (1 << 22) 8271 8274 #define MASK_WAKEMEM (1 << 13) 8272 - #define CNL_DDI_CLOCK_REG_ACCESS_ON (1 << 7) 8273 8275 8274 8276 #define GEN11_CHICKEN_DCPR_2 _MMIO(0x46434) 8275 8277 #define DCPR_MASK_MAXLATENCY_MEMUP_CLR REG_BIT(27) ··· 8289 8293 #define SKL_DFSM_PIPE_B_DISABLE (1 << 21) 8290 8294 #define SKL_DFSM_PIPE_C_DISABLE (1 << 28) 8291 8295 #define TGL_DFSM_PIPE_D_DISABLE (1 << 22) 8292 - #define CNL_DFSM_DISPLAY_DSC_DISABLE (1 << 7) 8296 + #define GLK_DFSM_DISPLAY_DSC_DISABLE (1 << 7) 8293 8297 8294 8298 #define SKL_DSSM _MMIO(0x51004) 8295 - #define CNL_DSSM_CDCLK_PLL_REFCLK_24MHz (1 << 31) 8296 8299 #define ICL_DSSM_CDCLK_PLL_REFCLK_MASK (7 << 29) 8297 8300 #define ICL_DSSM_CDCLK_PLL_REFCLK_24MHz (0 << 29) 8298 8301 #define ICL_DSSM_CDCLK_PLL_REFCLK_19_2MHz (1 << 29) ··· 8390 8395 8391 8396 /* GEN8 chicken */ 8392 8397 #define HDC_CHICKEN0 _MMIO(0x7300) 8393 - #define CNL_HDC_CHICKEN0 _MMIO(0xE5F0) 8394 8398 #define ICL_HDC_MODE _MMIO(0xE5F4) 8395 8399 #define HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE (1 << 15) 8396 8400 #define HDC_FENCE_DEST_SLM_DISABLE (1 << 14) ··· 8423 8429 #define _PIPEC_CHICKEN 0x72038 8424 8430 #define PIPE_CHICKEN(pipe) _MMIO_PIPE(pipe, _PIPEA_CHICKEN,\ 8425 8431 _PIPEB_CHICKEN) 8426 - #define UNDERRUN_RECOVERY_DISABLE REG_BIT(30) 8432 + #define UNDERRUN_RECOVERY_DISABLE_ADLP REG_BIT(30) 8433 + #define UNDERRUN_RECOVERY_ENABLE_DG2 REG_BIT(30) 8427 8434 #define PIXEL_ROUNDING_TRUNC_FB_PASSTHRU (1 << 15) 8428 8435 #define PER_PIXEL_ALPHA_BYPASS_EN (1 << 7) 8429 8436 ··· 9406 9411 #define ICL_PCODE_MEM_SUBSYSYSTEM_INFO 0xd 9407 9412 #define ICL_PCODE_MEM_SS_READ_GLOBAL_INFO (0x0 << 8) 9408 9413 #define ICL_PCODE_MEM_SS_READ_QGV_POINT_INFO(point) (((point) << 16) | (0x1 << 8)) 9414 + #define ADL_PCODE_MEM_SS_READ_PSF_GV_INFO ((0) | (0x2 << 8)) 9409 9415 #define ICL_PCODE_SAGV_DE_MEM_SS_CONFIG 0xe 9410 9416 #define ICL_PCODE_POINTS_RESTRICTED 0x0 9411 - #define ICL_PCODE_POINTS_RESTRICTED_MASK 0x1 9417 + #define ICL_PCODE_POINTS_RESTRICTED_MASK 0xf 9418 + #define ADLS_PSF_PT_SHIFT 8 9419 + #define ADLS_QGV_PT_MASK REG_GENMASK(7, 0) 9420 + #define ADLS_PSF_PT_MASK REG_GENMASK(10, 8) 9412 9421 #define GEN6_PCODE_READ_D_COMP 0x10 9413 9422 #define GEN6_PCODE_WRITE_D_COMP 0x11 9414 9423 #define ICL_PCODE_EXIT_TCCOLD 0x12 ··· 9572 9573 #define HSW_SAMPLE_C_PERFORMANCE (1 << 9) 9573 9574 #define GEN8_CENTROID_PIXEL_OPT_DIS (1 << 8) 9574 9575 #define GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC (1 << 5) 9575 - #define CNL_FAST_ANISO_L1_BANKING_FIX (1 << 4) 9576 9576 #define GEN8_SAMPLER_POWER_BYPASS_DIS (1 << 1) 9577 9577 9578 9578 #define GEN9_HALF_SLICE_CHICKEN7 _MMIO(0xe194) ··· 9752 9754 /* HSW/BDW power well */ 9753 9755 #define HSW_PW_CTL_IDX_GLOBAL 15 9754 9756 9755 - /* SKL/BXT/GLK/CNL power wells */ 9757 + /* SKL/BXT/GLK power wells */ 9756 9758 #define SKL_PW_CTL_IDX_PW_2 15 9757 9759 #define SKL_PW_CTL_IDX_PW_1 14 9758 - #define CNL_PW_CTL_IDX_AUX_F 12 9759 - #define CNL_PW_CTL_IDX_AUX_D 11 9760 9760 #define GLK_PW_CTL_IDX_AUX_C 10 9761 9761 #define GLK_PW_CTL_IDX_AUX_B 9 9762 9762 #define GLK_PW_CTL_IDX_AUX_A 8 9763 - #define CNL_PW_CTL_IDX_DDI_F 6 9764 9763 #define SKL_PW_CTL_IDX_DDI_D 4 9765 9764 #define SKL_PW_CTL_IDX_DDI_C 3 9766 9765 #define SKL_PW_CTL_IDX_DDI_B 2 ··· 9855 9860 #define ICL_PW_CTL_IDX_TO_PG(pw_idx) \ 9856 9861 ((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1) 9857 9862 #define SKL_FUSE_PG_DIST_STATUS(pg) (1 << (27 - (pg))) 9858 - 9859 - #define _CNL_AUX_REG_IDX(pw_idx) ((pw_idx) - GLK_PW_CTL_IDX_AUX_B) 9860 - #define _CNL_AUX_ANAOVRD1_B 0x162250 9861 - #define _CNL_AUX_ANAOVRD1_C 0x162210 9862 - #define _CNL_AUX_ANAOVRD1_D 0x1622D0 9863 - #define _CNL_AUX_ANAOVRD1_F 0x162A90 9864 - #define CNL_AUX_ANAOVRD1(pw_idx) _MMIO(_PICK(_CNL_AUX_REG_IDX(pw_idx), \ 9865 - _CNL_AUX_ANAOVRD1_B, \ 9866 - _CNL_AUX_ANAOVRD1_C, \ 9867 - _CNL_AUX_ANAOVRD1_D, \ 9868 - _CNL_AUX_ANAOVRD1_F)) 9869 - #define CNL_AUX_ANAOVRD1_ENABLE (1 << 16) 9870 - #define CNL_AUX_ANAOVRD1_LDO_BYPASS (1 << 23) 9871 9863 9872 9864 #define _ICL_AUX_REG_IDX(pw_idx) ((pw_idx) - ICL_PW_CTL_IDX_AUX_A) 9873 9865 #define _ICL_AUX_ANAOVRD1_A 0x162398 ··· 10155 10173 #define TRANS_DDI_BPC_10 (1 << 20) 10156 10174 #define TRANS_DDI_BPC_6 (2 << 20) 10157 10175 #define TRANS_DDI_BPC_12 (3 << 20) 10158 - #define TRANS_DDI_PORT_SYNC_MASTER_SELECT_MASK REG_GENMASK(19, 18) /* bdw-cnl */ 10176 + #define TRANS_DDI_PORT_SYNC_MASTER_SELECT_MASK REG_GENMASK(19, 18) 10159 10177 #define TRANS_DDI_PORT_SYNC_MASTER_SELECT(x) REG_FIELD_PREP(TRANS_DDI_PORT_SYNC_MASTER_SELECT_MASK, (x)) 10160 10178 #define TRANS_DDI_PVSYNC (1 << 17) 10161 10179 #define TRANS_DDI_PHSYNC (1 << 16) 10162 - #define TRANS_DDI_PORT_SYNC_ENABLE REG_BIT(15) /* bdw-cnl */ 10180 + #define TRANS_DDI_PORT_SYNC_ENABLE REG_BIT(15) 10163 10181 #define TRANS_DDI_EDP_INPUT_MASK (7 << 12) 10164 10182 #define TRANS_DDI_EDP_INPUT_A_ON (0 << 12) 10165 10183 #define TRANS_DDI_EDP_INPUT_A_ONOFF (4 << 12) ··· 10191 10209 #define PORT_SYNC_MODE_ENABLE REG_BIT(4) 10192 10210 #define PORT_SYNC_MODE_MASTER_SELECT_MASK REG_GENMASK(2, 0) 10193 10211 #define PORT_SYNC_MODE_MASTER_SELECT(x) REG_FIELD_PREP(PORT_SYNC_MODE_MASTER_SELECT_MASK, (x)) 10212 + 10213 + #define TRANS_CMTG_CHICKEN _MMIO(0x6fa90) 10214 + #define DISABLE_DPT_CLK_GATING REG_BIT(1) 10194 10215 10195 10216 /* DisplayPort Transport Control */ 10196 10217 #define _DP_TP_CTL_A 0x64040 ··· 10518 10533 #define DPLL_CFGCR1(id) _MMIO_PIPE((id) - SKL_DPLL1, _DPLL1_CFGCR1, _DPLL2_CFGCR1) 10519 10534 #define DPLL_CFGCR2(id) _MMIO_PIPE((id) - SKL_DPLL1, _DPLL1_CFGCR2, _DPLL2_CFGCR2) 10520 10535 10521 - /* 10522 - * CNL Clocks 10523 - */ 10524 - #define DPCLKA_CFGCR0 _MMIO(0x6C200) 10525 - #define DPCLKA_CFGCR0_DDI_CLK_OFF(port) (1 << ((port) == PORT_F ? 23 : \ 10526 - (port) + 10)) 10527 - #define DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port) ((port) == PORT_F ? 21 : \ 10528 - (port) * 2) 10529 - #define DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port) (3 << DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port)) 10530 - #define DPCLKA_CFGCR0_DDI_CLK_SEL(pll, port) ((pll) << DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port)) 10531 - 10532 10536 /* ICL Clocks */ 10533 10537 #define ICL_DPCLKA_CFGCR0 _MMIO(0x164280) 10534 10538 #define ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy) (1 << _PICK(phy, 10, 11, 24, 4, 5)) ··· 10573 10599 ADLS_DPCLKA_DDIJ_SEL_MASK, \ 10574 10600 ADLS_DPCLKA_DDIK_SEL_MASK) 10575 10601 10576 - /* CNL PLL */ 10602 + /* ICL PLL */ 10577 10603 #define DPLL0_ENABLE 0x46010 10578 10604 #define DPLL1_ENABLE 0x46014 10579 10605 #define _ADLS_DPLL2_ENABLE 0x46018 ··· 10582 10608 #define PLL_LOCK (1 << 30) 10583 10609 #define PLL_POWER_ENABLE (1 << 27) 10584 10610 #define PLL_POWER_STATE (1 << 26) 10585 - #define CNL_DPLL_ENABLE(pll) _MMIO_PLL3(pll, DPLL0_ENABLE, DPLL1_ENABLE, \ 10611 + #define ICL_DPLL_ENABLE(pll) _MMIO_PLL3(pll, DPLL0_ENABLE, DPLL1_ENABLE, \ 10586 10612 _ADLS_DPLL2_ENABLE, _ADLS_DPLL3_ENABLE) 10613 + 10614 + #define _DG2_PLL3_ENABLE 0x4601C 10615 + 10616 + #define DG2_PLL_ENABLE(pll) _MMIO_PLL3(pll, DPLL0_ENABLE, DPLL1_ENABLE, \ 10617 + _ADLS_DPLL2_ENABLE, _DG2_PLL3_ENABLE) 10587 10618 10588 10619 #define TBT_PLL_ENABLE _MMIO(0x46020) 10589 10620 ··· 10755 10776 _MG_PLL_TDC_COLDST_BIAS_PORT1, \ 10756 10777 _MG_PLL_TDC_COLDST_BIAS_PORT2) 10757 10778 10758 - #define _CNL_DPLL0_CFGCR0 0x6C000 10759 - #define _CNL_DPLL1_CFGCR0 0x6C080 10760 - #define DPLL_CFGCR0_HDMI_MODE (1 << 30) 10761 - #define DPLL_CFGCR0_SSC_ENABLE (1 << 29) 10762 - #define DPLL_CFGCR0_SSC_ENABLE_ICL (1 << 25) 10763 - #define DPLL_CFGCR0_LINK_RATE_MASK (0xf << 25) 10764 - #define DPLL_CFGCR0_LINK_RATE_2700 (0 << 25) 10765 - #define DPLL_CFGCR0_LINK_RATE_1350 (1 << 25) 10766 - #define DPLL_CFGCR0_LINK_RATE_810 (2 << 25) 10767 - #define DPLL_CFGCR0_LINK_RATE_1620 (3 << 25) 10768 - #define DPLL_CFGCR0_LINK_RATE_1080 (4 << 25) 10769 - #define DPLL_CFGCR0_LINK_RATE_2160 (5 << 25) 10770 - #define DPLL_CFGCR0_LINK_RATE_3240 (6 << 25) 10771 - #define DPLL_CFGCR0_LINK_RATE_4050 (7 << 25) 10772 - #define DPLL_CFGCR0_DCO_FRACTION_MASK (0x7fff << 10) 10773 - #define DPLL_CFGCR0_DCO_FRACTION_SHIFT (10) 10774 - #define DPLL_CFGCR0_DCO_FRACTION(x) ((x) << 10) 10775 - #define DPLL_CFGCR0_DCO_INTEGER_MASK (0x3ff) 10776 - #define CNL_DPLL_CFGCR0(pll) _MMIO_PLL(pll, _CNL_DPLL0_CFGCR0, _CNL_DPLL1_CFGCR0) 10777 - 10778 - #define _CNL_DPLL0_CFGCR1 0x6C004 10779 - #define _CNL_DPLL1_CFGCR1 0x6C084 10780 - #define DPLL_CFGCR1_QDIV_RATIO_MASK (0xff << 10) 10781 - #define DPLL_CFGCR1_QDIV_RATIO_SHIFT (10) 10782 - #define DPLL_CFGCR1_QDIV_RATIO(x) ((x) << 10) 10783 - #define DPLL_CFGCR1_QDIV_MODE_SHIFT (9) 10784 - #define DPLL_CFGCR1_QDIV_MODE(x) ((x) << 9) 10785 - #define DPLL_CFGCR1_KDIV_MASK (7 << 6) 10786 - #define DPLL_CFGCR1_KDIV_SHIFT (6) 10787 - #define DPLL_CFGCR1_KDIV(x) ((x) << 6) 10788 - #define DPLL_CFGCR1_KDIV_1 (1 << 6) 10789 - #define DPLL_CFGCR1_KDIV_2 (2 << 6) 10790 - #define DPLL_CFGCR1_KDIV_3 (4 << 6) 10791 - #define DPLL_CFGCR1_PDIV_MASK (0xf << 2) 10792 - #define DPLL_CFGCR1_PDIV_SHIFT (2) 10793 - #define DPLL_CFGCR1_PDIV(x) ((x) << 2) 10794 - #define DPLL_CFGCR1_PDIV_2 (1 << 2) 10795 - #define DPLL_CFGCR1_PDIV_3 (2 << 2) 10796 - #define DPLL_CFGCR1_PDIV_5 (4 << 2) 10797 - #define DPLL_CFGCR1_PDIV_7 (8 << 2) 10798 - #define DPLL_CFGCR1_CENTRAL_FREQ (3 << 0) 10799 - #define DPLL_CFGCR1_CENTRAL_FREQ_8400 (3 << 0) 10800 - #define TGL_DPLL_CFGCR1_CFSELOVRD_NORMAL_XTAL (0 << 0) 10801 - #define CNL_DPLL_CFGCR1(pll) _MMIO_PLL(pll, _CNL_DPLL0_CFGCR1, _CNL_DPLL1_CFGCR1) 10802 - 10803 10779 #define _ICL_DPLL0_CFGCR0 0x164000 10804 10780 #define _ICL_DPLL1_CFGCR0 0x164080 10805 10781 #define ICL_DPLL_CFGCR0(pll) _MMIO_PLL(pll, _ICL_DPLL0_CFGCR0, \ 10806 10782 _ICL_DPLL1_CFGCR0) 10783 + #define DPLL_CFGCR0_HDMI_MODE (1 << 30) 10784 + #define DPLL_CFGCR0_SSC_ENABLE (1 << 29) 10785 + #define DPLL_CFGCR0_SSC_ENABLE_ICL (1 << 25) 10786 + #define DPLL_CFGCR0_LINK_RATE_MASK (0xf << 25) 10787 + #define DPLL_CFGCR0_LINK_RATE_2700 (0 << 25) 10788 + #define DPLL_CFGCR0_LINK_RATE_1350 (1 << 25) 10789 + #define DPLL_CFGCR0_LINK_RATE_810 (2 << 25) 10790 + #define DPLL_CFGCR0_LINK_RATE_1620 (3 << 25) 10791 + #define DPLL_CFGCR0_LINK_RATE_1080 (4 << 25) 10792 + #define DPLL_CFGCR0_LINK_RATE_2160 (5 << 25) 10793 + #define DPLL_CFGCR0_LINK_RATE_3240 (6 << 25) 10794 + #define DPLL_CFGCR0_LINK_RATE_4050 (7 << 25) 10795 + #define DPLL_CFGCR0_DCO_FRACTION_MASK (0x7fff << 10) 10796 + #define DPLL_CFGCR0_DCO_FRACTION_SHIFT (10) 10797 + #define DPLL_CFGCR0_DCO_FRACTION(x) ((x) << 10) 10798 + #define DPLL_CFGCR0_DCO_INTEGER_MASK (0x3ff) 10807 10799 10808 10800 #define _ICL_DPLL0_CFGCR1 0x164004 10809 10801 #define _ICL_DPLL1_CFGCR1 0x164084 10810 10802 #define ICL_DPLL_CFGCR1(pll) _MMIO_PLL(pll, _ICL_DPLL0_CFGCR1, \ 10811 10803 _ICL_DPLL1_CFGCR1) 10804 + #define DPLL_CFGCR1_QDIV_RATIO_MASK (0xff << 10) 10805 + #define DPLL_CFGCR1_QDIV_RATIO_SHIFT (10) 10806 + #define DPLL_CFGCR1_QDIV_RATIO(x) ((x) << 10) 10807 + #define DPLL_CFGCR1_QDIV_MODE_SHIFT (9) 10808 + #define DPLL_CFGCR1_QDIV_MODE(x) ((x) << 9) 10809 + #define DPLL_CFGCR1_KDIV_MASK (7 << 6) 10810 + #define DPLL_CFGCR1_KDIV_SHIFT (6) 10811 + #define DPLL_CFGCR1_KDIV(x) ((x) << 6) 10812 + #define DPLL_CFGCR1_KDIV_1 (1 << 6) 10813 + #define DPLL_CFGCR1_KDIV_2 (2 << 6) 10814 + #define DPLL_CFGCR1_KDIV_3 (4 << 6) 10815 + #define DPLL_CFGCR1_PDIV_MASK (0xf << 2) 10816 + #define DPLL_CFGCR1_PDIV_SHIFT (2) 10817 + #define DPLL_CFGCR1_PDIV(x) ((x) << 2) 10818 + #define DPLL_CFGCR1_PDIV_2 (1 << 2) 10819 + #define DPLL_CFGCR1_PDIV_3 (2 << 2) 10820 + #define DPLL_CFGCR1_PDIV_5 (4 << 2) 10821 + #define DPLL_CFGCR1_PDIV_7 (8 << 2) 10822 + #define DPLL_CFGCR1_CENTRAL_FREQ (3 << 0) 10823 + #define DPLL_CFGCR1_CENTRAL_FREQ_8400 (3 << 0) 10824 + #define TGL_DPLL_CFGCR1_CFSELOVRD_NORMAL_XTAL (0 << 0) 10812 10825 10813 10826 #define _TGL_DPLL0_CFGCR0 0x164284 10814 10827 #define _TGL_DPLL1_CFGCR0 0x16428C ··· 11020 11049 #define BXT_DE_PLL_LOCK (1 << 30) 11021 11050 #define BXT_DE_PLL_FREQ_REQ (1 << 23) 11022 11051 #define BXT_DE_PLL_FREQ_REQ_ACK (1 << 22) 11023 - #define CNL_CDCLK_PLL_RATIO(x) (x) 11024 - #define CNL_CDCLK_PLL_RATIO_MASK 0xff 11052 + #define ICL_CDCLK_PLL_RATIO(x) (x) 11053 + #define ICL_CDCLK_PLL_RATIO_MASK 0xff 11025 11054 11026 11055 /* GEN9 DC */ 11027 11056 #define DC_STATE_EN _MMIO(0x45504) ··· 11076 11105 #define SKL_MEMORY_FREQ_MULTIPLIER_HZ 266666666 11077 11106 #define SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5E04) 11078 11107 #define SKL_REQ_DATA_MASK (0xF << 0) 11108 + #define DG1_GEAR_TYPE REG_BIT(16) 11079 11109 11080 11110 #define SKL_MAD_INTER_CHANNEL_0_0_0_MCHBAR_MCMAIN _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5000) 11081 11111 #define SKL_DRAM_DDR_TYPE_MASK (0x3 << 0) ··· 11099 11127 #define SKL_DRAM_RANK_1 (0x0 << 10) 11100 11128 #define SKL_DRAM_RANK_2 (0x1 << 10) 11101 11129 #define SKL_DRAM_RANK_MASK (0x1 << 10) 11102 - #define CNL_DRAM_SIZE_MASK 0x7F 11103 - #define CNL_DRAM_WIDTH_MASK (0x3 << 7) 11104 - #define CNL_DRAM_WIDTH_SHIFT 7 11105 - #define CNL_DRAM_WIDTH_X8 (0x0 << 7) 11106 - #define CNL_DRAM_WIDTH_X16 (0x1 << 7) 11107 - #define CNL_DRAM_WIDTH_X32 (0x2 << 7) 11108 - #define CNL_DRAM_RANK_MASK (0x3 << 9) 11109 - #define CNL_DRAM_RANK_SHIFT 9 11110 - #define CNL_DRAM_RANK_1 (0x0 << 9) 11111 - #define CNL_DRAM_RANK_2 (0x1 << 9) 11112 - #define CNL_DRAM_RANK_3 (0x2 << 9) 11113 - #define CNL_DRAM_RANK_4 (0x3 << 9) 11130 + #define ICL_DRAM_SIZE_MASK 0x7F 11131 + #define ICL_DRAM_WIDTH_MASK (0x3 << 7) 11132 + #define ICL_DRAM_WIDTH_SHIFT 7 11133 + #define ICL_DRAM_WIDTH_X8 (0x0 << 7) 11134 + #define ICL_DRAM_WIDTH_X16 (0x1 << 7) 11135 + #define ICL_DRAM_WIDTH_X32 (0x2 << 7) 11136 + #define ICL_DRAM_RANK_MASK (0x3 << 9) 11137 + #define ICL_DRAM_RANK_SHIFT 9 11138 + #define ICL_DRAM_RANK_1 (0x0 << 9) 11139 + #define ICL_DRAM_RANK_2 (0x1 << 9) 11140 + #define ICL_DRAM_RANK_3 (0x2 << 9) 11141 + #define ICL_DRAM_RANK_4 (0x3 << 9) 11142 + 11143 + #define SA_PERF_STATUS_0_0_0_MCHBAR_PC _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5918) 11144 + #define DG1_QCLK_RATIO_MASK REG_GENMASK(9, 2) 11145 + #define DG1_QCLK_REFERENCE REG_BIT(10) 11146 + 11147 + #define MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x4000) 11148 + #define DG1_DRAM_T_RDPRE_MASK REG_GENMASK(16, 11) 11149 + #define DG1_DRAM_T_RP_MASK REG_GENMASK(6, 0) 11150 + #define MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR_HIGH _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x4004) 11151 + #define DG1_DRAM_T_RCD_MASK REG_GENMASK(15, 9) 11152 + #define DG1_DRAM_T_RAS_MASK REG_GENMASK(8, 1) 11114 11153 11115 11154 /* 11116 11155 * Please see hsw_read_dcomp() and hsw_write_dcomp() before using this register, ··· 12372 12389 _ICL_PHY_MISC_B) 12373 12390 #define ICL_PHY_MISC_MUX_DDID (1 << 28) 12374 12391 #define ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN (1 << 23) 12392 + #define DG2_PHY_DP_TX_ACK_MASK REG_GENMASK(23, 20) 12375 12393 12376 12394 /* Icelake Display Stream Compression Registers */ 12377 12395 #define DSCA_PICTURE_PARAMETER_SET_0 _MMIO(0x6B200)
+13 -14
drivers/gpu/drm/i915/intel_device_info.c
··· 59 59 PLATFORM_NAME(GEMINILAKE), 60 60 PLATFORM_NAME(COFFEELAKE), 61 61 PLATFORM_NAME(COMETLAKE), 62 - PLATFORM_NAME(CANNONLAKE), 63 62 PLATFORM_NAME(ICELAKE), 64 63 PLATFORM_NAME(ELKHARTLAKE), 65 64 PLATFORM_NAME(JASPERLAKE), ··· 174 175 }; 175 176 176 177 static const u16 subplatform_portf_ids[] = { 177 - INTEL_CNL_PORT_F_IDS(0), 178 178 INTEL_ICL_PORT_F_IDS(0), 179 179 }; 180 180 ··· 261 263 struct intel_runtime_info *runtime = RUNTIME_INFO(dev_priv); 262 264 enum pipe pipe; 263 265 264 - /* Wa_14011765242: adl-s A0 */ 265 - if (IS_ADLS_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A0)) 266 + /* Wa_14011765242: adl-s A0,A1 */ 267 + if (IS_ADLS_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A2)) 266 268 for_each_pipe(dev_priv, pipe) 267 269 runtime->num_scalers[pipe] = 0; 268 - else if (GRAPHICS_VER(dev_priv) >= 10) { 270 + else if (DISPLAY_VER(dev_priv) >= 11) { 269 271 for_each_pipe(dev_priv, pipe) 270 272 runtime->num_scalers[pipe] = 2; 271 - } else if (GRAPHICS_VER(dev_priv) == 9) { 273 + } else if (DISPLAY_VER(dev_priv) >= 9) { 272 274 runtime->num_scalers[PIPE_A] = 2; 273 275 runtime->num_scalers[PIPE_B] = 2; 274 276 runtime->num_scalers[PIPE_C] = 1; ··· 279 281 if (DISPLAY_VER(dev_priv) >= 13 || HAS_D12_PLANE_MINIMIZATION(dev_priv)) 280 282 for_each_pipe(dev_priv, pipe) 281 283 runtime->num_sprites[pipe] = 4; 282 - else if (GRAPHICS_VER(dev_priv) >= 11) 284 + else if (DISPLAY_VER(dev_priv) >= 11) 283 285 for_each_pipe(dev_priv, pipe) 284 286 runtime->num_sprites[pipe] = 6; 285 - else if (GRAPHICS_VER(dev_priv) == 10 || IS_GEMINILAKE(dev_priv)) 287 + else if (DISPLAY_VER(dev_priv) == 10) 286 288 for_each_pipe(dev_priv, pipe) 287 289 runtime->num_sprites[pipe] = 3; 288 290 else if (IS_BROXTON(dev_priv)) { ··· 301 303 } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { 302 304 for_each_pipe(dev_priv, pipe) 303 305 runtime->num_sprites[pipe] = 2; 304 - } else if (GRAPHICS_VER(dev_priv) >= 5 || IS_G4X(dev_priv)) { 306 + } else if (DISPLAY_VER(dev_priv) >= 5 || IS_G4X(dev_priv)) { 305 307 for_each_pipe(dev_priv, pipe) 306 308 runtime->num_sprites[pipe] = 1; 307 309 } ··· 333 335 info->pipe_mask &= ~BIT(PIPE_C); 334 336 info->cpu_transcoder_mask &= ~BIT(TRANSCODER_C); 335 337 } 336 - } else if (HAS_DISPLAY(dev_priv) && GRAPHICS_VER(dev_priv) >= 9) { 338 + } else if (HAS_DISPLAY(dev_priv) && DISPLAY_VER(dev_priv) >= 9) { 337 339 u32 dfsm = intel_de_read(dev_priv, SKL_DFSM); 338 340 339 341 if (dfsm & SKL_DFSM_PIPE_A_DISABLE) { ··· 348 350 info->pipe_mask &= ~BIT(PIPE_C); 349 351 info->cpu_transcoder_mask &= ~BIT(TRANSCODER_C); 350 352 } 351 - if (GRAPHICS_VER(dev_priv) >= 12 && 353 + 354 + if (DISPLAY_VER(dev_priv) >= 12 && 352 355 (dfsm & TGL_DFSM_PIPE_D_DISABLE)) { 353 356 info->pipe_mask &= ~BIT(PIPE_D); 354 357 info->cpu_transcoder_mask &= ~BIT(TRANSCODER_D); ··· 361 362 if (dfsm & SKL_DFSM_DISPLAY_PM_DISABLE) 362 363 info->display.has_fbc = 0; 363 364 364 - if (GRAPHICS_VER(dev_priv) >= 11 && (dfsm & ICL_DFSM_DMC_DISABLE)) 365 + if (DISPLAY_VER(dev_priv) >= 11 && (dfsm & ICL_DFSM_DMC_DISABLE)) 365 366 info->display.has_dmc = 0; 366 367 367 - if (GRAPHICS_VER(dev_priv) >= 10 && 368 - (dfsm & CNL_DFSM_DISPLAY_DSC_DISABLE)) 368 + if (DISPLAY_VER(dev_priv) >= 10 && 369 + (dfsm & GLK_DFSM_DISPLAY_DSC_DISABLE)) 369 370 info->display.has_dsc = 0; 370 371 } 371 372
+2 -6
drivers/gpu/drm/i915/intel_device_info.h
··· 76 76 INTEL_GEMINILAKE, 77 77 INTEL_COFFEELAKE, 78 78 INTEL_COMETLAKE, 79 - /* gen10 */ 80 - INTEL_CANNONLAKE, 81 79 /* gen11 */ 82 80 INTEL_ICELAKE, 83 81 INTEL_ELKHARTLAKE, ··· 103 105 #define INTEL_SUBPLATFORM_ULT (0) 104 106 #define INTEL_SUBPLATFORM_ULX (1) 105 107 106 - /* CNL/ICL */ 108 + /* ICL */ 107 109 #define INTEL_SUBPLATFORM_PORTF (0) 108 110 109 111 /* DG2 */ ··· 131 133 func(has_llc); \ 132 134 func(has_logical_ring_contexts); \ 133 135 func(has_logical_ring_elsq); \ 134 - func(has_master_unit_irq); \ 135 136 func(has_mslices); \ 136 137 func(has_pooled_eu); \ 137 138 func(has_rc6); \ ··· 145 148 #define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \ 146 149 /* Keep in alphabetical order */ \ 147 150 func(cursor_needs_physical); \ 151 + func(has_cdclk_crawl); \ 148 152 func(has_dmc); \ 149 153 func(has_ddi); \ 150 154 func(has_dp_mst); \ ··· 192 194 u8 cpu_transcoder_mask; 193 195 194 196 u8 abox_mask; 195 - 196 - u8 has_cdclk_crawl; /* does support CDCLK crawling */ 197 197 198 198 #define DEFINE_FLAG(name) u8 name:1 199 199 DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
+20 -19
drivers/gpu/drm/i915/intel_dram.c
··· 77 77 } 78 78 79 79 /* Returns total Gb for the whole DIMM */ 80 - static int cnl_get_dimm_size(u16 val) 80 + static int icl_get_dimm_size(u16 val) 81 81 { 82 - return (val & CNL_DRAM_SIZE_MASK) * 8 / 2; 82 + return (val & ICL_DRAM_SIZE_MASK) * 8 / 2; 83 83 } 84 84 85 - static int cnl_get_dimm_width(u16 val) 85 + static int icl_get_dimm_width(u16 val) 86 86 { 87 - if (cnl_get_dimm_size(val) == 0) 87 + if (icl_get_dimm_size(val) == 0) 88 88 return 0; 89 89 90 - switch (val & CNL_DRAM_WIDTH_MASK) { 91 - case CNL_DRAM_WIDTH_X8: 92 - case CNL_DRAM_WIDTH_X16: 93 - case CNL_DRAM_WIDTH_X32: 94 - val = (val & CNL_DRAM_WIDTH_MASK) >> CNL_DRAM_WIDTH_SHIFT; 90 + switch (val & ICL_DRAM_WIDTH_MASK) { 91 + case ICL_DRAM_WIDTH_X8: 92 + case ICL_DRAM_WIDTH_X16: 93 + case ICL_DRAM_WIDTH_X32: 94 + val = (val & ICL_DRAM_WIDTH_MASK) >> ICL_DRAM_WIDTH_SHIFT; 95 95 return 8 << val; 96 96 default: 97 97 MISSING_CASE(val); ··· 99 99 } 100 100 } 101 101 102 - static int cnl_get_dimm_ranks(u16 val) 102 + static int icl_get_dimm_ranks(u16 val) 103 103 { 104 - if (cnl_get_dimm_size(val) == 0) 104 + if (icl_get_dimm_size(val) == 0) 105 105 return 0; 106 106 107 - val = (val & CNL_DRAM_RANK_MASK) >> CNL_DRAM_RANK_SHIFT; 107 + val = (val & ICL_DRAM_RANK_MASK) >> ICL_DRAM_RANK_SHIFT; 108 108 109 109 return val + 1; 110 110 } ··· 121 121 struct dram_dimm_info *dimm, 122 122 int channel, char dimm_name, u16 val) 123 123 { 124 - if (GRAPHICS_VER(i915) >= 10) { 125 - dimm->size = cnl_get_dimm_size(val); 126 - dimm->width = cnl_get_dimm_width(val); 127 - dimm->ranks = cnl_get_dimm_ranks(val); 124 + if (GRAPHICS_VER(i915) >= 11) { 125 + dimm->size = icl_get_dimm_size(val); 126 + dimm->width = icl_get_dimm_width(val); 127 + dimm->ranks = icl_get_dimm_ranks(val); 128 128 } else { 129 129 dimm->size = skl_get_dimm_size(val); 130 130 dimm->width = skl_get_dimm_width(val); ··· 468 468 469 469 dram_info->num_channels = (val & 0xf0) >> 4; 470 470 dram_info->num_qgv_points = (val & 0xf00) >> 8; 471 + dram_info->num_psf_gv_points = (val & 0x3000) >> 12; 471 472 472 473 return 0; 473 474 } ··· 495 494 struct dram_info *dram_info = &i915->dram_info; 496 495 int ret; 497 496 497 + if (GRAPHICS_VER(i915) < 9 || IS_DG2(i915) || !HAS_DISPLAY(i915)) 498 + return; 499 + 498 500 /* 499 501 * Assume level 0 watermark latency adjustment is needed until proven 500 502 * otherwise, this w/a is not needed by bxt/glk. 501 503 */ 502 504 dram_info->wm_lv_0_adjust_needed = !IS_GEN9_LP(i915); 503 - 504 - if (GRAPHICS_VER(i915) < 9 || !HAS_DISPLAY(i915)) 505 - return; 506 505 507 506 if (GRAPHICS_VER(i915) >= 12) 508 507 ret = gen12_get_dram_info(i915);
+4 -4
drivers/gpu/drm/i915/intel_pch.c
··· 81 81 case INTEL_PCH_CNP_DEVICE_ID_TYPE: 82 82 drm_dbg_kms(&dev_priv->drm, "Found Cannon Lake PCH (CNP)\n"); 83 83 drm_WARN_ON(&dev_priv->drm, 84 - !IS_CANNONLAKE(dev_priv) && 85 84 !IS_COFFEELAKE(dev_priv) && 86 85 !IS_COMETLAKE(dev_priv)); 87 86 return PCH_CNP; ··· 88 89 drm_dbg_kms(&dev_priv->drm, 89 90 "Found Cannon Lake LP PCH (CNP-LP)\n"); 90 91 drm_WARN_ON(&dev_priv->drm, 91 - !IS_CANNONLAKE(dev_priv) && 92 92 !IS_COFFEELAKE(dev_priv) && 93 93 !IS_COMETLAKE(dev_priv)); 94 94 return PCH_CNP; ··· 169 171 id = INTEL_PCH_MCC_DEVICE_ID_TYPE; 170 172 else if (IS_ICELAKE(dev_priv)) 171 173 id = INTEL_PCH_ICP_DEVICE_ID_TYPE; 172 - else if (IS_CANNONLAKE(dev_priv) || 173 - IS_COFFEELAKE(dev_priv) || 174 + else if (IS_COFFEELAKE(dev_priv) || 174 175 IS_COMETLAKE(dev_priv)) 175 176 id = INTEL_PCH_CNP_DEVICE_ID_TYPE; 176 177 else if (IS_KABYLAKE(dev_priv) || IS_SKYLAKE(dev_priv)) ··· 207 210 /* DG1 has south engine display on the same PCI device */ 208 211 if (IS_DG1(dev_priv)) { 209 212 dev_priv->pch_type = PCH_DG1; 213 + return; 214 + } else if (IS_DG2(dev_priv)) { 215 + dev_priv->pch_type = PCH_DG2; 210 216 return; 211 217 } 212 218
+2
drivers/gpu/drm/i915/intel_pch.h
··· 30 30 31 31 /* Fake PCHs, functionality handled on the same PCI dev */ 32 32 PCH_DG1 = 1024, 33 + PCH_DG2, 33 34 }; 34 35 35 36 #define INTEL_PCH_DEVICE_ID_MASK 0xff80 ··· 63 62 64 63 #define INTEL_PCH_TYPE(dev_priv) ((dev_priv)->pch_type) 65 64 #define INTEL_PCH_ID(dev_priv) ((dev_priv)->pch_id) 65 + #define HAS_PCH_DG2(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_DG2) 66 66 #define HAS_PCH_ADP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_ADP) 67 67 #define HAS_PCH_DG1(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_DG1) 68 68 #define HAS_PCH_JSP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_JSP)
+121 -42
drivers/gpu/drm/i915/intel_pm.c
··· 4584 4584 {} 4585 4585 }; 4586 4586 4587 + static const struct dbuf_slice_conf_entry dg2_allowed_dbufs[] = { 4588 + { 4589 + .active_pipes = BIT(PIPE_A), 4590 + .dbuf_mask = { 4591 + [PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2), 4592 + }, 4593 + }, 4594 + { 4595 + .active_pipes = BIT(PIPE_B), 4596 + .dbuf_mask = { 4597 + [PIPE_B] = BIT(DBUF_S1) | BIT(DBUF_S2), 4598 + }, 4599 + }, 4600 + { 4601 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_B), 4602 + .dbuf_mask = { 4603 + [PIPE_A] = BIT(DBUF_S1), 4604 + [PIPE_B] = BIT(DBUF_S2), 4605 + }, 4606 + }, 4607 + { 4608 + .active_pipes = BIT(PIPE_C), 4609 + .dbuf_mask = { 4610 + [PIPE_C] = BIT(DBUF_S3) | BIT(DBUF_S4), 4611 + }, 4612 + }, 4613 + { 4614 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_C), 4615 + .dbuf_mask = { 4616 + [PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2), 4617 + [PIPE_C] = BIT(DBUF_S3) | BIT(DBUF_S4), 4618 + }, 4619 + }, 4620 + { 4621 + .active_pipes = BIT(PIPE_B) | BIT(PIPE_C), 4622 + .dbuf_mask = { 4623 + [PIPE_B] = BIT(DBUF_S1) | BIT(DBUF_S2), 4624 + [PIPE_C] = BIT(DBUF_S3) | BIT(DBUF_S4), 4625 + }, 4626 + }, 4627 + { 4628 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), 4629 + .dbuf_mask = { 4630 + [PIPE_A] = BIT(DBUF_S1), 4631 + [PIPE_B] = BIT(DBUF_S2), 4632 + [PIPE_C] = BIT(DBUF_S3) | BIT(DBUF_S4), 4633 + }, 4634 + }, 4635 + { 4636 + .active_pipes = BIT(PIPE_D), 4637 + .dbuf_mask = { 4638 + [PIPE_D] = BIT(DBUF_S3) | BIT(DBUF_S4), 4639 + }, 4640 + }, 4641 + { 4642 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_D), 4643 + .dbuf_mask = { 4644 + [PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2), 4645 + [PIPE_D] = BIT(DBUF_S3) | BIT(DBUF_S4), 4646 + }, 4647 + }, 4648 + { 4649 + .active_pipes = BIT(PIPE_B) | BIT(PIPE_D), 4650 + .dbuf_mask = { 4651 + [PIPE_B] = BIT(DBUF_S1) | BIT(DBUF_S2), 4652 + [PIPE_D] = BIT(DBUF_S3) | BIT(DBUF_S4), 4653 + }, 4654 + }, 4655 + { 4656 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_D), 4657 + .dbuf_mask = { 4658 + [PIPE_A] = BIT(DBUF_S1), 4659 + [PIPE_B] = BIT(DBUF_S2), 4660 + [PIPE_D] = BIT(DBUF_S3) | BIT(DBUF_S4), 4661 + }, 4662 + }, 4663 + { 4664 + .active_pipes = BIT(PIPE_C) | BIT(PIPE_D), 4665 + .dbuf_mask = { 4666 + [PIPE_C] = BIT(DBUF_S3), 4667 + [PIPE_D] = BIT(DBUF_S4), 4668 + }, 4669 + }, 4670 + { 4671 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_C) | BIT(PIPE_D), 4672 + .dbuf_mask = { 4673 + [PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2), 4674 + [PIPE_C] = BIT(DBUF_S3), 4675 + [PIPE_D] = BIT(DBUF_S4), 4676 + }, 4677 + }, 4678 + { 4679 + .active_pipes = BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), 4680 + .dbuf_mask = { 4681 + [PIPE_B] = BIT(DBUF_S1) | BIT(DBUF_S2), 4682 + [PIPE_C] = BIT(DBUF_S3), 4683 + [PIPE_D] = BIT(DBUF_S4), 4684 + }, 4685 + }, 4686 + { 4687 + .active_pipes = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), 4688 + .dbuf_mask = { 4689 + [PIPE_A] = BIT(DBUF_S1), 4690 + [PIPE_B] = BIT(DBUF_S2), 4691 + [PIPE_C] = BIT(DBUF_S3), 4692 + [PIPE_D] = BIT(DBUF_S4), 4693 + }, 4694 + }, 4695 + {} 4696 + }; 4697 + 4587 4698 static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = { 4588 4699 { 4589 4700 .active_pipes = BIT(PIPE_A), ··· 4870 4759 return compute_dbuf_slices(pipe, active_pipes, adlp_allowed_dbufs); 4871 4760 } 4872 4761 4762 + static u32 dg2_compute_dbuf_slices(enum pipe pipe, u32 active_pipes) 4763 + { 4764 + return compute_dbuf_slices(pipe, active_pipes, dg2_allowed_dbufs); 4765 + } 4766 + 4873 4767 static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes) 4874 4768 { 4875 4769 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 4876 4770 enum pipe pipe = crtc->pipe; 4877 4771 4878 - if (IS_ALDERLAKE_P(dev_priv)) 4772 + if (IS_DG2(dev_priv)) 4773 + return dg2_compute_dbuf_slices(pipe, active_pipes); 4774 + else if (IS_ALDERLAKE_P(dev_priv)) 4879 4775 return adlp_compute_dbuf_slices(pipe, active_pipes); 4880 4776 else if (DISPLAY_VER(dev_priv) == 12) 4881 4777 return tgl_compute_dbuf_slices(pipe, active_pipes); ··· 7465 7347 7466 7348 /*Wa_14010594013:icl, ehl */ 7467 7349 intel_uncore_rmw(&dev_priv->uncore, GEN8_CHICKEN_DCPR_1, 7468 - 0, CNL_DELAY_PMRSP); 7350 + 0, ICL_DELAY_PMRSP); 7469 7351 } 7470 7352 7471 7353 static void gen12lp_init_clock_gating(struct drm_i915_private *dev_priv) ··· 7477 7359 ILK_DPFC_CHICKEN_COMP_DUMMY_PIXEL); 7478 7360 7479 7361 /* Wa_1409825376:tgl (pre-prod)*/ 7480 - if (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B1)) 7362 + if (IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) 7481 7363 intel_uncore_write(&dev_priv->uncore, GEN9_CLKGATE_DIS_3, intel_uncore_read(&dev_priv->uncore, GEN9_CLKGATE_DIS_3) | 7482 7364 TGL_VRH_GATING_DIS); 7483 7365 ··· 7513 7395 /* Display WA #1181 WaSouthDisplayDisablePWMCGEGating: cnp */ 7514 7396 intel_uncore_write(&dev_priv->uncore, SOUTH_DSPCLK_GATE_D, intel_uncore_read(&dev_priv->uncore, SOUTH_DSPCLK_GATE_D) | 7515 7397 CNP_PWM_CGE_GATING_DISABLE); 7516 - } 7517 - 7518 - static void cnl_init_clock_gating(struct drm_i915_private *dev_priv) 7519 - { 7520 - u32 val; 7521 - cnp_init_clock_gating(dev_priv); 7522 - 7523 - /* This is not an Wa. Enable for better image quality */ 7524 - intel_uncore_write(&dev_priv->uncore, _3D_CHICKEN3, 7525 - _MASKED_BIT_ENABLE(_3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE)); 7526 - 7527 - /* WaEnableChickenDCPR:cnl */ 7528 - intel_uncore_write(&dev_priv->uncore, GEN8_CHICKEN_DCPR_1, 7529 - intel_uncore_read(&dev_priv->uncore, GEN8_CHICKEN_DCPR_1) | MASK_WAKEMEM); 7530 - 7531 - /* 7532 - * WaFbcWakeMemOn:cnl 7533 - * Display WA #0859: cnl 7534 - */ 7535 - intel_uncore_write(&dev_priv->uncore, DISP_ARB_CTL, intel_uncore_read(&dev_priv->uncore, DISP_ARB_CTL) | 7536 - DISP_FBC_MEMORY_WAKE); 7537 - 7538 - val = intel_uncore_read(&dev_priv->uncore, SLICE_UNIT_LEVEL_CLKGATE); 7539 - /* ReadHitWriteOnlyDisable:cnl */ 7540 - val |= RCCUNIT_CLKGATE_DIS; 7541 - intel_uncore_write(&dev_priv->uncore, SLICE_UNIT_LEVEL_CLKGATE, val); 7542 - 7543 - /* Wa_2201832410:cnl */ 7544 - val = intel_uncore_read(&dev_priv->uncore, SUBSLICE_UNIT_LEVEL_CLKGATE); 7545 - val |= GWUNIT_CLKGATE_DIS; 7546 - intel_uncore_write(&dev_priv->uncore, SUBSLICE_UNIT_LEVEL_CLKGATE, val); 7547 - 7548 - /* WaDisableVFclkgate:cnl */ 7549 - /* WaVFUnitClockGatingDisable:cnl */ 7550 - val = intel_uncore_read(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE); 7551 - val |= VFUNIT_CLKGATE_DIS; 7552 - intel_uncore_write(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE, val); 7553 7398 } 7554 7399 7555 7400 static void cfl_init_clock_gating(struct drm_i915_private *dev_priv) ··· 7943 7862 dev_priv->display.init_clock_gating = gen12lp_init_clock_gating; 7944 7863 else if (GRAPHICS_VER(dev_priv) == 11) 7945 7864 dev_priv->display.init_clock_gating = icl_init_clock_gating; 7946 - else if (IS_CANNONLAKE(dev_priv)) 7947 - dev_priv->display.init_clock_gating = cnl_init_clock_gating; 7948 7865 else if (IS_COFFEELAKE(dev_priv) || IS_COMETLAKE(dev_priv)) 7949 7866 dev_priv->display.init_clock_gating = cfl_init_clock_gating; 7950 7867 else if (IS_SKYLAKE(dev_priv))
+9 -4
drivers/gpu/drm/i915/intel_sideband.c
··· 556 556 #undef COND 557 557 } 558 558 559 - void intel_pcode_init(struct drm_i915_private *i915) 559 + int intel_pcode_init(struct drm_i915_private *i915) 560 560 { 561 - int ret; 561 + int ret = 0; 562 562 563 563 if (!IS_DGFX(i915)) 564 - return; 564 + return ret; 565 565 566 566 ret = skl_pcode_request(i915, DG1_PCODE_STATUS, 567 567 DG1_UNCORE_GET_INIT_STATUS, 568 568 DG1_UNCORE_INIT_STATUS_COMPLETE, 569 - DG1_UNCORE_INIT_STATUS_COMPLETE, 50); 569 + DG1_UNCORE_INIT_STATUS_COMPLETE, 180000); 570 + 571 + drm_dbg(&i915->drm, "PCODE init status %d\n", ret); 572 + 570 573 if (ret) 571 574 drm_err(&i915->drm, "Pcode did not report uncore initialization completion!\n"); 575 + 576 + return ret; 572 577 }
+1 -1
drivers/gpu/drm/i915/intel_sideband.h
··· 138 138 int skl_pcode_request(struct drm_i915_private *i915, u32 mbox, u32 request, 139 139 u32 reply_mask, u32 reply, int timeout_base_ms); 140 140 141 - void intel_pcode_init(struct drm_i915_private *i915); 141 + int intel_pcode_init(struct drm_i915_private *i915); 142 142 143 143 #endif /* _INTEL_SIDEBAND_H */
+15
drivers/gpu/drm/i915/intel_step.c
··· 118 118 static const struct intel_step_info dg2_g11_revid_step_tbl[] = { 119 119 [0x0] = { .gt_step = STEP_A0, .display_step = STEP_B0 }, 120 120 [0x4] = { .gt_step = STEP_B0, .display_step = STEP_C0 }, 121 + [0x5] = { .gt_step = STEP_B1, .display_step = STEP_C0 }, 121 122 }; 122 123 123 124 void intel_step_init(struct drm_i915_private *i915) ··· 210 209 return; 211 210 212 211 RUNTIME_INFO(i915)->step = step; 212 + } 213 + 214 + #define STEP_NAME_CASE(name) \ 215 + case STEP_##name: \ 216 + return #name; 217 + 218 + const char *intel_step_name(enum intel_step step) 219 + { 220 + switch (step) { 221 + STEP_NAME_LIST(STEP_NAME_CASE); 222 + 223 + default: 224 + return "**"; 225 + } 213 226 }
+23 -15
drivers/gpu/drm/i915/intel_step.h
··· 15 15 u8 display_step; 16 16 }; 17 17 18 + #define STEP_ENUM_VAL(name) STEP_##name, 19 + 20 + #define STEP_NAME_LIST(func) \ 21 + func(A0) \ 22 + func(A1) \ 23 + func(A2) \ 24 + func(B0) \ 25 + func(B1) \ 26 + func(B2) \ 27 + func(C0) \ 28 + func(C1) \ 29 + func(D0) \ 30 + func(D1) \ 31 + func(E0) \ 32 + func(F0) \ 33 + func(G0) \ 34 + func(H0) \ 35 + func(I0) \ 36 + func(I1) \ 37 + func(J0) 38 + 18 39 /* 19 40 * Symbolic steppings that do not match the hardware. These are valid both as gt 20 41 * and display steppings as symbolic names. 21 42 */ 22 43 enum intel_step { 23 44 STEP_NONE = 0, 24 - STEP_A0, 25 - STEP_A1, 26 - STEP_A2, 27 - STEP_B0, 28 - STEP_B1, 29 - STEP_C0, 30 - STEP_D0, 31 - STEP_D1, 32 - STEP_E0, 33 - STEP_F0, 34 - STEP_G0, 35 - STEP_H0, 36 - STEP_I0, 37 - STEP_I1, 38 - STEP_J0, 45 + STEP_NAME_LIST(STEP_ENUM_VAL) 39 46 STEP_FUTURE, 40 47 STEP_FOREVER, 41 48 }; 42 49 43 50 void intel_step_init(struct drm_i915_private *i915); 51 + const char *intel_step_name(enum intel_step step); 44 52 45 53 #endif /* __INTEL_STEP_H__ */
+5 -5
drivers/gpu/drm/i915/intel_wopcm.c
··· 56 56 57 57 /* 24KB at the end of WOPCM is reserved for RC6 CTX on BXT. */ 58 58 #define BXT_WOPCM_RC6_CTX_RESERVED (SZ_16K + SZ_8K) 59 - /* 36KB WOPCM reserved at the end of WOPCM on CNL. */ 60 - #define CNL_WOPCM_HW_CTX_RESERVED (SZ_32K + SZ_4K) 59 + /* 36KB WOPCM reserved at the end of WOPCM on ICL. */ 60 + #define ICL_WOPCM_HW_CTX_RESERVED (SZ_32K + SZ_4K) 61 61 62 62 /* 128KB from GUC_WOPCM_RESERVED is reserved for FW on Gen9. */ 63 63 #define GEN9_GUC_FW_RESERVED SZ_128K ··· 93 93 { 94 94 if (IS_GEN9_LP(i915)) 95 95 return BXT_WOPCM_RC6_CTX_RESERVED; 96 - else if (GRAPHICS_VER(i915) >= 10) 97 - return CNL_WOPCM_HW_CTX_RESERVED; 96 + else if (GRAPHICS_VER(i915) >= 11) 97 + return ICL_WOPCM_HW_CTX_RESERVED; 98 98 else 99 99 return 0; 100 100 } ··· 126 126 u32 guc_wopcm_size, u32 huc_fw_size) 127 127 { 128 128 /* 129 - * On Gen9 & CNL A0, hardware requires the total available GuC WOPCM 129 + * On Gen9, hardware requires the total available GuC WOPCM 130 130 * size to be larger than or equal to HuC firmware size. Otherwise, 131 131 * firmware uploading would fail. 132 132 */