History

Merge tag 'drm-intel-next-2024-04-17-1' of https://anongit.freedesktop.org/git/drm/drm-intel into drm-next

Core Changes (DRM): - Fix documentation of DP tunnel functions (Imre) - DP MST read sideband messaging cap (Jani) - Preparation patches for Adaptive Sync SDP Support for DP (Mitul) Driver Changes: i915 core (non-display): - Documentation improvements (Nirmoy) - Add includes for BUG_ON/BUILD_BUG_ON in i915_memcpy.c (Joonas) - Do not print 'pxp init failed with 0' when it succeed (Jose) - Clean-up, including removal of dead code for unsupported platforms (Lucas) - Adding new DG2 PCI ID (Ravi) {i915,xe} display: - Spelling fix (Colin Ian) - Document CDCLK components (Gustavo) - Lunar Lake display enabling, including cdclk and other refactors (Gustavo, Bala) - BIOS/VBT/opregion related refactor (Jani, Ville, RK) - Save a few bytes of memory using {kstrdup,kfree}_const variant (Christophe) - Digital port related refactor/clean-up (Ville) - Fix 2s boot time regression on DP panel replay init (Animesh) - Remove redundant drm_rect_visible() overlay use (Arthur) - DSC HW state readout fixes (Imre) - Remove duplication on audio enable/disable on SDVO and g4x+ DP (Ville) - Disable AuxCCS framebuffers if built for Xe (Juha-Pekka) - Fix DSI init order (Ville) - DRRS related refactor and fixes (Bhanuprakash) - Fix DSB vblank waits with VRR (Ville) - General improvements on register name and use of REG_BIT (Ville) - Some display power well related improvements (Ville) - FBC changes for better w/a handling (Ville) - Make crtc disable more atomic (Ville) - Fix hwmon locking inversion in sysfs getter (Janusz) - Increase DP idle pattern wait timeout to 2ms (Shekhar) - PSR related fixes and improvents (Jouni) - Start using container_of_const() for some extra const safety (Ville) - Use drm_printer more on display code (Ville) - Fix Jasper Lake boot freeze (Jonathon) - Update Pipe src size check in skl_update_scaler (Ankit) - Enable MST mode for 128b/132b single-stream sideband (Jani) - Pass encoder around more for port/phy checks (Jani) - Some initial work to make display code more independent from i915 (Jani) - Pre-populate the cursor physical dma address (Ville) - Do not bump min backlight brightness to max on enable (Gareth) - Fix MTL supported DP rates - removal of UHBR13.5 (Arun) - Fix the computation for compressed_bpp for DISPLAY < 1 (Ankit) - Bigjoiner modeset sequence redesign and MST support (Ville) - Enable Adaptive Sync SDP Support for DP (Mitul) - Implemnt vblank sycnhronized mbus joining changes (Ville, Stanislav) - HDCP related fixes (Suraj) - Fix i915_display_info debugfs when connectors are not active (Ville) - Clean up on Xe compat layer (Jani) - Add jitter WAs for MST/FEC/DSC links (Imre) - DMC wakelock implementation (Luca) Signed-off-by: Dave Airlie <airlied@redhat.com> # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmYfzQEACgkQ+mJfZA7r # E8qYvAf/T8KrEewHOWz7NOaKcFRCNYaF4QTdVOfgHUYBX5NPDF/xzwFdHCL8QWQu # bwKwE2b94VEyruG3DYwTMd8GNcDxrsOrmU0IZe3PVkm+BvHLTmrOqL6BlCd85zXF # 02IuE+LCaWREmmpLMcsDMxsaaq8yp+cw9/F0jJDrH6LiyfxFriefxyZYpGYjRCuv # 8GP1fHXLFV2yys4rveR/+y9xIhgy82mVcg3/Kfk0+er7gALkY6Vc0N38wedET9MZ # ZPfVidBeaTkIKcCDFKnFzGjG+9rNQ7NFrXyS7Hl97VolGt2l03qGGPNW1PouDiUx # 7Y8CJOc+1k9wyBMKl0a/NQBRAqSZBQ== # =JvZN # -----END PGP SIGNATURE----- # gpg: Signature made Wed 17 Apr 2024 23:22:09 AEST # gpg: using RSA key 6D207068EEDD65091C2CE2A3FA625F640EEB13CA # gpg: Good signature from "Rodrigo Vivi <rodrigo.vivi@intel.com>" [unknown] # gpg: aka "Rodrigo Vivi <rodrigo.vivi@gmail.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6D20 7068 EEDD 6509 1C2C E2A3 FA62 5F64 0EEB 13CA From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Zh_Q72gYKMMbge9A@intel.com

Dave Airlie committed 2 years ago

Commit fad3dad2 parents 3463315 700c340140 files · +3622 −2989Browse files

Unified · Split

140 files
  1. Documentation/gpu/i915.rst +9 −0
  2. Documentation/gpu/rfc/i915_vm_bind.h +5 −6
  3. drivers/gpu/drm/display/drm_dp_helper.c +37 −0
  4. drivers/gpu/drm/display/drm_dp_mst_topology.c +13 −7
  5. drivers/gpu/drm/display/drm_dp_tunnel.c +4 −3
  6. drivers/gpu/drm/i915/Makefile +1 −5
  7. drivers/gpu/drm/i915/display/icl_dsi.c +1 −2
  8. drivers/gpu/drm/i915/display/intel_atomic.c +1 −1
  9. drivers/gpu/drm/i915/display/intel_backlight.c +5 −5
  10. drivers/gpu/drm/i915/display/intel_bios.c +136 −62
  11. drivers/gpu/drm/i915/display/intel_bw.h +2 −1
  12. drivers/gpu/drm/i915/display/intel_cdclk.c +167 −75
  13. drivers/gpu/drm/i915/display/intel_cdclk.h +13 −2
  14. drivers/gpu/drm/i915/display/intel_combo_phy_regs.h +60 −57
  15. drivers/gpu/drm/i915/display/intel_crt.c +1 −4
  16. drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +167 −186
  17. drivers/gpu/drm/i915/display/intel_cursor.c +23 −1
  18. drivers/gpu/drm/i915/display/intel_cx0_phy.c +186 −183
  19. drivers/gpu/drm/i915/display/intel_cx0_phy.h +1 −2
  20. drivers/gpu/drm/i915/display/intel_ddi.c +111 −113
  21. drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c +7 −11
  22. drivers/gpu/drm/i915/display/intel_de.h +99 −18
  23. drivers/gpu/drm/i915/display/intel_display.c +418 −255
  24. drivers/gpu/drm/i915/display/intel_display.h +22 −0
  25. drivers/gpu/drm/i915/display/intel_display_core.h +14 −0
  26. drivers/gpu/drm/i915/display/intel_display_debugfs.c +8 −79
  27. drivers/gpu/drm/i915/display/intel_display_device.c +5 −0
  28. drivers/gpu/drm/i915/display/intel_display_device.h +2 −0
  29. drivers/gpu/drm/i915/display/intel_display_driver.c +1 −0
  30. drivers/gpu/drm/i915/display/intel_display_irq.c +29 −28
  31. drivers/gpu/drm/i915/display/intel_display_params.c +5 −0
  32. drivers/gpu/drm/i915/display/intel_display_params.h +1 −0
  33. drivers/gpu/drm/i915/display/intel_display_power_well.c +37 −36
  34. drivers/gpu/drm/i915/display/intel_display_types.h +17 −4
  35. drivers/gpu/drm/i915/display/intel_display_wa.c +0 −8
  36. drivers/gpu/drm/i915/display/intel_dmc.c +15 −2
  37. drivers/gpu/drm/i915/display/intel_dmc_regs.h +6 −0
  38. drivers/gpu/drm/i915/display/intel_dmc_wl.c +262 −0
  39. drivers/gpu/drm/i915/display/intel_dmc_wl.h +31 −0
  40. drivers/gpu/drm/i915/display/intel_dp.c +243 −67
  41. drivers/gpu/drm/i915/display/intel_dp.h +4 −1
  42. drivers/gpu/drm/i915/display/intel_dp_aux.c +10 −5
  43. drivers/gpu/drm/i915/display/intel_dp_aux.h +1 −0
  44. drivers/gpu/drm/i915/display/intel_dp_hdcp.c +11 −11
  45. drivers/gpu/drm/i915/display/intel_dp_mst.c +96 −46
  46. drivers/gpu/drm/i915/display/intel_dp_tunnel.c +1 −1
  47. drivers/gpu/drm/i915/display/intel_dpio_phy.c +2 −5
  48. drivers/gpu/drm/i915/display/intel_dpll_mgr.c +54 −73
  49. drivers/gpu/drm/i915/display/intel_dpll_mgr.h +2 −0
  50. drivers/gpu/drm/i915/display/intel_dsb.c +3 −2
  51. drivers/gpu/drm/i915/display/intel_dsi.c +1 −4
  52. drivers/gpu/drm/i915/display/intel_dvo.c +1 −4
  53. drivers/gpu/drm/i915/display/intel_fb.c +3 −3
  54. drivers/gpu/drm/i915/display/intel_fbc.c +29 −3
  55. drivers/gpu/drm/i915/display/intel_fbdev.c +5 −0
  56. drivers/gpu/drm/i915/display/intel_fixed.h +0 −0
  57. drivers/gpu/drm/i915/display/intel_gmbus.c +1 −1
  58. drivers/gpu/drm/i915/display/intel_hdcp.c +3 −3
  59. drivers/gpu/drm/i915/display/intel_hdmi.c +56 −40
  60. drivers/gpu/drm/i915/display/intel_hotplug_irq.c +1 −1
  61. drivers/gpu/drm/i915/display/intel_lvds.c +1 −4
  62. drivers/gpu/drm/i915/display/intel_opregion.c +11 −47
  63. drivers/gpu/drm/i915/display/intel_opregion.h +6 −0
  64. drivers/gpu/drm/i915/display/intel_overlay.c +4 −3
  65. drivers/gpu/drm/i915/display/intel_pmdemand.c +4 −10
  66. drivers/gpu/drm/i915/display/intel_pmdemand.h +2 −3
  67. drivers/gpu/drm/i915/display/intel_pps.c +32 −2
  68. drivers/gpu/drm/i915/display/intel_pps.h +2 −0
  69. drivers/gpu/drm/i915/display/intel_psr.c +430 −103
  70. drivers/gpu/drm/i915/display/intel_psr.h +5 −0
  71. drivers/gpu/drm/i915/display/intel_psr_regs.h +8 −4
  72. drivers/gpu/drm/i915/display/intel_sdvo.c +3 −6
  73. drivers/gpu/drm/i915/display/intel_snps_phy.c +9 −7
  74. drivers/gpu/drm/i915/display/intel_snps_phy.h +2 −2
  75. drivers/gpu/drm/i915/display/intel_tc.c +10 −23
  76. drivers/gpu/drm/i915/display/intel_tv.c +3 −5
  77. drivers/gpu/drm/i915/display/intel_vbt_defs.h +19 −17
  78. drivers/gpu/drm/i915/display/intel_vrr.c +38 −2
  79. drivers/gpu/drm/i915/display/skl_scaler.c +4 −3
  80. drivers/gpu/drm/i915/display/skl_watermark.c +225 −95
  81. drivers/gpu/drm/i915/display/skl_watermark.h +11 −2
  82. drivers/gpu/drm/i915/display/skl_watermark_regs.h +10 −8
  83. drivers/gpu/drm/i915/display/vlv_dsi.c +1 −2
  84. drivers/gpu/drm/i915/gem/i915_gem_object_types.h +1 −1
  85. drivers/gpu/drm/i915/gem/selftests/huge_pages.c +2 −2
  86. drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +4 −4
  87. drivers/gpu/drm/i915/gt/gen8_engine_cs.c +1 −4
  88. drivers/gpu/drm/i915/gt/gen8_ppgtt.c +20 −20
  89. drivers/gpu/drm/i915/gt/intel_engine_cs.c +4 −39
  90. drivers/gpu/drm/i915/gt/intel_execlists_submission.c +5 −5
  91. drivers/gpu/drm/i915/gt/intel_gsc.c +0 −15
  92. drivers/gpu/drm/i915/gt/intel_gt.c +2 −2
  93. drivers/gpu/drm/i915/gt/intel_gt_mcr.c +4 −48
  94. drivers/gpu/drm/i915/gt/intel_gt_mcr.h +1 −1
  95. drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c +0 −4
  96. drivers/gpu/drm/i915/gt/intel_gt_regs.h +0 −59
  97. drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c +6 −15
  98. drivers/gpu/drm/i915/gt/intel_gtt.c +1 −1
  99. drivers/gpu/drm/i915/gt/intel_lrc.c +4 −47
  100. drivers/gpu/drm/i915/gt/intel_migrate.c +11 −11
  101. drivers/gpu/drm/i915/gt/intel_mocs.c +1 −51
  102. drivers/gpu/drm/i915/gt/intel_rps.c +1 −5
  103. drivers/gpu/drm/i915/gt/intel_sseu.c +4 −9
  104. drivers/gpu/drm/i915/gt/intel_workarounds.c +4 −179
  105. drivers/gpu/drm/i915/gt/uc/intel_guc.c +2 −6
  106. drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +2 −2
  107. drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c +1 −1
  108. drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 −1
  109. drivers/gpu/drm/i915/gt/uc/intel_uc.c +0 −4
  110. drivers/gpu/drm/i915/i915_debugfs.c +0 −12
  111. drivers/gpu/drm/i915/i915_drv.h +1 −25
  112. drivers/gpu/drm/i915/i915_getparam.c +2 −2
  113. drivers/gpu/drm/i915/i915_gpu_error.c +2 −3
  114. drivers/gpu/drm/i915/i915_hwmon.c +0 −6
  115. drivers/gpu/drm/i915/i915_irq.c +4 −4
  116. drivers/gpu/drm/i915/i915_pci.c +7 −59
  117. drivers/gpu/drm/i915/i915_perf.c +9 −10
  118. drivers/gpu/drm/i915/i915_query.c +1 −1
  119. drivers/gpu/drm/i915/i915_reg.h +30 −13
  120. drivers/gpu/drm/i915/i915_utils.h +0 −14
  121. drivers/gpu/drm/i915/intel_clock_gating.c +1 −58
  122. drivers/gpu/drm/i915/intel_device_info.c +0 −2
  123. drivers/gpu/drm/i915/intel_device_info.h +0 −2
  124. drivers/gpu/drm/i915/intel_step.c +1 −79
  125. drivers/gpu/drm/i915/intel_uncore.c +109 −271
  126. drivers/gpu/drm/i915/selftests/intel_uncore.c +0 −3
  127. drivers/gpu/drm/nouveau/nouveau_dp.c +1 −1
  128. drivers/gpu/drm/xe/Makefile +1 −3
  129. drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h +0 −40
  130. drivers/gpu/drm/xe/compat-i915-headers/i915_fixed.h +0 −6
  131. drivers/gpu/drm/xe/compat-i915-headers/i915_gem.h +0 −9
  132. drivers/gpu/drm/xe/compat-i915-headers/i915_vgpu.h +0 −26
  133. drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h +0 −11
  134. drivers/gpu/drm/xe/xe_device_types.h +2 −14
  135. drivers/gpu/drm/xe/xe_pci.c +1 −0
  136. include/drm/display/drm_dp.h +11 −0
  137. include/drm/display/drm_dp_helper.h +30 −0
  138. include/drm/display/drm_dp_mst_helper.h +22 −1
  139. include/drm/i915_pciids.h +3 −1
  140. include/uapi/drm/i915_drm.h +13 −3
Documentation/gpu/i915.rst+9−0
@@ -204,6 +204,15 @@ DMC Firmware Support · 203 unmodified lines
204204 .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc.c
205205 :internal:
206206
207+DMC wakelock support
208+--------------------
209+
210+.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc_wl.c
211+ :doc: DMC wakelock support
212+
213+.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc_wl.c
214+ :internal:
215+
207216 Video BIOS Table (VBT)
208217 ----------------------
209218
Documentation/gpu/rfc/i915_vm_bind.h+5−6
@@ -93,12 +93,11 @@ struct drm_i915_gem_timeline_fence { · 92 unmodified lines
9393 * Multiple VA mappings can be created to the same section of the object
9494 * (aliasing).
9595 *
96− * The @start, @offset and @length must be 4K page aligned. However the DG2
97− * and XEHPSDV has 64K page size for device local memory and has compact page
98− * table. On those platforms, for binding device local-memory objects, the
99− * @start, @offset and @length must be 64K aligned. Also, UMDs should not mix
100− * the local memory 64K page and the system memory 4K page bindings in the same
101− * 2M range.
96+ * The @start, @offset and @length must be 4K page aligned. However the DG2 has
97+ * 64K page size for device local memory and has compact page table. On that
98+ * platform, for binding device local-memory objects, the @start, @offset and
99+ * @length must be 64K aligned. Also, UMDs should not mix the local memory 64K
100+ * page and the system memory 4K page bindings in the same 2M range.
102101 *
103102 * Error code -EINVAL will be returned if @start, @offset and @length are not
104103 * properly aligned. In version 1 (See I915_PARAM_VM_BIND_VERSION), error code
drivers/gpu/drm/display/drm_dp_helper.c+37−0
@@ -2948,6 +2948,43 @@ void drm_dp_vsc_sdp_log(struct drm_printer *p, const struct drm_dp_vsc_sdp *vsc) · 2947 unmodified lines
29482948 }
29492949 EXPORT_SYMBOL(drm_dp_vsc_sdp_log);
29502950
2951+void drm_dp_as_sdp_log(struct drm_printer *p, const struct drm_dp_as_sdp *as_sdp)
2952+{
2953+ drm_printf(p, "DP SDP: AS_SDP, revision %u, length %u\n",
2954+ as_sdp->revision, as_sdp->length);
2955+ drm_printf(p, " vtotal: %d\n", as_sdp->vtotal);
2956+ drm_printf(p, " target_rr: %d\n", as_sdp->target_rr);
2957+ drm_printf(p, " duration_incr_ms: %d\n", as_sdp->duration_incr_ms);
2958+ drm_printf(p, " duration_decr_ms: %d\n", as_sdp->duration_decr_ms);
2959+ drm_printf(p, " operation_mode: %d\n", as_sdp->mode);
2960+}
2961+EXPORT_SYMBOL(drm_dp_as_sdp_log);
2962+
2963+/**
2964+ * drm_dp_as_sdp_supported() - check if adaptive sync sdp is supported
2965+ * @aux: DisplayPort AUX channel
2966+ * @dpcd: DisplayPort configuration data
2967+ *
2968+ * Returns true if adaptive sync sdp is supported, else returns false
2969+ */
2970+bool drm_dp_as_sdp_supported(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE])
2971+{
2972+ u8 rx_feature;
2973+
2974+ if (dpcd[DP_DPCD_REV] < DP_DPCD_REV_13)
2975+ return false;
2976+
2977+ if (drm_dp_dpcd_readb(aux, DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1,
2978+ &rx_feature) != 1) {
2979+ drm_dbg_dp(aux->drm_dev,
2980+ "Failed to read DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1\n");
2981+ return false;
2982+ }
2983+
2984+ return (rx_feature & DP_ADAPTIVE_SYNC_SDP_SUPPORTED);
2985+}
2986+EXPORT_SYMBOL(drm_dp_as_sdp_supported);
2987+
29512988 /**
29522989 * drm_dp_vsc_sdp_supported() - check if vsc sdp is supported
29532990 * @aux: DisplayPort AUX channel
drivers/gpu/drm/display/drm_dp_mst_topology.c+13−7
@@ -3608,24 +3608,30 @@ fixed20_12 drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr, · 3607 unmodified lines
36083608 EXPORT_SYMBOL(drm_dp_get_vc_payload_bw);
36093609
36103610 /**
3611− * drm_dp_read_mst_cap() - check whether or not a sink supports MST
3611+ * drm_dp_read_mst_cap() - Read the sink's MST mode capability
36123612 * @aux: The DP AUX channel to use
36133613 * @dpcd: A cached copy of the DPCD capabilities for this sink
36143614 *
3615− * Returns: %True if the sink supports MST, %false otherwise
3615+ * Returns: enum drm_dp_mst_mode to indicate MST mode capability
36163616 */
3617−bool drm_dp_read_mst_cap(struct drm_dp_aux *aux,
3618− const u8 dpcd[DP_RECEIVER_CAP_SIZE])
3617+enum drm_dp_mst_mode drm_dp_read_mst_cap(struct drm_dp_aux *aux,
3618+ const u8 dpcd[DP_RECEIVER_CAP_SIZE])
36193619 {
36203620 u8 mstm_cap;
36213621
36223622 if (dpcd[DP_DPCD_REV] < DP_DPCD_REV_12)
3623− return false;
3623+ return DRM_DP_SST;
36243624
36253625 if (drm_dp_dpcd_readb(aux, DP_MSTM_CAP, &mstm_cap) != 1)
3626− return false;
3626+ return DRM_DP_SST;
3627+
3628+ if (mstm_cap & DP_MST_CAP)
3629+ return DRM_DP_MST;
3630+
3631+ if (mstm_cap & DP_SINGLE_STREAM_SIDEBAND_MSG)
3632+ return DRM_DP_SST_SIDEBAND_MSG;
36273633
3628− return mstm_cap & DP_MST_CAP;
3634+ return DRM_DP_SST;
36293635 }
36303636 EXPORT_SYMBOL(drm_dp_read_mst_cap);
36313637
drivers/gpu/drm/display/drm_dp_tunnel.c+4−3
@@ -436,8 +436,8 @@ EXPORT_SYMBOL(drm_dp_tunnel_get); · 435 unmodified lines
436436
437437 /**
438438 * drm_dp_tunnel_put - Put a reference for a DP tunnel
439− * @tunnel - Tunnel object
440− * @tracker - Debug tracker for the reference
439+ * @tunnel: Tunnel object
440+ * @tracker: Debug tracker for the reference
441441 *
442442 * Put a reference for @tunnel along with its debug *@tracker, which
443443 * was obtained with drm_dp_tunnel_get().
@@ -1170,7 +1170,7 @@ int drm_dp_tunnel_alloc_bw(struct drm_dp_tunnel *tunnel, int bw) · 726 unmodified lines
11701170 EXPORT_SYMBOL(drm_dp_tunnel_alloc_bw);
11711171
11721172 /**
1173− * drm_dp_tunnel_atomic_get_allocated_bw - Get the BW allocated for a DP tunnel
1173+ * drm_dp_tunnel_get_allocated_bw - Get the BW allocated for a DP tunnel
11741174 * @tunnel: Tunnel object
11751175 *
11761176 * Get the current BW allocated for @tunnel. After the tunnel is created /
@@ -1892,6 +1892,7 @@ static void destroy_mgr(struct drm_dp_tunnel_mgr *mgr) · 715 unmodified lines
18921892 /**
18931893 * drm_dp_tunnel_mgr_create - Create a DP tunnel manager
18941894 * @dev: DRM device object
1895+ * @max_group_count: Maximum number of tunnel groups
18951896 *
18961897 * Creates a DP tunnel manager for @dev.
18971898 *
drivers/gpu/drm/i915/Makefile+1−5
@@ -32,11 +32,6 @@ endif · 31 unmodified lines
3232 # Enable -Werror in CI and development
3333 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
3434
35−# Fine grained warnings disable
36−CFLAGS_i915_pci.o = -Wno-override-init
37−CFLAGS_display/intel_display_device.o = -Wno-override-init
38−CFLAGS_display/intel_fbdev.o = -Wno-override-init
39−
4035 # Support compiling the display code separately for both i915 and xe
4136 # drivers. Define I915 when building i915.
4237 subdir-ccflags-y += -DI915
@@ -270,6 +265,7 @@ i915-y += \ · 227 unmodified lines
270265 display/intel_display_rps.o \
271266 display/intel_display_wa.o \
272267 display/intel_dmc.o \
268+ display/intel_dmc_wl.o \
273269 display/intel_dpio_phy.o \
274270 display/intel_dpll.o \
275271 display/intel_dpll_mgr.o \
drivers/gpu/drm/i915/display/icl_dsi.c+1−2
@@ -1616,8 +1616,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, · 1615 unmodified lines
16161616 struct drm_connector_state *conn_state)
16171617 {
16181618 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1619− struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
1620− base);
1619+ struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
16211620 struct intel_connector *intel_connector = intel_dsi->attached_connector;
16221621 struct drm_display_mode *adjusted_mode =
16231622 &pipe_config->hw.adjusted_mode;
drivers/gpu/drm/i915/display/intel_atomic.c+1−1
@@ -62,7 +62,7 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector, · 61 unmodified lines
6262 {
6363 struct drm_device *dev = connector->dev;
6464 struct drm_i915_private *dev_priv = to_i915(dev);
65− struct intel_digital_connector_state *intel_conn_state =
65+ const struct intel_digital_connector_state *intel_conn_state =
6666 to_intel_digital_connector_state(state);
6767
6868 if (property == dev_priv->display.properties.force_audio)
drivers/gpu/drm/i915/display/intel_backlight.c+5−5
@@ -761,8 +761,8 @@ static void __intel_backlight_enable(const struct intel_crtc_state *crtc_state, · 760 unmodified lines
761761
762762 WARN_ON(panel->backlight.max == 0);
763763
764− if (panel->backlight.level <= panel->backlight.min) {
765− panel->backlight.level = panel->backlight.max;
764+ if (panel->backlight.level < panel->backlight.min) {
765+ panel->backlight.level = panel->backlight.min;
766766 if (panel->backlight.device)
767767 panel->backlight.device->props.brightness =
768768 scale_hw_to_user(connector,
@@ -949,7 +949,7 @@ int intel_backlight_device_register(struct intel_connector *connector) · 180 unmodified lines
949949 else
950950 props.power = FB_BLANK_POWERDOWN;
951951
952− name = kstrdup("intel_backlight", GFP_KERNEL);
952+ name = kstrdup_const("intel_backlight", GFP_KERNEL);
953953 if (!name)
954954 return -ENOMEM;
955955
@@ -963,7 +963,7 @@ int intel_backlight_device_register(struct intel_connector *connector) · 7 unmodified lines
963963 * compatibility. Use unique names for subsequent backlight devices as a
964964 * fallback when the default name already exists.
965965 */
966− kfree(name);
966+ kfree_const(name);
967967 name = kasprintf(GFP_KERNEL, "card%d-%s-backlight",
968968 i915->drm.primary->index, connector->base.name);
969969 if (!name)
@@ -987,7 +987,7 @@ int intel_backlight_device_register(struct intel_connector *connector) · 17 unmodified lines
987987 connector->base.base.id, connector->base.name, name);
988988
989989 out:
990− kfree(name);
990+ kfree_const(name);
991991
992992 return ret;
993993 }
drivers/gpu/drm/i915/display/intel_bios.c+136−62
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 *
2626 */
2727
28+#include <linux/firmware.h>
29+
2830 #include <drm/display/drm_dp_helper.h>
2931 #include <drm/display/drm_dsc_helper.h>
3032 #include <drm/drm_edid.h>
@@ -2730,6 +2732,57 @@ static void parse_ddi_ports(struct drm_i915_private *i915) · 2699 unmodified lines
27302732 print_ddi_port(devdata);
27312733 }
27322734
2735+static int child_device_expected_size(u16 version)
2736+{
2737+ BUILD_BUG_ON(sizeof(struct child_device_config) < 40);
2738+
2739+ if (version > 256)
2740+ return -ENOENT;
2741+ else if (version >= 256)
2742+ return 40;
2743+ else if (version >= 216)
2744+ return 39;
2745+ else if (version >= 196)
2746+ return 38;
2747+ else if (version >= 195)
2748+ return 37;
2749+ else if (version >= 111)
2750+ return LEGACY_CHILD_DEVICE_CONFIG_SIZE;
2751+ else if (version >= 106)
2752+ return 27;
2753+ else
2754+ return 22;
2755+}
2756+
2757+static bool child_device_size_valid(struct drm_i915_private *i915, int size)
2758+{
2759+ int expected_size;
2760+
2761+ expected_size = child_device_expected_size(i915->display.vbt.version);
2762+ if (expected_size < 0) {
2763+ expected_size = sizeof(struct child_device_config);
2764+ drm_dbg(&i915->drm,
2765+ "Expected child device config size for VBT version %u not known; assuming %d\n",
2766+ i915->display.vbt.version, expected_size);
2767+ }
2768+
2769+ /* Flag an error for unexpected size, but continue anyway. */
2770+ if (size != expected_size)
2771+ drm_err(&i915->drm,
2772+ "Unexpected child device config size %d (expected %d for VBT version %u)\n",
2773+ size, expected_size, i915->display.vbt.version);
2774+
2775+ /* The legacy sized child device config is the minimum we need. */
2776+ if (size < LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
2777+ drm_dbg_kms(&i915->drm,
2778+ "Child device config size %d is too small.\n",
2779+ size);
2780+ return false;
2781+ }
2782+
2783+ return true;
2784+}
2785+
27332786 static void
27342787 parse_general_definitions(struct drm_i915_private *i915)
27352788 {
@@ -2737,7 +2790,6 @@ parse_general_definitions(struct drm_i915_private *i915) · 1 unmodified line
27372790 struct intel_bios_encoder_data *devdata;
27382791 const struct child_device_config *child;
27392792 int i, child_device_num;
2740− u8 expected_size;
27412793 u16 block_size;
27422794 int bus_pin;
27432795
@@ -2761,39 +2813,8 @@ parse_general_definitions(struct drm_i915_private *i915) · 17 unmodified lines
27612813 if (intel_gmbus_is_valid_pin(i915, bus_pin))
27622814 i915->display.vbt.crt_ddc_pin = bus_pin;
27632815
2764− if (i915->display.vbt.version < 106) {
2765− expected_size = 22;
2766− } else if (i915->display.vbt.version < 111) {
2767− expected_size = 27;
2768− } else if (i915->display.vbt.version < 195) {
2769− expected_size = LEGACY_CHILD_DEVICE_CONFIG_SIZE;
2770− } else if (i915->display.vbt.version == 195) {
2771− expected_size = 37;
2772− } else if (i915->display.vbt.version <= 215) {
2773− expected_size = 38;
2774− } else if (i915->display.vbt.version <= 250) {
2775− expected_size = 39;
2776− } else {
2777− expected_size = sizeof(*child);
2778− BUILD_BUG_ON(sizeof(*child) < 39);
2779− drm_dbg(&i915->drm,
2780− "Expected child device config size for VBT version %u not known; assuming %u\n",
2781− i915->display.vbt.version, expected_size);
2782− }
2783−
2784− /* Flag an error for unexpected size, but continue anyway. */
2785− if (defs->child_dev_size != expected_size)
2786− drm_err(&i915->drm,
2787− "Unexpected child device config size %u (expected %u for VBT version %u)\n",
2788− defs->child_dev_size, expected_size, i915->display.vbt.version);
2789−
2790− /* The legacy sized child device config is the minimum we need. */
2791− if (defs->child_dev_size < LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
2792− drm_dbg_kms(&i915->drm,
2793− "Child device config size %u is too small.\n",
2794− defs->child_dev_size);
2816+ if (!child_device_size_valid(i915, defs->child_dev_size))
27952817 return;
2796− }
27972818
27982819 /* get the number of child device */
27992820 child_device_num = (block_size - sizeof(*defs)) / defs->child_dev_size;
@@ -2869,9 +2890,8 @@ init_vbt_panel_defaults(struct intel_panel *panel) · 69 unmodified lines
28692890 static void
28702891 init_vbt_missing_defaults(struct drm_i915_private *i915)
28712892 {
2893+ unsigned int ports = DISPLAY_RUNTIME_INFO(i915)->port_mask;
28722894 enum port port;
2873− int ports = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) |
2874− BIT(PORT_D) | BIT(PORT_E) | BIT(PORT_F);
28752895
28762896 if (!HAS_DDI(i915) && !IS_CHERRYVIEW(i915))
28772897 return;
@@ -2981,6 +3001,43 @@ bool intel_bios_is_valid_vbt(struct drm_i915_private *i915, · 103 unmodified lines
29813001 return vbt;
29823002 }
29833003
3004+static struct vbt_header *firmware_get_vbt(struct drm_i915_private *i915,
3005+ size_t *size)
3006+{
3007+ struct vbt_header *vbt = NULL;
3008+ const struct firmware *fw = NULL;
3009+ const char *name = i915->display.params.vbt_firmware;
3010+ int ret;
3011+
3012+ if (!name || !*name)
3013+ return NULL;
3014+
3015+ ret = request_firmware(&fw, name, i915->drm.dev);
3016+ if (ret) {
3017+ drm_err(&i915->drm,
3018+ "Requesting VBT firmware \"%s\" failed (%d)\n",
3019+ name, ret);
3020+ return NULL;
3021+ }
3022+
3023+ if (intel_bios_is_valid_vbt(i915, fw->data, fw->size)) {
3024+ vbt = kmemdup(fw->data, fw->size, GFP_KERNEL);
3025+ if (vbt) {
3026+ drm_dbg_kms(&i915->drm,
3027+ "Found valid VBT firmware \"%s\"\n", name);
3028+ if (size)
3029+ *size = fw->size;
3030+ }
3031+ } else {
3032+ drm_dbg_kms(&i915->drm, "Invalid VBT firmware \"%s\"\n",
3033+ name);
3034+ }
3035+
3036+ release_firmware(fw);
3037+
3038+ return vbt;
3039+}
3040+
29843041 static u32 intel_spi_read(struct intel_uncore *uncore, u32 offset)
29853042 {
29863043 intel_uncore_write(uncore, PRIMARY_SPI_ADDRESS, offset);
@@ -2988,7 +3045,8 @@ static u32 intel_spi_read(struct intel_uncore *uncore, u32 offset) · 1 unmodified line
29883045 return intel_uncore_read(uncore, PRIMARY_SPI_TRIGGER);
29893046 }
29903047
2991−static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *i915)
3048+static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *i915,
3049+ size_t *size)
29923050 {
29933051 u32 count, data, found, store = 0;
29943052 u32 static_region, oprom_offset;
@@ -3031,6 +3089,9 @@ static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *i915) · 36 unmodified lines
30313089
30323090 drm_dbg_kms(&i915->drm, "Found valid VBT in SPI flash\n");
30333091
3092+ if (size)
3093+ *size = vbt_size;
3094+
30343095 return (struct vbt_header *)vbt;
30353096
30363097 err_free_vbt:
@@ -3039,7 +3100,8 @@ err_not_found: · 2 unmodified lines
30393100 return NULL;
30403101 }
30413102
3042−static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915)
3103+static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915,
3104+ size_t *sizep)
30433105 {
30443106 struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
30453107 void __iomem *p = NULL, *oprom;
@@ -3088,6 +3150,9 @@ static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915) · 42 unmodified lines
30883150
30893151 pci_unmap_rom(pdev, oprom);
30903152
3153+ if (sizep)
3154+ *sizep = vbt_size;
3155+
30913156 drm_dbg_kms(&i915->drm, "Found valid VBT in PCI ROM\n");
30923157
30933158 return vbt;
@@ -3100,6 +3165,32 @@ err_unmap_oprom: · 6 unmodified lines
31003165 return NULL;
31013166 }
31023167
3168+static const struct vbt_header *intel_bios_get_vbt(struct drm_i915_private *i915,
3169+ size_t *sizep)
3170+{
3171+ const struct vbt_header *vbt = NULL;
3172+ intel_wakeref_t wakeref;
3173+
3174+ vbt = firmware_get_vbt(i915, sizep);
3175+
3176+ if (!vbt)
3177+ vbt = intel_opregion_get_vbt(i915, sizep);
3178+
3179+ /*
3180+ * If the OpRegion does not have VBT, look in SPI flash
3181+ * through MMIO or PCI mapping
3182+ */
3183+ if (!vbt && IS_DGFX(i915))
3184+ with_intel_runtime_pm(&i915->runtime_pm, wakeref)
3185+ vbt = spi_oprom_get_vbt(i915, sizep);
3186+
3187+ if (!vbt)
3188+ with_intel_runtime_pm(&i915->runtime_pm, wakeref)
3189+ vbt = oprom_get_vbt(i915, sizep);
3190+
3191+ return vbt;
3192+}
3193+
31033194 /**
31043195 * intel_bios_init - find VBT and initialize settings from the BIOS
31053196 * @i915: i915 device instance
@@ -3111,7 +3202,6 @@ err_unmap_oprom: · 5 unmodified lines
31113202 void intel_bios_init(struct drm_i915_private *i915)
31123203 {
31133204 const struct vbt_header *vbt;
3114− struct vbt_header *oprom_vbt = NULL;
31153205 const struct bdb_header *bdb;
31163206
31173207 INIT_LIST_HEAD(&i915->display.vbt.display_devices);
@@ -3125,21 +3215,7 @@ void intel_bios_init(struct drm_i915_private *i915) · 7 unmodified lines
31253215
31263216 init_vbt_defaults(i915);
31273217
3128− vbt = intel_opregion_get_vbt(i915, NULL);
3129−
3130− /*
3131− * If the OpRegion does not have VBT, look in SPI flash through MMIO or
3132− * PCI mapping
3133− */
3134− if (!vbt && IS_DGFX(i915)) {
3135− oprom_vbt = spi_oprom_get_vbt(i915);
3136− vbt = oprom_vbt;
3137− }
3138−
3139− if (!vbt) {
3140− oprom_vbt = oprom_get_vbt(i915);
3141− vbt = oprom_vbt;
3142− }
3218+ vbt = intel_bios_get_vbt(i915, NULL);
31433219
31443220 if (!vbt)
31453221 goto out;
@@ -3172,7 +3248,7 @@ out: · 26 unmodified lines
31723248 parse_sdvo_device_mapping(i915);
31733249 parse_ddi_ports(i915);
31743250
3175− kfree(oprom_vbt);
3251+ kfree(vbt);
31763252 }
31773253
31783254 static void intel_bios_init_panel(struct drm_i915_private *i915,
@@ -3344,8 +3420,7 @@ bool intel_bios_is_lvds_present(struct drm_i915_private *i915, u8 *i2c_pin) · 165 unmodified lines
33443420 * additional data. Trust that if the VBT was written into
33453421 * the OpRegion then they have validated the LVDS's existence.
33463422 */
3347− if (intel_opregion_get_vbt(i915, NULL))
3348− return true;
3423+ return intel_opregion_vbt_present(i915);
33493424 }
33503425
33513426 return false;
@@ -3706,13 +3781,12 @@ static int intel_bios_vbt_show(struct seq_file *m, void *unused) · 354 unmodified lines
37063781 const void *vbt;
37073782 size_t vbt_size;
37083783
3709− /*
3710− * FIXME: VBT might originate from other places than opregion, and then
3711− * this would be incorrect.
3712− */
3713− vbt = intel_opregion_get_vbt(i915, &vbt_size);
3714− if (vbt)
3784+ vbt = intel_bios_get_vbt(i915, &vbt_size);
3785+
3786+ if (vbt) {
37153787 seq_write(m, vbt, vbt_size);
3788+ kfree(vbt);
3789+ }
37163790
37173791 return 0;
37183792 }
drivers/gpu/drm/i915/display/intel_bw.h+2−1
@@ -52,7 +52,8 @@ struct intel_bw_state { · 51 unmodified lines
5252 u8 num_active_planes[I915_MAX_PIPES];
5353 };
5454
55−#define to_intel_bw_state(x) container_of((x), struct intel_bw_state, base)
55+#define to_intel_bw_state(global_state) \
56+ container_of_const((global_state), struct intel_bw_state, base)
5657
5758 struct intel_bw_state *
5859 intel_atomic_get_old_bw_state(struct intel_atomic_state *state);
drivers/gpu/drm/i915/display/intel_cdclk.c+167−75
@@ -39,6 +39,8 @@ · 38 unmodified lines
3939 #include "intel_pcode.h"
4040 #include "intel_psr.h"
4141 #include "intel_vdsc.h"
42+#include "skl_watermark.h"
43+#include "skl_watermark_regs.h"
4244 #include "vlv_sideband.h"
4345
4446 /**
@@ -63,6 +65,32 @@ · 18 unmodified lines
6365 * DMC will not change the active CDCLK frequency however, so that part
6466 * will still be performed by the driver directly.
6567 *
68+ * There are multiple components involved in the generation of the CDCLK
69+ * frequency:
70+ *
71+ * - We have the CDCLK PLL, which generates an output clock based on a
72+ * reference clock and a ratio parameter.
73+ * - The CD2X Divider, which divides the output of the PLL based on a
74+ * divisor selected from a set of pre-defined choices.
75+ * - The CD2X Squasher, which further divides the output based on a
76+ * waveform represented as a sequence of bits where each zero
77+ * "squashes out" a clock cycle.
78+ * - And, finally, a fixed divider that divides the output frequency by 2.
79+ *
80+ * As such, the resulting CDCLK frequency can be calculated with the
81+ * following formula:
82+ *
83+ * cdclk = vco / cd2x_div / (sq_len / sq_div) / 2
84+ *
85+ * , where vco is the frequency generated by the PLL; cd2x_div
86+ * represents the CD2X Divider; sq_len and sq_div are the bit length
87+ * and the number of high bits for the CD2X Squasher waveform, respectively;
88+ * and 2 represents the fixed divider.
89+ *
90+ * Note that some older platforms do not contain the CD2X Divider
91+ * and/or CD2X Squasher, in which case we can ignore their respective
92+ * factors in the formula above.
93+ *
6694 * Several methods exist to change the CDCLK frequency, which ones are
6795 * supported depends on the platform:
6896 *
@@ -993,15 +1021,14 @@ static int skl_cdclk_decimal(int cdclk) · 924 unmodified lines
9931021 return DIV_ROUND_CLOSEST(cdclk - 1000, 500);
9941022 }
9951023
996−static void skl_set_preferred_cdclk_vco(struct drm_i915_private *dev_priv,
997− int vco)
1024+static void skl_set_preferred_cdclk_vco(struct drm_i915_private *i915, int vco)
9981025 {
999− bool changed = dev_priv->skl_preferred_vco_freq != vco;
1026+ bool changed = i915->display.cdclk.skl_preferred_vco_freq != vco;
10001027
1001− dev_priv->skl_preferred_vco_freq = vco;
1028+ i915->display.cdclk.skl_preferred_vco_freq = vco;
10021029
10031030 if (changed)
1004− intel_update_max_cdclk(dev_priv);
1031+ intel_update_max_cdclk(i915);
10051032 }
10061033
10071034 static u32 skl_dpll0_link_rate(struct drm_i915_private *dev_priv, int vco)
@@ -1205,7 +1232,7 @@ static void skl_cdclk_init_hw(struct drm_i915_private *dev_priv) · 197 unmodified lines
12051232 * Use the current vco as our initial
12061233 * guess as to what the preferred vco is.
12071234 */
1208− if (dev_priv->skl_preferred_vco_freq == 0)
1235+ if (dev_priv->display.cdclk.skl_preferred_vco_freq == 0)
12091236 skl_set_preferred_cdclk_vco(dev_priv,
12101237 dev_priv->display.cdclk.hw.vco);
12111238 return;
@@ -1213,7 +1240,7 @@ static void skl_cdclk_init_hw(struct drm_i915_private *dev_priv) · 1 unmodified line
12131240
12141241 cdclk_config = dev_priv->display.cdclk.hw;
12151242
1216− cdclk_config.vco = dev_priv->skl_preferred_vco_freq;
1243+ cdclk_config.vco = dev_priv->display.cdclk.skl_preferred_vco_freq;
12171244 if (cdclk_config.vco == 0)
12181245 cdclk_config.vco = 8100000;
12191246 cdclk_config.cdclk = skl_calc_cdclk(0, cdclk_config.vco);
@@ -1391,7 +1418,7 @@ static const struct intel_cdclk_vals mtl_cdclk_table[] = { · 171 unmodified lines
13911418 {}
13921419 };
13931420
1394−static const struct intel_cdclk_vals lnl_cdclk_table[] = {
1421+static const struct intel_cdclk_vals xe2lpd_cdclk_table[] = {
13951422 { .refclk = 38400, .cdclk = 153600, .ratio = 16, .waveform = 0xaaaa },
13961423 { .refclk = 38400, .cdclk = 172800, .ratio = 16, .waveform = 0xad5a },
13971424 { .refclk = 38400, .cdclk = 192000, .ratio = 16, .waveform = 0xb6b6 },
@@ -1656,6 +1683,8 @@ static void bxt_get_cdclk(struct drm_i915_private *dev_priv, · 258 unmodified lines
16561683 }
16571684
16581685 out:
1686+ if (DISPLAY_VER(dev_priv) >= 20)
1687+ cdclk_config->joined_mbus = intel_de_read(dev_priv, MBUS_CTL) & MBUS_JOIN;
16591688 /*
16601689 * Can't read this out :( Let's assume it's
16611690 * at least what the CDCLK frequency requires.
@@ -1850,6 +1879,37 @@ static bool cdclk_pll_is_unknown(unsigned int vco) · 188 unmodified lines
18501879 return vco == ~0;
18511880 }
18521881
1882+static bool mdclk_source_is_cdclk_pll(struct drm_i915_private *i915)
1883+{
1884+ return DISPLAY_VER(i915) >= 20;
1885+}
1886+
1887+static u32 xe2lpd_mdclk_source_sel(struct drm_i915_private *i915)
1888+{
1889+ if (mdclk_source_is_cdclk_pll(i915))
1890+ return MDCLK_SOURCE_SEL_CDCLK_PLL;
1891+
1892+ return MDCLK_SOURCE_SEL_CD2XCLK;
1893+}
1894+
1895+int intel_mdclk_cdclk_ratio(struct drm_i915_private *i915,
1896+ const struct intel_cdclk_config *cdclk_config)
1897+{
1898+ if (mdclk_source_is_cdclk_pll(i915))
1899+ return DIV_ROUND_UP(cdclk_config->vco, cdclk_config->cdclk);
1900+
1901+ /* Otherwise, source for MDCLK is CD2XCLK. */
1902+ return 2;
1903+}
1904+
1905+static void xe2lpd_mdclk_cdclk_ratio_program(struct drm_i915_private *i915,
1906+ const struct intel_cdclk_config *cdclk_config)
1907+{
1908+ intel_dbuf_mdclk_cdclk_ratio_update(i915,
1909+ intel_mdclk_cdclk_ratio(i915, cdclk_config),
1910+ cdclk_config->joined_mbus);
1911+}
1912+
18531913 static bool cdclk_compute_crawl_and_squash_midpoint(struct drm_i915_private *i915,
18541914 const struct intel_cdclk_config *old_cdclk_config,
18551915 const struct intel_cdclk_config *new_cdclk_config,
@@ -1954,7 +2014,7 @@ static u32 bxt_cdclk_ctl(struct drm_i915_private *i915, · 98 unmodified lines
19542014 val |= BXT_CDCLK_SSA_PRECHARGE_ENABLE;
19552015
19562016 if (DISPLAY_VER(i915) >= 20)
1957− val |= MDCLK_SOURCE_SEL_CDCLK_PLL;
2017+ val |= xe2lpd_mdclk_source_sel(i915);
19582018 else
19592019 val |= skl_cdclk_decimal(cdclk);
19602020
@@ -1967,7 +2027,6 @@ static void _bxt_set_cdclk(struct drm_i915_private *dev_priv, · 6 unmodified lines
19672027 {
19682028 int cdclk = cdclk_config->cdclk;
19692029 int vco = cdclk_config->vco;
1970− u16 waveform;
19712030
19722031 if (HAS_CDCLK_CRAWL(dev_priv) && dev_priv->display.cdclk.hw.vco > 0 && vco > 0 &&
19732032 !cdclk_pll_is_unknown(dev_priv->display.cdclk.hw.vco)) {
@@ -1982,10 +2041,11 @@ static void _bxt_set_cdclk(struct drm_i915_private *dev_priv, · 8 unmodified lines
19822041 } else
19832042 bxt_cdclk_pll_update(dev_priv, vco);
19842043
1985− waveform = cdclk_squash_waveform(dev_priv, cdclk);
2044+ if (HAS_CDCLK_SQUASH(dev_priv)) {
2045+ u16 waveform = cdclk_squash_waveform(dev_priv, cdclk);
19862046
1987− if (HAS_CDCLK_SQUASH(dev_priv))
19882047 dg2_cdclk_squash_program(dev_priv, waveform);
2048+ }
19892049
19902050 intel_de_write(dev_priv, CDCLK_CTL, bxt_cdclk_ctl(dev_priv, cdclk_config, pipe));
19912051
@@ -2030,6 +2090,9 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv, · 38 unmodified lines
20302090 return;
20312091 }
20322092
2093+ if (DISPLAY_VER(dev_priv) >= 20 && cdclk < dev_priv->display.cdclk.hw.cdclk)
2094+ xe2lpd_mdclk_cdclk_ratio_program(dev_priv, cdclk_config);
2095+
20332096 if (cdclk_compute_crawl_and_squash_midpoint(dev_priv, &dev_priv->display.cdclk.hw,
20342097 cdclk_config, &mid_cdclk_config)) {
20352098 _bxt_set_cdclk(dev_priv, &mid_cdclk_config, pipe);
@@ -2038,6 +2101,9 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv, · 2 unmodified lines
20382101 _bxt_set_cdclk(dev_priv, cdclk_config, pipe);
20392102 }
20402103
2104+ if (DISPLAY_VER(dev_priv) >= 20 && cdclk > dev_priv->display.cdclk.hw.cdclk)
2105+ xe2lpd_mdclk_cdclk_ratio_program(dev_priv, cdclk_config);
2106+
20412107 if (DISPLAY_VER(dev_priv) >= 14)
20422108 /*
20432109 * NOOP - No Pcode communication needed for
@@ -2260,16 +2326,15 @@ static bool intel_cdclk_can_squash(struct drm_i915_private *dev_priv, · 216 unmodified lines
22602326 }
22612327
22622328 /**
2263− * intel_cdclk_needs_modeset - Determine if changong between the CDCLK
2264− * configurations requires a modeset on all pipes
2329+ * intel_cdclk_clock_changed - Check whether the clock changed
22652330 * @a: first CDCLK configuration
22662331 * @b: second CDCLK configuration
22672332 *
22682333 * Returns:
2269− * True if changing between the two CDCLK configurations
2270− * requires all pipes to be off, false if not.
2334+ * True if CDCLK changed in a way that requires re-programming and
2335+ * False otherwise.
22712336 */
2272−bool intel_cdclk_needs_modeset(const struct intel_cdclk_config *a,
2337+bool intel_cdclk_clock_changed(const struct intel_cdclk_config *a,
22732338 const struct intel_cdclk_config *b)
22742339 {
22752340 return a->cdclk != b->cdclk ||
@@ -2322,7 +2387,7 @@ static bool intel_cdclk_can_cd2x_update(struct drm_i915_private *dev_priv, · 46 unmodified lines
23222387 static bool intel_cdclk_changed(const struct intel_cdclk_config *a,
23232388 const struct intel_cdclk_config *b)
23242389 {
2325− return intel_cdclk_needs_modeset(a, b) ||
2390+ return intel_cdclk_clock_changed(a, b) ||
23262391 a->voltage_level != b->voltage_level;
23272392 }
23282393
@@ -2368,18 +2433,9 @@ static void intel_pcode_notify(struct drm_i915_private *i915, · 39 unmodified lines
23682433 ret);
23692434 }
23702435
2371−/**
2372− * intel_set_cdclk - Push the CDCLK configuration to the hardware
2373− * @dev_priv: i915 device
2374− * @cdclk_config: new CDCLK configuration
2375− * @pipe: pipe with which to synchronize the update
2376− *
2377− * Program the hardware based on the passed in CDCLK state,
2378− * if necessary.
2379− */
23802436 static void intel_set_cdclk(struct drm_i915_private *dev_priv,
23812437 const struct intel_cdclk_config *cdclk_config,
2382− enum pipe pipe)
2438+ enum pipe pipe, const char *context)
23832439 {
23842440 struct intel_encoder *encoder;
23852441
@@ -2389,7 +2445,7 @@ static void intel_set_cdclk(struct drm_i915_private *dev_priv, · 3 unmodified lines
23892445 if (drm_WARN_ON_ONCE(&dev_priv->drm, !dev_priv->display.funcs.cdclk->set_cdclk))
23902446 return;
23912447
2392− intel_cdclk_dump_config(dev_priv, cdclk_config, "Changing CDCLK to");
2448+ intel_cdclk_dump_config(dev_priv, cdclk_config, context);
23932449
23942450 for_each_intel_encoder_with_psr(&dev_priv->drm, encoder) {
23952451 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
@@ -2519,6 +2575,17 @@ static void intel_cdclk_pcode_post_notify(struct intel_atomic_state *state) · 123 unmodified lines
25192575 update_cdclk, update_pipe_count);
25202576 }
25212577
2578+bool intel_cdclk_is_decreasing_later(struct intel_atomic_state *state)
2579+{
2580+ const struct intel_cdclk_state *old_cdclk_state =
2581+ intel_atomic_get_old_cdclk_state(state);
2582+ const struct intel_cdclk_state *new_cdclk_state =
2583+ intel_atomic_get_new_cdclk_state(state);
2584+
2585+ return new_cdclk_state && !new_cdclk_state->disable_pipes &&
2586+ new_cdclk_state->actual.cdclk < old_cdclk_state->actual.cdclk;
2587+}
2588+
25222589 /**
25232590 * intel_set_cdclk_pre_plane_update - Push the CDCLK state to the hardware
25242591 * @state: intel atomic state
@@ -2534,7 +2601,8 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) · 9 unmodified lines
25342601 intel_atomic_get_old_cdclk_state(state);
25352602 const struct intel_cdclk_state *new_cdclk_state =
25362603 intel_atomic_get_new_cdclk_state(state);
2537− enum pipe pipe = new_cdclk_state->pipe;
2604+ struct intel_cdclk_config cdclk_config;
2605+ enum pipe pipe;
25382606
25392607 if (!intel_cdclk_changed(&old_cdclk_state->actual,
25402608 &new_cdclk_state->actual))
@@ -2543,12 +2611,32 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) · 2 unmodified lines
25432611 if (IS_DG2(i915))
25442612 intel_cdclk_pcode_pre_notify(state);
25452613
2546− if (pipe == INVALID_PIPE ||
2547− old_cdclk_state->actual.cdclk <= new_cdclk_state->actual.cdclk) {
2548− drm_WARN_ON(&i915->drm, !new_cdclk_state->base.changed);
2614+ if (new_cdclk_state->disable_pipes) {
2615+ cdclk_config = new_cdclk_state->actual;
2616+ pipe = INVALID_PIPE;
2617+ } else {
2618+ if (new_cdclk_state->actual.cdclk >= old_cdclk_state->actual.cdclk) {
2619+ cdclk_config = new_cdclk_state->actual;
2620+ pipe = new_cdclk_state->pipe;
2621+ } else {
2622+ cdclk_config = old_cdclk_state->actual;
2623+ pipe = INVALID_PIPE;
2624+ }
25492625
2550− intel_set_cdclk(i915, &new_cdclk_state->actual, pipe);
2626+ cdclk_config.voltage_level = max(new_cdclk_state->actual.voltage_level,
2627+ old_cdclk_state->actual.voltage_level);
25512628 }
2629+
2630+ /*
2631+ * mbus joining will be changed later by
2632+ * intel_dbuf_mbus_{pre,post}_ddb_update()
2633+ */
2634+ cdclk_config.joined_mbus = old_cdclk_state->actual.joined_mbus;
2635+
2636+ drm_WARN_ON(&i915->drm, !new_cdclk_state->base.changed);
2637+
2638+ intel_set_cdclk(i915, &cdclk_config, pipe,
2639+ "Pre changing CDCLK to");
25522640 }
25532641
25542642 /**
@@ -2566,7 +2654,7 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state) · 11 unmodified lines
25662654 intel_atomic_get_old_cdclk_state(state);
25672655 const struct intel_cdclk_state *new_cdclk_state =
25682656 intel_atomic_get_new_cdclk_state(state);
2569− enum pipe pipe = new_cdclk_state->pipe;
2657+ enum pipe pipe;
25702658
25712659 if (!intel_cdclk_changed(&old_cdclk_state->actual,
25722660 &new_cdclk_state->actual))
@@ -2575,12 +2663,16 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state) · 2 unmodified lines
25752663 if (IS_DG2(i915))
25762664 intel_cdclk_pcode_post_notify(state);
25772665
2578− if (pipe != INVALID_PIPE &&
2579− old_cdclk_state->actual.cdclk > new_cdclk_state->actual.cdclk) {
2580− drm_WARN_ON(&i915->drm, !new_cdclk_state->base.changed);
2666+ if (!new_cdclk_state->disable_pipes &&
2667+ new_cdclk_state->actual.cdclk < old_cdclk_state->actual.cdclk)
2668+ pipe = new_cdclk_state->pipe;
2669+ else
2670+ pipe = INVALID_PIPE;
25812671
2582− intel_set_cdclk(i915, &new_cdclk_state->actual, pipe);
2583− }
2672+ drm_WARN_ON(&i915->drm, !new_cdclk_state->base.changed);
2673+
2674+ intel_set_cdclk(i915, &new_cdclk_state->actual, pipe,
2675+ "Post changing CDCLK to");
25842676 }
25852677
25862678 static int intel_pixel_rate_to_cdclk(const struct intel_crtc_state *crtc_state)
@@ -2731,25 +2823,6 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) · 144 unmodified lines
27312823 if (crtc_state->dsc.compression_enable)
27322824 min_cdclk = max(min_cdclk, intel_vdsc_min_cdclk(crtc_state));
27332825
2734− /*
2735− * HACK. Currently for TGL/DG2 platforms we calculate
2736− * min_cdclk initially based on pixel_rate divided
2737− * by 2, accounting for also plane requirements,
2738− * however in some cases the lowest possible CDCLK
2739− * doesn't work and causing the underruns.
2740− * Explicitly stating here that this seems to be currently
2741− * rather a Hack, than final solution.
2742− */
2743− if (IS_TIGERLAKE(dev_priv) || IS_DG2(dev_priv)) {
2744− /*
2745− * Clamp to max_cdclk_freq in case pixel rate is higher,
2746− * in order not to break an 8K, but still leave W/A at place.
2747− */
2748− min_cdclk = max_t(int, min_cdclk,
2749− min_t(int, crtc_state->pixel_rate,
2750− dev_priv->display.cdclk.max_cdclk_freq));
2751− }
2752−
27532826 return min_cdclk;
27542827 }
27552828
@@ -2937,7 +3010,7 @@ static int skl_dpll0_vco(struct intel_cdclk_state *cdclk_state) · 181 unmodified lines
29373010
29383011 vco = cdclk_state->logical.vco;
29393012 if (!vco)
2940− vco = dev_priv->skl_preferred_vco_freq;
3013+ vco = dev_priv->display.cdclk.skl_preferred_vco_freq;
29413014
29423015 for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
29433016 if (!crtc_state->hw.enable)
@@ -3058,6 +3131,7 @@ static struct intel_global_state *intel_cdclk_duplicate_state(struct intel_globa · 114 unmodified lines
30583131 return NULL;
30593132
30603133 cdclk_state->pipe = INVALID_PIPE;
3134+ cdclk_state->disable_pipes = false;
30613135
30623136 return &cdclk_state->base;
30633137 }
@@ -3121,6 +3195,20 @@ int intel_cdclk_atomic_check(struct intel_atomic_state *state, · 57 unmodified lines
31213195 return 0;
31223196 }
31233197
3198+int intel_cdclk_state_set_joined_mbus(struct intel_atomic_state *state, bool joined_mbus)
3199+{
3200+ struct intel_cdclk_state *cdclk_state;
3201+
3202+ cdclk_state = intel_atomic_get_cdclk_state(state);
3203+ if (IS_ERR(cdclk_state))
3204+ return PTR_ERR(cdclk_state);
3205+
3206+ cdclk_state->actual.joined_mbus = joined_mbus;
3207+ cdclk_state->logical.joined_mbus = joined_mbus;
3208+
3209+ return intel_atomic_lock_global_state(&cdclk_state->base);
3210+}
3211+
31243212 int intel_cdclk_init(struct drm_i915_private *dev_priv)
31253213 {
31263214 struct intel_cdclk_state *cdclk_state;
@@ -3229,17 +3317,28 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state) · 102 unmodified lines
32293317 drm_dbg_kms(&dev_priv->drm,
32303318 "Can change cdclk cd2x divider with pipe %c active\n",
32313319 pipe_name(pipe));
3232− } else if (intel_cdclk_needs_modeset(&old_cdclk_state->actual,
3320+ } else if (intel_cdclk_clock_changed(&old_cdclk_state->actual,
32333321 &new_cdclk_state->actual)) {
32343322 /* All pipes must be switched off while we change the cdclk. */
32353323 ret = intel_modeset_all_pipes_late(state, "CDCLK change");
32363324 if (ret)
32373325 return ret;
32383326
3327+ new_cdclk_state->disable_pipes = true;
3328+
32393329 drm_dbg_kms(&dev_priv->drm,
32403330 "Modeset required for cdclk change\n");
32413331 }
32423332
3333+ if (intel_mdclk_cdclk_ratio(dev_priv, &old_cdclk_state->actual) !=
3334+ intel_mdclk_cdclk_ratio(dev_priv, &new_cdclk_state->actual)) {
3335+ int ratio = intel_mdclk_cdclk_ratio(dev_priv, &new_cdclk_state->actual);
3336+
3337+ ret = intel_dbuf_state_set_mdclk_cdclk_ratio(state, ratio);
3338+ if (ret)
3339+ return ret;
3340+ }
3341+
32433342 drm_dbg_kms(&dev_priv->drm,
32443343 "New cdclk calculated to be logical %u kHz, actual %u kHz\n",
32453344 new_cdclk_state->logical.cdclk,
@@ -3297,7 +3396,7 @@ void intel_update_max_cdclk(struct drm_i915_private *dev_priv) · 51 unmodified lines
32973396 u32 limit = intel_de_read(dev_priv, SKL_DFSM) & SKL_DFSM_CDCLK_LIMIT_MASK;
32983397 int max_cdclk, vco;
32993398
3300− vco = dev_priv->skl_preferred_vco_freq;
3399+ vco = dev_priv->display.cdclk.skl_preferred_vco_freq;
33013400 drm_WARN_ON(&dev_priv->drm, vco != 8100000 && vco != 8640000);
33023401
33033402 /*
@@ -3339,13 +3438,13 @@ void intel_update_max_cdclk(struct drm_i915_private *dev_priv) · 35 unmodified lines
33393438 dev_priv->display.cdclk.max_cdclk_freq = dev_priv->display.cdclk.hw.cdclk;
33403439 }
33413440
3342− dev_priv->max_dotclk_freq = intel_compute_max_dotclk(dev_priv);
3441+ dev_priv->display.cdclk.max_dotclk_freq = intel_compute_max_dotclk(dev_priv);
33433442
33443443 drm_dbg(&dev_priv->drm, "Max CD clock rate: %d kHz\n",
33453444 dev_priv->display.cdclk.max_cdclk_freq);
33463445
33473446 drm_dbg(&dev_priv->drm, "Max dotclock rate: %d kHz\n",
3348− dev_priv->max_dotclk_freq);
3447+ dev_priv->display.cdclk.max_dotclk_freq);
33493448 }
33503449
33513450 /**
@@ -3519,7 +3618,7 @@ static int i915_cdclk_info_show(struct seq_file *m, void *unused) · 167 unmodified lines
35193618
35203619 seq_printf(m, "Current CD clock frequency: %d kHz\n", i915->display.cdclk.hw.cdclk);
35213620 seq_printf(m, "Max CD clock frequency: %d kHz\n", i915->display.cdclk.max_cdclk_freq);
3522− seq_printf(m, "Max pixel clock frequency: %d kHz\n", i915->max_dotclk_freq);
3621+ seq_printf(m, "Max pixel clock frequency: %d kHz\n", i915->display.cdclk.max_dotclk_freq);
35233622
35243623 return 0;
35253624 }
@@ -3534,13 +3633,6 @@ void intel_cdclk_debugfs_register(struct drm_i915_private *i915) · 8 unmodified lines
35343633 i915, &i915_cdclk_info_fops);
35353634 }
35363635
3537−static const struct intel_cdclk_funcs mtl_cdclk_funcs = {
3538− .get_cdclk = bxt_get_cdclk,
3539− .set_cdclk = bxt_set_cdclk,
3540− .modeset_calc_cdclk = bxt_modeset_calc_cdclk,
3541− .calc_voltage_level = rplu_calc_voltage_level,
3542−};
3543−
35443636 static const struct intel_cdclk_funcs rplu_cdclk_funcs = {
35453637 .get_cdclk = bxt_get_cdclk,
35463638 .set_cdclk = bxt_set_cdclk,
@@ -3684,10 +3776,10 @@ static const struct intel_cdclk_funcs i830_cdclk_funcs = { · 137 unmodified lines
36843776 void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv)
36853777 {
36863778 if (DISPLAY_VER(dev_priv) >= 20) {
3687− dev_priv->display.funcs.cdclk = &mtl_cdclk_funcs;
3688− dev_priv->display.cdclk.table = lnl_cdclk_table;
3779+ dev_priv->display.funcs.cdclk = &rplu_cdclk_funcs;
3780+ dev_priv->display.cdclk.table = xe2lpd_cdclk_table;
36893781 } else if (DISPLAY_VER(dev_priv) >= 14) {
3690− dev_priv->display.funcs.cdclk = &mtl_cdclk_funcs;
3782+ dev_priv->display.funcs.cdclk = &rplu_cdclk_funcs;
36913783 dev_priv->display.cdclk.table = mtl_cdclk_table;
36923784 } else if (IS_DG2(dev_priv)) {
36933785 dev_priv->display.funcs.cdclk = &tgl_cdclk_funcs;
drivers/gpu/drm/i915/display/intel_cdclk.h+13−2
@@ -18,6 +18,8 @@ struct intel_crtc_state; · 17 unmodified lines
1818 struct intel_cdclk_config {
1919 unsigned int cdclk, vco, ref, bypass;
2020 u8 voltage_level;
21+ /* This field is only valid for Xe2LPD and above. */
22+ bool joined_mbus;
2123 };
2224
2325 struct intel_cdclk_state {
@@ -51,6 +53,9 @@ struct intel_cdclk_state { · 27 unmodified lines
5153
5254 /* bitmask of active pipes */
5355 u8 active_pipes;
56+
57+ /* update cdclk with pipes disabled */
58+ bool disable_pipes;
5459 };
5560
5661 int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
@@ -60,8 +65,11 @@ void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv); · 3 unmodified lines
6065 void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
6166 void intel_update_cdclk(struct drm_i915_private *dev_priv);
6267 u32 intel_read_rawclk(struct drm_i915_private *dev_priv);
63−bool intel_cdclk_needs_modeset(const struct intel_cdclk_config *a,
68+bool intel_cdclk_clock_changed(const struct intel_cdclk_config *a,
6469 const struct intel_cdclk_config *b);
70+int intel_mdclk_cdclk_ratio(struct drm_i915_private *i915,
71+ const struct intel_cdclk_config *cdclk_config);
72+bool intel_cdclk_is_decreasing_later(struct intel_atomic_state *state);
6573 void intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state);
6674 void intel_set_cdclk_post_plane_update(struct intel_atomic_state *state);
6775 void intel_cdclk_dump_config(struct drm_i915_private *i915,
@@ -72,10 +80,13 @@ void intel_cdclk_get_cdclk(struct drm_i915_private *dev_priv, · 4 unmodified lines
7280 struct intel_cdclk_config *cdclk_config);
7381 int intel_cdclk_atomic_check(struct intel_atomic_state *state,
7482 bool *need_cdclk_calc);
83+int intel_cdclk_state_set_joined_mbus(struct intel_atomic_state *state, bool joined_mbus);
7584 struct intel_cdclk_state *
7685 intel_atomic_get_cdclk_state(struct intel_atomic_state *state);
7786
78−#define to_intel_cdclk_state(x) container_of((x), struct intel_cdclk_state, base)
87+#define to_intel_cdclk_state(global_state) \
88+ container_of_const((global_state), struct intel_cdclk_state, base)
89+
7990 #define intel_atomic_get_old_cdclk_state(state) \
8091 to_intel_cdclk_state(intel_atomic_get_old_global_obj_state(state, &to_i915(state->base.dev)->display.cdclk.obj))
8192 #define intel_atomic_get_new_cdclk_state(state) \
drivers/gpu/drm/i915/display/intel_combo_phy_regs.h+60−57
@@ -25,28 +25,26 @@ · 24 unmodified lines
2525 4 * (dw))
2626
2727 #define ICL_PORT_CL_DW5(phy) _MMIO(_ICL_PORT_CL_DW(5, phy))
28−#define CL_POWER_DOWN_ENABLE (1 << 4)
29−#define SUS_CLOCK_CONFIG (3 << 0)
28+#define CL_POWER_DOWN_ENABLE REG_BIT(4)
29+#define SUS_CLOCK_CONFIG REG_GENMASK(1, 0)
3030
3131 #define ICL_PORT_CL_DW10(phy) _MMIO(_ICL_PORT_CL_DW(10, phy))
32−#define PG_SEQ_DELAY_OVERRIDE_MASK (3 << 25)
33−#define PG_SEQ_DELAY_OVERRIDE_SHIFT 25
34−#define PG_SEQ_DELAY_OVERRIDE_ENABLE (1 << 24)
35−#define PWR_UP_ALL_LANES (0x0 << 4)
36−#define PWR_DOWN_LN_3_2_1 (0xe << 4)
37−#define PWR_DOWN_LN_3_2 (0xc << 4)
38−#define PWR_DOWN_LN_3 (0x8 << 4)
39−#define PWR_DOWN_LN_2_1_0 (0x7 << 4)
40−#define PWR_DOWN_LN_1_0 (0x3 << 4)
41−#define PWR_DOWN_LN_3_1 (0xa << 4)
42−#define PWR_DOWN_LN_3_1_0 (0xb << 4)
43−#define PWR_DOWN_LN_MASK (0xf << 4)
44−#define PWR_DOWN_LN_SHIFT 4
45−#define EDP4K2K_MODE_OVRD_EN (1 << 3)
46−#define EDP4K2K_MODE_OVRD_OPTIMIZED (1 << 2)
32+#define PG_SEQ_DELAY_OVERRIDE_MASK REG_GENMASK(26, 25)
33+#define PG_SEQ_DELAY_OVERRIDE_ENABLE REG_BIT(24)
34+#define PWR_DOWN_LN_MASK REG_GENMASK(7, 4)
35+#define PWR_UP_ALL_LANES REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0x0)
36+#define PWR_DOWN_LN_3_2_1 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0xe)
37+#define PWR_DOWN_LN_3_2 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0xc)
38+#define PWR_DOWN_LN_3 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0x8)
39+#define PWR_DOWN_LN_2_1_0 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0x7)
40+#define PWR_DOWN_LN_1_0 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0x3)
41+#define PWR_DOWN_LN_3_1 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0xa)
42+#define PWR_DOWN_LN_3_1_0 REG_FIELD_PREP(PWR_DOWN_LN_MASK, 0xb)
43+#define EDP4K2K_MODE_OVRD_EN REG_BIT(3)
44+#define EDP4K2K_MODE_OVRD_OPTIMIZED REG_BIT(2)
4745
4846 #define ICL_PORT_CL_DW12(phy) _MMIO(_ICL_PORT_CL_DW(12, phy))
49−#define ICL_LANE_ENABLE_AUX (1 << 0)
47+#define ICL_LANE_ENABLE_AUX REG_BIT(0)
5048
5149 /* ICL Port COMP_DW registers */
5250 #define _ICL_PORT_COMP 0x100
@@ -54,24 +52,22 @@ · 1 unmodified line
5452 _ICL_PORT_COMP + 4 * (dw))
5553
5654 #define ICL_PORT_COMP_DW0(phy) _MMIO(_ICL_PORT_COMP_DW(0, phy))
57−#define COMP_INIT (1 << 31)
55+#define COMP_INIT REG_BIT(31)
5856
5957 #define ICL_PORT_COMP_DW1(phy) _MMIO(_ICL_PORT_COMP_DW(1, phy))
6058
6159 #define ICL_PORT_COMP_DW3(phy) _MMIO(_ICL_PORT_COMP_DW(3, phy))
62−#define PROCESS_INFO_DOT_0 (0 << 26)
63−#define PROCESS_INFO_DOT_1 (1 << 26)
64−#define PROCESS_INFO_DOT_4 (2 << 26)
65−#define PROCESS_INFO_MASK (7 << 26)
66−#define PROCESS_INFO_SHIFT 26
67−#define VOLTAGE_INFO_0_85V (0 << 24)
68−#define VOLTAGE_INFO_0_95V (1 << 24)
69−#define VOLTAGE_INFO_1_05V (2 << 24)
70−#define VOLTAGE_INFO_MASK (3 << 24)
71−#define VOLTAGE_INFO_SHIFT 24
60+#define PROCESS_INFO_MASK REG_GENMASK(28, 26)
61+#define PROCESS_INFO_DOT_0 REG_FIELD_PREP(PROCESS_INFO_MASK, 0)
62+#define PROCESS_INFO_DOT_1 REG_FIELD_PREP(PROCESS_INFO_MASK, 1)
63+#define PROCESS_INFO_DOT_4 REG_FIELD_PREP(PROCESS_INFO_MASK, 2)
64+#define VOLTAGE_INFO_MASK REG_GENMASK(25, 24)
65+#define VOLTAGE_INFO_0_85V REG_FIELD_PREP(VOLTAGE_INFO_MASK, 0)
66+#define VOLTAGE_INFO_0_95V REG_FIELD_PREP(VOLTAGE_INFO_MASK, 1)
67+#define VOLTAGE_INFO_1_05V REG_FIELD_PREP(VOLTAGE_INFO_MASK, 2)
7268
7369 #define ICL_PORT_COMP_DW8(phy) _MMIO(_ICL_PORT_COMP_DW(8, phy))
74−#define IREFGEN (1 << 24)
70+#define IREFGEN REG_BIT(24)
7571
7672 #define ICL_PORT_COMP_DW9(phy) _MMIO(_ICL_PORT_COMP_DW(9, phy))
7773
@@ -92,9 +88,9 @@ · 14 unmodified lines
9288 #define ICL_PORT_PCS_DW1_LN(ln, phy) _MMIO(_ICL_PORT_PCS_DW_LN(1, ln, phy))
9389 #define DCC_MODE_SELECT_MASK REG_GENMASK(21, 20)
9490 #define RUN_DCC_ONCE REG_FIELD_PREP(DCC_MODE_SELECT_MASK, 0)
95−#define COMMON_KEEPER_EN (1 << 26)
96−#define LATENCY_OPTIM_MASK (0x3 << 2)
97−#define LATENCY_OPTIM_VAL(x) ((x) << 2)
91+#define COMMON_KEEPER_EN REG_BIT(26)
92+#define LATENCY_OPTIM_MASK REG_GENMASK(3, 2)
93+#define LATENCY_OPTIM_VAL(x) REG_FIELD_PREP(LATENCY_OPTIM_MASK, (x))
9894
9995 /* ICL Port TX registers */
10096 #define _ICL_PORT_TX_AUX 0x380
@@ -111,42 +107,49 @@ · 10 unmodified lines
111107 #define ICL_PORT_TX_DW2_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(2, phy))
112108 #define ICL_PORT_TX_DW2_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(2, phy))
113109 #define ICL_PORT_TX_DW2_LN(ln, phy) _MMIO(_ICL_PORT_TX_DW_LN(2, ln, phy))
114−#define SWING_SEL_UPPER(x) (((x) >> 3) << 15)
115−#define SWING_SEL_UPPER_MASK (1 << 15)
116−#define SWING_SEL_LOWER(x) (((x) & 0x7) << 11)
117−#define SWING_SEL_LOWER_MASK (0x7 << 11)
118−#define FRC_LATENCY_OPTIM_MASK (0x7 << 8)
119−#define FRC_LATENCY_OPTIM_VAL(x) ((x) << 8)
120−#define RCOMP_SCALAR(x) ((x) << 0)
121−#define RCOMP_SCALAR_MASK (0xFF << 0)
110+#define SWING_SEL_UPPER_MASK REG_BIT(15)
111+#define SWING_SEL_UPPER(x) REG_FIELD_PREP(SWING_SEL_UPPER_MASK, (x) >> 3)
112+#define SWING_SEL_LOWER_MASK REG_GENMASK(13, 11)
113+#define SWING_SEL_LOWER(x) REG_FIELD_PREP(SWING_SEL_LOWER_MASK, (x) & 0x7)
114+#define FRC_LATENCY_OPTIM_MASK REG_GENMASK(10, 8)
115+#define FRC_LATENCY_OPTIM_VAL(x) REG_FIELD_PREP(FRC_LATENCY_OPTIM_MASK, (x))
116+#define RCOMP_SCALAR_MASK REG_GENMASK(7, 0)
117+#define RCOMP_SCALAR(x) REG_FIELD_PREP(RCOMP_SCALAR_MASK, (x))
122118
123119 #define ICL_PORT_TX_DW4_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(4, phy))
124120 #define ICL_PORT_TX_DW4_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(4, phy))
125121 #define ICL_PORT_TX_DW4_LN(ln, phy) _MMIO(_ICL_PORT_TX_DW_LN(4, ln, phy))
126−#define LOADGEN_SELECT (1 << 31)
127−#define POST_CURSOR_1(x) ((x) << 12)
128−#define POST_CURSOR_1_MASK (0x3F << 12)
129−#define POST_CURSOR_2(x) ((x) << 6)
130−#define POST_CURSOR_2_MASK (0x3F << 6)
131−#define CURSOR_COEFF(x) ((x) << 0)
132−#define CURSOR_COEFF_MASK (0x3F << 0)
122+#define LOADGEN_SELECT REG_BIT(31)
123+#define POST_CURSOR_1_MASK REG_GENMASK(17, 12)
124+#define POST_CURSOR_1(x) REG_FIELD_PREP(POST_CURSOR_1_MASK, (x))
125+#define POST_CURSOR_2_MASK REG_GENMASK(11, 6)
126+#define POST_CURSOR_2(x) REG_FIELD_PREP(POST_CURSOR_2_MASK, (x))
127+#define CURSOR_COEFF_MASK REG_GENMASK(5, 0)
128+#define CURSOR_COEFF(x) REG_FIELD_PREP(CURSOR_COEFF_MASK, (x))
133129
134130 #define ICL_PORT_TX_DW5_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(5, phy))
135131 #define ICL_PORT_TX_DW5_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(5, phy))
136132 #define ICL_PORT_TX_DW5_LN(ln, phy) _MMIO(_ICL_PORT_TX_DW_LN(5, ln, phy))
137−#define TX_TRAINING_EN (1 << 31)
138−#define TAP2_DISABLE (1 << 30)
139−#define TAP3_DISABLE (1 << 29)
140−#define SCALING_MODE_SEL(x) ((x) << 18)
141−#define SCALING_MODE_SEL_MASK (0x7 << 18)
142−#define RTERM_SELECT(x) ((x) << 3)
143−#define RTERM_SELECT_MASK (0x7 << 3)
133+#define TX_TRAINING_EN REG_BIT(31)
134+#define TAP2_DISABLE REG_BIT(30)
135+#define TAP3_DISABLE REG_BIT(29)
136+#define SCALING_MODE_SEL_MASK REG_GENMASK(20, 18)
137+#define SCALING_MODE_SEL(x) REG_FIELD_PREP(SCALING_MODE_SEL_MASK, (x))
138+#define RTERM_SELECT_MASK REG_GENMASK(5, 3)
139+#define RTERM_SELECT(x) REG_FIELD_PREP(RTERM_SELECT_MASK, (x))
140+
141+#define ICL_PORT_TX_DW6_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(6, phy))
142+#define ICL_PORT_TX_DW6_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(6, phy))
143+#define ICL_PORT_TX_DW6_LN(ln, phy) _MMIO(_ICL_PORT_TX_DW_LN(6, ln, phy))
144+#define O_FUNC_OVRD_EN REG_BIT(7)
145+#define O_LDO_REF_SEL_CRI REG_GENMASK(6, 1)
146+#define O_LDO_BYPASS_CRI REG_BIT(0)
144147
145148 #define ICL_PORT_TX_DW7_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(7, phy))
146149 #define ICL_PORT_TX_DW7_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(7, phy))
147150 #define ICL_PORT_TX_DW7_LN(ln, phy) _MMIO(_ICL_PORT_TX_DW_LN(7, ln, phy))
148−#define N_SCALAR(x) ((x) << 24)
149−#define N_SCALAR_MASK (0x7F << 24)
151+#define N_SCALAR_MASK REG_GENMASK(30, 24)
152+#define N_SCALAR(x) REG_FIELD_PREP(N_SCALAR_MASK, (x))
150153
151154 #define ICL_PORT_TX_DW8_AUX(phy) _MMIO(_ICL_PORT_TX_DW_AUX(8, phy))
152155 #define ICL_PORT_TX_DW8_GRP(phy) _MMIO(_ICL_PORT_TX_DW_GRP(8, phy))
drivers/gpu/drm/i915/display/intel_crt.c+1−4
@@ -348,7 +348,7 @@ intel_crt_mode_valid(struct drm_connector *connector, · 347 unmodified lines
348348 {
349349 struct drm_device *dev = connector->dev;
350350 struct drm_i915_private *dev_priv = to_i915(dev);
351− int max_dotclk = dev_priv->max_dotclk_freq;
351+ int max_dotclk = dev_priv->display.cdclk.max_dotclk_freq;
352352 enum drm_mode_status status;
353353 int max_clock;
354354
@@ -356,9 +356,6 @@ intel_crt_mode_valid(struct drm_connector *connector, · 1 unmodified line
356356 if (status != MODE_OK)
357357 return status;
358358
359− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
360− return MODE_NO_DBLESCAN;
361−
362359 if (mode->clock < 25000)
363360 return MODE_CLOCK_LOW;
364361
drivers/gpu/drm/i915/display/intel_crtc_state_dump.c+167−186
@@ -12,33 +12,31 @@ · 11 unmodified lines
1212 #include "intel_hdmi.h"
1313 #include "intel_vrr.h"
1414
15−static void intel_dump_crtc_timings(struct drm_i915_private *i915,
15+static void intel_dump_crtc_timings(struct drm_printer *p,
1616 const struct drm_display_mode *mode)
1717 {
18− drm_dbg_kms(&i915->drm, "crtc timings: clock=%d, "
19− "hd=%d hb=%d-%d hs=%d-%d ht=%d, "
20− "vd=%d vb=%d-%d vs=%d-%d vt=%d, "
21− "flags=0x%x\n",
22− mode->crtc_clock,
23− mode->crtc_hdisplay, mode->crtc_hblank_start, mode->crtc_hblank_end,
24− mode->crtc_hsync_start, mode->crtc_hsync_end, mode->crtc_htotal,
25− mode->crtc_vdisplay, mode->crtc_vblank_start, mode->crtc_vblank_end,
26− mode->crtc_vsync_start, mode->crtc_vsync_end, mode->crtc_vtotal,
27− mode->flags);
18+ drm_printf(p, "crtc timings: clock=%d, "
19+ "hd=%d hb=%d-%d hs=%d-%d ht=%d, "
20+ "vd=%d vb=%d-%d vs=%d-%d vt=%d, "
21+ "flags=0x%x\n",
22+ mode->crtc_clock,
23+ mode->crtc_hdisplay, mode->crtc_hblank_start, mode->crtc_hblank_end,
24+ mode->crtc_hsync_start, mode->crtc_hsync_end, mode->crtc_htotal,
25+ mode->crtc_vdisplay, mode->crtc_vblank_start, mode->crtc_vblank_end,
26+ mode->crtc_vsync_start, mode->crtc_vsync_end, mode->crtc_vtotal,
27+ mode->flags);
2828 }
2929
3030 static void
31−intel_dump_m_n_config(const struct intel_crtc_state *pipe_config,
31+intel_dump_m_n_config(struct drm_printer *p,
32+ const struct intel_crtc_state *pipe_config,
3233 const char *id, unsigned int lane_count,
3334 const struct intel_link_m_n *m_n)
3435 {
35− struct drm_i915_private *i915 = to_i915(pipe_config->uapi.crtc->dev);
36−
37− drm_dbg_kms(&i915->drm,
38− "%s: lanes: %i; data_m: %u, data_n: %u, link_m: %u, link_n: %u, tu: %u\n",
39− id, lane_count,
40− m_n->data_m, m_n->data_n,
41− m_n->link_m, m_n->link_n, m_n->tu);
36+ drm_printf(p, "%s: lanes: %i; data_m: %u, data_n: %u, link_m: %u, link_n: %u, tu: %u\n",
37+ id, lane_count,
38+ m_n->data_m, m_n->data_n,
39+ m_n->link_m, m_n->link_n, m_n->tu);
4240 }
4341
4442 static void
@@ -52,17 +50,7 @@ intel_dump_infoframe(struct drm_i915_private *i915, · 7 unmodified lines
5250 }
5351
5452 static void
55−intel_dump_dp_vsc_sdp(struct drm_i915_private *i915,
56− const struct drm_dp_vsc_sdp *vsc)
57−{
58− struct drm_printer p = drm_dbg_printer(&i915->drm, DRM_UT_KMS, NULL);
59−
60− drm_dp_vsc_sdp_log(&p, vsc);
61−}
62−
63−static void
64−intel_dump_buffer(struct drm_i915_private *i915,
65− const char *prefix, const u8 *buf, size_t len)
53+intel_dump_buffer(const char *prefix, const u8 *buf, size_t len)
6654 {
6755 if (!drm_debug_enabled(DRM_UT_KMS))
6856 return;
@@ -130,71 +118,66 @@ const char *intel_output_format_name(enum intel_output_format format) · 61 unmodified lines
130118 return output_format_str[format];
131119 }
132120
133−static void intel_dump_plane_state(const struct intel_plane_state *plane_state)
121+static void intel_dump_plane_state(struct drm_printer *p,
122+ const struct intel_plane_state *plane_state)
134123 {
135124 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
136− struct drm_i915_private *i915 = to_i915(plane->base.dev);
137125 const struct drm_framebuffer *fb = plane_state->hw.fb;
138126
139127 if (!fb) {
140− drm_dbg_kms(&i915->drm,
141− "[PLANE:%d:%s] fb: [NOFB], visible: %s\n",
142− plane->base.base.id, plane->base.name,
143− str_yes_no(plane_state->uapi.visible));
128+ drm_printf(p, "[PLANE:%d:%s] fb: [NOFB], visible: %s\n",
129+ plane->base.base.id, plane->base.name,
130+ str_yes_no(plane_state->uapi.visible));
144131 return;
145132 }
146133
147− drm_dbg_kms(&i915->drm,
148− "[PLANE:%d:%s] fb: [FB:%d] %ux%u format = %p4cc modifier = 0x%llx, visible: %s\n",
149− plane->base.base.id, plane->base.name,
150− fb->base.id, fb->width, fb->height, &fb->format->format,
151− fb->modifier, str_yes_no(plane_state->uapi.visible));
152− drm_dbg_kms(&i915->drm, "\trotation: 0x%x, scaler: %d, scaling_filter: %d\n",
153− plane_state->hw.rotation, plane_state->scaler_id, plane_state->hw.scaling_filter);
134+ drm_printf(p, "[PLANE:%d:%s] fb: [FB:%d] %ux%u format = %p4cc modifier = 0x%llx, visible: %s\n",
135+ plane->base.base.id, plane->base.name,
136+ fb->base.id, fb->width, fb->height, &fb->format->format,
137+ fb->modifier, str_yes_no(plane_state->uapi.visible));
138+ drm_printf(p, "\trotation: 0x%x, scaler: %d, scaling_filter: %d\n",
139+ plane_state->hw.rotation, plane_state->scaler_id, plane_state->hw.scaling_filter);
154140 if (plane_state->uapi.visible)
155− drm_dbg_kms(&i915->drm,
156− "\tsrc: " DRM_RECT_FP_FMT " dst: " DRM_RECT_FMT "\n",
157− DRM_RECT_FP_ARG(&plane_state->uapi.src),
158− DRM_RECT_ARG(&plane_state->uapi.dst));
141+ drm_printf(p, "\tsrc: " DRM_RECT_FP_FMT " dst: " DRM_RECT_FMT "\n",
142+ DRM_RECT_FP_ARG(&plane_state->uapi.src),
143+ DRM_RECT_ARG(&plane_state->uapi.dst));
159144 }
160145
161146 static void
162−ilk_dump_csc(struct drm_i915_private *i915, const char *name,
147+ilk_dump_csc(struct drm_i915_private *i915,
148+ struct drm_printer *p,
149+ const char *name,
163150 const struct intel_csc_matrix *csc)
164151 {
165152 int i;
166153
167− drm_dbg_kms(&i915->drm,
168− "%s: pre offsets: 0x%04x 0x%04x 0x%04x\n", name,
169− csc->preoff[0], csc->preoff[1], csc->preoff[2]);
154+ drm_printf(p, "%s: pre offsets: 0x%04x 0x%04x 0x%04x\n", name,
155+ csc->preoff[0], csc->preoff[1], csc->preoff[2]);
170156
171157 for (i = 0; i < 3; i++)
172− drm_dbg_kms(&i915->drm,
173− "%s: coefficients: 0x%04x 0x%04x 0x%04x\n", name,
174− csc->coeff[3 * i + 0],
175− csc->coeff[3 * i + 1],
176− csc->coeff[3 * i + 2]);
158+ drm_printf(p, "%s: coefficients: 0x%04x 0x%04x 0x%04x\n", name,
159+ csc->coeff[3 * i + 0],
160+ csc->coeff[3 * i + 1],
161+ csc->coeff[3 * i + 2]);
177162
178163 if (DISPLAY_VER(i915) < 7)
179164 return;
180165
181− drm_dbg_kms(&i915->drm,
182− "%s: post offsets: 0x%04x 0x%04x 0x%04x\n", name,
183− csc->postoff[0], csc->postoff[1], csc->postoff[2]);
166+ drm_printf(p, "%s: post offsets: 0x%04x 0x%04x 0x%04x\n", name,
167+ csc->postoff[0], csc->postoff[1], csc->postoff[2]);
184168 }
185169
186170 static void
187−vlv_dump_csc(struct drm_i915_private *i915, const char *name,
171+vlv_dump_csc(struct drm_printer *p, const char *name,
188172 const struct intel_csc_matrix *csc)
189173 {
190174 int i;
191175
192176 for (i = 0; i < 3; i++)
193− drm_dbg_kms(&i915->drm,
194− "%s: coefficients: 0x%04x 0x%04x 0x%04x\n", name,
195− csc->coeff[3 * i + 0],
196− csc->coeff[3 * i + 1],
197− csc->coeff[3 * i + 2]);
177+ drm_printf(p, "%s: coefficients: 0x%04x 0x%04x 0x%04x\n", name,
178+ csc->coeff[3 * i + 0],
179+ csc->coeff[3 * i + 1],
180+ csc->coeff[3 * i + 2]);
198181 }
199182
200183 void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
@@ -205,85 +188,86 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config, · 4 unmodified lines
205188 struct drm_i915_private *i915 = to_i915(crtc->base.dev);
206189 const struct intel_plane_state *plane_state;
207190 struct intel_plane *plane;
191+ struct drm_printer p;
208192 char buf[64];
209193 int i;
210194
211− drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] enable: %s [%s]\n",
212− crtc->base.base.id, crtc->base.name,
213− str_yes_no(pipe_config->hw.enable), context);
195+ if (!drm_debug_enabled(DRM_UT_KMS))
196+ return;
197+
198+ p = drm_dbg_printer(&i915->drm, DRM_UT_KMS, NULL);
199+
200+ drm_printf(&p, "[CRTC:%d:%s] enable: %s [%s]\n",
201+ crtc->base.base.id, crtc->base.name,
202+ str_yes_no(pipe_config->hw.enable), context);
214203
215204 if (!pipe_config->hw.enable)
216205 goto dump_planes;
217206
218207 snprintf_output_types(buf, sizeof(buf), pipe_config->output_types);
219− drm_dbg_kms(&i915->drm,
220− "active: %s, output_types: %s (0x%x), output format: %s, sink format: %s\n",
221− str_yes_no(pipe_config->hw.active),
222− buf, pipe_config->output_types,
223− intel_output_format_name(pipe_config->output_format),
224− intel_output_format_name(pipe_config->sink_format));
225−
226− drm_dbg_kms(&i915->drm,
227− "cpu_transcoder: %s, pipe bpp: %i, dithering: %i\n",
228− transcoder_name(pipe_config->cpu_transcoder),
229− pipe_config->pipe_bpp, pipe_config->dither);
230−
231− drm_dbg_kms(&i915->drm, "MST master transcoder: %s\n",
232− transcoder_name(pipe_config->mst_master_transcoder));
233−
234− drm_dbg_kms(&i915->drm,
235− "port sync: master transcoder: %s, slave transcoder bitmask = 0x%x\n",
236− transcoder_name(pipe_config->master_transcoder),
237− pipe_config->sync_mode_slaves_mask);
238−
239− drm_dbg_kms(&i915->drm, "bigjoiner: %s, pipes: 0x%x\n",
240− intel_crtc_is_bigjoiner_slave(pipe_config) ? "slave" :
241− intel_crtc_is_bigjoiner_master(pipe_config) ? "master" : "no",
242− pipe_config->bigjoiner_pipes);
243−
244− drm_dbg_kms(&i915->drm, "splitter: %s, link count %d, overlap %d\n",
245− str_enabled_disabled(pipe_config->splitter.enable),
246− pipe_config->splitter.link_count,
247− pipe_config->splitter.pixel_overlap);
208+ drm_printf(&p, "active: %s, output_types: %s (0x%x), output format: %s, sink format: %s\n",
209+ str_yes_no(pipe_config->hw.active),
210+ buf, pipe_config->output_types,
211+ intel_output_format_name(pipe_config->output_format),
212+ intel_output_format_name(pipe_config->sink_format));
213+
214+ drm_printf(&p, "cpu_transcoder: %s, pipe bpp: %i, dithering: %i\n",
215+ transcoder_name(pipe_config->cpu_transcoder),
216+ pipe_config->pipe_bpp, pipe_config->dither);
217+
218+ drm_printf(&p, "MST master transcoder: %s\n",
219+ transcoder_name(pipe_config->mst_master_transcoder));
220+
221+ drm_printf(&p, "port sync: master transcoder: %s, slave transcoder bitmask = 0x%x\n",
222+ transcoder_name(pipe_config->master_transcoder),
223+ pipe_config->sync_mode_slaves_mask);
224+
225+ drm_printf(&p, "bigjoiner: %s, pipes: 0x%x\n",
226+ intel_crtc_is_bigjoiner_slave(pipe_config) ? "slave" :
227+ intel_crtc_is_bigjoiner_master(pipe_config) ? "master" : "no",
228+ pipe_config->bigjoiner_pipes);
229+
230+ drm_printf(&p, "splitter: %s, link count %d, overlap %d\n",
231+ str_enabled_disabled(pipe_config->splitter.enable),
232+ pipe_config->splitter.link_count,
233+ pipe_config->splitter.pixel_overlap);
248234
249235 if (pipe_config->has_pch_encoder)
250− intel_dump_m_n_config(pipe_config, "fdi",
236+ intel_dump_m_n_config(&p, pipe_config, "fdi",
251237 pipe_config->fdi_lanes,
252238 &pipe_config->fdi_m_n);
253239
254240 if (intel_crtc_has_dp_encoder(pipe_config)) {
255− intel_dump_m_n_config(pipe_config, "dp m_n",
241+ intel_dump_m_n_config(&p, pipe_config, "dp m_n",
256242 pipe_config->lane_count,
257243 &pipe_config->dp_m_n);
258− intel_dump_m_n_config(pipe_config, "dp m2_n2",
244+ intel_dump_m_n_config(&p, pipe_config, "dp m2_n2",
259245 pipe_config->lane_count,
260246 &pipe_config->dp_m2_n2);
261− drm_dbg_kms(&i915->drm, "fec: %s, enhanced framing: %s\n",
262− str_enabled_disabled(pipe_config->fec_enable),
263− str_enabled_disabled(pipe_config->enhanced_framing));
264−
265− drm_dbg_kms(&i915->drm, "sdp split: %s\n",
266− str_enabled_disabled(pipe_config->sdp_split_enable));
267−
268− drm_dbg_kms(&i915->drm, "psr: %s, psr2: %s, panel replay: %s, selective fetch: %s\n",
269− str_enabled_disabled(pipe_config->has_psr),
270− str_enabled_disabled(pipe_config->has_psr2),
271− str_enabled_disabled(pipe_config->has_panel_replay),
272− str_enabled_disabled(pipe_config->enable_psr2_sel_fetch));
247+ drm_printf(&p, "fec: %s, enhanced framing: %s\n",
248+ str_enabled_disabled(pipe_config->fec_enable),
249+ str_enabled_disabled(pipe_config->enhanced_framing));
250+
251+ drm_printf(&p, "sdp split: %s\n",
252+ str_enabled_disabled(pipe_config->sdp_split_enable));
253+
254+ drm_printf(&p, "psr: %s, psr2: %s, panel replay: %s, selective fetch: %s\n",
255+ str_enabled_disabled(pipe_config->has_psr),
256+ str_enabled_disabled(pipe_config->has_psr2),
257+ str_enabled_disabled(pipe_config->has_panel_replay),
258+ str_enabled_disabled(pipe_config->enable_psr2_sel_fetch));
273259 }
274260
275− drm_dbg_kms(&i915->drm, "framestart delay: %d, MSA timing delay: %d\n",
276− pipe_config->framestart_delay, pipe_config->msa_timing_delay);
261+ drm_printf(&p, "framestart delay: %d, MSA timing delay: %d\n",
262+ pipe_config->framestart_delay, pipe_config->msa_timing_delay);
277263
278− drm_dbg_kms(&i915->drm,
279− "audio: %i, infoframes: %i, infoframes enabled: 0x%x\n",
280− pipe_config->has_audio, pipe_config->has_infoframe,
281− pipe_config->infoframes.enable);
264+ drm_printf(&p, "audio: %i, infoframes: %i, infoframes enabled: 0x%x\n",
265+ pipe_config->has_audio, pipe_config->has_infoframe,
266+ pipe_config->infoframes.enable);
282267
283268 if (pipe_config->infoframes.enable &
284269 intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GENERAL_CONTROL))
285− drm_dbg_kms(&i915->drm, "GCP: 0x%x\n",
286− pipe_config->infoframes.gcp);
270+ drm_printf(&p, "GCP: 0x%x\n", pipe_config->infoframes.gcp);
287271 if (pipe_config->infoframes.enable &
288272 intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_AVI))
289273 intel_dump_infoframe(i915, &pipe_config->infoframes.avi);
@@ -301,91 +285,88 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config, · 11 unmodified lines
301285 intel_dump_infoframe(i915, &pipe_config->infoframes.drm);
302286 if (pipe_config->infoframes.enable &
303287 intel_hdmi_infoframe_enable(DP_SDP_VSC))
304− intel_dump_dp_vsc_sdp(i915, &pipe_config->infoframes.vsc);
288+ drm_dp_vsc_sdp_log(&p, &pipe_config->infoframes.vsc);
289+ if (pipe_config->infoframes.enable &
290+ intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC))
291+ drm_dp_as_sdp_log(&p, &pipe_config->infoframes.as_sdp);
305292
306293 if (pipe_config->has_audio)
307− intel_dump_buffer(i915, "ELD: ", pipe_config->eld,
294+ intel_dump_buffer("ELD: ", pipe_config->eld,
308295 drm_eld_size(pipe_config->eld));
309296
310− drm_dbg_kms(&i915->drm, "vrr: %s, vmin: %d, vmax: %d, pipeline full: %d, guardband: %d flipline: %d, vmin vblank: %d, vmax vblank: %d\n",
311− str_yes_no(pipe_config->vrr.enable),
312− pipe_config->vrr.vmin, pipe_config->vrr.vmax,
313− pipe_config->vrr.pipeline_full, pipe_config->vrr.guardband,
314− pipe_config->vrr.flipline,
315− intel_vrr_vmin_vblank_start(pipe_config),
316− intel_vrr_vmax_vblank_start(pipe_config));
317−
318− drm_dbg_kms(&i915->drm, "requested mode: " DRM_MODE_FMT "\n",
319− DRM_MODE_ARG(&pipe_config->hw.mode));
320− drm_dbg_kms(&i915->drm, "adjusted mode: " DRM_MODE_FMT "\n",
321− DRM_MODE_ARG(&pipe_config->hw.adjusted_mode));
322− intel_dump_crtc_timings(i915, &pipe_config->hw.adjusted_mode);
323− drm_dbg_kms(&i915->drm, "pipe mode: " DRM_MODE_FMT "\n",
324− DRM_MODE_ARG(&pipe_config->hw.pipe_mode));
325− intel_dump_crtc_timings(i915, &pipe_config->hw.pipe_mode);
326− drm_dbg_kms(&i915->drm,
327− "port clock: %d, pipe src: " DRM_RECT_FMT ", pixel rate %d\n",
328− pipe_config->port_clock, DRM_RECT_ARG(&pipe_config->pipe_src),
329− pipe_config->pixel_rate);
330−
331− drm_dbg_kms(&i915->drm, "linetime: %d, ips linetime: %d\n",
332− pipe_config->linetime, pipe_config->ips_linetime);
297+ drm_printf(&p, "vrr: %s, vmin: %d, vmax: %d, pipeline full: %d, guardband: %d flipline: %d, vmin vblank: %d, vmax vblank: %d\n",
298+ str_yes_no(pipe_config->vrr.enable),
299+ pipe_config->vrr.vmin, pipe_config->vrr.vmax,
300+ pipe_config->vrr.pipeline_full, pipe_config->vrr.guardband,
301+ pipe_config->vrr.flipline,
302+ intel_vrr_vmin_vblank_start(pipe_config),
303+ intel_vrr_vmax_vblank_start(pipe_config));
304+
305+ drm_printf(&p, "requested mode: " DRM_MODE_FMT "\n",
306+ DRM_MODE_ARG(&pipe_config->hw.mode));
307+ drm_printf(&p, "adjusted mode: " DRM_MODE_FMT "\n",
308+ DRM_MODE_ARG(&pipe_config->hw.adjusted_mode));
309+ intel_dump_crtc_timings(&p, &pipe_config->hw.adjusted_mode);
310+ drm_printf(&p, "pipe mode: " DRM_MODE_FMT "\n",
311+ DRM_MODE_ARG(&pipe_config->hw.pipe_mode));
312+ intel_dump_crtc_timings(&p, &pipe_config->hw.pipe_mode);
313+ drm_printf(&p, "port clock: %d, pipe src: " DRM_RECT_FMT ", pixel rate %d\n",
314+ pipe_config->port_clock, DRM_RECT_ARG(&pipe_config->pipe_src),
315+ pipe_config->pixel_rate);
316+
317+ drm_printf(&p, "linetime: %d, ips linetime: %d\n",
318+ pipe_config->linetime, pipe_config->ips_linetime);
333319
334320 if (DISPLAY_VER(i915) >= 9)
335− drm_dbg_kms(&i915->drm,
336− "num_scalers: %d, scaler_users: 0x%x, scaler_id: %d, scaling_filter: %d\n",
337− crtc->num_scalers,
338− pipe_config->scaler_state.scaler_users,
339− pipe_config->scaler_state.scaler_id,
340− pipe_config->hw.scaling_filter);
321+ drm_printf(&p, "num_scalers: %d, scaler_users: 0x%x, scaler_id: %d, scaling_filter: %d\n",
322+ crtc->num_scalers,
323+ pipe_config->scaler_state.scaler_users,
324+ pipe_config->scaler_state.scaler_id,
325+ pipe_config->hw.scaling_filter);
341326
342327 if (HAS_GMCH(i915))
343− drm_dbg_kms(&i915->drm,
344− "gmch pfit: control: 0x%08x, ratios: 0x%08x, lvds border: 0x%08x\n",
345− pipe_config->gmch_pfit.control,
346− pipe_config->gmch_pfit.pgm_ratios,
347− pipe_config->gmch_pfit.lvds_border_bits);
328+ drm_printf(&p, "gmch pfit: control: 0x%08x, ratios: 0x%08x, lvds border: 0x%08x\n",
329+ pipe_config->gmch_pfit.control,
330+ pipe_config->gmch_pfit.pgm_ratios,
331+ pipe_config->gmch_pfit.lvds_border_bits);
348332 else
349− drm_dbg_kms(&i915->drm,
350− "pch pfit: " DRM_RECT_FMT ", %s, force thru: %s\n",
351− DRM_RECT_ARG(&pipe_config->pch_pfit.dst),
352− str_enabled_disabled(pipe_config->pch_pfit.enabled),
353− str_yes_no(pipe_config->pch_pfit.force_thru));
333+ drm_printf(&p, "pch pfit: " DRM_RECT_FMT ", %s, force thru: %s\n",
334+ DRM_RECT_ARG(&pipe_config->pch_pfit.dst),
335+ str_enabled_disabled(pipe_config->pch_pfit.enabled),
336+ str_yes_no(pipe_config->pch_pfit.force_thru));
354337
355− drm_dbg_kms(&i915->drm, "ips: %i, double wide: %i, drrs: %i\n",
356− pipe_config->ips_enabled, pipe_config->double_wide,
357− pipe_config->has_drrs);
338+ drm_printf(&p, "ips: %i, double wide: %i, drrs: %i\n",
339+ pipe_config->ips_enabled, pipe_config->double_wide,
340+ pipe_config->has_drrs);
358341
359− intel_dpll_dump_hw_state(i915, &pipe_config->dpll_hw_state);
342+ intel_dpll_dump_hw_state(i915, &p, &pipe_config->dpll_hw_state);
360343
361344 if (IS_CHERRYVIEW(i915))
362− drm_dbg_kms(&i915->drm,
363− "cgm_mode: 0x%x gamma_mode: 0x%x gamma_enable: %d csc_enable: %d\n",
364− pipe_config->cgm_mode, pipe_config->gamma_mode,
365− pipe_config->gamma_enable, pipe_config->csc_enable);
345+ drm_printf(&p, "cgm_mode: 0x%x gamma_mode: 0x%x gamma_enable: %d csc_enable: %d\n",
346+ pipe_config->cgm_mode, pipe_config->gamma_mode,
347+ pipe_config->gamma_enable, pipe_config->csc_enable);
366348 else
367− drm_dbg_kms(&i915->drm,
368− "csc_mode: 0x%x gamma_mode: 0x%x gamma_enable: %d csc_enable: %d\n",
369− pipe_config->csc_mode, pipe_config->gamma_mode,
370− pipe_config->gamma_enable, pipe_config->csc_enable);
371−
372− drm_dbg_kms(&i915->drm, "pre csc lut: %s%d entries, post csc lut: %d entries\n",
373− pipe_config->pre_csc_lut && pipe_config->pre_csc_lut ==
374− i915->display.color.glk_linear_degamma_lut ? "(linear) " : "",
375− pipe_config->pre_csc_lut ?
376− drm_color_lut_size(pipe_config->pre_csc_lut) : 0,
377− pipe_config->post_csc_lut ?
378− drm_color_lut_size(pipe_config->post_csc_lut) : 0);
349+ drm_printf(&p, "csc_mode: 0x%x gamma_mode: 0x%x gamma_enable: %d csc_enable: %d\n",
350+ pipe_config->csc_mode, pipe_config->gamma_mode,
351+ pipe_config->gamma_enable, pipe_config->csc_enable);
352+
353+ drm_printf(&p, "pre csc lut: %s%d entries, post csc lut: %d entries\n",
354+ pipe_config->pre_csc_lut && pipe_config->pre_csc_lut ==
355+ i915->display.color.glk_linear_degamma_lut ? "(linear) " : "",
356+ pipe_config->pre_csc_lut ?
357+ drm_color_lut_size(pipe_config->pre_csc_lut) : 0,
358+ pipe_config->post_csc_lut ?
359+ drm_color_lut_size(pipe_config->post_csc_lut) : 0);
379360
380361 if (DISPLAY_VER(i915) >= 11)
381− ilk_dump_csc(i915, "output csc", &pipe_config->output_csc);
362+ ilk_dump_csc(i915, &p, "output csc", &pipe_config->output_csc);
382363
383364 if (!HAS_GMCH(i915))
384− ilk_dump_csc(i915, "pipe csc", &pipe_config->csc);
365+ ilk_dump_csc(i915, &p, "pipe csc", &pipe_config->csc);
385366 else if (IS_CHERRYVIEW(i915))
386− vlv_dump_csc(i915, "cgm csc", &pipe_config->csc);
367+ vlv_dump_csc(&p, "cgm csc", &pipe_config->csc);
387368 else if (IS_VALLEYVIEW(i915))
388− vlv_dump_csc(i915, "wgc csc", &pipe_config->csc);
369+ vlv_dump_csc(&p, "wgc csc", &pipe_config->csc);
389370
390371 dump_planes:
391372 if (!state)
@@ -393,6 +374,6 @@ dump_planes: · 1 unmodified line
393374
394375 for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
395376 if (plane->pipe == crtc->pipe)
396− intel_dump_plane_state(plane_state);
377+ intel_dump_plane_state(&p, plane_state);
397378 }
398379 }
drivers/gpu/drm/i915/display/intel_cursor.c+23−1
@@ -509,6 +509,24 @@ static void i9xx_cursor_disable_sel_fetch_arm(struct intel_plane *plane, · 508 unmodified lines
509509 intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_CTL(pipe, plane->id), 0);
510510 }
511511
512+static void wa_16021440873(struct intel_plane *plane,
513+ const struct intel_crtc_state *crtc_state,
514+ const struct intel_plane_state *plane_state)
515+{
516+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
517+ u32 ctl = plane_state->ctl;
518+ int et_y_position = drm_rect_height(&crtc_state->pipe_src) + 1;
519+ enum pipe pipe = plane->pipe;
520+
521+ ctl &= ~MCURSOR_MODE_MASK;
522+ ctl |= MCURSOR_MODE_64_2B;
523+
524+ intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_CTL(pipe, plane->id), ctl);
525+
526+ intel_de_write(dev_priv, PIPE_SRCSZ_ERLY_TPT(pipe),
527+ PIPESRC_HEIGHT(et_y_position));
528+}
529+
512530 static void i9xx_cursor_update_sel_fetch_arm(struct intel_plane *plane,
513531 const struct intel_crtc_state *crtc_state,
514532 const struct intel_plane_state *plane_state)
@@ -529,7 +547,11 @@ static void i9xx_cursor_update_sel_fetch_arm(struct intel_plane *plane, · 14 unmodified lines
529547 intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_CTL(pipe, plane->id),
530548 plane_state->ctl);
531549 } else {
532− i9xx_cursor_disable_sel_fetch_arm(plane, crtc_state);
550+ /* Wa_16021440873 */
551+ if (crtc_state->enable_psr2_su_region_et)
552+ wa_16021440873(plane, crtc_state, plane_state);
553+ else
554+ i9xx_cursor_disable_sel_fetch_arm(plane, crtc_state);
533555 }
534556 }
535557
drivers/gpu/drm/i915/display/intel_cx0_phy.c+186−183
@@ -29,8 +29,11 @@ · 28 unmodified lines
2929 #define INTEL_CX0_LANE1 BIT(1)
3030 #define INTEL_CX0_BOTH_LANES (INTEL_CX0_LANE1 | INTEL_CX0_LANE0)
3131
32−bool intel_is_c10phy(struct drm_i915_private *i915, enum phy phy)
32+bool intel_encoder_is_c10phy(struct intel_encoder *encoder)
3333 {
34+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
35+ enum phy phy = intel_encoder_to_phy(encoder);
36+
3437 if ((IS_LUNARLAKE(i915) || IS_METEORLAKE(i915)) && phy < PHY_C)
3538 return true;
3639
@@ -46,8 +49,7 @@ static int lane_mask_to_lane(u8 lane_mask) · 9 unmodified lines
4649 return ilog2(lane_mask);
4750 }
4851
49−static u8 intel_cx0_get_owned_lane_mask(struct drm_i915_private *i915,
50− struct intel_encoder *encoder)
52+static u8 intel_cx0_get_owned_lane_mask(struct intel_encoder *encoder)
5153 {
5254 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
5355
@@ -114,16 +116,20 @@ static void intel_cx0_phy_transaction_end(struct intel_encoder *encoder, intel_w · 60 unmodified lines
114116 intel_display_power_put(i915, POWER_DOMAIN_DC_OFF, wakeref);
115117 }
116118
117−static void intel_clear_response_ready_flag(struct drm_i915_private *i915,
118− enum port port, int lane)
119+static void intel_clear_response_ready_flag(struct intel_encoder *encoder,
120+ int lane)
119121 {
120− intel_de_rmw(i915, XELPDP_PORT_P2M_MSGBUS_STATUS(i915, port, lane),
122+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
123+
124+ intel_de_rmw(i915, XELPDP_PORT_P2M_MSGBUS_STATUS(i915, encoder->port, lane),
121125 0, XELPDP_PORT_P2M_RESPONSE_READY | XELPDP_PORT_P2M_ERROR_SET);
122126 }
123127
124−static void intel_cx0_bus_reset(struct drm_i915_private *i915, enum port port, int lane)
128+static void intel_cx0_bus_reset(struct intel_encoder *encoder, int lane)
125129 {
126− enum phy phy = intel_port_to_phy(i915, port);
130+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
131+ enum port port = encoder->port;
132+ enum phy phy = intel_encoder_to_phy(encoder);
127133
128134 intel_de_write(i915, XELPDP_PORT_M2P_MSGBUS_CTL(i915, port, lane),
129135 XELPDP_PORT_M2P_TRANSACTION_RESET);
@@ -135,20 +141,22 @@ static void intel_cx0_bus_reset(struct drm_i915_private *i915, enum port port, i · 5 unmodified lines
135141 return;
136142 }
137143
138− intel_clear_response_ready_flag(i915, port, lane);
144+ intel_clear_response_ready_flag(encoder, lane);
139145 }
140146
141−static int intel_cx0_wait_for_ack(struct drm_i915_private *i915, enum port port,
147+static int intel_cx0_wait_for_ack(struct intel_encoder *encoder,
142148 int command, int lane, u32 *val)
143149 {
144− enum phy phy = intel_port_to_phy(i915, port);
145−
146− if (__intel_de_wait_for_register(i915,
147− XELPDP_PORT_P2M_MSGBUS_STATUS(i915, port, lane),
148− XELPDP_PORT_P2M_RESPONSE_READY,
149− XELPDP_PORT_P2M_RESPONSE_READY,
150− XELPDP_MSGBUS_TIMEOUT_FAST_US,
151− XELPDP_MSGBUS_TIMEOUT_SLOW, val)) {
150+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
151+ enum port port = encoder->port;
152+ enum phy phy = intel_encoder_to_phy(encoder);
153+
154+ if (intel_de_wait_custom(i915,
155+ XELPDP_PORT_P2M_MSGBUS_STATUS(i915, port, lane),
156+ XELPDP_PORT_P2M_RESPONSE_READY,
157+ XELPDP_PORT_P2M_RESPONSE_READY,
158+ XELPDP_MSGBUS_TIMEOUT_FAST_US,
159+ XELPDP_MSGBUS_TIMEOUT_SLOW, val)) {
152160 drm_dbg_kms(&i915->drm, "PHY %c Timeout waiting for message ACK. Status: 0x%x\n",
153161 phy_name(phy), *val);
154162
@@ -158,31 +166,33 @@ static int intel_cx0_wait_for_ack(struct drm_i915_private *i915, enum port port, · 3 unmodified lines
158166 "PHY %c Hardware did not detect a timeout\n",
159167 phy_name(phy));
160168
161− intel_cx0_bus_reset(i915, port, lane);
169+ intel_cx0_bus_reset(encoder, lane);
162170 return -ETIMEDOUT;
163171 }
164172
165173 if (*val & XELPDP_PORT_P2M_ERROR_SET) {
166174 drm_dbg_kms(&i915->drm, "PHY %c Error occurred during %s command. Status: 0x%x\n", phy_name(phy),
167175 command == XELPDP_PORT_P2M_COMMAND_READ_ACK ? "read" : "write", *val);
168− intel_cx0_bus_reset(i915, port, lane);
176+ intel_cx0_bus_reset(encoder, lane);
169177 return -EINVAL;
170178 }
171179
172180 if (REG_FIELD_GET(XELPDP_PORT_P2M_COMMAND_TYPE_MASK, *val) != command) {
173181 drm_dbg_kms(&i915->drm, "PHY %c Not a %s response. MSGBUS Status: 0x%x.\n", phy_name(phy),
174182 command == XELPDP_PORT_P2M_COMMAND_READ_ACK ? "read" : "write", *val);
175− intel_cx0_bus_reset(i915, port, lane);
183+ intel_cx0_bus_reset(encoder, lane);
176184 return -EINVAL;
177185 }
178186
179187 return 0;
180188 }
181189
182−static int __intel_cx0_read_once(struct drm_i915_private *i915, enum port port,
190+static int __intel_cx0_read_once(struct intel_encoder *encoder,
183191 int lane, u16 addr)
184192 {
185− enum phy phy = intel_port_to_phy(i915, port);
193+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
194+ enum port port = encoder->port;
195+ enum phy phy = intel_encoder_to_phy(encoder);
186196 int ack;
187197 u32 val;
188198
@@ -191,7 +201,7 @@ static int __intel_cx0_read_once(struct drm_i915_private *i915, enum port port, · 2 unmodified lines
191201 XELPDP_MSGBUS_TIMEOUT_SLOW)) {
192202 drm_dbg_kms(&i915->drm,
193203 "PHY %c Timeout waiting for previous transaction to complete. Reset the bus and retry.\n", phy_name(phy));
194− intel_cx0_bus_reset(i915, port, lane);
204+ intel_cx0_bus_reset(encoder, lane);
195205 return -ETIMEDOUT;
196206 }
197207
@@ -200,33 +210,34 @@ static int __intel_cx0_read_once(struct drm_i915_private *i915, enum port port, · 2 unmodified lines
200210 XELPDP_PORT_M2P_COMMAND_READ |
201211 XELPDP_PORT_M2P_ADDRESS(addr));
202212
203− ack = intel_cx0_wait_for_ack(i915, port, XELPDP_PORT_P2M_COMMAND_READ_ACK, lane, &val);
213+ ack = intel_cx0_wait_for_ack(encoder, XELPDP_PORT_P2M_COMMAND_READ_ACK, lane, &val);
204214 if (ack < 0)
205215 return ack;
206216
207− intel_clear_response_ready_flag(i915, port, lane);
217+ intel_clear_response_ready_flag(encoder, lane);
208218
209219 /*
210220 * FIXME: Workaround to let HW to settle
211221 * down and let the message bus to end up
212222 * in a known state
213223 */
214− intel_cx0_bus_reset(i915, port, lane);
224+ intel_cx0_bus_reset(encoder, lane);
215225
216226 return REG_FIELD_GET(XELPDP_PORT_P2M_DATA_MASK, val);
217227 }
218228
219−static u8 __intel_cx0_read(struct drm_i915_private *i915, enum port port,
229+static u8 __intel_cx0_read(struct intel_encoder *encoder,
220230 int lane, u16 addr)
221231 {
222− enum phy phy = intel_port_to_phy(i915, port);
232+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
233+ enum phy phy = intel_encoder_to_phy(encoder);
223234 int i, status;
224235
225236 assert_dc_off(i915);
226237
227238 /* 3 tries is assumed to be enough to read successfully */
228239 for (i = 0; i < 3; i++) {
229− status = __intel_cx0_read_once(i915, port, lane, addr);
240+ status = __intel_cx0_read_once(encoder, lane, addr);
230241
231242 if (status >= 0)
232243 return status;
@@ -238,18 +249,20 @@ static u8 __intel_cx0_read(struct drm_i915_private *i915, enum port port, · 5 unmodified lines
238249 return 0;
239250 }
240251
241−static u8 intel_cx0_read(struct drm_i915_private *i915, enum port port,
252+static u8 intel_cx0_read(struct intel_encoder *encoder,
242253 u8 lane_mask, u16 addr)
243254 {
244255 int lane = lane_mask_to_lane(lane_mask);
245256
246− return __intel_cx0_read(i915, port, lane, addr);
257+ return __intel_cx0_read(encoder, lane, addr);
247258 }
248259
249−static int __intel_cx0_write_once(struct drm_i915_private *i915, enum port port,
260+static int __intel_cx0_write_once(struct intel_encoder *encoder,
250261 int lane, u16 addr, u8 data, bool committed)
251262 {
252− enum phy phy = intel_port_to_phy(i915, port);
263+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
264+ enum port port = encoder->port;
265+ enum phy phy = intel_encoder_to_phy(encoder);
253266 int ack;
254267 u32 val;
255268
@@ -258,7 +271,7 @@ static int __intel_cx0_write_once(struct drm_i915_private *i915, enum port port, · 2 unmodified lines
258271 XELPDP_MSGBUS_TIMEOUT_SLOW)) {
259272 drm_dbg_kms(&i915->drm,
260273 "PHY %c Timeout waiting for previous transaction to complete. Resetting the bus.\n", phy_name(phy));
261− intel_cx0_bus_reset(i915, port, lane);
274+ intel_cx0_bus_reset(encoder, lane);
262275 return -ETIMEDOUT;
263276 }
264277
@@ -274,45 +287,46 @@ static int __intel_cx0_write_once(struct drm_i915_private *i915, enum port port, · 9 unmodified lines
274287 XELPDP_MSGBUS_TIMEOUT_SLOW)) {
275288 drm_dbg_kms(&i915->drm,
276289 "PHY %c Timeout waiting for write to complete. Resetting the bus.\n", phy_name(phy));
277− intel_cx0_bus_reset(i915, port, lane);
290+ intel_cx0_bus_reset(encoder, lane);
278291 return -ETIMEDOUT;
279292 }
280293
281294 if (committed) {
282− ack = intel_cx0_wait_for_ack(i915, port, XELPDP_PORT_P2M_COMMAND_WRITE_ACK, lane, &val);
295+ ack = intel_cx0_wait_for_ack(encoder, XELPDP_PORT_P2M_COMMAND_WRITE_ACK, lane, &val);
283296 if (ack < 0)
284297 return ack;
285298 } else if ((intel_de_read(i915, XELPDP_PORT_P2M_MSGBUS_STATUS(i915, port, lane)) &
286299 XELPDP_PORT_P2M_ERROR_SET)) {
287300 drm_dbg_kms(&i915->drm,
288301 "PHY %c Error occurred during write command.\n", phy_name(phy));
289− intel_cx0_bus_reset(i915, port, lane);
302+ intel_cx0_bus_reset(encoder, lane);
290303 return -EINVAL;
291304 }
292305
293− intel_clear_response_ready_flag(i915, port, lane);
306+ intel_clear_response_ready_flag(encoder, lane);
294307
295308 /*
296309 * FIXME: Workaround to let HW to settle
297310 * down and let the message bus to end up
298311 * in a known state
299312 */
300− intel_cx0_bus_reset(i915, port, lane);
313+ intel_cx0_bus_reset(encoder, lane);
301314
302315 return 0;
303316 }
304317
305−static void __intel_cx0_write(struct drm_i915_private *i915, enum port port,
318+static void __intel_cx0_write(struct intel_encoder *encoder,
306319 int lane, u16 addr, u8 data, bool committed)
307320 {
308− enum phy phy = intel_port_to_phy(i915, port);
321+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
322+ enum phy phy = intel_encoder_to_phy(encoder);
309323 int i, status;
310324
311325 assert_dc_off(i915);
312326
313327 /* 3 tries is assumed to be enough to write successfully */
314328 for (i = 0; i < 3; i++) {
315− status = __intel_cx0_write_once(i915, port, lane, addr, data, committed);
329+ status = __intel_cx0_write_once(encoder, lane, addr, data, committed);
316330
317331 if (status == 0)
318332 return;
@@ -322,63 +336,66 @@ static void __intel_cx0_write(struct drm_i915_private *i915, enum port port, · 3 unmodified lines
322336 "PHY %c Write %04x failed after %d retries.\n", phy_name(phy), addr, i);
323337 }
324338
325−static void intel_cx0_write(struct drm_i915_private *i915, enum port port,
339+static void intel_cx0_write(struct intel_encoder *encoder,
326340 u8 lane_mask, u16 addr, u8 data, bool committed)
327341 {
328342 int lane;
329343
330344 for_each_cx0_lane_in_mask(lane_mask, lane)
331− __intel_cx0_write(i915, port, lane, addr, data, committed);
345+ __intel_cx0_write(encoder, lane, addr, data, committed);
332346 }
333347
334−static void intel_c20_sram_write(struct drm_i915_private *i915, enum port port,
348+static void intel_c20_sram_write(struct intel_encoder *encoder,
335349 int lane, u16 addr, u16 data)
336350 {
351+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
352+
337353 assert_dc_off(i915);
338354
339− intel_cx0_write(i915, port, lane, PHY_C20_WR_ADDRESS_H, addr >> 8, 0);
340− intel_cx0_write(i915, port, lane, PHY_C20_WR_ADDRESS_L, addr & 0xff, 0);
355+ intel_cx0_write(encoder, lane, PHY_C20_WR_ADDRESS_H, addr >> 8, 0);
356+ intel_cx0_write(encoder, lane, PHY_C20_WR_ADDRESS_L, addr & 0xff, 0);
341357
342− intel_cx0_write(i915, port, lane, PHY_C20_WR_DATA_H, data >> 8, 0);
343− intel_cx0_write(i915, port, lane, PHY_C20_WR_DATA_L, data & 0xff, 1);
358+ intel_cx0_write(encoder, lane, PHY_C20_WR_DATA_H, data >> 8, 0);
359+ intel_cx0_write(encoder, lane, PHY_C20_WR_DATA_L, data & 0xff, 1);
344360 }
345361
346−static u16 intel_c20_sram_read(struct drm_i915_private *i915, enum port port,
362+static u16 intel_c20_sram_read(struct intel_encoder *encoder,
347363 int lane, u16 addr)
348364 {
365+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
349366 u16 val;
350367
351368 assert_dc_off(i915);
352369
353− intel_cx0_write(i915, port, lane, PHY_C20_RD_ADDRESS_H, addr >> 8, 0);
354− intel_cx0_write(i915, port, lane, PHY_C20_RD_ADDRESS_L, addr & 0xff, 1);
370+ intel_cx0_write(encoder, lane, PHY_C20_RD_ADDRESS_H, addr >> 8, 0);
371+ intel_cx0_write(encoder, lane, PHY_C20_RD_ADDRESS_L, addr & 0xff, 1);
355372
356− val = intel_cx0_read(i915, port, lane, PHY_C20_RD_DATA_H);
373+ val = intel_cx0_read(encoder, lane, PHY_C20_RD_DATA_H);
357374 val <<= 8;
358− val |= intel_cx0_read(i915, port, lane, PHY_C20_RD_DATA_L);
375+ val |= intel_cx0_read(encoder, lane, PHY_C20_RD_DATA_L);
359376
360377 return val;
361378 }
362379
363−static void __intel_cx0_rmw(struct drm_i915_private *i915, enum port port,
380+static void __intel_cx0_rmw(struct intel_encoder *encoder,
364381 int lane, u16 addr, u8 clear, u8 set, bool committed)
365382 {
366383 u8 old, val;
367384
368− old = __intel_cx0_read(i915, port, lane, addr);
385+ old = __intel_cx0_read(encoder, lane, addr);
369386 val = (old & ~clear) | set;
370387
371388 if (val != old)
372− __intel_cx0_write(i915, port, lane, addr, val, committed);
389+ __intel_cx0_write(encoder, lane, addr, val, committed);
373390 }
374391
375−static void intel_cx0_rmw(struct drm_i915_private *i915, enum port port,
392+static void intel_cx0_rmw(struct intel_encoder *encoder,
376393 u8 lane_mask, u16 addr, u8 clear, u8 set, bool committed)
377394 {
378395 u8 lane;
379396
380397 for_each_cx0_lane_in_mask(lane_mask, lane)
381− __intel_cx0_rmw(i915, port, lane, addr, clear, set, committed);
398+ __intel_cx0_rmw(encoder, lane, addr, clear, set, committed);
382399 }
383400
384401 static u8 intel_c10_get_tx_vboost_lvl(const struct intel_crtc_state *crtc_state)
@@ -414,7 +431,6 @@ void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder, · 29 unmodified lines
414431 {
415432 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
416433 const struct intel_ddi_buf_trans *trans;
417− enum phy phy = intel_port_to_phy(i915, encoder->port);
418434 u8 owned_lane_mask;
419435 intel_wakeref_t wakeref;
420436 int n_entries, ln;
@@ -423,7 +439,7 @@ void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder, · 2 unmodified lines
423439 if (intel_tc_port_in_tbt_alt_mode(dig_port))
424440 return;
425441
426− owned_lane_mask = intel_cx0_get_owned_lane_mask(i915, encoder);
442+ owned_lane_mask = intel_cx0_get_owned_lane_mask(encoder);
427443
428444 wakeref = intel_cx0_phy_transaction_begin(encoder);
429445
@@ -433,14 +449,14 @@ void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder, · 3 unmodified lines
433449 return;
434450 }
435451
436− if (intel_is_c10phy(i915, phy)) {
437− intel_cx0_rmw(i915, encoder->port, owned_lane_mask, PHY_C10_VDR_CONTROL(1),
452+ if (intel_encoder_is_c10phy(encoder)) {
453+ intel_cx0_rmw(encoder, owned_lane_mask, PHY_C10_VDR_CONTROL(1),
438454 0, C10_VDR_CTRL_MSGBUS_ACCESS, MB_WRITE_COMMITTED);
439− intel_cx0_rmw(i915, encoder->port, owned_lane_mask, PHY_C10_VDR_CMN(3),
455+ intel_cx0_rmw(encoder, owned_lane_mask, PHY_C10_VDR_CMN(3),
440456 C10_CMN3_TXVBOOST_MASK,
441457 C10_CMN3_TXVBOOST(intel_c10_get_tx_vboost_lvl(crtc_state)),
442458 MB_WRITE_UNCOMMITTED);
443− intel_cx0_rmw(i915, encoder->port, owned_lane_mask, PHY_C10_VDR_TX(1),
459+ intel_cx0_rmw(encoder, owned_lane_mask, PHY_C10_VDR_TX(1),
444460 C10_TX1_TERMCTL_MASK,
445461 C10_TX1_TERMCTL(intel_c10_get_tx_term_ctl(crtc_state)),
446462 MB_WRITE_COMMITTED);
@@ -455,27 +471,27 @@ void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder, · 8 unmodified lines
455471 if (!(lane_mask & owned_lane_mask))
456472 continue;
457473
458− intel_cx0_rmw(i915, encoder->port, lane_mask, PHY_CX0_VDROVRD_CTL(lane, tx, 0),
474+ intel_cx0_rmw(encoder, lane_mask, PHY_CX0_VDROVRD_CTL(lane, tx, 0),
459475 C10_PHY_OVRD_LEVEL_MASK,
460476 C10_PHY_OVRD_LEVEL(trans->entries[level].snps.pre_cursor),
461477 MB_WRITE_COMMITTED);
462− intel_cx0_rmw(i915, encoder->port, lane_mask, PHY_CX0_VDROVRD_CTL(lane, tx, 1),
478+ intel_cx0_rmw(encoder, lane_mask, PHY_CX0_VDROVRD_CTL(lane, tx, 1),
463479 C10_PHY_OVRD_LEVEL_MASK,
464480 C10_PHY_OVRD_LEVEL(trans->entries[level].snps.vswing),
465481 MB_WRITE_COMMITTED);
466− intel_cx0_rmw(i915, encoder->port, lane_mask, PHY_CX0_VDROVRD_CTL(lane, tx, 2),
482+ intel_cx0_rmw(encoder, lane_mask, PHY_CX0_VDROVRD_CTL(lane, tx, 2),
467483 C10_PHY_OVRD_LEVEL_MASK,
468484 C10_PHY_OVRD_LEVEL(trans->entries[level].snps.post_cursor),
469485 MB_WRITE_COMMITTED);
470486 }
471487
472488 /* Write Override enables in 0xD71 */
473− intel_cx0_rmw(i915, encoder->port, owned_lane_mask, PHY_C10_VDR_OVRD,
489+ intel_cx0_rmw(encoder, owned_lane_mask, PHY_C10_VDR_OVRD,
474490 0, PHY_C10_VDR_OVRD_TX1 | PHY_C10_VDR_OVRD_TX2,
475491 MB_WRITE_COMMITTED);
476492
477− if (intel_is_c10phy(i915, phy))
478− intel_cx0_rmw(i915, encoder->port, owned_lane_mask, PHY_C10_VDR_CONTROL(1),
493+ if (intel_encoder_is_c10phy(encoder))
494+ intel_cx0_rmw(encoder, owned_lane_mask, PHY_C10_VDR_CONTROL(1),
479495 0, C10_VDR_CTRL_UPDATE_CFG, MB_WRITE_COMMITTED);
480496
481497 intel_cx0_phy_transaction_end(encoder, wakeref);
@@ -1856,7 +1872,6 @@ static int intel_c10pll_calc_state(struct intel_crtc_state *crtc_state, · 1374 unmodified lines
18561872 static void intel_c10pll_readout_hw_state(struct intel_encoder *encoder,
18571873 struct intel_c10pll_state *pll_state)
18581874 {
1859− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
18601875 u8 lane = INTEL_CX0_LANE0;
18611876 intel_wakeref_t wakeref;
18621877 int i;
@@ -1867,16 +1882,15 @@ static void intel_c10pll_readout_hw_state(struct intel_encoder *encoder, · 4 unmodified lines
18671882 * According to C10 VDR Register programming Sequence we need
18681883 * to do this to read PHY internal registers from MsgBus.
18691884 */
1870− intel_cx0_rmw(i915, encoder->port, lane, PHY_C10_VDR_CONTROL(1),
1885+ intel_cx0_rmw(encoder, lane, PHY_C10_VDR_CONTROL(1),
18711886 0, C10_VDR_CTRL_MSGBUS_ACCESS,
18721887 MB_WRITE_COMMITTED);
18731888
18741889 for (i = 0; i < ARRAY_SIZE(pll_state->pll); i++)
1875− pll_state->pll[i] = intel_cx0_read(i915, encoder->port, lane,
1876− PHY_C10_VDR_PLL(i));
1890+ pll_state->pll[i] = intel_cx0_read(encoder, lane, PHY_C10_VDR_PLL(i));
18771891
1878− pll_state->cmn = intel_cx0_read(i915, encoder->port, lane, PHY_C10_VDR_CMN(0));
1879− pll_state->tx = intel_cx0_read(i915, encoder->port, lane, PHY_C10_VDR_TX(0));
1892+ pll_state->cmn = intel_cx0_read(encoder, lane, PHY_C10_VDR_CMN(0));
1893+ pll_state->tx = intel_cx0_read(encoder, lane, PHY_C10_VDR_TX(0));
18801894
18811895 intel_cx0_phy_transaction_end(encoder, wakeref);
18821896 }
@@ -1888,28 +1902,28 @@ static void intel_c10_pll_program(struct drm_i915_private *i915, · 5 unmodified lines
18881902 const struct intel_c10pll_state *pll_state = &crtc_state->cx0pll_state.c10;
18891903 int i;
18901904
1891− intel_cx0_rmw(i915, encoder->port, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),
1905+ intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),
18921906 0, C10_VDR_CTRL_MSGBUS_ACCESS,
18931907 MB_WRITE_COMMITTED);
18941908
18951909 /* Custom width needs to be programmed to 0 for both the phy lanes */
1896− intel_cx0_rmw(i915, encoder->port, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CUSTOM_WIDTH,
1910+ intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CUSTOM_WIDTH,
18971911 C10_VDR_CUSTOM_WIDTH_MASK, C10_VDR_CUSTOM_WIDTH_8_10,
18981912 MB_WRITE_COMMITTED);
1899− intel_cx0_rmw(i915, encoder->port, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),
1913+ intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),
19001914 0, C10_VDR_CTRL_UPDATE_CFG,
19011915 MB_WRITE_COMMITTED);
19021916
19031917 /* Program the pll values only for the master lane */
19041918 for (i = 0; i < ARRAY_SIZE(pll_state->pll); i++)
1905− intel_cx0_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C10_VDR_PLL(i),
1919+ intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_PLL(i),
19061920 pll_state->pll[i],
19071921 (i % 4) ? MB_WRITE_UNCOMMITTED : MB_WRITE_COMMITTED);
19081922
1909− intel_cx0_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C10_VDR_CMN(0), pll_state->cmn, MB_WRITE_COMMITTED);
1910− intel_cx0_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C10_VDR_TX(0), pll_state->tx, MB_WRITE_COMMITTED);
1923+ intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_CMN(0), pll_state->cmn, MB_WRITE_COMMITTED);
1924+ intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_TX(0), pll_state->tx, MB_WRITE_COMMITTED);
19111925
1912− intel_cx0_rmw(i915, encoder->port, INTEL_CX0_LANE0, PHY_C10_VDR_CONTROL(1),
1926+ intel_cx0_rmw(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_CONTROL(1),
19131927 0, C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG,
19141928 MB_WRITE_COMMITTED);
19151929 }
@@ -2037,10 +2051,8 @@ static int intel_c20_phy_check_hdmi_link_rate(int clock) · 121 unmodified lines
20372051 int intel_cx0_phy_check_hdmi_link_rate(struct intel_hdmi *hdmi, int clock)
20382052 {
20392053 struct intel_digital_port *dig_port = hdmi_to_dig_port(hdmi);
2040− struct drm_i915_private *i915 = intel_hdmi_to_i915(hdmi);
2041− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
20422054
2043− if (intel_is_c10phy(i915, phy))
2055+ if (intel_encoder_is_c10phy(&dig_port->base))
20442056 return intel_c10_phy_check_hdmi_link_rate(clock);
20452057 return intel_c20_phy_check_hdmi_link_rate(clock);
20462058 }
@@ -2088,10 +2100,7 @@ static int intel_c20pll_calc_state(struct intel_crtc_state *crtc_state, · 41 unmodified lines
20882100 int intel_cx0pll_calc_state(struct intel_crtc_state *crtc_state,
20892101 struct intel_encoder *encoder)
20902102 {
2091− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2092− enum phy phy = intel_port_to_phy(i915, encoder->port);
2093−
2094− if (intel_is_c10phy(i915, phy))
2103+ if (intel_encoder_is_c10phy(encoder))
20952104 return intel_c10pll_calc_state(crtc_state, encoder);
20962105 return intel_c20pll_calc_state(crtc_state, encoder);
20972106 }
@@ -2149,7 +2158,6 @@ static int intel_c20pll_calc_port_clock(struct intel_encoder *encoder, · 51 unmodified lines
21492158 static void intel_c20pll_readout_hw_state(struct intel_encoder *encoder,
21502159 struct intel_c20pll_state *pll_state)
21512160 {
2152− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
21532161 bool cntx;
21542162 intel_wakeref_t wakeref;
21552163 int i;
@@ -2157,25 +2165,25 @@ static void intel_c20pll_readout_hw_state(struct intel_encoder *encoder, · 1 unmodified line
21572165 wakeref = intel_cx0_phy_transaction_begin(encoder);
21582166
21592167 /* 1. Read current context selection */
2160− cntx = intel_cx0_read(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_VDR_CUSTOM_SERDES_RATE) & PHY_C20_CONTEXT_TOGGLE;
2168+ cntx = intel_cx0_read(encoder, INTEL_CX0_LANE0, PHY_C20_VDR_CUSTOM_SERDES_RATE) & PHY_C20_CONTEXT_TOGGLE;
21612169
21622170 /* Read Tx configuration */
21632171 for (i = 0; i < ARRAY_SIZE(pll_state->tx); i++) {
21642172 if (cntx)
2165− pll_state->tx[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2173+ pll_state->tx[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21662174 PHY_C20_B_TX_CNTX_CFG(i));
21672175 else
2168− pll_state->tx[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2176+ pll_state->tx[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21692177 PHY_C20_A_TX_CNTX_CFG(i));
21702178 }
21712179
21722180 /* Read common configuration */
21732181 for (i = 0; i < ARRAY_SIZE(pll_state->cmn); i++) {
21742182 if (cntx)
2175− pll_state->cmn[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2183+ pll_state->cmn[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21762184 PHY_C20_B_CMN_CNTX_CFG(i));
21772185 else
2178− pll_state->cmn[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2186+ pll_state->cmn[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21792187 PHY_C20_A_CMN_CNTX_CFG(i));
21802188 }
21812189
@@ -2183,20 +2191,20 @@ static void intel_c20pll_readout_hw_state(struct intel_encoder *encoder, · 1 unmodified line
21832191 /* MPLLB configuration */
21842192 for (i = 0; i < ARRAY_SIZE(pll_state->mpllb); i++) {
21852193 if (cntx)
2186− pll_state->mpllb[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2194+ pll_state->mpllb[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21872195 PHY_C20_B_MPLLB_CNTX_CFG(i));
21882196 else
2189− pll_state->mpllb[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2197+ pll_state->mpllb[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21902198 PHY_C20_A_MPLLB_CNTX_CFG(i));
21912199 }
21922200 } else {
21932201 /* MPLLA configuration */
21942202 for (i = 0; i < ARRAY_SIZE(pll_state->mplla); i++) {
21952203 if (cntx)
2196− pll_state->mplla[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2204+ pll_state->mplla[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
21972205 PHY_C20_B_MPLLA_CNTX_CFG(i));
21982206 else
2199− pll_state->mplla[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
2207+ pll_state->mplla[i] = intel_c20_sram_read(encoder, INTEL_CX0_LANE0,
22002208 PHY_C20_A_MPLLA_CNTX_CFG(i));
22012209 }
22022210 }
@@ -2338,7 +2346,7 @@ static void intel_c20_pll_program(struct drm_i915_private *i915, · 135 unmodified lines
23382346 dp = true;
23392347
23402348 /* 1. Read current context selection */
2341− cntx = intel_cx0_read(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_VDR_CUSTOM_SERDES_RATE) & BIT(0);
2349+ cntx = intel_cx0_read(encoder, INTEL_CX0_LANE0, PHY_C20_VDR_CUSTOM_SERDES_RATE) & BIT(0);
23422350
23432351 /*
23442352 * 2. If there is a protocol switch from HDMI to DP or vice versa, clear
@@ -2347,7 +2355,7 @@ static void intel_c20_pll_program(struct drm_i915_private *i915, · 2 unmodified lines
23472355 */
23482356 if (intel_c20_protocol_switch_valid(encoder)) {
23492357 for (i = 0; i < 4; i++)
2350− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0, RAWLANEAONX_DIG_TX_MPLLB_CAL_DONE_BANK(i), 0);
2358+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0, RAWLANEAONX_DIG_TX_MPLLB_CAL_DONE_BANK(i), 0);
23512359 usleep_range(4000, 4100);
23522360 }
23532361
@@ -2355,63 +2363,63 @@ static void intel_c20_pll_program(struct drm_i915_private *i915, · 1 unmodified line
23552363 /* 3.1 Tx configuration */
23562364 for (i = 0; i < ARRAY_SIZE(pll_state->tx); i++) {
23572365 if (cntx)
2358− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_A_TX_CNTX_CFG(i), pll_state->tx[i]);
2366+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0, PHY_C20_A_TX_CNTX_CFG(i), pll_state->tx[i]);
23592367 else
2360− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_B_TX_CNTX_CFG(i), pll_state->tx[i]);
2368+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0, PHY_C20_B_TX_CNTX_CFG(i), pll_state->tx[i]);
23612369 }
23622370
23632371 /* 3.2 common configuration */
23642372 for (i = 0; i < ARRAY_SIZE(pll_state->cmn); i++) {
23652373 if (cntx)
2366− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_A_CMN_CNTX_CFG(i), pll_state->cmn[i]);
2374+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0, PHY_C20_A_CMN_CNTX_CFG(i), pll_state->cmn[i]);
23672375 else
2368− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_B_CMN_CNTX_CFG(i), pll_state->cmn[i]);
2376+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0, PHY_C20_B_CMN_CNTX_CFG(i), pll_state->cmn[i]);
23692377 }
23702378
23712379 /* 3.3 mpllb or mplla configuration */
23722380 if (intel_c20phy_use_mpllb(pll_state)) {
23732381 for (i = 0; i < ARRAY_SIZE(pll_state->mpllb); i++) {
23742382 if (cntx)
2375− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0,
2383+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0,
23762384 PHY_C20_A_MPLLB_CNTX_CFG(i),
23772385 pll_state->mpllb[i]);
23782386 else
2379− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0,
2387+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0,
23802388 PHY_C20_B_MPLLB_CNTX_CFG(i),
23812389 pll_state->mpllb[i]);
23822390 }
23832391 } else {
23842392 for (i = 0; i < ARRAY_SIZE(pll_state->mplla); i++) {
23852393 if (cntx)
2386− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0,
2394+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0,
23872395 PHY_C20_A_MPLLA_CNTX_CFG(i),
23882396 pll_state->mplla[i]);
23892397 else
2390− intel_c20_sram_write(i915, encoder->port, INTEL_CX0_LANE0,
2398+ intel_c20_sram_write(encoder, INTEL_CX0_LANE0,
23912399 PHY_C20_B_MPLLA_CNTX_CFG(i),
23922400 pll_state->mplla[i]);
23932401 }
23942402 }
23952403
23962404 /* 4. Program custom width to match the link protocol */
2397− intel_cx0_rmw(i915, encoder->port, lane, PHY_C20_VDR_CUSTOM_WIDTH,
2405+ intel_cx0_rmw(encoder, lane, PHY_C20_VDR_CUSTOM_WIDTH,
23982406 PHY_C20_CUSTOM_WIDTH_MASK,
23992407 PHY_C20_CUSTOM_WIDTH(intel_get_c20_custom_width(clock, dp)),
24002408 MB_WRITE_COMMITTED);
24012409
24022410 /* 5. For DP or 6. For HDMI */
24032411 if (dp) {
2404− intel_cx0_rmw(i915, encoder->port, lane, PHY_C20_VDR_CUSTOM_SERDES_RATE,
2412+ intel_cx0_rmw(encoder, lane, PHY_C20_VDR_CUSTOM_SERDES_RATE,
24052413 BIT(6) | PHY_C20_CUSTOM_SERDES_MASK,
24062414 BIT(6) | PHY_C20_CUSTOM_SERDES(intel_c20_get_dp_rate(clock)),
24072415 MB_WRITE_COMMITTED);
24082416 } else {
2409− intel_cx0_rmw(i915, encoder->port, lane, PHY_C20_VDR_CUSTOM_SERDES_RATE,
2417+ intel_cx0_rmw(encoder, lane, PHY_C20_VDR_CUSTOM_SERDES_RATE,
24102418 BIT(7) | PHY_C20_CUSTOM_SERDES_MASK,
24112419 is_hdmi_frl(clock) ? BIT(7) : 0,
24122420 MB_WRITE_COMMITTED);
24132421
2414− intel_cx0_write(i915, encoder->port, INTEL_CX0_BOTH_LANES, PHY_C20_VDR_HDMI_RATE,
2422+ intel_cx0_write(encoder, INTEL_CX0_BOTH_LANES, PHY_C20_VDR_HDMI_RATE,
24152423 intel_c20_get_hdmi_rate(clock),
24162424 MB_WRITE_COMMITTED);
24172425 }
@@ -2420,7 +2428,7 @@ static void intel_c20_pll_program(struct drm_i915_private *i915, · 2 unmodified lines
24202428 * 7. Write Vendor specific registers to toggle context setting to load
24212429 * the updated programming toggle context bit
24222430 */
2423− intel_cx0_rmw(i915, encoder->port, lane, PHY_C20_VDR_CUSTOM_SERDES_RATE,
2431+ intel_cx0_rmw(encoder, lane, PHY_C20_VDR_CUSTOM_SERDES_RATE,
24242432 BIT(0), cntx ? 0 : 1, MB_WRITE_COMMITTED);
24252433 }
24262434
@@ -2508,11 +2516,12 @@ static u32 intel_cx0_get_powerdown_state(u8 lane_mask, u8 state) · 81 unmodified lines
25082516 return val;
25092517 }
25102518
2511−static void intel_cx0_powerdown_change_sequence(struct drm_i915_private *i915,
2512− enum port port,
2519+static void intel_cx0_powerdown_change_sequence(struct intel_encoder *encoder,
25132520 u8 lane_mask, u8 state)
25142521 {
2515− enum phy phy = intel_port_to_phy(i915, port);
2522+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2523+ enum port port = encoder->port;
2524+ enum phy phy = intel_encoder_to_phy(encoder);
25162525 i915_reg_t buf_ctl2_reg = XELPDP_PORT_BUF_CTL2(i915, port);
25172526 int lane;
25182527
@@ -2528,7 +2537,7 @@ static void intel_cx0_powerdown_change_sequence(struct drm_i915_private *i915, · 9 unmodified lines
25282537 drm_dbg_kms(&i915->drm,
25292538 "PHY %c Timeout waiting for previous transaction to complete. Reset the bus.\n",
25302539 phy_name(phy));
2531− intel_cx0_bus_reset(i915, port, lane);
2540+ intel_cx0_bus_reset(encoder, lane);
25322541 }
25332542
25342543 intel_de_rmw(i915, buf_ctl2_reg,
@@ -2536,15 +2545,18 @@ static void intel_cx0_powerdown_change_sequence(struct drm_i915_private *i915, · 1 unmodified line
25362545 intel_cx0_get_powerdown_update(lane_mask));
25372546
25382547 /* Update Timeout Value */
2539− if (__intel_de_wait_for_register(i915, buf_ctl2_reg,
2540− intel_cx0_get_powerdown_update(lane_mask), 0,
2541− XELPDP_PORT_POWERDOWN_UPDATE_TIMEOUT_US, 0, NULL))
2548+ if (intel_de_wait_custom(i915, buf_ctl2_reg,
2549+ intel_cx0_get_powerdown_update(lane_mask), 0,
2550+ XELPDP_PORT_POWERDOWN_UPDATE_TIMEOUT_US, 0, NULL))
25422551 drm_warn(&i915->drm, "PHY %c failed to bring out of Lane reset after %dus.\n",
25432552 phy_name(phy), XELPDP_PORT_RESET_START_TIMEOUT_US);
25442553 }
25452554
2546−static void intel_cx0_setup_powerdown(struct drm_i915_private *i915, enum port port)
2555+static void intel_cx0_setup_powerdown(struct intel_encoder *encoder)
25472556 {
2557+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2558+ enum port port = encoder->port;
2559+
25482560 intel_de_rmw(i915, XELPDP_PORT_BUF_CTL2(i915, port),
25492561 XELPDP_POWER_STATE_READY_MASK,
25502562 XELPDP_POWER_STATE_READY(CX0_P2_STATE_READY));
@@ -2577,13 +2589,13 @@ static u32 intel_cx0_get_pclk_refclk_ack(u8 lane_mask) · 26 unmodified lines
25772589 return val;
25782590 }
25792591
2580−static void intel_cx0_phy_lane_reset(struct drm_i915_private *i915,
2581− struct intel_encoder *encoder,
2592+static void intel_cx0_phy_lane_reset(struct intel_encoder *encoder,
25822593 bool lane_reversal)
25832594 {
2595+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
25842596 enum port port = encoder->port;
2585− enum phy phy = intel_port_to_phy(i915, port);
2586− u8 owned_lane_mask = intel_cx0_get_owned_lane_mask(i915, encoder);
2597+ enum phy phy = intel_encoder_to_phy(encoder);
2598+ u8 owned_lane_mask = intel_cx0_get_owned_lane_mask(encoder);
25872599 u8 lane_mask = lane_reversal ? INTEL_CX0_LANE1 : INTEL_CX0_LANE0;
25882600 u32 lane_pipe_reset = owned_lane_mask == INTEL_CX0_BOTH_LANES
25892601 ? XELPDP_LANE_PIPE_RESET(0) | XELPDP_LANE_PIPE_RESET(1)
@@ -2593,19 +2605,19 @@ static void intel_cx0_phy_lane_reset(struct drm_i915_private *i915, · 3 unmodified lines
25932605 XELPDP_LANE_PHY_CURRENT_STATUS(1))
25942606 : XELPDP_LANE_PHY_CURRENT_STATUS(0);
25952607
2596− if (__intel_de_wait_for_register(i915, XELPDP_PORT_BUF_CTL1(i915, port),
2597− XELPDP_PORT_BUF_SOC_PHY_READY,
2598− XELPDP_PORT_BUF_SOC_PHY_READY,
2599− XELPDP_PORT_BUF_SOC_READY_TIMEOUT_US, 0, NULL))
2608+ if (intel_de_wait_custom(i915, XELPDP_PORT_BUF_CTL1(i915, port),
2609+ XELPDP_PORT_BUF_SOC_PHY_READY,
2610+ XELPDP_PORT_BUF_SOC_PHY_READY,
2611+ XELPDP_PORT_BUF_SOC_READY_TIMEOUT_US, 0, NULL))
26002612 drm_warn(&i915->drm, "PHY %c failed to bring out of SOC reset after %dus.\n",
26012613 phy_name(phy), XELPDP_PORT_BUF_SOC_READY_TIMEOUT_US);
26022614
26032615 intel_de_rmw(i915, XELPDP_PORT_BUF_CTL2(i915, port), lane_pipe_reset,
26042616 lane_pipe_reset);
26052617
2606− if (__intel_de_wait_for_register(i915, XELPDP_PORT_BUF_CTL2(i915, port),
2607− lane_phy_current_status, lane_phy_current_status,
2608− XELPDP_PORT_RESET_START_TIMEOUT_US, 0, NULL))
2618+ if (intel_de_wait_custom(i915, XELPDP_PORT_BUF_CTL2(i915, port),
2619+ lane_phy_current_status, lane_phy_current_status,
2620+ XELPDP_PORT_RESET_START_TIMEOUT_US, 0, NULL))
26092621 drm_warn(&i915->drm, "PHY %c failed to bring out of Lane reset after %dus.\n",
26102622 phy_name(phy), XELPDP_PORT_RESET_START_TIMEOUT_US);
26112623
@@ -2613,16 +2625,16 @@ static void intel_cx0_phy_lane_reset(struct drm_i915_private *i915, · 1 unmodified line
26132625 intel_cx0_get_pclk_refclk_request(owned_lane_mask),
26142626 intel_cx0_get_pclk_refclk_request(lane_mask));
26152627
2616− if (__intel_de_wait_for_register(i915, XELPDP_PORT_CLOCK_CTL(i915, port),
2617− intel_cx0_get_pclk_refclk_ack(owned_lane_mask),
2618− intel_cx0_get_pclk_refclk_ack(lane_mask),
2619− XELPDP_REFCLK_ENABLE_TIMEOUT_US, 0, NULL))
2628+ if (intel_de_wait_custom(i915, XELPDP_PORT_CLOCK_CTL(i915, port),
2629+ intel_cx0_get_pclk_refclk_ack(owned_lane_mask),
2630+ intel_cx0_get_pclk_refclk_ack(lane_mask),
2631+ XELPDP_REFCLK_ENABLE_TIMEOUT_US, 0, NULL))
26202632 drm_warn(&i915->drm, "PHY %c failed to request refclk after %dus.\n",
26212633 phy_name(phy), XELPDP_REFCLK_ENABLE_TIMEOUT_US);
26222634
2623− intel_cx0_powerdown_change_sequence(i915, port, INTEL_CX0_BOTH_LANES,
2635+ intel_cx0_powerdown_change_sequence(encoder, INTEL_CX0_BOTH_LANES,
26242636 CX0_P2_STATE_RESET);
2625− intel_cx0_setup_powerdown(i915, port);
2637+ intel_cx0_setup_powerdown(encoder);
26262638
26272639 intel_de_rmw(i915, XELPDP_PORT_BUF_CTL2(i915, port), lane_pipe_reset, 0);
26282640
@@ -2640,11 +2652,10 @@ static void intel_cx0_program_phy_lane(struct drm_i915_private *i915, · 11 unmodified lines
26402652 int i;
26412653 u8 disables;
26422654 bool dp_alt_mode = intel_tc_port_in_dp_alt_mode(enc_to_dig_port(encoder));
2643− u8 owned_lane_mask = intel_cx0_get_owned_lane_mask(i915, encoder);
2644− enum port port = encoder->port;
2655+ u8 owned_lane_mask = intel_cx0_get_owned_lane_mask(encoder);
26452656
2646− if (intel_is_c10phy(i915, intel_port_to_phy(i915, port)))
2647− intel_cx0_rmw(i915, port, owned_lane_mask,
2657+ if (intel_encoder_is_c10phy(encoder))
2658+ intel_cx0_rmw(encoder, owned_lane_mask,
26482659 PHY_C10_VDR_CONTROL(1), 0,
26492660 C10_VDR_CTRL_MSGBUS_ACCESS,
26502661 MB_WRITE_COMMITTED);
@@ -2666,14 +2677,14 @@ static void intel_cx0_program_phy_lane(struct drm_i915_private *i915, · 15 unmodified lines
26662677 if (!(owned_lane_mask & lane_mask))
26672678 continue;
26682679
2669− intel_cx0_rmw(i915, port, lane_mask, PHY_CX0_TX_CONTROL(tx, 2),
2680+ intel_cx0_rmw(encoder, lane_mask, PHY_CX0_TX_CONTROL(tx, 2),
26702681 CONTROL2_DISABLE_SINGLE_TX,
26712682 disables & BIT(i) ? CONTROL2_DISABLE_SINGLE_TX : 0,
26722683 MB_WRITE_COMMITTED);
26732684 }
26742685
2675− if (intel_is_c10phy(i915, intel_port_to_phy(i915, port)))
2676− intel_cx0_rmw(i915, port, owned_lane_mask,
2686+ if (intel_encoder_is_c10phy(encoder))
2687+ intel_cx0_rmw(encoder, owned_lane_mask,
26772688 PHY_C10_VDR_CONTROL(1), 0,
26782689 C10_VDR_CTRL_UPDATE_CFG,
26792690 MB_WRITE_COMMITTED);
@@ -2705,7 +2716,7 @@ static void intel_cx0pll_enable(struct intel_encoder *encoder, · 25 unmodified lines
27052716 const struct intel_crtc_state *crtc_state)
27062717 {
27072718 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2708− enum phy phy = intel_port_to_phy(i915, encoder->port);
2719+ enum phy phy = intel_encoder_to_phy(encoder);
27092720 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
27102721 bool lane_reversal = dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;
27112722 u8 maxpclk_lane = lane_reversal ? INTEL_CX0_LANE1 :
@@ -2719,13 +2730,13 @@ static void intel_cx0pll_enable(struct intel_encoder *encoder, · 7 unmodified lines
27192730 intel_program_port_clock_ctl(encoder, crtc_state, lane_reversal);
27202731
27212732 /* 2. Bring PHY out of reset. */
2722− intel_cx0_phy_lane_reset(i915, encoder, lane_reversal);
2733+ intel_cx0_phy_lane_reset(encoder, lane_reversal);
27232734
27242735 /*
27252736 * 3. Change Phy power state to Ready.
27262737 * TODO: For DP alt mode use only one lane.
27272738 */
2728− intel_cx0_powerdown_change_sequence(i915, encoder->port, INTEL_CX0_BOTH_LANES,
2739+ intel_cx0_powerdown_change_sequence(encoder, INTEL_CX0_BOTH_LANES,
27292740 CX0_P2_STATE_READY);
27302741
27312742 /*
@@ -2735,7 +2746,7 @@ static void intel_cx0pll_enable(struct intel_encoder *encoder, · 3 unmodified lines
27352746 */
27362747
27372748 /* 5. Program PHY internal PLL internal registers. */
2738− if (intel_is_c10phy(i915, phy))
2749+ if (intel_encoder_is_c10phy(encoder))
27392750 intel_c10_pll_program(i915, crtc_state, encoder);
27402751 else
27412752 intel_c20_pll_program(i915, crtc_state, encoder);
@@ -2767,10 +2778,10 @@ static void intel_cx0pll_enable(struct intel_encoder *encoder, · 25 unmodified lines
27672778 intel_cx0_get_pclk_pll_request(maxpclk_lane));
27682779
27692780 /* 10. Poll on PORT_CLOCK_CTL PCLK PLL Ack LN<Lane for maxPCLK> == "1". */
2770− if (__intel_de_wait_for_register(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2771− intel_cx0_get_pclk_pll_ack(INTEL_CX0_BOTH_LANES),
2772− intel_cx0_get_pclk_pll_ack(maxpclk_lane),
2773− XELPDP_PCLK_PLL_ENABLE_TIMEOUT_US, 0, NULL))
2781+ if (intel_de_wait_custom(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2782+ intel_cx0_get_pclk_pll_ack(INTEL_CX0_BOTH_LANES),
2783+ intel_cx0_get_pclk_pll_ack(maxpclk_lane),
2784+ XELPDP_PCLK_PLL_ENABLE_TIMEOUT_US, 0, NULL))
27742785 drm_warn(&i915->drm, "Port %c PLL not locked after %dus.\n",
27752786 phy_name(phy), XELPDP_PCLK_PLL_ENABLE_TIMEOUT_US);
27762787
@@ -2831,7 +2842,7 @@ static void intel_mtl_tbt_pll_enable(struct intel_encoder *encoder, · 54 unmodified lines
28312842 const struct intel_crtc_state *crtc_state)
28322843 {
28332844 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2834− enum phy phy = intel_port_to_phy(i915, encoder->port);
2845+ enum phy phy = intel_encoder_to_phy(encoder);
28352846 u32 val = 0;
28362847
28372848 /*
@@ -2858,10 +2869,10 @@ static void intel_mtl_tbt_pll_enable(struct intel_encoder *encoder, · 20 unmodified lines
28582869 intel_de_write(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port), val);
28592870
28602871 /* 5. Poll on PORT_CLOCK_CTL TBT CLOCK Ack == "1". */
2861− if (__intel_de_wait_for_register(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2862− XELPDP_TBT_CLOCK_ACK,
2863− XELPDP_TBT_CLOCK_ACK,
2864− 100, 0, NULL))
2872+ if (intel_de_wait_custom(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2873+ XELPDP_TBT_CLOCK_ACK,
2874+ XELPDP_TBT_CLOCK_ACK,
2875+ 100, 0, NULL))
28652876 drm_warn(&i915->drm, "[ENCODER:%d:%s][%c] PHY PLL not locked after 100us.\n",
28662877 encoder->base.base.id, encoder->base.name, phy_name(phy));
28672878
@@ -2892,12 +2903,12 @@ void intel_mtl_pll_enable(struct intel_encoder *encoder, · 24 unmodified lines
28922903 static void intel_cx0pll_disable(struct intel_encoder *encoder)
28932904 {
28942905 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2895− enum phy phy = intel_port_to_phy(i915, encoder->port);
2896− bool is_c10 = intel_is_c10phy(i915, phy);
2906+ enum phy phy = intel_encoder_to_phy(encoder);
2907+ bool is_c10 = intel_encoder_is_c10phy(encoder);
28972908 intel_wakeref_t wakeref = intel_cx0_phy_transaction_begin(encoder);
28982909
28992910 /* 1. Change owned PHY lane power to Disable state. */
2900− intel_cx0_powerdown_change_sequence(i915, encoder->port, INTEL_CX0_BOTH_LANES,
2911+ intel_cx0_powerdown_change_sequence(encoder, INTEL_CX0_BOTH_LANES,
29012912 is_c10 ? CX0_P2PG_STATE_DISABLE :
29022913 CX0_P4PG_STATE_DISABLE);
29032914
@@ -2920,10 +2931,10 @@ static void intel_cx0pll_disable(struct intel_encoder *encoder) · 16 unmodified lines
29202931 /*
29212932 * 5. Poll on PORT_CLOCK_CTL PCLK PLL Ack LN<Lane for maxPCLK**> == "0".
29222933 */
2923− if (__intel_de_wait_for_register(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2924− intel_cx0_get_pclk_pll_ack(INTEL_CX0_BOTH_LANES) |
2925− intel_cx0_get_pclk_refclk_ack(INTEL_CX0_BOTH_LANES), 0,
2926− XELPDP_PCLK_PLL_DISABLE_TIMEOUT_US, 0, NULL))
2934+ if (intel_de_wait_custom(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2935+ intel_cx0_get_pclk_pll_ack(INTEL_CX0_BOTH_LANES) |
2936+ intel_cx0_get_pclk_refclk_ack(INTEL_CX0_BOTH_LANES), 0,
2937+ XELPDP_PCLK_PLL_DISABLE_TIMEOUT_US, 0, NULL))
29272938 drm_warn(&i915->drm, "Port %c PLL not unlocked after %dus.\n",
29282939 phy_name(phy), XELPDP_PCLK_PLL_DISABLE_TIMEOUT_US);
29292940
@@ -2944,7 +2955,7 @@ static void intel_cx0pll_disable(struct intel_encoder *encoder) · 14 unmodified lines
29442955 static void intel_mtl_tbt_pll_disable(struct intel_encoder *encoder)
29452956 {
29462957 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2947− enum phy phy = intel_port_to_phy(i915, encoder->port);
2958+ enum phy phy = intel_encoder_to_phy(encoder);
29482959
29492960 /*
29502961 * 1. Follow the Display Voltage Frequency Switching Sequence Before
@@ -2958,8 +2969,8 @@ static void intel_mtl_tbt_pll_disable(struct intel_encoder *encoder) · 7 unmodified lines
29582969 XELPDP_TBT_CLOCK_REQUEST, 0);
29592970
29602971 /* 3. Poll on PORT_CLOCK_CTL TBT CLOCK Ack == "0". */
2961− if (__intel_de_wait_for_register(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2962− XELPDP_TBT_CLOCK_ACK, 0, 10, 0, NULL))
2972+ if (intel_de_wait_custom(i915, XELPDP_PORT_CLOCK_CTL(i915, encoder->port),
2973+ XELPDP_TBT_CLOCK_ACK, 0, 10, 0, NULL))
29632974 drm_warn(&i915->drm, "[ENCODER:%d:%s][%c] PHY PLL not unlocked after 10us.\n",
29642975 encoder->base.base.id, encoder->base.name, phy_name(phy));
29652976
@@ -3043,10 +3054,7 @@ static void intel_c10pll_state_verify(const struct intel_crtc_state *state, · 77 unmodified lines
30433054 void intel_cx0pll_readout_hw_state(struct intel_encoder *encoder,
30443055 struct intel_cx0pll_state *pll_state)
30453056 {
3046− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3047− enum phy phy = intel_port_to_phy(i915, encoder->port);
3048−
3049− if (intel_is_c10phy(i915, phy))
3057+ if (intel_encoder_is_c10phy(encoder))
30503058 intel_c10pll_readout_hw_state(encoder, &pll_state->c10);
30513059 else
30523060 intel_c20pll_readout_hw_state(encoder, &pll_state->c20);
@@ -3055,10 +3063,7 @@ void intel_cx0pll_readout_hw_state(struct intel_encoder *encoder, · 2 unmodified lines
30553063 int intel_cx0pll_calc_port_clock(struct intel_encoder *encoder,
30563064 const struct intel_cx0pll_state *pll_state)
30573065 {
3058− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3059− enum phy phy = intel_port_to_phy(i915, encoder->port);
3060−
3061− if (intel_is_c10phy(i915, phy))
3066+ if (intel_encoder_is_c10phy(encoder))
30623067 return intel_c10pll_calc_port_clock(encoder, &pll_state->c10);
30633068
30643069 return intel_c20pll_calc_port_clock(encoder, &pll_state->c20);
@@ -3124,7 +3129,6 @@ void intel_cx0pll_state_verify(struct intel_atomic_state *state, · 59 unmodified lines
31243129 intel_atomic_get_new_crtc_state(state, crtc);
31253130 struct intel_encoder *encoder;
31263131 struct intel_cx0pll_state mpll_hw_state = {};
3127− enum phy phy;
31283132
31293133 if (DISPLAY_VER(i915) < 14)
31303134 return;
@@ -3138,14 +3142,13 @@ void intel_cx0pll_state_verify(struct intel_atomic_state *state, · 7 unmodified lines
31383142 return;
31393143
31403144 encoder = intel_get_crtc_new_encoder(state, new_crtc_state);
3141− phy = intel_port_to_phy(i915, encoder->port);
31423145
31433146 if (intel_tc_port_in_tbt_alt_mode(enc_to_dig_port(encoder)))
31443147 return;
31453148
31463149 intel_cx0pll_readout_hw_state(encoder, &mpll_hw_state);
31473150
3148− if (intel_is_c10phy(i915, phy))
3151+ if (intel_encoder_is_c10phy(encoder))
31493152 intel_c10pll_state_verify(new_crtc_state, crtc, encoder, &mpll_hw_state.c10);
31503153 else
31513154 intel_c20pll_state_verify(new_crtc_state, crtc, encoder, &mpll_hw_state.c20);
drivers/gpu/drm/i915/display/intel_cx0_phy.h+1−2
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/bits.h>
1212
1313 enum icl_port_dpll_id;
14−enum phy;
1514 struct drm_i915_private;
1615 struct intel_atomic_state;
1716 struct intel_c10pll_state;
@@ -22,7 +21,7 @@ struct intel_crtc_state; · 4 unmodified lines
2221 struct intel_encoder;
2322 struct intel_hdmi;
2423
25−bool intel_is_c10phy(struct drm_i915_private *dev_priv, enum phy phy);
24+bool intel_encoder_is_c10phy(struct intel_encoder *encoder);
2625 void intel_mtl_pll_enable(struct intel_encoder *encoder,
2726 const struct intel_crtc_state *crtc_state);
2827 void intel_mtl_pll_disable(struct intel_encoder *encoder);
drivers/gpu/drm/i915/display/intel_ddi.c+111−113
@@ -200,10 +200,10 @@ void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv, · 199 unmodified lines
200200 port_name(port));
201201 }
202202
203−static void intel_wait_ddi_buf_active(struct drm_i915_private *dev_priv,
204− enum port port)
203+static void intel_wait_ddi_buf_active(struct intel_encoder *encoder)
205204 {
206− enum phy phy = intel_port_to_phy(dev_priv, port);
205+ struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
206+ enum port port = encoder->port;
207207 int timeout_us;
208208 int ret;
209209
@@ -218,7 +218,7 @@ static void intel_wait_ddi_buf_active(struct drm_i915_private *dev_priv, · 8 unmodified lines
218218 } else if (IS_DG2(dev_priv)) {
219219 timeout_us = 1200;
220220 } else if (DISPLAY_VER(dev_priv) >= 12) {
221− if (intel_phy_is_tc(dev_priv, phy))
221+ if (intel_encoder_is_tc(encoder))
222222 timeout_us = 3000;
223223 else
224224 timeout_us = 1000;
@@ -331,7 +331,6 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder, · 106 unmodified lines
331331 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
332332 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
333333 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
334− enum phy phy = intel_port_to_phy(i915, encoder->port);
335334
336335 /* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain() later */
337336 intel_dp->DP = dig_port->saved_port_bits |
@@ -345,7 +344,7 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder, · 7 unmodified lines
345344 intel_dp->DP |= DDI_BUF_PORT_DATA_10BIT;
346345 }
347346
348− if (IS_ALDERLAKE_P(i915) && intel_phy_is_tc(i915, phy)) {
347+ if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
349348 intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
350349 if (!intel_tc_port_in_tbt_alt_mode(dig_port))
351350 intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
@@ -895,7 +894,6 @@ intel_ddi_main_link_aux_domain(struct intel_digital_port *dig_port, · 543 unmodified lines
895894 const struct intel_crtc_state *crtc_state)
896895 {
897896 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
898− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
899897
900898 /*
901899 * ICL+ HW requires corresponding AUX IOs to be powered up for PSR with
@@ -914,7 +912,7 @@ intel_ddi_main_link_aux_domain(struct intel_digital_port *dig_port, · 12 unmodified lines
914912 return intel_display_power_aux_io_domain(i915, dig_port->aux_ch);
915913 else if (DISPLAY_VER(i915) < 14 &&
916914 (intel_crtc_has_dp_encoder(crtc_state) ||
917− intel_phy_is_tc(i915, phy)))
915+ intel_encoder_is_tc(&dig_port->base)))
918916 return intel_aux_power_domain(dig_port);
919917 else
920918 return POWER_DOMAIN_INVALID;
@@ -984,7 +982,7 @@ void intel_ddi_enable_transcoder_clock(struct intel_encoder *encoder, · 63 unmodified lines
984982 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
985983 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
986984 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
987− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
985+ enum phy phy = intel_encoder_to_phy(encoder);
988986 u32 val;
989987
990988 if (cpu_transcoder == TRANSCODER_EDP)
@@ -1113,7 +1111,7 @@ static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder, · 122 unmodified lines
11131111 {
11141112 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
11151113 const struct intel_ddi_buf_trans *trans;
1116− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
1114+ enum phy phy = intel_encoder_to_phy(encoder);
11171115 int n_entries, ln;
11181116 u32 val;
11191117
@@ -1176,7 +1174,7 @@ static void icl_combo_phy_set_signal_levels(struct intel_encoder *encoder, · 56 unmodified lines
11761174 const struct intel_crtc_state *crtc_state)
11771175 {
11781176 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1179− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
1177+ enum phy phy = intel_encoder_to_phy(encoder);
11801178 u32 val;
11811179 int ln;
11821180
@@ -1227,7 +1225,7 @@ static void icl_mg_phy_set_signal_levels(struct intel_encoder *encoder, · 44 unmodified lines
12271225 const struct intel_crtc_state *crtc_state)
12281226 {
12291227 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1230− enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port);
1228+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
12311229 const struct intel_ddi_buf_trans *trans;
12321230 int n_entries, ln;
12331231
@@ -1328,7 +1326,7 @@ static void tgl_dkl_phy_set_signal_levels(struct intel_encoder *encoder, · 94 unmodified lines
13281326 const struct intel_crtc_state *crtc_state)
13291327 {
13301328 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1331− enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port);
1329+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
13321330 const struct intel_ddi_buf_trans *trans;
13331331 int n_entries, ln;
13341332
@@ -1526,7 +1524,7 @@ static void adls_ddi_enable_clock(struct intel_encoder *encoder, · 191 unmodified lines
15261524 {
15271525 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
15281526 const struct intel_shared_dpll *pll = crtc_state->shared_dpll;
1529− enum phy phy = intel_port_to_phy(i915, encoder->port);
1527+ enum phy phy = intel_encoder_to_phy(encoder);
15301528
15311529 if (drm_WARN_ON(&i915->drm, !pll))
15321530 return;
@@ -1540,7 +1538,7 @@ static void adls_ddi_enable_clock(struct intel_encoder *encoder, · 7 unmodified lines
15401538 static void adls_ddi_disable_clock(struct intel_encoder *encoder)
15411539 {
15421540 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1543− enum phy phy = intel_port_to_phy(i915, encoder->port);
1541+ enum phy phy = intel_encoder_to_phy(encoder);
15441542
15451543 _icl_ddi_disable_clock(i915, ADLS_DPCLKA_CFGCR(phy),
15461544 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1549,7 +1547,7 @@ static void adls_ddi_disable_clock(struct intel_encoder *encoder) · 2 unmodified lines
15491547 static bool adls_ddi_is_clock_enabled(struct intel_encoder *encoder)
15501548 {
15511549 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1552− enum phy phy = intel_port_to_phy(i915, encoder->port);
1550+ enum phy phy = intel_encoder_to_phy(encoder);
15531551
15541552 return _icl_ddi_is_clock_enabled(i915, ADLS_DPCLKA_CFGCR(phy),
15551553 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1558,7 +1556,7 @@ static bool adls_ddi_is_clock_enabled(struct intel_encoder *encoder) · 2 unmodified lines
15581556 static struct intel_shared_dpll *adls_ddi_get_pll(struct intel_encoder *encoder)
15591557 {
15601558 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1561− enum phy phy = intel_port_to_phy(i915, encoder->port);
1559+ enum phy phy = intel_encoder_to_phy(encoder);
15621560
15631561 return _icl_ddi_get_pll(i915, ADLS_DPCLKA_CFGCR(phy),
15641562 ADLS_DPCLKA_CFGCR_DDI_CLK_SEL_MASK(phy),
@@ -1570,7 +1568,7 @@ static void rkl_ddi_enable_clock(struct intel_encoder *encoder, · 5 unmodified lines
15701568 {
15711569 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
15721570 const struct intel_shared_dpll *pll = crtc_state->shared_dpll;
1573− enum phy phy = intel_port_to_phy(i915, encoder->port);
1571+ enum phy phy = intel_encoder_to_phy(encoder);
15741572
15751573 if (drm_WARN_ON(&i915->drm, !pll))
15761574 return;
@@ -1584,7 +1582,7 @@ static void rkl_ddi_enable_clock(struct intel_encoder *encoder, · 7 unmodified lines
15841582 static void rkl_ddi_disable_clock(struct intel_encoder *encoder)
15851583 {
15861584 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1587− enum phy phy = intel_port_to_phy(i915, encoder->port);
1585+ enum phy phy = intel_encoder_to_phy(encoder);
15881586
15891587 _icl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0,
15901588 RKL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1593,7 +1591,7 @@ static void rkl_ddi_disable_clock(struct intel_encoder *encoder) · 2 unmodified lines
15931591 static bool rkl_ddi_is_clock_enabled(struct intel_encoder *encoder)
15941592 {
15951593 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1596− enum phy phy = intel_port_to_phy(i915, encoder->port);
1594+ enum phy phy = intel_encoder_to_phy(encoder);
15971595
15981596 return _icl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0,
15991597 RKL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1602,7 +1600,7 @@ static bool rkl_ddi_is_clock_enabled(struct intel_encoder *encoder) · 2 unmodified lines
16021600 static struct intel_shared_dpll *rkl_ddi_get_pll(struct intel_encoder *encoder)
16031601 {
16041602 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1605− enum phy phy = intel_port_to_phy(i915, encoder->port);
1603+ enum phy phy = intel_encoder_to_phy(encoder);
16061604
16071605 return _icl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0,
16081606 RKL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy),
@@ -1614,7 +1612,7 @@ static void dg1_ddi_enable_clock(struct intel_encoder *encoder, · 5 unmodified lines
16141612 {
16151613 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
16161614 const struct intel_shared_dpll *pll = crtc_state->shared_dpll;
1617− enum phy phy = intel_port_to_phy(i915, encoder->port);
1615+ enum phy phy = intel_encoder_to_phy(encoder);
16181616
16191617 if (drm_WARN_ON(&i915->drm, !pll))
16201618 return;
@@ -1637,7 +1635,7 @@ static void dg1_ddi_enable_clock(struct intel_encoder *encoder, · 16 unmodified lines
16371635 static void dg1_ddi_disable_clock(struct intel_encoder *encoder)
16381636 {
16391637 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1640− enum phy phy = intel_port_to_phy(i915, encoder->port);
1638+ enum phy phy = intel_encoder_to_phy(encoder);
16411639
16421640 _icl_ddi_disable_clock(i915, DG1_DPCLKA_CFGCR0(phy),
16431641 DG1_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1646,7 +1644,7 @@ static void dg1_ddi_disable_clock(struct intel_encoder *encoder) · 2 unmodified lines
16461644 static bool dg1_ddi_is_clock_enabled(struct intel_encoder *encoder)
16471645 {
16481646 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1649− enum phy phy = intel_port_to_phy(i915, encoder->port);
1647+ enum phy phy = intel_encoder_to_phy(encoder);
16501648
16511649 return _icl_ddi_is_clock_enabled(i915, DG1_DPCLKA_CFGCR0(phy),
16521650 DG1_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1655,7 +1653,7 @@ static bool dg1_ddi_is_clock_enabled(struct intel_encoder *encoder) · 2 unmodified lines
16551653 static struct intel_shared_dpll *dg1_ddi_get_pll(struct intel_encoder *encoder)
16561654 {
16571655 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1658− enum phy phy = intel_port_to_phy(i915, encoder->port);
1656+ enum phy phy = intel_encoder_to_phy(encoder);
16591657 enum intel_dpll_id id;
16601658 u32 val;
16611659
@@ -1680,7 +1678,7 @@ static void icl_ddi_combo_enable_clock(struct intel_encoder *encoder, · 18 unmodified lines
16801678 {
16811679 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
16821680 const struct intel_shared_dpll *pll = crtc_state->shared_dpll;
1683− enum phy phy = intel_port_to_phy(i915, encoder->port);
1681+ enum phy phy = intel_encoder_to_phy(encoder);
16841682
16851683 if (drm_WARN_ON(&i915->drm, !pll))
16861684 return;
@@ -1694,7 +1692,7 @@ static void icl_ddi_combo_enable_clock(struct intel_encoder *encoder, · 7 unmodified lines
16941692 static void icl_ddi_combo_disable_clock(struct intel_encoder *encoder)
16951693 {
16961694 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1697− enum phy phy = intel_port_to_phy(i915, encoder->port);
1695+ enum phy phy = intel_encoder_to_phy(encoder);
16981696
16991697 _icl_ddi_disable_clock(i915, ICL_DPCLKA_CFGCR0,
17001698 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1703,7 +1701,7 @@ static void icl_ddi_combo_disable_clock(struct intel_encoder *encoder) · 2 unmodified lines
17031701 static bool icl_ddi_combo_is_clock_enabled(struct intel_encoder *encoder)
17041702 {
17051703 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1706− enum phy phy = intel_port_to_phy(i915, encoder->port);
1704+ enum phy phy = intel_encoder_to_phy(encoder);
17071705
17081706 return _icl_ddi_is_clock_enabled(i915, ICL_DPCLKA_CFGCR0,
17091707 ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy));
@@ -1712,7 +1710,7 @@ static bool icl_ddi_combo_is_clock_enabled(struct intel_encoder *encoder) · 2 unmodified lines
17121710 struct intel_shared_dpll *icl_ddi_combo_get_pll(struct intel_encoder *encoder)
17131711 {
17141712 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1715− enum phy phy = intel_port_to_phy(i915, encoder->port);
1713+ enum phy phy = intel_encoder_to_phy(encoder);
17161714
17171715 return _icl_ddi_get_pll(i915, ICL_DPCLKA_CFGCR0,
17181716 ICL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy),
@@ -1767,7 +1765,7 @@ static void icl_ddi_tc_enable_clock(struct intel_encoder *encoder, · 48 unmodified lines
17671765 {
17681766 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
17691767 const struct intel_shared_dpll *pll = crtc_state->shared_dpll;
1770− enum tc_port tc_port = intel_port_to_tc(i915, encoder->port);
1768+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
17711769 enum port port = encoder->port;
17721770
17731771 if (drm_WARN_ON(&i915->drm, !pll))
@@ -1787,7 +1785,7 @@ static void icl_ddi_tc_enable_clock(struct intel_encoder *encoder, · 13 unmodified lines
17871785 static void icl_ddi_tc_disable_clock(struct intel_encoder *encoder)
17881786 {
17891787 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1790− enum tc_port tc_port = intel_port_to_tc(i915, encoder->port);
1788+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
17911789 enum port port = encoder->port;
17921790
17931791 mutex_lock(&i915->display.dpll.lock);
@@ -1803,7 +1801,7 @@ static void icl_ddi_tc_disable_clock(struct intel_encoder *encoder) · 9 unmodified lines
18031801 static bool icl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder)
18041802 {
18051803 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1806− enum tc_port tc_port = intel_port_to_tc(i915, encoder->port);
1804+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
18071805 enum port port = encoder->port;
18081806 u32 tmp;
18091807
@@ -1820,7 +1818,7 @@ static bool icl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) · 10 unmodified lines
18201818 static struct intel_shared_dpll *icl_ddi_tc_get_pll(struct intel_encoder *encoder)
18211819 {
18221820 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1823− enum tc_port tc_port = intel_port_to_tc(i915, encoder->port);
1821+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
18241822 enum port port = encoder->port;
18251823 enum intel_dpll_id id;
18261824 u32 tmp;
@@ -2086,12 +2084,11 @@ icl_program_mg_dp_mode(struct intel_digital_port *dig_port, · 259 unmodified lines
20862084 const struct intel_crtc_state *crtc_state)
20872085 {
20882086 struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
2089− enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
2090− enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port);
2087+ enum tc_port tc_port = intel_encoder_to_tc(&dig_port->base);
20912088 u32 ln0, ln1, pin_assignment;
20922089 u8 width;
20932090
2094− if (!intel_phy_is_tc(dev_priv, phy) ||
2091+ if (!intel_encoder_is_tc(&dig_port->base) ||
20952092 intel_tc_port_in_tbt_alt_mode(dig_port))
20962093 return;
20972094
@@ -2327,9 +2324,9 @@ static void intel_ddi_power_up_lanes(struct intel_encoder *encoder, · 229 unmodified lines
23272324 {
23282325 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
23292326 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
2330− enum phy phy = intel_port_to_phy(i915, encoder->port);
23312327
2332− if (intel_phy_is_combo(i915, phy)) {
2328+ if (intel_encoder_is_combo(encoder)) {
2329+ enum phy phy = intel_encoder_to_phy(encoder);
23332330 bool lane_reversal =
23342331 dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;
23352332
@@ -2812,15 +2809,14 @@ static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state, · 476 unmodified lines
28122809 const struct drm_connector_state *conn_state)
28132810 {
28142811 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
2815− struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
28162812
2817− if (HAS_DP20(dev_priv)) {
2813+ if (HAS_DP20(dev_priv))
28182814 intel_dp_128b132b_sdp_crc16(enc_to_intel_dp(encoder),
28192815 crtc_state);
2820− if (crtc_state->has_panel_replay)
2821− drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG,
2822− DP_PANEL_REPLAY_ENABLE);
2823− }
2816+
2817+ /* Panel replay has to be enabled in sink dpcd before link training. */
2818+ if (crtc_state->has_panel_replay)
2819+ intel_psr_enable_sink(enc_to_intel_dp(encoder), crtc_state);
28242820
28252821 if (DISPLAY_VER(dev_priv) >= 14)
28262822 mtl_ddi_pre_enable_dp(state, encoder, crtc_state, conn_state);
@@ -3095,39 +3091,48 @@ static void intel_ddi_post_disable_hdmi(struct intel_atomic_state *state, · 268 unmodified lines
30953091 intel_dp_dual_mode_set_tmds_output(intel_hdmi, false);
30963092 }
30973093
3098−static void intel_ddi_post_disable(struct intel_atomic_state *state,
3099− struct intel_encoder *encoder,
3100− const struct intel_crtc_state *old_crtc_state,
3101− const struct drm_connector_state *old_conn_state)
3094+static void intel_ddi_post_disable_hdmi_or_sst(struct intel_atomic_state *state,
3095+ struct intel_encoder *encoder,
3096+ const struct intel_crtc_state *old_crtc_state,
3097+ const struct drm_connector_state *old_conn_state)
31023098 {
31033099 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
3104− struct intel_crtc *slave_crtc;
3100+ struct intel_crtc *pipe_crtc;
3101+
3102+ for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
3103+ intel_crtc_joined_pipe_mask(old_crtc_state)) {
3104+ const struct intel_crtc_state *old_pipe_crtc_state =
3105+ intel_atomic_get_old_crtc_state(state, pipe_crtc);
3106+
3107+ intel_crtc_vblank_off(old_pipe_crtc_state);
3108+ }
31053109
3106− if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST)) {
3107− intel_crtc_vblank_off(old_crtc_state);
3110+ intel_disable_transcoder(old_crtc_state);
31083111
3109− intel_disable_transcoder(old_crtc_state);
3112+ intel_ddi_disable_transcoder_func(old_crtc_state);
31103113
3111− intel_ddi_disable_transcoder_func(old_crtc_state);
3114+ for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
3115+ intel_crtc_joined_pipe_mask(old_crtc_state)) {
3116+ const struct intel_crtc_state *old_pipe_crtc_state =
3117+ intel_atomic_get_old_crtc_state(state, pipe_crtc);
31123118
3113− intel_dsc_disable(old_crtc_state);
3119+ intel_dsc_disable(old_pipe_crtc_state);
31143120
31153121 if (DISPLAY_VER(dev_priv) >= 9)
3116− skl_scaler_disable(old_crtc_state);
3122+ skl_scaler_disable(old_pipe_crtc_state);
31173123 else
3118− ilk_pfit_disable(old_crtc_state);
3124+ ilk_pfit_disable(old_pipe_crtc_state);
31193125 }
3126+}
31203127
3121− for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, slave_crtc,
3122− intel_crtc_bigjoiner_slave_pipes(old_crtc_state)) {
3123− const struct intel_crtc_state *old_slave_crtc_state =
3124− intel_atomic_get_old_crtc_state(state, slave_crtc);
3125−
3126− intel_crtc_vblank_off(old_slave_crtc_state);
3127−
3128− intel_dsc_disable(old_slave_crtc_state);
3129− skl_scaler_disable(old_slave_crtc_state);
3130− }
3128+static void intel_ddi_post_disable(struct intel_atomic_state *state,
3129+ struct intel_encoder *encoder,
3130+ const struct intel_crtc_state *old_crtc_state,
3131+ const struct drm_connector_state *old_conn_state)
3132+{
3133+ if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST))
3134+ intel_ddi_post_disable_hdmi_or_sst(state, encoder, old_crtc_state,
3135+ old_conn_state);
31313136
31323137 /*
31333138 * When called from DP MST code:
@@ -3155,14 +3160,11 @@ static void intel_ddi_post_pll_disable(struct intel_atomic_state *state, · 21 unmodified lines
31553160 const struct intel_crtc_state *old_crtc_state,
31563161 const struct drm_connector_state *old_conn_state)
31573162 {
3158− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
31593163 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
3160− enum phy phy = intel_port_to_phy(i915, encoder->port);
3161− bool is_tc_port = intel_phy_is_tc(i915, phy);
31623164
31633165 main_link_aux_power_domain_put(dig_port, old_crtc_state);
31643166
3165− if (is_tc_port)
3167+ if (intel_encoder_is_tc(encoder))
31663168 intel_tc_port_put_link(dig_port);
31673169 }
31683170
@@ -3263,7 +3265,6 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state, · 94 unmodified lines
32633265 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
32643266 struct drm_connector *connector = conn_state->connector;
32653267 enum port port = encoder->port;
3266− enum phy phy = intel_port_to_phy(dev_priv, port);
32673268 u32 buf_ctl;
32683269
32693270 if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
@@ -3347,14 +3348,14 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state, · 77 unmodified lines
33473348
33483349 if (DISPLAY_VER(dev_priv) >= 20)
33493350 buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
3350− } else if (IS_ALDERLAKE_P(dev_priv) && intel_phy_is_tc(dev_priv, phy)) {
3351+ } else if (IS_ALDERLAKE_P(dev_priv) && intel_encoder_is_tc(encoder)) {
33513352 drm_WARN_ON(&dev_priv->drm, !intel_tc_port_in_legacy_mode(dig_port));
33523353 buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
33533354 }
33543355
33553356 intel_de_write(dev_priv, DDI_BUF_CTL(port), buf_ctl);
33563357
3357− intel_wait_ddi_buf_active(dev_priv, port);
3358+ intel_wait_ddi_buf_active(encoder);
33583359 }
33593360
33603361 static void intel_enable_ddi(struct intel_atomic_state *state,
@@ -3362,10 +3363,10 @@ static void intel_enable_ddi(struct intel_atomic_state *state, · 1 unmodified line
33623363 const struct intel_crtc_state *crtc_state,
33633364 const struct drm_connector_state *conn_state)
33643365 {
3365− drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
3366+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3367+ struct intel_crtc *pipe_crtc;
33663368
3367− if (!intel_crtc_is_bigjoiner_slave(crtc_state))
3368− intel_ddi_enable_transcoder_func(encoder, crtc_state);
3369+ intel_ddi_enable_transcoder_func(encoder, crtc_state);
33693370
33703371 /* Enable/Disable DP2.0 SDP split config before transcoder */
33713372 intel_audio_sdp_split_update(crtc_state);
@@ -3374,7 +3375,13 @@ static void intel_enable_ddi(struct intel_atomic_state *state, · 2 unmodified lines
33743375
33753376 intel_ddi_wait_for_fec_status(encoder, crtc_state, true);
33763377
3377− intel_crtc_vblank_on(crtc_state);
3378+ for_each_intel_crtc_in_pipe_mask_reverse(&i915->drm, pipe_crtc,
3379+ intel_crtc_joined_pipe_mask(crtc_state)) {
3380+ const struct intel_crtc_state *pipe_crtc_state =
3381+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
3382+
3383+ intel_crtc_vblank_on(pipe_crtc_state);
3384+ }
33783385
33793386 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
33803387 intel_enable_ddi_hdmi(state, encoder, crtc_state, conn_state);
@@ -3470,19 +3477,17 @@ void intel_ddi_update_active_dpll(struct intel_atomic_state *state, · 89 unmodified lines
34703477 struct intel_crtc *crtc)
34713478 {
34723479 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3473− struct intel_crtc_state *crtc_state =
3480+ const struct intel_crtc_state *crtc_state =
34743481 intel_atomic_get_new_crtc_state(state, crtc);
3475− struct intel_crtc *slave_crtc;
3476− enum phy phy = intel_port_to_phy(i915, encoder->port);
3482+ struct intel_crtc *pipe_crtc;
34773483
34783484 /* FIXME: Add MTL pll_mgr */
3479− if (DISPLAY_VER(i915) >= 14 || !intel_phy_is_tc(i915, phy))
3485+ if (DISPLAY_VER(i915) >= 14 || !intel_encoder_is_tc(encoder))
34803486 return;
34813487
3482− intel_update_active_dpll(state, crtc, encoder);
3483− for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
3484− intel_crtc_bigjoiner_slave_pipes(crtc_state))
3485− intel_update_active_dpll(state, slave_crtc, encoder);
3488+ for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
3489+ intel_crtc_joined_pipe_mask(crtc_state))
3490+ intel_update_active_dpll(state, pipe_crtc, encoder);
34863491 }
34873492
34883493 static void
@@ -3493,8 +3498,7 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state *state, · 4 unmodified lines
34933498 {
34943499 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
34953500 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
3496− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
3497− bool is_tc_port = intel_phy_is_tc(dev_priv, phy);
3501+ bool is_tc_port = intel_encoder_is_tc(encoder);
34983502
34993503 if (is_tc_port) {
35003504 struct intel_crtc *master_crtc =
@@ -3520,7 +3524,7 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state *state, · 19 unmodified lines
35203524 static void adlp_tbt_to_dp_alt_switch_wa(struct intel_encoder *encoder)
35213525 {
35223526 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3523− enum tc_port tc_port = intel_port_to_tc(i915, encoder->port);
3527+ enum tc_port tc_port = intel_encoder_to_tc(encoder);
35243528 int ln;
35253529
35263530 for (ln = 0; ln < 2; ln++)
@@ -3574,7 +3578,7 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp, · 47 unmodified lines
35743578 intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
35753579
35763580 /* 6.j Poll for PORT_BUF_CTL Idle Status == 0, timeout after 100 us */
3577− intel_wait_ddi_buf_active(dev_priv, port);
3581+ intel_wait_ddi_buf_active(encoder);
35783582 }
35793583
35803584 static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
@@ -3624,7 +3628,7 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp, · 43 unmodified lines
36243628 intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
36253629 intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
36263630
3627− intel_wait_ddi_buf_active(dev_priv, port);
3631+ intel_wait_ddi_buf_active(encoder);
36283632 }
36293633
36303634 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
@@ -3681,7 +3685,7 @@ static void intel_ddi_set_idle_link_train(struct intel_dp *intel_dp, · 50 unmodified lines
36813685
36823686 if (intel_de_wait_for_set(dev_priv,
36833687 dp_tp_status_reg(encoder, crtc_state),
3684− DP_TP_STATUS_IDLE_DONE, 1))
3688+ DP_TP_STATUS_IDLE_DONE, 2))
36853689 drm_err(&dev_priv->drm,
36863690 "Timed out waiting for DP idle patterns\n");
36873691 }
@@ -3972,6 +3976,7 @@ static void intel_ddi_get_config(struct intel_encoder *encoder, · 284 unmodified lines
39723976
39733977 intel_read_dp_sdp(encoder, pipe_config, HDMI_PACKET_TYPE_GAMUT_METADATA);
39743978 intel_read_dp_sdp(encoder, pipe_config, DP_SDP_VSC);
3979+ intel_read_dp_sdp(encoder, pipe_config, DP_SDP_ADAPTIVE_SYNC);
39753980
39763981 intel_audio_codec_get_config(encoder, pipe_config);
39773982 }
@@ -4144,10 +4149,7 @@ void hsw_ddi_get_config(struct intel_encoder *encoder, · 166 unmodified lines
41444149 static void intel_ddi_sync_state(struct intel_encoder *encoder,
41454150 const struct intel_crtc_state *crtc_state)
41464151 {
4147− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
4148− enum phy phy = intel_port_to_phy(i915, encoder->port);
4149−
4150− if (intel_phy_is_tc(i915, phy))
4152+ if (intel_encoder_is_tc(encoder))
41514153 intel_tc_port_sanitize_mode(enc_to_dig_port(encoder),
41524154 crtc_state);
41534155
@@ -4159,10 +4161,9 @@ static bool intel_ddi_initial_fastset_check(struct intel_encoder *encoder, · 5 unmodified lines
41594161 struct intel_crtc_state *crtc_state)
41604162 {
41614163 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
4162− enum phy phy = intel_port_to_phy(i915, encoder->port);
41634164 bool fastset = true;
41644165
4165− if (intel_phy_is_tc(i915, phy)) {
4166+ if (intel_encoder_is_tc(encoder)) {
41664167 drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] Forcing full modeset to compute TC port DPLLs\n",
41674168 encoder->base.base.id, encoder->base.name);
41684169 crtc_state->uapi.mode_changed = true;
@@ -4256,7 +4257,12 @@ static bool m_n_equal(const struct intel_link_m_n *m_n_1, · 87 unmodified lines
42564257 static bool crtcs_port_sync_compatible(const struct intel_crtc_state *crtc_state1,
42574258 const struct intel_crtc_state *crtc_state2)
42584259 {
4260+ /*
4261+ * FIXME the modeset sequence is currently wrong and
4262+ * can't deal with bigjoiner + port sync at the same time.
4263+ */
42594264 return crtc_state1->hw.active && crtc_state2->hw.active &&
4265+ !crtc_state1->bigjoiner_pipes && !crtc_state2->bigjoiner_pipes &&
42604266 crtc_state1->output_types == crtc_state2->output_types &&
42614267 crtc_state1->output_format == crtc_state2->output_format &&
42624268 crtc_state1->lane_count == crtc_state2->lane_count &&
@@ -4348,10 +4354,9 @@ static void intel_ddi_encoder_destroy(struct drm_encoder *encoder) · 85 unmodified lines
43484354 {
43494355 struct drm_i915_private *i915 = to_i915(encoder->dev);
43504356 struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder));
4351− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
43524357
43534358 intel_dp_encoder_flush_work(encoder);
4354− if (intel_phy_is_tc(i915, phy))
4359+ if (intel_encoder_is_tc(&dig_port->base))
43554360 intel_tc_port_cleanup(dig_port);
43564361 intel_display_power_flush_work(i915);
43574362
@@ -4362,16 +4367,14 @@ static void intel_ddi_encoder_destroy(struct drm_encoder *encoder) · 4 unmodified lines
43624367
43634368 static void intel_ddi_encoder_reset(struct drm_encoder *encoder)
43644369 {
4365− struct drm_i915_private *i915 = to_i915(encoder->dev);
43664370 struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(encoder));
43674371 struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder));
4368− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
43694372
43704373 intel_dp->reset_link_params = true;
43714374
43724375 intel_pps_encoder_reset(intel_dp);
43734376
4374− if (intel_phy_is_tc(i915, phy))
4377+ if (intel_encoder_is_tc(&dig_port->base))
43754378 intel_tc_port_init_mode(dig_port);
43764379 }
43774380
@@ -4538,11 +4541,9 @@ static enum intel_hotplug_state · 160 unmodified lines
45384541 intel_ddi_hotplug(struct intel_encoder *encoder,
45394542 struct intel_connector *connector)
45404543 {
4541− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
45424544 struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
45434545 struct intel_dp *intel_dp = &dig_port->dp;
4544− enum phy phy = intel_port_to_phy(i915, encoder->port);
4545− bool is_tc = intel_phy_is_tc(i915, phy);
4546+ bool is_tc = intel_encoder_is_tc(encoder);
45464547 struct drm_modeset_acquire_ctx ctx;
45474548 enum intel_hotplug_state state;
45484549 int ret;
@@ -4824,10 +4825,7 @@ static bool port_strap_detected(struct drm_i915_private *i915, enum port port) · 275 unmodified lines
48244825
48254826 static bool need_aux_ch(struct intel_encoder *encoder, bool init_dp)
48264827 {
4827− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
4828− enum phy phy = intel_port_to_phy(i915, encoder->port);
4829−
4830− return init_dp || intel_phy_is_tc(i915, phy);
4828+ return init_dp || intel_encoder_is_tc(encoder);
48314829 }
48324830
48334831 static bool assert_has_icl_dsi(struct drm_i915_private *i915)
@@ -5071,12 +5069,12 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, · 237 unmodified lines
50715069 } else if (IS_DG2(dev_priv)) {
50725070 encoder->set_signal_levels = intel_snps_phy_set_signal_levels;
50735071 } else if (DISPLAY_VER(dev_priv) >= 12) {
5074− if (intel_phy_is_combo(dev_priv, phy))
5072+ if (intel_encoder_is_combo(encoder))
50755073 encoder->set_signal_levels = icl_combo_phy_set_signal_levels;
50765074 else
50775075 encoder->set_signal_levels = tgl_dkl_phy_set_signal_levels;
50785076 } else if (DISPLAY_VER(dev_priv) >= 11) {
5079− if (intel_phy_is_combo(dev_priv, phy))
5077+ if (intel_encoder_is_combo(encoder))
50805078 encoder->set_signal_levels = icl_combo_phy_set_signal_levels;
50815079 else
50825080 encoder->set_signal_levels = icl_mg_phy_set_signal_levels;
@@ -5126,7 +5124,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, · 43 unmodified lines
51265124 goto err;
51275125 }
51285126
5129− if (intel_phy_is_tc(dev_priv, phy)) {
5127+ if (intel_encoder_is_tc(encoder)) {
51305128 bool is_legacy =
51315129 !intel_bios_encoder_supports_typec_usb(devdata) &&
51325130 !intel_bios_encoder_supports_tbt(devdata);
@@ -5155,7 +5153,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, · 22 unmodified lines
51555153 dig_port->ddi_io_power_domain = intel_display_power_ddi_io_domain(dev_priv, port);
51565154
51575155 if (DISPLAY_VER(dev_priv) >= 11) {
5158− if (intel_phy_is_tc(dev_priv, phy))
5156+ if (intel_encoder_is_tc(encoder))
51595157 dig_port->connected = intel_tc_port_connected;
51605158 else
51615159 dig_port->connected = lpt_digital_port_connected;
drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c+7−11
@@ -1691,14 +1691,11 @@ mtl_get_cx0_buf_trans(struct intel_encoder *encoder, · 1690 unmodified lines
16911691 const struct intel_crtc_state *crtc_state,
16921692 int *n_entries)
16931693 {
1694− struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1695− enum phy phy = intel_port_to_phy(i915, encoder->port);
1696−
16971694 if (intel_crtc_has_dp_encoder(crtc_state) && crtc_state->port_clock >= 1000000)
16981695 return intel_get_buf_trans(&mtl_c20_trans_uhbr, n_entries);
1699− else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) && !(intel_is_c10phy(i915, phy)))
1696+ else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) && !(intel_encoder_is_c10phy(encoder)))
17001697 return intel_get_buf_trans(&mtl_c20_trans_hdmi, n_entries);
1701− else if (!intel_is_c10phy(i915, phy))
1698+ else if (!intel_encoder_is_c10phy(encoder))
17021699 return intel_get_buf_trans(&mtl_c20_trans_dp14, n_entries);
17031700 else
17041701 return intel_get_buf_trans(&mtl_c10_trans_dp14, n_entries);
@@ -1707,14 +1704,13 @@ mtl_get_cx0_buf_trans(struct intel_encoder *encoder, · 2 unmodified lines
17071704 void intel_ddi_buf_trans_init(struct intel_encoder *encoder)
17081705 {
17091706 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1710− enum phy phy = intel_port_to_phy(i915, encoder->port);
17111707
17121708 if (DISPLAY_VER(i915) >= 14) {
17131709 encoder->get_buf_trans = mtl_get_cx0_buf_trans;
17141710 } else if (IS_DG2(i915)) {
17151711 encoder->get_buf_trans = dg2_get_snps_buf_trans;
17161712 } else if (IS_ALDERLAKE_P(i915)) {
1717− if (intel_phy_is_combo(i915, phy))
1713+ if (intel_encoder_is_combo(encoder))
17181714 encoder->get_buf_trans = adlp_get_combo_buf_trans;
17191715 else
17201716 encoder->get_buf_trans = adlp_get_dkl_buf_trans;
@@ -1725,16 +1721,16 @@ void intel_ddi_buf_trans_init(struct intel_encoder *encoder) · 4 unmodified lines
17251721 } else if (IS_DG1(i915)) {
17261722 encoder->get_buf_trans = dg1_get_combo_buf_trans;
17271723 } else if (DISPLAY_VER(i915) >= 12) {
1728− if (intel_phy_is_combo(i915, phy))
1724+ if (intel_encoder_is_combo(encoder))
17291725 encoder->get_buf_trans = tgl_get_combo_buf_trans;
17301726 else
17311727 encoder->get_buf_trans = tgl_get_dkl_buf_trans;
17321728 } else if (DISPLAY_VER(i915) == 11) {
1733− if (IS_PLATFORM(i915, INTEL_JASPERLAKE))
1729+ if (IS_JASPERLAKE(i915))
17341730 encoder->get_buf_trans = jsl_get_combo_buf_trans;
1735− else if (IS_PLATFORM(i915, INTEL_ELKHARTLAKE))
1731+ else if (IS_ELKHARTLAKE(i915))
17361732 encoder->get_buf_trans = ehl_get_combo_buf_trans;
1737− else if (intel_phy_is_combo(i915, phy))
1733+ else if (intel_encoder_is_combo(encoder))
17381734 encoder->get_buf_trans = icl_get_combo_buf_trans;
17391735 else
17401736 encoder->get_buf_trans = icl_get_mg_buf_trans;
drivers/gpu/drm/i915/display/intel_de.h+99−18
@@ -13,76 +13,157 @@ · 12 unmodified lines
1313 static inline u32
1414 intel_de_read(struct drm_i915_private *i915, i915_reg_t reg)
1515 {
16− return intel_uncore_read(&i915->uncore, reg);
16+ u32 val;
17+
18+ intel_dmc_wl_get(i915, reg);
19+
20+ val = intel_uncore_read(&i915->uncore, reg);
21+
22+ intel_dmc_wl_put(i915, reg);
23+
24+ return val;
1725 }
1826
1927 static inline u8
2028 intel_de_read8(struct drm_i915_private *i915, i915_reg_t reg)
2129 {
22− return intel_uncore_read8(&i915->uncore, reg);
30+ u8 val;
31+
32+ intel_dmc_wl_get(i915, reg);
33+
34+ val = intel_uncore_read8(&i915->uncore, reg);
35+
36+ intel_dmc_wl_put(i915, reg);
37+
38+ return val;
2339 }
2440
2541 static inline u64
2642 intel_de_read64_2x32(struct drm_i915_private *i915,
2743 i915_reg_t lower_reg, i915_reg_t upper_reg)
2844 {
29− return intel_uncore_read64_2x32(&i915->uncore, lower_reg, upper_reg);
45+ u64 val;
46+
47+ intel_dmc_wl_get(i915, lower_reg);
48+ intel_dmc_wl_get(i915, upper_reg);
49+
50+ val = intel_uncore_read64_2x32(&i915->uncore, lower_reg, upper_reg);
51+
52+ intel_dmc_wl_put(i915, upper_reg);
53+ intel_dmc_wl_put(i915, lower_reg);
54+
55+ return val;
3056 }
3157
3258 static inline void
3359 intel_de_posting_read(struct drm_i915_private *i915, i915_reg_t reg)
3460 {
61+ intel_dmc_wl_get(i915, reg);
62+
3563 intel_uncore_posting_read(&i915->uncore, reg);
64+
65+ intel_dmc_wl_put(i915, reg);
3666 }
3767
3868 static inline void
3969 intel_de_write(struct drm_i915_private *i915, i915_reg_t reg, u32 val)
4070 {
71+ intel_dmc_wl_get(i915, reg);
72+
4173 intel_uncore_write(&i915->uncore, reg, val);
74+
75+ intel_dmc_wl_put(i915, reg);
4276 }
4377
4478 static inline u32
45−intel_de_rmw(struct drm_i915_private *i915, i915_reg_t reg, u32 clear, u32 set)
79+__intel_de_rmw_nowl(struct drm_i915_private *i915, i915_reg_t reg,
80+ u32 clear, u32 set)
4681 {
4782 return intel_uncore_rmw(&i915->uncore, reg, clear, set);
4883 }
4984
85+static inline u32
86+intel_de_rmw(struct drm_i915_private *i915, i915_reg_t reg, u32 clear, u32 set)
87+{
88+ u32 val;
89+
90+ intel_dmc_wl_get(i915, reg);
91+
92+ val = __intel_de_rmw_nowl(i915, reg, clear, set);
93+
94+ intel_dmc_wl_put(i915, reg);
95+
96+ return val;
97+}
98+
99+static inline int
100+__intel_wait_for_register_nowl(struct drm_i915_private *i915, i915_reg_t reg,
101+ u32 mask, u32 value, unsigned int timeout)
102+{
103+ return intel_wait_for_register(&i915->uncore, reg, mask,
104+ value, timeout);
105+}
106+
50107 static inline int
51−intel_de_wait_for_register(struct drm_i915_private *i915, i915_reg_t reg,
52− u32 mask, u32 value, unsigned int timeout)
108+intel_de_wait(struct drm_i915_private *i915, i915_reg_t reg,
109+ u32 mask, u32 value, unsigned int timeout)
53110 {
54− return intel_wait_for_register(&i915->uncore, reg, mask, value, timeout);
111+ int ret;
112+
113+ intel_dmc_wl_get(i915, reg);
114+
115+ ret = __intel_wait_for_register_nowl(i915, reg, mask, value, timeout);
116+
117+ intel_dmc_wl_put(i915, reg);
118+
119+ return ret;
55120 }
56121
57122 static inline int
58−intel_de_wait_for_register_fw(struct drm_i915_private *i915, i915_reg_t reg,
59− u32 mask, u32 value, unsigned int timeout)
123+intel_de_wait_fw(struct drm_i915_private *i915, i915_reg_t reg,
124+ u32 mask, u32 value, unsigned int timeout)
60125 {
61− return intel_wait_for_register_fw(&i915->uncore, reg, mask, value, timeout);
126+ int ret;
127+
128+ intel_dmc_wl_get(i915, reg);
129+
130+ ret = intel_wait_for_register_fw(&i915->uncore, reg, mask, value, timeout);
131+
132+ intel_dmc_wl_put(i915, reg);
133+
134+ return ret;
62135 }
63136
64137 static inline int
65−__intel_de_wait_for_register(struct drm_i915_private *i915, i915_reg_t reg,
66− u32 mask, u32 value,
67− unsigned int fast_timeout_us,
68− unsigned int slow_timeout_ms, u32 *out_value)
138+intel_de_wait_custom(struct drm_i915_private *i915, i915_reg_t reg,
139+ u32 mask, u32 value,
140+ unsigned int fast_timeout_us,
141+ unsigned int slow_timeout_ms, u32 *out_value)
69142 {
70− return __intel_wait_for_register(&i915->uncore, reg, mask, value,
71− fast_timeout_us, slow_timeout_ms, out_value);
143+ int ret;
144+
145+ intel_dmc_wl_get(i915, reg);
146+
147+ ret = __intel_wait_for_register(&i915->uncore, reg, mask, value,
148+ fast_timeout_us, slow_timeout_ms, out_value);
149+
150+ intel_dmc_wl_put(i915, reg);
151+
152+ return ret;
72153 }
73154
74155 static inline int
75156 intel_de_wait_for_set(struct drm_i915_private *i915, i915_reg_t reg,
76157 u32 mask, unsigned int timeout)
77158 {
78− return intel_de_wait_for_register(i915, reg, mask, mask, timeout);
159+ return intel_de_wait(i915, reg, mask, mask, timeout);
79160 }
80161
81162 static inline int
82163 intel_de_wait_for_clear(struct drm_i915_private *i915, i915_reg_t reg,
83164 u32 mask, unsigned int timeout)
84165 {
85− return intel_de_wait_for_register(i915, reg, mask, 0, timeout);
166+ return intel_de_wait(i915, reg, mask, 0, timeout);
86167 }
87168
88169 /*
drivers/gpu/drm/i915/display/intel_display.c+418−255
@@ -275,6 +275,13 @@ static int intel_bigjoiner_num_pipes(const struct intel_crtc_state *crtc_state) · 274 unmodified lines
275275 return hweight8(crtc_state->bigjoiner_pipes);
276276 }
277277
278+u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state)
279+{
280+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
281+
282+ return BIT(crtc->pipe) | crtc_state->bigjoiner_pipes;
283+}
284+
278285 struct intel_crtc *intel_master_crtc(const struct intel_crtc_state *crtc_state)
279286 {
280287 struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
@@ -383,8 +390,7 @@ void vlv_wait_port_ready(struct drm_i915_private *dev_priv, · 102 unmodified lines
383390 break;
384391 }
385392
386− if (intel_de_wait_for_register(dev_priv, dpll_reg,
387− port_mask, expected_mask, 1000))
393+ if (intel_de_wait(dev_priv, dpll_reg, port_mask, expected_mask, 1000))
388394 drm_WARN(&dev_priv->drm, 1,
389395 "timed out waiting for [ENCODER:%d:%s] port ready: got 0x%x, expected 0x%x\n",
390396 dig_port->base.base.base.id, dig_port->base.base.name,
@@ -430,6 +436,18 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) · 39 unmodified lines
430436 intel_de_rmw(dev_priv, PIPE_ARB_CTL(pipe),
431437 0, PIPE_ARB_USE_PROG_SLOTS);
432438
439+ if (DISPLAY_VER(dev_priv) >= 14) {
440+ u32 clear = DP_DSC_INSERT_SF_AT_EOL_WA;
441+ u32 set = 0;
442+
443+ if (DISPLAY_VER(dev_priv) == 14)
444+ set |= DP_FEC_BS_JITTER_WA;
445+
446+ intel_de_rmw(dev_priv,
447+ hsw_chicken_trans_reg(dev_priv, cpu_transcoder),
448+ clear, set);
449+ }
450+
433451 val = intel_de_read(dev_priv, TRANSCONF(cpu_transcoder));
434452 if (val & TRANSCONF_ENABLE) {
435453 /* we keep both pipes enabled on 830 */
@@ -437,6 +455,14 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) · 1 unmodified line
437455 return;
438456 }
439457
458+ /* Wa_1409098942:adlp+ */
459+ if (DISPLAY_VER(dev_priv) >= 13 &&
460+ new_crtc_state->dsc.compression_enable) {
461+ val &= ~TRANSCONF_PIXEL_COUNT_SCALING_MASK;
462+ val |= REG_FIELD_PREP(TRANSCONF_PIXEL_COUNT_SCALING_MASK,
463+ TRANSCONF_PIXEL_COUNT_SCALING_X4);
464+ }
465+
440466 intel_de_write(dev_priv, TRANSCONF(cpu_transcoder),
441467 val | TRANSCONF_ENABLE);
442468 intel_de_posting_read(dev_priv, TRANSCONF(cpu_transcoder));
@@ -483,6 +509,11 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state) · 40 unmodified lines
483509 if (!IS_I830(dev_priv))
484510 val &= ~TRANSCONF_ENABLE;
485511
512+ /* Wa_1409098942:adlp+ */
513+ if (DISPLAY_VER(dev_priv) >= 13 &&
514+ old_crtc_state->dsc.compression_enable)
515+ val &= ~TRANSCONF_PIXEL_COUNT_SCALING_MASK;
516+
486517 intel_de_write(dev_priv, TRANSCONF(cpu_transcoder), val);
487518
488519 if (DISPLAY_VER(dev_priv) >= 12)
@@ -535,7 +566,7 @@ bool intel_plane_uses_fence(const struct intel_plane_state *plane_state) · 46 unmodified lines
535566 struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
536567
537568 return DISPLAY_VER(dev_priv) < 4 ||
538− (plane->fbc &&
569+ (plane->fbc && !plane_state->no_fbc_reason &&
539570 plane_state->view.gtt.type == I915_GTT_VIEW_NORMAL);
540571 }
541572
@@ -1552,18 +1583,21 @@ static void ilk_crtc_enable(struct intel_atomic_state *state, · 1010 unmodified lines
15521583 intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, true);
15531584 }
15541585
1555−static void glk_pipe_scaler_clock_gating_wa(struct drm_i915_private *dev_priv,
1556− enum pipe pipe, bool apply)
1586+/* Display WA #1180: WaDisableScalarClockGating: glk */
1587+static bool glk_need_scaler_clock_gating_wa(const struct intel_crtc_state *crtc_state)
15571588 {
1558− u32 val = intel_de_read(dev_priv, CLKGATE_DIS_PSL(pipe));
1559− u32 mask = DPF_GATING_DIS | DPF_RAM_GATING_DIS | DPFR_GATING_DIS;
1589+ struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
15601590
1561− if (apply)
1562− val |= mask;
1563− else
1564− val &= ~mask;
1591+ return DISPLAY_VER(i915) == 10 && crtc_state->pch_pfit.enabled;
1592+}
15651593
1566− intel_de_write(dev_priv, CLKGATE_DIS_PSL(pipe), val);
1594+static void glk_pipe_scaler_clock_gating_wa(struct intel_crtc *crtc, bool enable)
1595+{
1596+ struct drm_i915_private *i915 = to_i915(crtc->base.dev);
1597+ u32 mask = DPF_GATING_DIS | DPF_RAM_GATING_DIS | DPFR_GATING_DIS;
1598+
1599+ intel_de_rmw(i915, CLKGATE_DIS_PSL(crtc->pipe),
1600+ mask, enable ? mask : 0);
15671601 }
15681602
15691603 static void hsw_set_linetime_wm(const struct intel_crtc_state *crtc_state)
@@ -1586,24 +1620,6 @@ static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state) · 16 unmodified lines
15861620 HSW_FRAME_START_DELAY(crtc_state->framestart_delay - 1));
15871621 }
15881622
1589−static void icl_ddi_bigjoiner_pre_enable(struct intel_atomic_state *state,
1590− const struct intel_crtc_state *crtc_state)
1591−{
1592− struct intel_crtc *master_crtc = intel_master_crtc(crtc_state);
1593−
1594− /*
1595− * Enable sequence steps 1-7 on bigjoiner master
1596− */
1597− if (intel_crtc_is_bigjoiner_slave(crtc_state))
1598− intel_encoders_pre_pll_enable(state, master_crtc);
1599−
1600− if (crtc_state->shared_dpll)
1601− intel_enable_shared_dpll(crtc_state);
1602−
1603− if (intel_crtc_is_bigjoiner_slave(crtc_state))
1604− intel_encoders_pre_enable(state, master_crtc);
1605−}
1606−
16071623 static void hsw_configure_cpu_transcoder(const struct intel_crtc_state *crtc_state)
16081624 {
16091625 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -1639,90 +1655,107 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, · 29 unmodified lines
16391655 const struct intel_crtc_state *new_crtc_state =
16401656 intel_atomic_get_new_crtc_state(state, crtc);
16411657 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
1642− enum pipe pipe = crtc->pipe, hsw_workaround_pipe;
16431658 enum transcoder cpu_transcoder = new_crtc_state->cpu_transcoder;
1644− bool psl_clkgate_wa;
1659+ struct intel_crtc *pipe_crtc;
16451660
16461661 if (drm_WARN_ON(&dev_priv->drm, crtc->active))
16471662 return;
16481663
1649− intel_dmc_enable_pipe(dev_priv, crtc->pipe);
1664+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
1665+ intel_crtc_joined_pipe_mask(new_crtc_state))
1666+ intel_dmc_enable_pipe(dev_priv, pipe_crtc->pipe);
16501667
1651− if (!new_crtc_state->bigjoiner_pipes) {
1652− intel_encoders_pre_pll_enable(state, crtc);
1668+ intel_encoders_pre_pll_enable(state, crtc);
16531669
1654− if (new_crtc_state->shared_dpll)
1655− intel_enable_shared_dpll(new_crtc_state);
1670+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
1671+ intel_crtc_joined_pipe_mask(new_crtc_state)) {
1672+ const struct intel_crtc_state *pipe_crtc_state =
1673+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
16561674
1657− intel_encoders_pre_enable(state, crtc);
1658− } else {
1659− icl_ddi_bigjoiner_pre_enable(state, new_crtc_state);
1675+ if (pipe_crtc_state->shared_dpll)
1676+ intel_enable_shared_dpll(pipe_crtc_state);
16601677 }
16611678
1662− intel_dsc_enable(new_crtc_state);
1679+ intel_encoders_pre_enable(state, crtc);
16631680
1664− if (DISPLAY_VER(dev_priv) >= 13)
1665− intel_uncompressed_joiner_enable(new_crtc_state);
1681+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
1682+ intel_crtc_joined_pipe_mask(new_crtc_state)) {
1683+ const struct intel_crtc_state *pipe_crtc_state =
1684+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
16661685
1667− intel_set_pipe_src_size(new_crtc_state);
1668− if (DISPLAY_VER(dev_priv) >= 9 || IS_BROADWELL(dev_priv))
1669− bdw_set_pipe_misc(new_crtc_state);
1686+ intel_dsc_enable(pipe_crtc_state);
1687+
1688+ if (DISPLAY_VER(dev_priv) >= 13)
1689+ intel_uncompressed_joiner_enable(pipe_crtc_state);
1690+
1691+ intel_set_pipe_src_size(pipe_crtc_state);
16701692
1671− if (!intel_crtc_is_bigjoiner_slave(new_crtc_state) &&
1672− !transcoder_is_dsi(cpu_transcoder))
1693+ if (DISPLAY_VER(dev_priv) >= 9 || IS_BROADWELL(dev_priv))
1694+ bdw_set_pipe_misc(pipe_crtc_state);
1695+ }
1696+
1697+ if (!transcoder_is_dsi(cpu_transcoder))
16731698 hsw_configure_cpu_transcoder(new_crtc_state);
16741699
1675− crtc->active = true;
1700+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
1701+ intel_crtc_joined_pipe_mask(new_crtc_state)) {
1702+ const struct intel_crtc_state *pipe_crtc_state =
1703+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
16761704
1677− /* Display WA #1180: WaDisableScalarClockGating: glk */
1678− psl_clkgate_wa = DISPLAY_VER(dev_priv) == 10 &&
1679− new_crtc_state->pch_pfit.enabled;
1680− if (psl_clkgate_wa)
1681− glk_pipe_scaler_clock_gating_wa(dev_priv, pipe, true);
1705+ pipe_crtc->active = true;
16821706
1683− if (DISPLAY_VER(dev_priv) >= 9)
1684− skl_pfit_enable(new_crtc_state);
1685− else
1686− ilk_pfit_enable(new_crtc_state);
1707+ if (glk_need_scaler_clock_gating_wa(pipe_crtc_state))
1708+ glk_pipe_scaler_clock_gating_wa(pipe_crtc, true);
16871709
1688− /*
1689− * On ILK+ LUT must be loaded before the pipe is running but with
1690− * clocks enabled
1691− */
1692− intel_color_load_luts(new_crtc_state);
1693− intel_color_commit_noarm(new_crtc_state);
1694− intel_color_commit_arm(new_crtc_state);
1695− /* update DSPCNTR to configure gamma/csc for pipe bottom color */
1696− if (DISPLAY_VER(dev_priv) < 9)
1697− intel_disable_primary_plane(new_crtc_state);
1710+ if (DISPLAY_VER(dev_priv) >= 9)
1711+ skl_pfit_enable(pipe_crtc_state);
1712+ else
1713+ ilk_pfit_enable(pipe_crtc_state);
16981714
1699− hsw_set_linetime_wm(new_crtc_state);
1715+ /*
1716+ * On ILK+ LUT must be loaded before the pipe is running but with
1717+ * clocks enabled
1718+ */
1719+ intel_color_load_luts(pipe_crtc_state);
1720+ intel_color_commit_noarm(pipe_crtc_state);
1721+ intel_color_commit_arm(pipe_crtc_state);
1722+ /* update DSPCNTR to configure gamma/csc for pipe bottom color */
1723+ if (DISPLAY_VER(dev_priv) < 9)
1724+ intel_disable_primary_plane(pipe_crtc_state);
17001725
1701− if (DISPLAY_VER(dev_priv) >= 11)
1702− icl_set_pipe_chicken(new_crtc_state);
1726+ hsw_set_linetime_wm(pipe_crtc_state);
17031727
1704− intel_initial_watermarks(state, crtc);
1728+ if (DISPLAY_VER(dev_priv) >= 11)
1729+ icl_set_pipe_chicken(pipe_crtc_state);
17051730
1706− if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
1707− intel_crtc_vblank_on(new_crtc_state);
1731+ intel_initial_watermarks(state, pipe_crtc);
1732+ }
17081733
17091734 intel_encoders_enable(state, crtc);
17101735
1711− if (psl_clkgate_wa) {
1712− intel_crtc_wait_for_next_vblank(crtc);
1713− glk_pipe_scaler_clock_gating_wa(dev_priv, pipe, false);
1714− }
1736+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
1737+ intel_crtc_joined_pipe_mask(new_crtc_state)) {
1738+ const struct intel_crtc_state *pipe_crtc_state =
1739+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
1740+ enum pipe hsw_workaround_pipe;
17151741
1716− /* If we change the relative order between pipe/planes enabling, we need
1717− * to change the workaround. */
1718− hsw_workaround_pipe = new_crtc_state->hsw_workaround_pipe;
1719− if (IS_HASWELL(dev_priv) && hsw_workaround_pipe != INVALID_PIPE) {
1720− struct intel_crtc *wa_crtc;
1742+ if (glk_need_scaler_clock_gating_wa(pipe_crtc_state)) {
1743+ intel_crtc_wait_for_next_vblank(pipe_crtc);
1744+ glk_pipe_scaler_clock_gating_wa(pipe_crtc, false);
1745+ }
17211746
1722− wa_crtc = intel_crtc_for_pipe(dev_priv, hsw_workaround_pipe);
1747+ /*
1748+ * If we change the relative order between pipe/planes
1749+ * enabling, we need to change the workaround.
1750+ */
1751+ hsw_workaround_pipe = pipe_crtc_state->hsw_workaround_pipe;
1752+ if (IS_HASWELL(dev_priv) && hsw_workaround_pipe != INVALID_PIPE) {
1753+ struct intel_crtc *wa_crtc =
1754+ intel_crtc_for_pipe(dev_priv, hsw_workaround_pipe);
17231755
1724− intel_crtc_wait_for_next_vblank(wa_crtc);
1725− intel_crtc_wait_for_next_vblank(wa_crtc);
1756+ intel_crtc_wait_for_next_vblank(wa_crtc);
1757+ intel_crtc_wait_for_next_vblank(wa_crtc);
1758+ }
17261759 }
17271760 }
17281761
@@ -1786,29 +1819,28 @@ static void hsw_crtc_disable(struct intel_atomic_state *state, · 57 unmodified lines
17861819 const struct intel_crtc_state *old_crtc_state =
17871820 intel_atomic_get_old_crtc_state(state, crtc);
17881821 struct drm_i915_private *i915 = to_i915(crtc->base.dev);
1822+ struct intel_crtc *pipe_crtc;
17891823
17901824 /*
17911825 * FIXME collapse everything to one hook.
17921826 * Need care with mst->ddi interactions.
17931827 */
1794− if (!intel_crtc_is_bigjoiner_slave(old_crtc_state)) {
1795− intel_encoders_disable(state, crtc);
1796− intel_encoders_post_disable(state, crtc);
1797− }
1798−
1799− intel_disable_shared_dpll(old_crtc_state);
1828+ intel_encoders_disable(state, crtc);
1829+ intel_encoders_post_disable(state, crtc);
18001830
1801− if (!intel_crtc_is_bigjoiner_slave(old_crtc_state)) {
1802− struct intel_crtc *slave_crtc;
1831+ for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
1832+ intel_crtc_joined_pipe_mask(old_crtc_state)) {
1833+ const struct intel_crtc_state *old_pipe_crtc_state =
1834+ intel_atomic_get_old_crtc_state(state, pipe_crtc);
18031835
1804− intel_encoders_post_pll_disable(state, crtc);
1836+ intel_disable_shared_dpll(old_pipe_crtc_state);
1837+ }
18051838
1806− intel_dmc_disable_pipe(i915, crtc->pipe);
1839+ intel_encoders_post_pll_disable(state, crtc);
18071840
1808− for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
1809− intel_crtc_bigjoiner_slave_pipes(old_crtc_state))
1810− intel_dmc_disable_pipe(i915, slave_crtc->pipe);
1811− }
1841+ for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
1842+ intel_crtc_joined_pipe_mask(old_crtc_state))
1843+ intel_dmc_disable_pipe(i915, pipe_crtc->pipe);
18121844 }
18131845
18141846 static void i9xx_pfit_enable(const struct intel_crtc_state *crtc_state)
@@ -1836,6 +1868,7 @@ static void i9xx_pfit_enable(const struct intel_crtc_state *crtc_state) · 21 unmodified lines
18361868 intel_de_write(dev_priv, BCLRPAT(crtc->pipe), 0);
18371869 }
18381870
1871+/* Prefer intel_encoder_is_combo() */
18391872 bool intel_phy_is_combo(struct drm_i915_private *dev_priv, enum phy phy)
18401873 {
18411874 if (phy == PHY_NONE)
@@ -1857,6 +1890,7 @@ bool intel_phy_is_combo(struct drm_i915_private *dev_priv, enum phy phy) · 15 unmodified lines
18571890 return false;
18581891 }
18591892
1893+/* Prefer intel_encoder_is_tc() */
18601894 bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy)
18611895 {
18621896 /*
@@ -1877,6 +1911,7 @@ bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy) · 14 unmodified lines
18771911 return false;
18781912 }
18791913
1914+/* Prefer intel_encoder_is_snps() */
18801915 bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy)
18811916 {
18821917 /*
@@ -1886,6 +1921,7 @@ bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy) · 3 unmodified lines
18861921 return IS_DG2(dev_priv) && phy > PHY_NONE && phy <= PHY_E;
18871922 }
18881923
1924+/* Prefer intel_encoder_to_phy() */
18891925 enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port)
18901926 {
18911927 if (DISPLAY_VER(i915) >= 13 && port >= PORT_D_XELPD)
@@ -1903,6 +1939,7 @@ enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port) · 11 unmodified lines
19031939 return PHY_A + port - PORT_A;
19041940 }
19051941
1942+/* Prefer intel_encoder_to_tc() */
19061943 enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port)
19071944 {
19081945 if (!intel_phy_is_tc(dev_priv, intel_port_to_phy(dev_priv, port)))
@@ -1914,6 +1951,41 @@ enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port) · 5 unmodified lines
19141951 return TC_PORT_1 + port - PORT_C;
19151952 }
19161953
1954+enum phy intel_encoder_to_phy(struct intel_encoder *encoder)
1955+{
1956+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1957+
1958+ return intel_port_to_phy(i915, encoder->port);
1959+}
1960+
1961+bool intel_encoder_is_combo(struct intel_encoder *encoder)
1962+{
1963+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1964+
1965+ return intel_phy_is_combo(i915, intel_encoder_to_phy(encoder));
1966+}
1967+
1968+bool intel_encoder_is_snps(struct intel_encoder *encoder)
1969+{
1970+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1971+
1972+ return intel_phy_is_snps(i915, intel_encoder_to_phy(encoder));
1973+}
1974+
1975+bool intel_encoder_is_tc(struct intel_encoder *encoder)
1976+{
1977+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1978+
1979+ return intel_phy_is_tc(i915, intel_encoder_to_phy(encoder));
1980+}
1981+
1982+enum tc_port intel_encoder_to_tc(struct intel_encoder *encoder)
1983+{
1984+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1985+
1986+ return intel_port_to_tc(i915, encoder->port);
1987+}
1988+
19171989 enum intel_display_power_domain
19181990 intel_aux_power_domain(struct intel_digital_port *dig_port)
19191991 {
@@ -2381,7 +2453,7 @@ static int intel_crtc_compute_pipe_mode(struct intel_crtc_state *crtc_state) · 461 unmodified lines
23812453 struct drm_i915_private *i915 = to_i915(crtc->base.dev);
23822454 struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
23832455 struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;
2384− int clock_limit = i915->max_dotclk_freq;
2456+ int clock_limit = i915->display.cdclk.max_dotclk_freq;
23852457
23862458 /*
23872459 * Start with the adjusted_mode crtc timings, which
@@ -2405,7 +2477,7 @@ static int intel_crtc_compute_pipe_mode(struct intel_crtc_state *crtc_state) · 17 unmodified lines
24052477 */
24062478 if (intel_crtc_supports_double_wide(crtc) &&
24072479 pipe_mode->crtc_clock > clock_limit) {
2408− clock_limit = i915->max_dotclk_freq;
2480+ clock_limit = i915->display.cdclk.max_dotclk_freq;
24092481 crtc_state->double_wide = true;
24102482 }
24112483 }
@@ -2709,15 +2781,6 @@ static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state) · 297 unmodified lines
27092781 */
27102782 intel_de_write(dev_priv, PIPESRC(pipe),
27112783 PIPESRC_WIDTH(width - 1) | PIPESRC_HEIGHT(height - 1));
2712−
2713− if (!crtc_state->enable_psr2_su_region_et)
2714− return;
2715−
2716− width = drm_rect_width(&crtc_state->psr2_su_area);
2717− height = drm_rect_height(&crtc_state->psr2_su_area);
2718−
2719− intel_de_write(dev_priv, PIPE_SRCSZ_ERLY_TPT(pipe),
2720− PIPESRC_WIDTH(width - 1) | PIPESRC_HEIGHT(height - 1));
27212784 }
27222785
27232786 static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)
@@ -4723,8 +4786,6 @@ intel_modeset_pipe_config_late(struct intel_atomic_state *state, · 1999 unmodified lines
47234786 struct drm_connector *connector;
47244787 int i;
47254788
4726− intel_bigjoiner_adjust_pipe_src(crtc_state);
4727−
47284789 for_each_new_connector_in_state(&state->base, connector,
47294790 conn_state, i) {
47304791 struct intel_encoder *encoder =
@@ -4791,42 +4852,92 @@ intel_compare_dp_vsc_sdp(const struct drm_dp_vsc_sdp *a, · 60 unmodified lines
47914852 a->content_type == b->content_type;
47924853 }
47934854
4855+static bool
4856+intel_compare_dp_as_sdp(const struct drm_dp_as_sdp *a,
4857+ const struct drm_dp_as_sdp *b)
4858+{
4859+ return a->vtotal == b->vtotal &&
4860+ a->target_rr == b->target_rr &&
4861+ a->duration_incr_ms == b->duration_incr_ms &&
4862+ a->duration_decr_ms == b->duration_decr_ms &&
4863+ a->mode == b->mode;
4864+}
4865+
47944866 static bool
47954867 intel_compare_buffer(const u8 *a, const u8 *b, size_t len)
47964868 {
47974869 return memcmp(a, b, len) == 0;
47984870 }
47994871
4872+static void __printf(5, 6)
4873+pipe_config_mismatch(struct drm_printer *p, bool fastset,
4874+ const struct intel_crtc *crtc,
4875+ const char *name, const char *format, ...)
4876+{
4877+ struct va_format vaf;
4878+ va_list args;
4879+
4880+ va_start(args, format);
4881+ vaf.fmt = format;
4882+ vaf.va = &args;
4883+
4884+ if (fastset)
4885+ drm_printf(p, "[CRTC:%d:%s] fastset requirement not met in %s %pV\n",
4886+ crtc->base.base.id, crtc->base.name, name, &vaf);
4887+ else
4888+ drm_printf(p, "[CRTC:%d:%s] mismatch in %s %pV\n",
4889+ crtc->base.base.id, crtc->base.name, name, &vaf);
4890+
4891+ va_end(args);
4892+}
4893+
48004894 static void
4801−pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv,
4802− bool fastset, const char *name,
4895+pipe_config_infoframe_mismatch(struct drm_printer *p, bool fastset,
4896+ const struct intel_crtc *crtc,
4897+ const char *name,
48034898 const union hdmi_infoframe *a,
48044899 const union hdmi_infoframe *b)
48054900 {
4901+ struct drm_i915_private *i915 = to_i915(crtc->base.dev);
4902+ const char *loglevel;
4903+
48064904 if (fastset) {
48074905 if (!drm_debug_enabled(DRM_UT_KMS))
48084906 return;
48094907
4810− drm_dbg_kms(&dev_priv->drm,
4811− "fastset requirement not met in %s infoframe\n", name);
4812− drm_dbg_kms(&dev_priv->drm, "expected:\n");
4813− hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, a);
4814− drm_dbg_kms(&dev_priv->drm, "found:\n");
4815− hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, b);
4908+ loglevel = KERN_DEBUG;
48164909 } else {
4817− drm_err(&dev_priv->drm, "mismatch in %s infoframe\n", name);
4818− drm_err(&dev_priv->drm, "expected:\n");
4819− hdmi_infoframe_log(KERN_ERR, dev_priv->drm.dev, a);
4820− drm_err(&dev_priv->drm, "found:\n");
4821− hdmi_infoframe_log(KERN_ERR, dev_priv->drm.dev, b);
4910+ loglevel = KERN_ERR;
48224911 }
4912+
4913+ pipe_config_mismatch(p, fastset, crtc, name, "infoframe");
4914+
4915+ drm_printf(p, "expected:\n");
4916+ hdmi_infoframe_log(loglevel, i915->drm.dev, a);
4917+ drm_printf(p, "found:\n");
4918+ hdmi_infoframe_log(loglevel, i915->drm.dev, b);
48234919 }
48244920
48254921 static void
4826−pipe_config_dp_vsc_sdp_mismatch(struct drm_i915_private *i915,
4827− bool fastset, const char *name,
4922+pipe_config_dp_vsc_sdp_mismatch(struct drm_printer *p, bool fastset,
4923+ const struct intel_crtc *crtc,
4924+ const char *name,
48284925 const struct drm_dp_vsc_sdp *a,
48294926 const struct drm_dp_vsc_sdp *b)
4927+{
4928+ pipe_config_mismatch(p, fastset, crtc, name, "dp sdp");
4929+
4930+ drm_printf(p, "expected:\n");
4931+ drm_dp_vsc_sdp_log(p, a);
4932+ drm_printf(p, "found:\n");
4933+ drm_dp_vsc_sdp_log(p, b);
4934+}
4935+
4936+static void
4937+pipe_config_dp_as_sdp_mismatch(struct drm_i915_private *i915,
4938+ bool fastset, const char *name,
4939+ const struct drm_dp_as_sdp *a,
4940+ const struct drm_dp_as_sdp *b)
48304941 {
48314942 struct drm_printer p;
48324943
@@ -4841,9 +4952,9 @@ pipe_config_dp_vsc_sdp_mismatch(struct drm_i915_private *i915, · 8 unmodified lines
48414952 }
48424953
48434954 drm_printf(&p, "expected:\n");
4844− drm_dp_vsc_sdp_log(&p, a);
4955+ drm_dp_as_sdp_log(&p, a);
48454956 drm_printf(&p, "found:\n");
4846− drm_dp_vsc_sdp_log(&p, b);
4957+ drm_dp_as_sdp_log(&p, b);
48474958 }
48484959
48494960 /* Returns the length up to and including the last differing byte */
@@ -4861,64 +4972,35 @@ memcmp_diff_len(const u8 *a, const u8 *b, size_t len) · 11 unmodified lines
48614972 }
48624973
48634974 static void
4864−pipe_config_buffer_mismatch(bool fastset, const struct intel_crtc *crtc,
4975+pipe_config_buffer_mismatch(struct drm_printer *p, bool fastset,
4976+ const struct intel_crtc *crtc,
48654977 const char *name,
48664978 const u8 *a, const u8 *b, size_t len)
48674979 {
4868− struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
4980+ const char *loglevel;
48694981
48704982 if (fastset) {
48714983 if (!drm_debug_enabled(DRM_UT_KMS))
48724984 return;
48734985
4874− /* only dump up to the last difference */
4875− len = memcmp_diff_len(a, b, len);
4876−
4877− drm_dbg_kms(&dev_priv->drm,
4878− "[CRTC:%d:%s] fastset requirement not met in %s buffer\n",
4879− crtc->base.base.id, crtc->base.name, name);
4880− print_hex_dump(KERN_DEBUG, "expected: ", DUMP_PREFIX_NONE,
4881− 16, 0, a, len, false);
4882− print_hex_dump(KERN_DEBUG, "found: ", DUMP_PREFIX_NONE,
4883− 16, 0, b, len, false);
4986+ loglevel = KERN_DEBUG;
48844987 } else {
4885− /* only dump up to the last difference */
4886− len = memcmp_diff_len(a, b, len);
4887−
4888− drm_err(&dev_priv->drm, "[CRTC:%d:%s] mismatch in %s buffer\n",
4889− crtc->base.base.id, crtc->base.name, name);
4890− print_hex_dump(KERN_ERR, "expected: ", DUMP_PREFIX_NONE,
4891− 16, 0, a, len, false);
4892− print_hex_dump(KERN_ERR, "found: ", DUMP_PREFIX_NONE,
4893− 16, 0, b, len, false);
4988+ loglevel = KERN_ERR;
48944989 }
4895−}
48964990
4897−static void __printf(4, 5)
4898−pipe_config_mismatch(bool fastset, const struct intel_crtc *crtc,
4899− const char *name, const char *format, ...)
4900−{
4901− struct drm_i915_private *i915 = to_i915(crtc->base.dev);
4902− struct va_format vaf;
4903− va_list args;
4904−
4905− va_start(args, format);
4906− vaf.fmt = format;
4907− vaf.va = &args;
4991+ pipe_config_mismatch(p, fastset, crtc, name, "buffer");
49084992
4909− if (fastset)
4910− drm_dbg_kms(&i915->drm,
4911− "[CRTC:%d:%s] fastset requirement not met in %s %pV\n",
4912− crtc->base.base.id, crtc->base.name, name, &vaf);
4913− else
4914− drm_err(&i915->drm, "[CRTC:%d:%s] mismatch in %s %pV\n",
4915− crtc->base.base.id, crtc->base.name, name, &vaf);
4993+ /* only dump up to the last difference */
4994+ len = memcmp_diff_len(a, b, len);
49164995
4917− va_end(args);
4996+ print_hex_dump(loglevel, "expected: ", DUMP_PREFIX_NONE,
4997+ 16, 0, a, len, false);
4998+ print_hex_dump(loglevel, "found: ", DUMP_PREFIX_NONE,
4999+ 16, 0, b, len, false);
49185000 }
49195001
49205002 static void
4921−pipe_config_pll_mismatch(bool fastset,
5003+pipe_config_pll_mismatch(struct drm_printer *p, bool fastset,
49225004 const struct intel_crtc *crtc,
49235005 const char *name,
49245006 const struct intel_dpll_hw_state *a,
@@ -4926,25 +5008,12 @@ pipe_config_pll_mismatch(bool fastset, · 1 unmodified line
49265008 {
49275009 struct drm_i915_private *i915 = to_i915(crtc->base.dev);
49285010
4929− if (fastset) {
4930− if (!drm_debug_enabled(DRM_UT_KMS))
4931− return;
5011+ pipe_config_mismatch(p, fastset, crtc, name, " "); /* stupid -Werror=format-zero-length */
49325012
4933− drm_dbg_kms(&i915->drm,
4934− "[CRTC:%d:%s] fastset requirement not met in %s\n",
4935− crtc->base.base.id, crtc->base.name, name);
4936− drm_dbg_kms(&i915->drm, "expected:\n");
4937− intel_dpll_dump_hw_state(i915, a);
4938− drm_dbg_kms(&i915->drm, "found:\n");
4939− intel_dpll_dump_hw_state(i915, b);
4940− } else {
4941− drm_err(&i915->drm, "[CRTC:%d:%s] mismatch in %s buffer\n",
4942− crtc->base.base.id, crtc->base.name, name);
4943− drm_err(&i915->drm, "expected:\n");
4944− intel_dpll_dump_hw_state(i915, a);
4945− drm_err(&i915->drm, "found:\n");
4946− intel_dpll_dump_hw_state(i915, b);
4947− }
5013+ drm_printf(p, "expected:\n");
5014+ intel_dpll_dump_hw_state(i915, p, a);
5015+ drm_printf(p, "found:\n");
5016+ intel_dpll_dump_hw_state(i915, p, b);
49485017 }
49495018
49505019 bool
@@ -4954,13 +5023,19 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 3 unmodified lines
49545023 {
49555024 struct drm_i915_private *dev_priv = to_i915(current_config->uapi.crtc->dev);
49565025 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
5026+ struct drm_printer p;
49575027 bool ret = true;
49585028
5029+ if (fastset)
5030+ p = drm_dbg_printer(&dev_priv->drm, DRM_UT_KMS, NULL);
5031+ else
5032+ p = drm_err_printer(&dev_priv->drm, NULL);
5033+
49595034 #define PIPE_CONF_CHECK_X(name) do { \
49605035 if (current_config->name != pipe_config->name) { \
49615036 BUILD_BUG_ON_MSG(__same_type(current_config->name, bool), \
49625037 __stringify(name) " is bool"); \
4963− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5038+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
49645039 "(expected 0x%08x, found 0x%08x)", \
49655040 current_config->name, \
49665041 pipe_config->name); \
@@ -4972,7 +5047,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 5 unmodified lines
49725047 if ((current_config->name & (mask)) != (pipe_config->name & (mask))) { \
49735048 BUILD_BUG_ON_MSG(__same_type(current_config->name, bool), \
49745049 __stringify(name) " is bool"); \
4975− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5050+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
49765051 "(expected 0x%08x, found 0x%08x)", \
49775052 current_config->name & (mask), \
49785053 pipe_config->name & (mask)); \
@@ -4984,7 +5059,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 5 unmodified lines
49845059 if (current_config->name != pipe_config->name) { \
49855060 BUILD_BUG_ON_MSG(__same_type(current_config->name, bool), \
49865061 __stringify(name) " is bool"); \
4987− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5062+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
49885063 "(expected %i, found %i)", \
49895064 current_config->name, \
49905065 pipe_config->name); \
@@ -4996,7 +5071,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 5 unmodified lines
49965071 if (current_config->name != pipe_config->name) { \
49975072 BUILD_BUG_ON_MSG(!__same_type(current_config->name, bool), \
49985073 __stringify(name) " is not bool"); \
4999− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5074+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
50005075 "(expected %s, found %s)", \
50015076 str_yes_no(current_config->name), \
50025077 str_yes_no(pipe_config->name)); \
@@ -5006,7 +5081,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 3 unmodified lines
50065081
50075082 #define PIPE_CONF_CHECK_P(name) do { \
50085083 if (current_config->name != pipe_config->name) { \
5009− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5084+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
50105085 "(expected %p, found %p)", \
50115086 current_config->name, \
50125087 pipe_config->name); \
@@ -5017,7 +5092,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 4 unmodified lines
50175092 #define PIPE_CONF_CHECK_M_N(name) do { \
50185093 if (!intel_compare_link_m_n(&current_config->name, \
50195094 &pipe_config->name)) { \
5020− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5095+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
50215096 "(expected tu %i data %i/%i link %i/%i, " \
50225097 "found tu %i, data %i/%i link %i/%i)", \
50235098 current_config->name.tu, \
@@ -5037,7 +5112,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 13 unmodified lines
50375112 #define PIPE_CONF_CHECK_PLL(name) do { \
50385113 if (!intel_dpll_compare_hw_state(dev_priv, &current_config->name, \
50395114 &pipe_config->name)) { \
5040− pipe_config_pll_mismatch(fastset, crtc, __stringify(name), \
5115+ pipe_config_pll_mismatch(&p, fastset, crtc, __stringify(name), \
50415116 &current_config->name, \
50425117 &pipe_config->name); \
50435118 ret = false; \
@@ -5070,7 +5145,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 26 unmodified lines
50705145
50715146 #define PIPE_CONF_CHECK_FLAGS(name, mask) do { \
50725147 if ((current_config->name ^ pipe_config->name) & (mask)) { \
5073− pipe_config_mismatch(fastset, crtc, __stringify(name), \
5148+ pipe_config_mismatch(&p, fastset, crtc, __stringify(name), \
50745149 "(%x) (expected %i, found %i)", \
50755150 (mask), \
50765151 current_config->name & (mask), \
@@ -5082,7 +5157,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 5 unmodified lines
50825157 #define PIPE_CONF_CHECK_INFOFRAME(name) do { \
50835158 if (!intel_compare_infoframe(&current_config->infoframes.name, \
50845159 &pipe_config->infoframes.name)) { \
5085− pipe_config_infoframe_mismatch(dev_priv, fastset, __stringify(name), \
5160+ pipe_config_infoframe_mismatch(&p, fastset, crtc, __stringify(name), \
50865161 &current_config->infoframes.name, \
50875162 &pipe_config->infoframes.name); \
50885163 ret = false; \
@@ -5092,7 +5167,17 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 3 unmodified lines
50925167 #define PIPE_CONF_CHECK_DP_VSC_SDP(name) do { \
50935168 if (!intel_compare_dp_vsc_sdp(&current_config->infoframes.name, \
50945169 &pipe_config->infoframes.name)) { \
5095− pipe_config_dp_vsc_sdp_mismatch(dev_priv, fastset, __stringify(name), \
5170+ pipe_config_dp_vsc_sdp_mismatch(&p, fastset, crtc, __stringify(name), \
5171+ &current_config->infoframes.name, \
5172+ &pipe_config->infoframes.name); \
5173+ ret = false; \
5174+ } \
5175+} while (0)
5176+
5177+#define PIPE_CONF_CHECK_DP_AS_SDP(name) do { \
5178+ if (!intel_compare_dp_as_sdp(&current_config->infoframes.name, \
5179+ &pipe_config->infoframes.name)) { \
5180+ pipe_config_dp_as_sdp_mismatch(dev_priv, fastset, __stringify(name), \
50965181 &current_config->infoframes.name, \
50975182 &pipe_config->infoframes.name); \
50985183 ret = false; \
@@ -5103,7 +5188,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 4 unmodified lines
51035188 BUILD_BUG_ON(sizeof(current_config->name) != (len)); \
51045189 BUILD_BUG_ON(sizeof(pipe_config->name) != (len)); \
51055190 if (!intel_compare_buffer(current_config->name, pipe_config->name, (len))) { \
5106− pipe_config_buffer_mismatch(fastset, crtc, __stringify(name), \
5191+ pipe_config_buffer_mismatch(&p, fastset, crtc, __stringify(name), \
51075192 current_config->name, \
51085193 pipe_config->name, \
51095194 (len)); \
@@ -5116,7 +5201,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 6 unmodified lines
51165201 !intel_color_lut_equal(current_config, \
51175202 current_config->lut, pipe_config->lut, \
51185203 is_pre_csc_lut)) { \
5119− pipe_config_mismatch(fastset, crtc, __stringify(lut), \
5204+ pipe_config_mismatch(&p, fastset, crtc, __stringify(lut), \
51205205 "hw_state doesn't match sw_state"); \
51215206 ret = false; \
51225207 } \
@@ -5245,6 +5330,18 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 122 unmodified lines
52455330 PIPE_CONF_CHECK_CSC(output_csc);
52465331 }
52475332
5333+ /*
5334+ * Panel replay has to be enabled before link training. PSR doesn't have
5335+ * this requirement -> check these only if using panel replay
5336+ */
5337+ if (current_config->has_panel_replay || pipe_config->has_panel_replay) {
5338+ PIPE_CONF_CHECK_BOOL(has_psr);
5339+ PIPE_CONF_CHECK_BOOL(has_psr2);
5340+ PIPE_CONF_CHECK_BOOL(enable_psr2_sel_fetch);
5341+ PIPE_CONF_CHECK_BOOL(enable_psr2_su_region_et);
5342+ PIPE_CONF_CHECK_BOOL(has_panel_replay);
5343+ }
5344+
52485345 PIPE_CONF_CHECK_BOOL(double_wide);
52495346
52505347 if (dev_priv->display.dpll.mgr)
@@ -5280,6 +5377,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 29 unmodified lines
52805377 PIPE_CONF_CHECK_INFOFRAME(hdmi);
52815378 PIPE_CONF_CHECK_INFOFRAME(drm);
52825379 PIPE_CONF_CHECK_DP_VSC_SDP(vsc);
5380+ PIPE_CONF_CHECK_DP_AS_SDP(as_sdp);
52835381
52845382 PIPE_CONF_CHECK_X(sync_mode_slaves_mask);
52855383 PIPE_CONF_CHECK_I(master_transcoder);
@@ -5331,6 +5429,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, · 45 unmodified lines
53315429 PIPE_CONF_CHECK_I(vrr.flipline);
53325430 PIPE_CONF_CHECK_I(vrr.pipeline_full);
53335431 PIPE_CONF_CHECK_I(vrr.guardband);
5432+ PIPE_CONF_CHECK_I(vrr.vsync_start);
5433+ PIPE_CONF_CHECK_I(vrr.vsync_end);
53345434 }
53355435
53365436 #undef PIPE_CONF_CHECK_X
@@ -5576,14 +5676,16 @@ static int intel_modeset_checks(struct intel_atomic_state *state) · 239 unmodified lines
55765676 static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_state,
55775677 struct intel_crtc_state *new_crtc_state)
55785678 {
5579− struct drm_i915_private *i915 = to_i915(old_crtc_state->uapi.crtc->dev);
5679+ struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
5680+ struct drm_i915_private *i915 = to_i915(crtc->base.dev);
55805681
55815682 /* only allow LRR when the timings stay within the VRR range */
55825683 if (old_crtc_state->vrr.in_range != new_crtc_state->vrr.in_range)
55835684 new_crtc_state->update_lrr = false;
55845685
55855686 if (!intel_pipe_config_compare(old_crtc_state, new_crtc_state, true))
5586− drm_dbg_kms(&i915->drm, "fastset requirement not met, forcing full modeset\n");
5687+ drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] fastset requirement not met, forcing full modeset\n",
5688+ crtc->base.base.id, crtc->base.name);
55875689 else
55885690 new_crtc_state->uapi.mode_changed = false;
55895691
@@ -6237,27 +6339,37 @@ static int intel_atomic_check_config(struct intel_atomic_state *state, · 647 unmodified lines
62376339 continue;
62386340 }
62396341
6240− if (intel_crtc_is_bigjoiner_slave(new_crtc_state)) {
6241− drm_WARN_ON(&i915->drm, new_crtc_state->uapi.enable);
6342+ if (drm_WARN_ON(&i915->drm, intel_crtc_is_bigjoiner_slave(new_crtc_state)))
62426343 continue;
6243− }
62446344
62456345 ret = intel_crtc_prepare_cleared_state(state, crtc);
62466346 if (ret)
6247− break;
6347+ goto fail;
62486348
62496349 if (!new_crtc_state->hw.enable)
62506350 continue;
62516351
62526352 ret = intel_modeset_pipe_config(state, crtc, limits);
62536353 if (ret)
6254− break;
6354+ goto fail;
6355+ }
62556356
6256− ret = intel_atomic_check_bigjoiner(state, crtc);
6357+ for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
6358+ if (!intel_crtc_needs_modeset(new_crtc_state))
6359+ continue;
6360+
6361+ if (drm_WARN_ON(&i915->drm, intel_crtc_is_bigjoiner_slave(new_crtc_state)))
6362+ continue;
6363+
6364+ if (!new_crtc_state->hw.enable)
6365+ continue;
6366+
6367+ ret = intel_modeset_pipe_config_late(state, crtc);
62576368 if (ret)
6258− break;
6369+ goto fail;
62596370 }
62606371
6372+fail:
62616373 if (ret)
62626374 *failed_pipe = crtc->pipe;
62636375
@@ -6353,16 +6465,26 @@ int intel_atomic_check(struct drm_device *dev, · 89 unmodified lines
63536465 if (ret)
63546466 goto fail;
63556467
6468+ for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
6469+ if (!intel_crtc_needs_modeset(new_crtc_state))
6470+ continue;
6471+
6472+ if (intel_crtc_is_bigjoiner_slave(new_crtc_state)) {
6473+ drm_WARN_ON(&dev_priv->drm, new_crtc_state->uapi.enable);
6474+ continue;
6475+ }
6476+
6477+ ret = intel_atomic_check_bigjoiner(state, crtc);
6478+ if (ret)
6479+ goto fail;
6480+ }
6481+
63566482 for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
63576483 new_crtc_state, i) {
63586484 if (!intel_crtc_needs_modeset(new_crtc_state))
63596485 continue;
63606486
6361− if (new_crtc_state->hw.enable) {
6362− ret = intel_modeset_pipe_config_late(state, crtc);
6363− if (ret)
6364− goto fail;
6365− }
6487+ intel_bigjoiner_adjust_pipe_src(new_crtc_state);
63666488
63676489 intel_crtc_check_fastset(old_crtc_state, new_crtc_state);
63686490 }
@@ -6644,17 +6766,21 @@ static void intel_enable_crtc(struct intel_atomic_state *state, · 275 unmodified lines
66446766 struct drm_i915_private *dev_priv = to_i915(state->base.dev);
66456767 const struct intel_crtc_state *new_crtc_state =
66466768 intel_atomic_get_new_crtc_state(state, crtc);
6769+ struct intel_crtc *pipe_crtc;
66476770
66486771 if (!intel_crtc_needs_modeset(new_crtc_state))
66496772 return;
66506773
6651− /* VRR will be enable later, if required */
6652− intel_crtc_update_active_timings(new_crtc_state, false);
6774+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
6775+ intel_crtc_joined_pipe_mask(new_crtc_state)) {
6776+ const struct intel_crtc_state *pipe_crtc_state =
6777+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
66536778
6654− dev_priv->display.funcs.display->crtc_enable(state, crtc);
6779+ /* VRR will be enable later, if required */
6780+ intel_crtc_update_active_timings(pipe_crtc_state, false);
6781+ }
66556782
6656− if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
6657− return;
6783+ dev_priv->display.funcs.display->crtc_enable(state, crtc);
66586784
66596785 /* vblanks work again, re-enable pipe CRC. */
66606786 intel_crtc_enable_pipe_crc(crtc);
@@ -6746,31 +6872,42 @@ static void intel_update_crtc(struct intel_atomic_state *state, · 85 unmodified lines
67466872 }
67476873
67486874 static void intel_old_crtc_state_disables(struct intel_atomic_state *state,
6749− struct intel_crtc_state *old_crtc_state,
6750− struct intel_crtc_state *new_crtc_state,
67516875 struct intel_crtc *crtc)
67526876 {
67536877 struct drm_i915_private *dev_priv = to_i915(state->base.dev);
6878+ const struct intel_crtc_state *old_crtc_state =
6879+ intel_atomic_get_old_crtc_state(state, crtc);
6880+ struct intel_crtc *pipe_crtc;
67546881
67556882 /*
67566883 * We need to disable pipe CRC before disabling the pipe,
67576884 * or we race against vblank off.
67586885 */
6759− intel_crtc_disable_pipe_crc(crtc);
6886+ for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
6887+ intel_crtc_joined_pipe_mask(old_crtc_state))
6888+ intel_crtc_disable_pipe_crc(pipe_crtc);
67606889
67616890 dev_priv->display.funcs.display->crtc_disable(state, crtc);
6762− crtc->active = false;
6763− intel_fbc_disable(crtc);
67646891
6765− if (!new_crtc_state->hw.active)
6766− intel_initial_watermarks(state, crtc);
6892+ for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
6893+ intel_crtc_joined_pipe_mask(old_crtc_state)) {
6894+ const struct intel_crtc_state *new_pipe_crtc_state =
6895+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
6896+
6897+ pipe_crtc->active = false;
6898+ intel_fbc_disable(pipe_crtc);
6899+
6900+ if (!new_pipe_crtc_state->hw.active)
6901+ intel_initial_watermarks(state, pipe_crtc);
6902+ }
67676903 }
67686904
67696905 static void intel_commit_modeset_disables(struct intel_atomic_state *state)
67706906 {
6771− struct intel_crtc_state *new_crtc_state, *old_crtc_state;
6907+ struct drm_i915_private *i915 = to_i915(state->base.dev);
6908+ const struct intel_crtc_state *new_crtc_state, *old_crtc_state;
67726909 struct intel_crtc *crtc;
6773− u32 handled = 0;
6910+ u8 disable_pipes = 0;
67746911 int i;
67756912
67766913 for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
@@ -6778,21 +6915,31 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) · 1 unmodified line
67786915 if (!intel_crtc_needs_modeset(new_crtc_state))
67796916 continue;
67806917
6918+ /*
6919+ * Needs to be done even for pipes
6920+ * that weren't enabled previously.
6921+ */
67816922 intel_pre_plane_update(state, crtc);
67826923
67836924 if (!old_crtc_state->hw.active)
67846925 continue;
67856926
6927+ disable_pipes |= BIT(crtc->pipe);
6928+ }
6929+
6930+ for_each_old_intel_crtc_in_state(state, crtc, old_crtc_state, i) {
6931+ if ((disable_pipes & BIT(crtc->pipe)) == 0)
6932+ continue;
6933+
67866934 intel_crtc_disable_planes(state, crtc);
67876935 }
67886936
67896937 /* Only disable port sync and MST slaves */
6790− for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
6791− new_crtc_state, i) {
6792− if (!intel_crtc_needs_modeset(new_crtc_state))
6938+ for_each_old_intel_crtc_in_state(state, crtc, old_crtc_state, i) {
6939+ if ((disable_pipes & BIT(crtc->pipe)) == 0)
67936940 continue;
67946941
6795− if (!old_crtc_state->hw.active)
6942+ if (intel_crtc_is_bigjoiner_slave(old_crtc_state))
67966943 continue;
67976944
67986945 /* In case of Transcoder port Sync master slave CRTCs can be
@@ -6801,28 +6948,28 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) · 2 unmodified lines
68016948 * Slave vblanks are masked till Master Vblanks.
68026949 */
68036950 if (!is_trans_port_sync_slave(old_crtc_state) &&
6804− !intel_dp_mst_is_slave_trans(old_crtc_state) &&
6805− !intel_crtc_is_bigjoiner_slave(old_crtc_state))
6951+ !intel_dp_mst_is_slave_trans(old_crtc_state))
68066952 continue;
68076953
6808− intel_old_crtc_state_disables(state, old_crtc_state,
6809− new_crtc_state, crtc);
6810− handled |= BIT(crtc->pipe);
6954+ intel_old_crtc_state_disables(state, crtc);
6955+
6956+ disable_pipes &= ~intel_crtc_joined_pipe_mask(old_crtc_state);
68116957 }
68126958
68136959 /* Disable everything else left on */
6814− for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
6815− new_crtc_state, i) {
6816− if (!intel_crtc_needs_modeset(new_crtc_state) ||
6817− (handled & BIT(crtc->pipe)))
6960+ for_each_old_intel_crtc_in_state(state, crtc, old_crtc_state, i) {
6961+ if ((disable_pipes & BIT(crtc->pipe)) == 0)
68186962 continue;
68196963
6820− if (!old_crtc_state->hw.active)
6964+ if (intel_crtc_is_bigjoiner_slave(old_crtc_state))
68216965 continue;
68226966
6823− intel_old_crtc_state_disables(state, old_crtc_state,
6824− new_crtc_state, crtc);
6967+ intel_old_crtc_state_disables(state, crtc);
6968+
6969+ disable_pipes &= ~intel_crtc_joined_pipe_mask(old_crtc_state);
68256970 }
6971+
6972+ drm_WARN_ON(&i915->drm, disable_pipes);
68266973 }
68276974
68286975 static void intel_commit_modeset_enables(struct intel_atomic_state *state)
@@ -6889,9 +7036,15 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) · 60 unmodified lines
68897036 intel_pre_update_crtc(state, crtc);
68907037 }
68917038
7039+ intel_dbuf_mbus_pre_ddb_update(state);
7040+
68927041 while (update_pipes) {
6893− for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
6894− new_crtc_state, i) {
7042+ /*
7043+ * Commit in reverse order to make bigjoiner master
7044+ * send the uapi events after slaves are done.
7045+ */
7046+ for_each_oldnew_intel_crtc_in_state_reverse(state, crtc, old_crtc_state,
7047+ new_crtc_state, i) {
68957048 enum pipe pipe = crtc->pipe;
68967049
68977050 if ((update_pipes & BIT(pipe)) == 0)
@@ -6919,6 +7072,8 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) · 21 unmodified lines
69197072 }
69207073 }
69217074
7075+ intel_dbuf_mbus_post_ddb_update(state);
7076+
69227077 update_pipes = modeset_pipes;
69237078
69247079 /*
@@ -6931,12 +7086,14 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) · 6 unmodified lines
69317086 if ((modeset_pipes & BIT(pipe)) == 0)
69327087 continue;
69337088
7089+ if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
7090+ continue;
7091+
69347092 if (intel_dp_mst_is_slave_trans(new_crtc_state) ||
6935− is_trans_port_sync_master(new_crtc_state) ||
6936− intel_crtc_is_bigjoiner_master(new_crtc_state))
7093+ is_trans_port_sync_master(new_crtc_state))
69377094 continue;
69387095
6939− modeset_pipes &= ~BIT(pipe);
7096+ modeset_pipes &= ~intel_crtc_joined_pipe_mask(new_crtc_state);
69407097
69417098 intel_enable_crtc(state, crtc);
69427099 }
@@ -6951,7 +7108,10 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) · 8 unmodified lines
69517108 if ((modeset_pipes & BIT(pipe)) == 0)
69527109 continue;
69537110
6954− modeset_pipes &= ~BIT(pipe);
7111+ if (intel_crtc_is_bigjoiner_slave(new_crtc_state))
7112+ continue;
7113+
7114+ modeset_pipes &= ~intel_crtc_joined_pipe_mask(new_crtc_state);
69557115
69567116 intel_enable_crtc(state, crtc);
69577117 }
@@ -6968,7 +7128,11 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) · 10 unmodified lines
69687128 intel_pre_update_crtc(state, crtc);
69697129 }
69707130
6971− for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
7131+ /*
7132+ * Commit in reverse order to make bigjoiner master
7133+ * send the uapi events after slaves are done.
7134+ */
7135+ for_each_new_intel_crtc_in_state_reverse(state, crtc, new_crtc_state, i) {
69727136 enum pipe pipe = crtc->pipe;
69737137
69747138 if ((update_pipes & BIT(pipe)) == 0)
@@ -7165,7 +7329,6 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state) · 190 unmodified lines
71657329 intel_encoders_update_prepare(state);
71667330
71677331 intel_dbuf_pre_plane_update(state);
7168− intel_mbus_dbox_update(state);
71697332
71707333 for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
71717334 if (new_crtc_state->do_async_flip)
@@ -7690,7 +7853,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv) · 518 unmodified lines
76907853
76917854 static int max_dotclock(struct drm_i915_private *i915)
76927855 {
7693− int max_dotclock = i915->max_dotclk_freq;
7856+ int max_dotclock = i915->display.cdclk.max_dotclk_freq;
76947857
76957858 /* icl+ might use bigjoiner */
76967859 if (DISPLAY_VER(i915) >= 11)
drivers/gpu/drm/i915/display/intel_display.h+22−0
@@ -280,6 +280,12 @@ enum phy_fia { · 279 unmodified lines
280280 base.head) \
281281 for_each_if((pipe_mask) & BIT(intel_crtc->pipe))
282282
283+#define for_each_intel_crtc_in_pipe_mask_reverse(dev, intel_crtc, pipe_mask) \
284+ list_for_each_entry_reverse((intel_crtc), \
285+ &(dev)->mode_config.crtc_list, \
286+ base.head) \
287+ for_each_if((pipe_mask) & BIT((intel_crtc)->pipe))
288+
283289 #define for_each_intel_encoder(dev, intel_encoder) \
284290 list_for_each_entry(intel_encoder, \
285291 &(dev)->mode_config.encoder_list, \
@@ -344,6 +350,14 @@ enum phy_fia { · 58 unmodified lines
344350 (__i)++) \
345351 for_each_if(crtc)
346352
353+#define for_each_new_intel_crtc_in_state_reverse(__state, crtc, new_crtc_state, __i) \
354+ for ((__i) = (__state)->base.dev->mode_config.num_crtc - 1; \
355+ (__i) >= 0 && \
356+ ((crtc) = to_intel_crtc((__state)->base.crtcs[__i].ptr), \
357+ (new_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].new_state), 1); \
358+ (__i)--) \
359+ for_each_if(crtc)
360+
347361 #define for_each_oldnew_intel_plane_in_state(__state, plane, old_plane_state, new_plane_state, __i) \
348362 for ((__i) = 0; \
349363 (__i) < (__state)->base.dev->mode_config.num_total_plane && \
@@ -408,6 +422,7 @@ intel_cpu_transcoder_mode_valid(struct drm_i915_private *i915, · 58 unmodified lines
408422 enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port);
409423 bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
410424 bool is_trans_port_sync_master(const struct intel_crtc_state *state);
425+u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state);
411426 bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
412427 bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state);
413428 u8 intel_crtc_bigjoiner_slave_pipes(const struct intel_crtc_state *crtc_state);
@@ -448,6 +463,13 @@ bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy); · 34 unmodified lines
448463 bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy);
449464 enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv,
450465 enum port port);
466+
467+enum phy intel_encoder_to_phy(struct intel_encoder *encoder);
468+bool intel_encoder_is_combo(struct intel_encoder *encoder);
469+bool intel_encoder_is_snps(struct intel_encoder *encoder);
470+bool intel_encoder_is_tc(struct intel_encoder *encoder);
471+enum tc_port intel_encoder_to_tc(struct intel_encoder *encoder);
472+
451473 int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
452474 struct drm_file *file_priv);
453475
drivers/gpu/drm/i915/display/intel_display_core.h+14−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include "intel_global_state.h"
2727 #include "intel_gmbus.h"
2828 #include "intel_opregion.h"
29+#include "intel_dmc_wl.h"
2930 #include "intel_wm_types.h"
3031
3132 struct task_struct;
@@ -345,6 +346,8 @@ struct intel_display { · 313 unmodified lines
345346 struct intel_global_obj obj;
346347
347348 unsigned int max_cdclk_freq;
349+ unsigned int max_dotclk_freq;
350+ unsigned int skl_preferred_vco_freq;
348351 } cdclk;
349352
350353 struct {
@@ -445,6 +448,16 @@ struct intel_display { · 94 unmodified lines
445448 bool false_color;
446449 } ips;
447450
451+ struct {
452+ bool display_irqs_enabled;
453+
454+ /* For i915gm/i945gm vblank irq workaround */
455+ u8 vblank_enabled;
456+
457+ u32 de_irq_mask[I915_MAX_PIPES];
458+ u32 pipestat_irq_mask[I915_MAX_PIPES];
459+ } irq;
460+
448461 struct {
449462 wait_queue_head_t waitqueue;
450463
@@ -534,6 +547,7 @@ struct intel_display { · 83 unmodified lines
534547 struct intel_overlay *overlay;
535548 struct intel_display_params params;
536549 struct intel_vbt_data vbt;
550+ struct intel_dmc_wl wl;
537551 struct intel_wm wm;
538552 };
539553
drivers/gpu/drm/i915/display/intel_display_debugfs.c+8−79
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include "intel_hdmi.h"
3232 #include "intel_hotplug.h"
3333 #include "intel_panel.h"
34+#include "intel_pps.h"
3435 #include "intel_psr.h"
3536 #include "intel_psr_regs.h"
3637 #include "intel_wm.h"
@@ -191,7 +192,7 @@ static void intel_hdcp_info(struct seq_file *m, · 154 unmodified lines
191192 struct intel_connector *intel_connector,
192193 bool remote_req)
193194 {
194− bool hdcp_cap, hdcp2_cap;
195+ bool hdcp_cap = false, hdcp2_cap = false;
195196
196197 if (!intel_connector->hdcp.shim) {
197198 seq_puts(m, "No Connector Support");
@@ -252,9 +253,6 @@ static void intel_connector_info(struct seq_file *m, · 54 unmodified lines
252253 struct drm_connector *connector)
253254 {
254255 struct intel_connector *intel_connector = to_intel_connector(connector);
255− const struct drm_connector_state *conn_state = connector->state;
256− struct intel_encoder *encoder =
257− to_intel_encoder(conn_state->best_encoder);
258256 const struct drm_display_mode *mode;
259257
260258 seq_printf(m, "[CONNECTOR:%d:%s]: status: %s\n",
@@ -271,28 +269,23 @@ static void intel_connector_info(struct seq_file *m, · 10 unmodified lines
271269 drm_get_subpixel_order_name(connector->display_info.subpixel_order));
272270 seq_printf(m, "\tCEA rev: %d\n", connector->display_info.cea_rev);
273271
274− if (!encoder)
275− return;
276−
277272 switch (connector->connector_type) {
278273 case DRM_MODE_CONNECTOR_DisplayPort:
279274 case DRM_MODE_CONNECTOR_eDP:
280− if (encoder->type == INTEL_OUTPUT_DP_MST)
275+ if (intel_connector->mst_port)
281276 intel_dp_mst_info(m, intel_connector);
282277 else
283278 intel_dp_info(m, intel_connector);
284279 break;
285280 case DRM_MODE_CONNECTOR_HDMIA:
286− if (encoder->type == INTEL_OUTPUT_HDMI ||
287− encoder->type == INTEL_OUTPUT_DDI)
288− intel_hdmi_info(m, intel_connector);
281+ intel_hdmi_info(m, intel_connector);
289282 break;
290283 default:
291284 break;
292285 }
293286
294287 seq_puts(m, "\tHDCP version: ");
295− if (intel_encoder_is_mst(encoder)) {
288+ if (intel_connector->mst_port) {
296289 intel_hdcp_info(m, intel_connector, true);
297290 seq_puts(m, "\tMST Hub HDCP version: ");
298291 }
@@ -1103,27 +1096,6 @@ void intel_display_debugfs_register(struct drm_i915_private *i915) · 804 unmodified lines
11031096 intel_display_debugfs_params(i915);
11041097 }
11051098
1106−static int i915_panel_show(struct seq_file *m, void *data)
1107−{
1108− struct intel_connector *connector = m->private;
1109− struct intel_dp *intel_dp = intel_attached_dp(connector);
1110−
1111− if (connector->base.status != connector_status_connected)
1112− return -ENODEV;
1113−
1114− seq_printf(m, "Panel power up delay: %d\n",
1115− intel_dp->pps.panel_power_up_delay);
1116− seq_printf(m, "Panel power down delay: %d\n",
1117− intel_dp->pps.panel_power_down_delay);
1118− seq_printf(m, "Backlight on delay: %d\n",
1119− intel_dp->pps.backlight_on_delay);
1120− seq_printf(m, "Backlight off delay: %d\n",
1121− intel_dp->pps.backlight_off_delay);
1122−
1123− return 0;
1124−}
1125−DEFINE_SHOW_ATTRIBUTE(i915_panel);
1126−
11271099 static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)
11281100 {
11291101 struct intel_connector *connector = m->private;
@@ -1402,20 +1374,6 @@ out: drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); · 272 unmodified lines
14021374 return ret;
14031375 }
14041376
1405−static int i915_bigjoiner_enable_show(struct seq_file *m, void *data)
1406−{
1407− struct intel_connector *connector = m->private;
1408− struct drm_crtc *crtc;
1409−
1410− crtc = connector->base.state->crtc;
1411− if (connector->base.status != connector_status_connected || !crtc)
1412− return -ENODEV;
1413−
1414− seq_printf(m, "Bigjoiner enable: %d\n", connector->force_bigjoiner_enable);
1415−
1416− return 0;
1417−}
1418−
14191377 static ssize_t i915_dsc_output_format_write(struct file *file,
14201378 const char __user *ubuf,
14211379 size_t len, loff_t *offp)
@@ -1437,30 +1395,6 @@ static ssize_t i915_dsc_output_format_write(struct file *file, · 15 unmodified lines
14371395 return len;
14381396 }
14391397
1440−static ssize_t i915_bigjoiner_enable_write(struct file *file,
1441− const char __user *ubuf,
1442− size_t len, loff_t *offp)
1443−{
1444− struct seq_file *m = file->private_data;
1445− struct intel_connector *connector = m->private;
1446− struct drm_crtc *crtc;
1447− bool bigjoiner_en = 0;
1448− int ret;
1449−
1450− crtc = connector->base.state->crtc;
1451− if (connector->base.status != connector_status_connected || !crtc)
1452− return -ENODEV;
1453−
1454− ret = kstrtobool_from_user(ubuf, len, &bigjoiner_en);
1455− if (ret < 0)
1456− return ret;
1457−
1458− connector->force_bigjoiner_enable = bigjoiner_en;
1459− *offp += len;
1460−
1461− return len;
1462−}
1463−
14641398 static int i915_dsc_output_format_open(struct inode *inode,
14651399 struct file *file)
14661400 {
@@ -1554,8 +1488,6 @@ static const struct file_operations i915_dsc_fractional_bpp_fops = { · 87 unmodified lines
15541488 .write = i915_dsc_fractional_bpp_write
15551489 };
15561490
1557−DEFINE_SHOW_STORE_ATTRIBUTE(i915_bigjoiner_enable);
1558−
15591491 /*
15601492 * Returns the Current CRTC's bpc.
15611493 * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
@@ -1608,12 +1540,9 @@ void intel_connector_debugfs_add(struct intel_connector *connector) · 46 unmodified lines
16081540 return;
16091541
16101542 intel_drrs_connector_debugfs_add(connector);
1543+ intel_pps_connector_debugfs_add(connector);
16111544 intel_psr_connector_debugfs_add(connector);
16121545
1613− if (connector_type == DRM_MODE_CONNECTOR_eDP)
1614− debugfs_create_file("i915_panel_timings", 0444, root,
1615− connector, &i915_panel_fops);
1616−
16171546 if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
16181547 connector_type == DRM_MODE_CONNECTOR_HDMIA ||
16191548 connector_type == DRM_MODE_CONNECTOR_HDMIB) {
@@ -1640,8 +1569,8 @@ void intel_connector_debugfs_add(struct intel_connector *connector) · 20 unmodified lines
16401569 if (DISPLAY_VER(i915) >= 11 &&
16411570 (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
16421571 connector_type == DRM_MODE_CONNECTOR_eDP)) {
1643− debugfs_create_file("i915_bigjoiner_force_enable", 0644, root,
1644− connector, &i915_bigjoiner_enable_fops);
1572+ debugfs_create_bool("i915_bigjoiner_force_enable", 0644, root,
1573+ &connector->force_bigjoiner_enable);
16451574 }
16461575
16471576 if (connector_type == DRM_MODE_CONNECTOR_DSI ||
drivers/gpu/drm/i915/display/intel_display_device.c+5−0
@@ -17,6 +17,9 @@ · 16 unmodified lines
1717 #include "intel_display_reg_defs.h"
1818 #include "intel_fbc.h"
1919
20+__diag_push();
21+__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for display info");
22+
2023 static const struct intel_display_device_info no_display = {};
2124
2225 #define PIPE_A_OFFSET 0x70000
@@ -768,6 +771,8 @@ static const struct intel_display_device_info xe2_lpd_display = { · 745 unmodified lines
768771 BIT(INTEL_FBC_C) | BIT(INTEL_FBC_D),
769772 };
770773
774+__diag_pop();
775+
771776 /*
772777 * Separate detection for no display cases to keep the display id array simple.
773778 *
drivers/gpu/drm/i915/display/intel_display_device.h+2−0
@@ -47,6 +47,7 @@ struct drm_printer; · 46 unmodified lines
4747 #define HAS_DPT(i915) (DISPLAY_VER(i915) >= 13)
4848 #define HAS_DSB(i915) (DISPLAY_INFO(i915)->has_dsb)
4949 #define HAS_DSC(__i915) (DISPLAY_RUNTIME_INFO(__i915)->has_dsc)
50+#define HAS_DSC_MST(__i915) (DISPLAY_VER(__i915) >= 12 && HAS_DSC(__i915))
5051 #define HAS_FBC(i915) (DISPLAY_RUNTIME_INFO(i915)->fbc_mask != 0)
5152 #define HAS_FPGA_DBG_UNCLAIMED(i915) (DISPLAY_INFO(i915)->has_fpga_dbg)
5253 #define HAS_FW_BLC(i915) (DISPLAY_VER(i915) >= 3)
@@ -68,6 +69,7 @@ struct drm_printer; · 15 unmodified lines
6869 #define HAS_TRANSCODER(i915, trans) ((DISPLAY_RUNTIME_INFO(i915)->cpu_transcoder_mask & \
6970 BIT(trans)) != 0)
7071 #define HAS_VRR(i915) (DISPLAY_VER(i915) >= 11)
72+#define HAS_AS_SDP(i915) (DISPLAY_VER(i915) >= 13)
7173 #define INTEL_NUM_PIPES(i915) (hweight8(DISPLAY_RUNTIME_INFO(i915)->pipe_mask))
7274 #define I915_HAS_HOTPLUG(i915) (DISPLAY_INFO(i915)->has_hotplug)
7375 #define OVERLAY_NEEDS_PHYSICAL(i915) (DISPLAY_INFO(i915)->overlay_needs_physical)
drivers/gpu/drm/i915/display/intel_display_driver.c+1−0
@@ -198,6 +198,7 @@ void intel_display_driver_early_probe(struct drm_i915_private *i915) · 197 unmodified lines
198198 intel_dpll_init_clock_hook(i915);
199199 intel_init_display_hooks(i915);
200200 intel_fdi_init_hook(i915);
201+ intel_dmc_wl_init(i915);
201202 }
202203
203204 /* part #1: call before irq install */
drivers/gpu/drm/i915/display/intel_display_irq.c+29−28
@@ -117,13 +117,14 @@ static void bdw_update_pipe_irq(struct drm_i915_private *dev_priv, · 116 unmodified lines
117117 if (drm_WARN_ON(&dev_priv->drm, !intel_irqs_enabled(dev_priv)))
118118 return;
119119
120− new_val = dev_priv->de_irq_mask[pipe];
120+ new_val = dev_priv->display.irq.de_irq_mask[pipe];
121121 new_val &= ~interrupt_mask;
122122 new_val |= (~enabled_irq_mask & interrupt_mask);
123123
124− if (new_val != dev_priv->de_irq_mask[pipe]) {
125− dev_priv->de_irq_mask[pipe] = new_val;
126− intel_uncore_write(&dev_priv->uncore, GEN8_DE_PIPE_IMR(pipe), dev_priv->de_irq_mask[pipe]);
124+ if (new_val != dev_priv->display.irq.de_irq_mask[pipe]) {
125+ dev_priv->display.irq.de_irq_mask[pipe] = new_val;
126+ intel_uncore_write(&dev_priv->uncore, GEN8_DE_PIPE_IMR(pipe),
127+ dev_priv->display.irq.de_irq_mask[pipe]);
127128 intel_uncore_posting_read(&dev_priv->uncore, GEN8_DE_PIPE_IMR(pipe));
128129 }
129130 }
@@ -179,7 +180,7 @@ void ibx_disable_display_interrupt(struct drm_i915_private *i915, u32 bits) · 49 unmodified lines
179180 u32 i915_pipestat_enable_mask(struct drm_i915_private *dev_priv,
180181 enum pipe pipe)
181182 {
182− u32 status_mask = dev_priv->pipestat_irq_mask[pipe];
183+ u32 status_mask = dev_priv->display.irq.pipestat_irq_mask[pipe];
183184 u32 enable_mask = status_mask << 16;
184185
185186 lockdep_assert_held(&dev_priv->irq_lock);
@@ -233,10 +234,10 @@ void i915_enable_pipestat(struct drm_i915_private *dev_priv, · 47 unmodified lines
233234 lockdep_assert_held(&dev_priv->irq_lock);
234235 drm_WARN_ON(&dev_priv->drm, !intel_irqs_enabled(dev_priv));
235236
236− if ((dev_priv->pipestat_irq_mask[pipe] & status_mask) == status_mask)
237+ if ((dev_priv->display.irq.pipestat_irq_mask[pipe] & status_mask) == status_mask)
237238 return;
238239
239− dev_priv->pipestat_irq_mask[pipe] |= status_mask;
240+ dev_priv->display.irq.pipestat_irq_mask[pipe] |= status_mask;
240241 enable_mask = i915_pipestat_enable_mask(dev_priv, pipe);
241242
242243 intel_uncore_write(&dev_priv->uncore, reg, enable_mask | status_mask);
@@ -256,10 +257,10 @@ void i915_disable_pipestat(struct drm_i915_private *dev_priv, · 13 unmodified lines
256257 lockdep_assert_held(&dev_priv->irq_lock);
257258 drm_WARN_ON(&dev_priv->drm, !intel_irqs_enabled(dev_priv));
258259
259− if ((dev_priv->pipestat_irq_mask[pipe] & status_mask) == 0)
260+ if ((dev_priv->display.irq.pipestat_irq_mask[pipe] & status_mask) == 0)
260261 return;
261262
262− dev_priv->pipestat_irq_mask[pipe] &= ~status_mask;
263+ dev_priv->display.irq.pipestat_irq_mask[pipe] &= ~status_mask;
263264 enable_mask = i915_pipestat_enable_mask(dev_priv, pipe);
264265
265266 intel_uncore_write(&dev_priv->uncore, reg, enable_mask | status_mask);
@@ -401,7 +402,7 @@ void i9xx_pipestat_irq_reset(struct drm_i915_private *dev_priv) · 135 unmodified lines
401402 PIPESTAT_INT_STATUS_MASK |
402403 PIPE_FIFO_UNDERRUN_STATUS);
403404
404− dev_priv->pipestat_irq_mask[pipe] = 0;
405+ dev_priv->display.irq.pipestat_irq_mask[pipe] = 0;
405406 }
406407 }
407408
@@ -412,7 +413,7 @@ void i9xx_pipestat_irq_ack(struct drm_i915_private *dev_priv, · 4 unmodified lines
412413
413414 spin_lock(&dev_priv->irq_lock);
414415
415− if (!dev_priv->display_irqs_enabled) {
416+ if (!dev_priv->display.irq.display_irqs_enabled) {
416417 spin_unlock(&dev_priv->irq_lock);
417418 return;
418419 }
@@ -445,7 +446,7 @@ void i9xx_pipestat_irq_ack(struct drm_i915_private *dev_priv, · 26 unmodified lines
445446 break;
446447 }
447448 if (iir & iir_bit)
448− status_mask |= dev_priv->pipestat_irq_mask[pipe];
449+ status_mask |= dev_priv->display.irq.pipestat_irq_mask[pipe];
449450
450451 if (!status_mask)
451452 continue;
@@ -1203,7 +1204,7 @@ int i8xx_enable_vblank(struct drm_crtc *crtc) · 751 unmodified lines
12031204
12041205 int i915gm_enable_vblank(struct drm_crtc *crtc)
12051206 {
1206− struct drm_i915_private *dev_priv = to_i915(crtc->dev);
1207+ struct drm_i915_private *i915 = to_i915(crtc->dev);
12071208
12081209 /*
12091210 * Vblank interrupts fail to wake the device up from C2+.
@@ -1211,8 +1212,8 @@ int i915gm_enable_vblank(struct drm_crtc *crtc) · 1 unmodified line
12111212 * the problem. There is a small power cost so we do this
12121213 * only when vblank interrupts are actually enabled.
12131214 */
1214− if (dev_priv->vblank_enabled++ == 0)
1215− intel_uncore_write(&dev_priv->uncore, SCPD0, _MASKED_BIT_ENABLE(CSTATE_RENDER_CLOCK_GATE_DISABLE));
1215+ if (i915->display.irq.vblank_enabled++ == 0)
1216+ intel_uncore_write(&i915->uncore, SCPD0, _MASKED_BIT_ENABLE(CSTATE_RENDER_CLOCK_GATE_DISABLE));
12161217
12171218 return i8xx_enable_vblank(crtc);
12181219 }
@@ -1315,12 +1316,12 @@ void i8xx_disable_vblank(struct drm_crtc *crtc) · 96 unmodified lines
13151316
13161317 void i915gm_disable_vblank(struct drm_crtc *crtc)
13171318 {
1318− struct drm_i915_private *dev_priv = to_i915(crtc->dev);
1319+ struct drm_i915_private *i915 = to_i915(crtc->dev);
13191320
13201321 i8xx_disable_vblank(crtc);
13211322
1322− if (--dev_priv->vblank_enabled == 0)
1323− intel_uncore_write(&dev_priv->uncore, SCPD0, _MASKED_BIT_DISABLE(CSTATE_RENDER_CLOCK_GATE_DISABLE));
1323+ if (--i915->display.irq.vblank_enabled == 0)
1324+ intel_uncore_write(&i915->uncore, SCPD0, _MASKED_BIT_DISABLE(CSTATE_RENDER_CLOCK_GATE_DISABLE));
13241325 }
13251326
13261327 void i965_disable_vblank(struct drm_crtc *crtc)
@@ -1497,8 +1498,8 @@ void gen8_irq_power_well_post_enable(struct drm_i915_private *dev_priv, · 170 unmodified lines
14971498
14981499 for_each_pipe_masked(dev_priv, pipe, pipe_mask)
14991500 GEN8_IRQ_INIT_NDX(uncore, DE_PIPE, pipe,
1500− dev_priv->de_irq_mask[pipe],
1501− ~dev_priv->de_irq_mask[pipe] | extra_ier);
1501+ dev_priv->display.irq.de_irq_mask[pipe],
1502+ ~dev_priv->display.irq.de_irq_mask[pipe] | extra_ier);
15021503
15031504 spin_unlock_irq(&dev_priv->irq_lock);
15041505 }
@@ -1558,10 +1559,10 @@ void valleyview_enable_display_irqs(struct drm_i915_private *dev_priv) · 53 unmodified lines
15581559 {
15591560 lockdep_assert_held(&dev_priv->irq_lock);
15601561
1561− if (dev_priv->display_irqs_enabled)
1562+ if (dev_priv->display.irq.display_irqs_enabled)
15621563 return;
15631564
1564− dev_priv->display_irqs_enabled = true;
1565+ dev_priv->display.irq.display_irqs_enabled = true;
15651566
15661567 if (intel_irqs_enabled(dev_priv)) {
15671568 vlv_display_irq_reset(dev_priv);
@@ -1573,10 +1574,10 @@ void valleyview_disable_display_irqs(struct drm_i915_private *dev_priv) · 5 unmodified lines
15731574 {
15741575 lockdep_assert_held(&dev_priv->irq_lock);
15751576
1576− if (!dev_priv->display_irqs_enabled)
1577+ if (!dev_priv->display.irq.display_irqs_enabled)
15771578 return;
15781579
1579− dev_priv->display_irqs_enabled = false;
1580+ dev_priv->display.irq.display_irqs_enabled = false;
15801581
15811582 if (intel_irqs_enabled(dev_priv))
15821583 vlv_display_irq_reset(dev_priv);
@@ -1694,12 +1695,12 @@ void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) · 111 unmodified lines
16941695 }
16951696
16961697 for_each_pipe(dev_priv, pipe) {
1697− dev_priv->de_irq_mask[pipe] = ~de_pipe_masked;
1698+ dev_priv->display.irq.de_irq_mask[pipe] = ~de_pipe_masked;
16981699
16991700 if (intel_display_power_is_enabled(dev_priv,
17001701 POWER_DOMAIN_PIPE(pipe)))
17011702 GEN8_IRQ_INIT_NDX(uncore, DE_PIPE, pipe,
1702− dev_priv->de_irq_mask[pipe],
1703+ dev_priv->display.irq.de_irq_mask[pipe],
17031704 de_pipe_enables);
17041705 }
17051706
@@ -1770,9 +1771,9 @@ void intel_display_irq_init(struct drm_i915_private *i915) · 64 unmodified lines
17701771 * domain. We defer setting up the display irqs in this case to the
17711772 * runtime pm.
17721773 */
1773− i915->display_irqs_enabled = true;
1774+ i915->display.irq.display_irqs_enabled = true;
17741775 if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915))
1775− i915->display_irqs_enabled = false;
1776+ i915->display.irq.display_irqs_enabled = false;
17761777
17771778 intel_hotplug_irq_init(i915);
17781779 }
drivers/gpu/drm/i915/display/intel_display_params.c+5−0
@@ -116,6 +116,11 @@ intel_display_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400, · 115 unmodified lines
116116 "(0=disabled, 1=enabled) "
117117 "Default: 1");
118118
119+intel_display_param_named_unsafe(enable_dmc_wl, bool, 0400,
120+ "Enable DMC wakelock "
121+ "(0=disabled, 1=enabled) "
122+ "Default: 0");
123+
119124 __maybe_unused
120125 static void _param_print_bool(struct drm_printer *p, const char *driver_name,
121126 const char *name, bool val)
drivers/gpu/drm/i915/display/intel_display_params.h+1−0
@@ -46,6 +46,7 @@ struct drm_i915_private; · 45 unmodified lines
4646 param(int, enable_psr, -1, 0600) \
4747 param(bool, psr_safest_params, false, 0400) \
4848 param(bool, enable_psr2_sel_fetch, true, 0400) \
49+ param(bool, enable_dmc_wl, false, 0400) \
4950
5051 #define MEMBER(T, member, ...) T member;
5152 struct intel_display_params {
drivers/gpu/drm/i915/display/intel_display_power_well.c+37−36
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include "intel_dkl_phy.h"
1818 #include "intel_dkl_phy_regs.h"
1919 #include "intel_dmc.h"
20+#include "intel_dmc_wl.h"
2021 #include "intel_dp_aux_regs.h"
2122 #include "intel_dpio_phy.h"
2223 #include "intel_dpll.h"
@@ -199,6 +200,9 @@ static void hsw_power_well_pre_disable(struct drm_i915_private *dev_priv, · 176 unmodified lines
199200 gen8_irq_power_well_pre_disable(dev_priv, irq_pipe_mask);
200201 }
201202
203+#define ICL_AUX_PW_TO_PHY(pw_idx) \
204+ ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + PHY_A)
205+
202206 #define ICL_AUX_PW_TO_CH(pw_idx) \
203207 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
204208
@@ -217,27 +221,22 @@ static struct intel_digital_port * · 12 unmodified lines
217221 aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
218222 enum aux_ch aux_ch)
219223 {
220− struct intel_digital_port *dig_port = NULL;
221224 struct intel_encoder *encoder;
222225
223226 for_each_intel_encoder(&dev_priv->drm, encoder) {
227+ struct intel_digital_port *dig_port;
228+
224229 /* We'll check the MST primary port */
225230 if (encoder->type == INTEL_OUTPUT_DP_MST)
226231 continue;
227232
228233 dig_port = enc_to_dig_port(encoder);
229− if (!dig_port)
230− continue;
231−
232− if (dig_port->aux_ch != aux_ch) {
233− dig_port = NULL;
234− continue;
235− }
236234
237− break;
235+ if (dig_port && dig_port->aux_ch == aux_ch)
236+ return dig_port;
238237 }
239238
240− return dig_port;
239+ return NULL;
241240 }
242241
243242 static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
@@ -253,7 +252,7 @@ static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915, · 9 unmodified lines
253252 * as HDMI-only and routed to a combo PHY, the encoder either won't be
254253 * present at all or it will not have an aux_ch assigned.
255254 */
256− return dig_port ? intel_port_to_phy(i915, dig_port->base.port) : PHY_NONE;
255+ return dig_port ? intel_encoder_to_phy(&dig_port->base) : PHY_NONE;
257256 }
258257
259258 static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
@@ -396,17 +395,11 @@ static void hsw_power_well_disable(struct drm_i915_private *dev_priv, · 136 unmodified lines
396395 hsw_wait_for_power_well_disable(dev_priv, power_well);
397396 }
398397
399−static bool intel_port_is_edp(struct drm_i915_private *i915, enum port port)
398+static bool intel_aux_ch_is_edp(struct drm_i915_private *i915, enum aux_ch aux_ch)
400399 {
401− struct intel_encoder *encoder;
402−
403− for_each_intel_encoder(&i915->drm, encoder) {
404− if (encoder->type == INTEL_OUTPUT_EDP &&
405− encoder->port == port)
406− return true;
407− }
400+ struct intel_digital_port *dig_port = aux_ch_to_digital_port(i915, aux_ch);
408401
409− return false;
402+ return dig_port && dig_port->base.type == INTEL_OUTPUT_EDP;
410403 }
411404
412405 static void
@@ -415,24 +408,25 @@ icl_combo_phy_aux_power_well_enable(struct drm_i915_private *dev_priv, · 2 unmodified lines
415408 {
416409 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
417410 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
418− enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
419411
420412 drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
421413
422414 intel_de_rmw(dev_priv, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx));
423415
424− /* FIXME this is a mess */
425− if (phy != PHY_NONE)
426− intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
427− 0, ICL_LANE_ENABLE_AUX);
416+ /*
417+ * FIXME not sure if we should derive the PHY from the pw_idx, or
418+ * from the VBT defined AUX_CH->DDI->PHY mapping.
419+ */
420+ intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(ICL_AUX_PW_TO_PHY(pw_idx)),
421+ 0, ICL_LANE_ENABLE_AUX);
428422
429423 hsw_wait_for_power_well_enable(dev_priv, power_well, false);
430424
431425 /* Display WA #1178: icl */
432426 if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <= ICL_PW_CTL_IDX_AUX_B &&
433− !intel_port_is_edp(dev_priv, (enum port)phy))
434− intel_de_rmw(dev_priv, ICL_AUX_ANAOVRD1(pw_idx),
435− 0, ICL_AUX_ANAOVRD1_ENABLE | ICL_AUX_ANAOVRD1_LDO_BYPASS);
427+ !intel_aux_ch_is_edp(dev_priv, ICL_AUX_PW_TO_CH(pw_idx)))
428+ intel_de_rmw(dev_priv, ICL_PORT_TX_DW6_AUX(ICL_AUX_PW_TO_PHY(pw_idx)),
429+ 0, O_FUNC_OVRD_EN | O_LDO_BYPASS_CRI);
436430 }
437431
438432 static void
@@ -441,14 +435,15 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv, · 2 unmodified lines
441435 {
442436 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
443437 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
444− enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
445438
446439 drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
447440
448− /* FIXME this is a mess */
449− if (phy != PHY_NONE)
450− intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
451− ICL_LANE_ENABLE_AUX, 0);
441+ /*
442+ * FIXME not sure if we should derive the PHY from the pw_idx, or
443+ * from the VBT defined AUX_CH->DDI->PHY mapping.
444+ */
445+ intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(ICL_AUX_PW_TO_PHY(pw_idx)),
446+ ICL_LANE_ENABLE_AUX, 0);
452447
453448 intel_de_rmw(dev_priv, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0);
454449
@@ -827,6 +822,8 @@ void gen9_enable_dc5(struct drm_i915_private *dev_priv) · 372 unmodified lines
827822 intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1,
828823 0, SKL_SELECT_ALTERNATE_DC_EXIT);
829824
825+ intel_dmc_wl_enable(dev_priv);
826+
830827 gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5);
831828 }
832829
@@ -856,6 +853,8 @@ void skl_enable_dc6(struct drm_i915_private *dev_priv) · 23 unmodified lines
856853 intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1,
857854 0, SKL_SELECT_ALTERNATE_DC_EXIT);
858855
856+ intel_dmc_wl_enable(dev_priv);
857+
859858 gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
860859 }
861860
@@ -976,10 +975,12 @@ void gen9_disable_dc_states(struct drm_i915_private *dev_priv) · 114 unmodified lines
976975 if (!HAS_DISPLAY(dev_priv))
977976 return;
978977
978+ intel_dmc_wl_disable(dev_priv);
979+
979980 intel_cdclk_get_cdclk(dev_priv, &cdclk_config);
980981 /* Can't read out voltage_level so can't use intel_cdclk_changed() */
981982 drm_WARN_ON(&dev_priv->drm,
982− intel_cdclk_needs_modeset(&dev_priv->display.cdclk.hw,
983+ intel_cdclk_clock_changed(&dev_priv->display.cdclk.hw,
983984 &cdclk_config));
984985
985986 gen9_assert_dbuf_enabled(dev_priv);
@@ -1396,8 +1397,8 @@ static void assert_chv_phy_status(struct drm_i915_private *dev_priv) · 410 unmodified lines
13961397 * The PHY may be busy with some initial calibration and whatnot,
13971398 * so the power state can take a while to actually change.
13981399 */
1399− if (intel_de_wait_for_register(dev_priv, DISPLAY_PHY_STATUS,
1400− phy_status_mask, phy_status, 10))
1400+ if (intel_de_wait(dev_priv, DISPLAY_PHY_STATUS,
1401+ phy_status_mask, phy_status, 10))
14011402 drm_err(&dev_priv->drm,
14021403 "Unexpected PHY_STATUS 0x%08x, expected 0x%08x (PHY_CONTROL=0x%08x)\n",
14031404 intel_de_read(dev_priv, DISPLAY_PHY_STATUS) & phy_status_mask,
drivers/gpu/drm/i915/display/intel_display_types.h+17−4
@@ -661,7 +661,8 @@ struct intel_digital_connector_state { · 660 unmodified lines
661661 int broadcast_rgb;
662662 };
663663
664−#define to_intel_digital_connector_state(x) container_of(x, struct intel_digital_connector_state, base)
664+#define to_intel_digital_connector_state(conn_state) \
665+ container_of_const((conn_state), struct intel_digital_connector_state, base)
665666
666667 struct dpll {
667668 /* given values */
@@ -1346,6 +1347,7 @@ struct intel_crtc_state { · 678 unmodified lines
13461347 union hdmi_infoframe hdmi;
13471348 union hdmi_infoframe drm;
13481349 struct drm_dp_vsc_sdp vsc;
1350+ struct drm_dp_as_sdp as_sdp;
13491351 } infoframes;
13501352
13511353 u8 eld[MAX_ELD_BYTES];
@@ -1423,6 +1425,8 @@ struct intel_crtc_state { · 71 unmodified lines
14231425
14241426 u32 psr2_man_track_ctl;
14251427
1428+ u32 pipe_srcsz_early_tpt;
1429+
14261430 struct drm_rect psr2_su_area;
14271431
14281432 /* Variable Refresh Rate state */
@@ -1430,6 +1434,7 @@ struct intel_crtc_state { · 1 unmodified line
14301434 bool enable, in_range;
14311435 u8 pipeline_full;
14321436 u16 flipline, vmin, vmax, guardband;
1437+ u32 vsync_end, vsync_start;
14331438 } vrr;
14341439
14351440 /* Stream Splitter for eDP MSO */
@@ -1618,12 +1623,17 @@ struct intel_watermark_params { · 182 unmodified lines
16181623
16191624 #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base)
16201625 #define to_intel_crtc(x) container_of(x, struct intel_crtc, base)
1621−#define to_intel_crtc_state(x) container_of(x, struct intel_crtc_state, uapi)
16221626 #define to_intel_connector(x) container_of(x, struct intel_connector, base)
16231627 #define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
1624−#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
16251628 #define to_intel_plane(x) container_of(x, struct intel_plane, base)
1626−#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, uapi)
1629+
1630+#define to_intel_crtc_state(crtc_state) \
1631+ container_of_const((crtc_state), struct intel_crtc_state, uapi)
1632+#define to_intel_plane_state(plane_state) \
1633+ container_of_const((plane_state), struct intel_plane_state, uapi)
1634+#define to_intel_framebuffer(fb) \
1635+ container_of_const((fb), struct intel_framebuffer, base)
1636+
16271637 #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL)
16281638
16291639 struct intel_hdmi {
@@ -1738,6 +1748,8 @@ struct intel_psr { · 108 unmodified lines
17381748
17391749 /* LNL and beyond */
17401750 u8 check_entry_lines;
1751+ u8 silence_period_sym_clocks;
1752+ u8 lfps_half_cycle_num_of_syms;
17411753 } alpm_parameters;
17421754
17431755 ktime_t last_entry_attempt;
@@ -1799,6 +1811,7 @@ struct intel_dp { · 55 unmodified lines
17991811
18001812 bool is_mst;
18011813 int active_mst_links;
1814+ enum drm_dp_mst_mode mst_detect;
18021815
18031816 /* connector directly attached - won't be use for modeset in mst world */
18041817 struct intel_connector *attached_connector;
drivers/gpu/drm/i915/display/intel_display_wa.c+0−8
@@ -10,20 +10,12 @@ · 9 unmodified lines
1010
1111 static void gen11_display_wa_apply(struct drm_i915_private *i915)
1212 {
13− /* Wa_1409120013 */
14− intel_de_write(i915, ILK_DPFC_CHICKEN(INTEL_FBC_A),
15− DPFC_CHICKEN_COMP_DUMMY_PIXEL);
16−
1713 /* Wa_14010594013 */
1814 intel_de_rmw(i915, GEN8_CHICKEN_DCPR_1, 0, ICL_DELAY_PMRSP);
1915 }
2016
2117 static void xe_d_display_wa_apply(struct drm_i915_private *i915)
2218 {
23− /* Wa_1409120013 */
24− intel_de_write(i915, ILK_DPFC_CHICKEN(INTEL_FBC_A),
25− DPFC_CHICKEN_COMP_DUMMY_PIXEL);
26−
2719 /* Wa_14013723622 */
2820 intel_de_rmw(i915, CLKREQ_POLICY, CLKREQ_POLICY_MEM_UP_OVRD, 0);
2921 }
drivers/gpu/drm/i915/display/intel_dmc.c+15−2
@@ -38,6 +38,8 @@ · 37 unmodified lines
3838 * low-power state and comes back to normal.
3939 */
4040
41+#define INTEL_DMC_FIRMWARE_URL "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
42+
4143 enum intel_dmc_id {
4244 DMC_FW_MAIN = 0,
4345 DMC_FW_PIPEA,
@@ -89,10 +91,14 @@ static struct intel_dmc *i915_to_dmc(struct drm_i915_private *i915) · 45 unmodified lines
8991 __stringify(major) "_" \
9092 __stringify(minor) ".bin"
9193
94+#define XE2LPD_DMC_MAX_FW_SIZE 0x8000
9295 #define XELPDP_DMC_MAX_FW_SIZE 0x7000
9396 #define DISPLAY_VER13_DMC_MAX_FW_SIZE 0x20000
9497 #define DISPLAY_VER12_DMC_MAX_FW_SIZE ICL_DMC_MAX_FW_SIZE
9598
99+#define XE2LPD_DMC_PATH DMC_PATH(xe2lpd)
100+MODULE_FIRMWARE(XE2LPD_DMC_PATH);
101+
96102 #define MTL_DMC_PATH DMC_PATH(mtl)
97103 MODULE_FIRMWARE(MTL_DMC_PATH);
98104
@@ -546,6 +552,8 @@ void intel_dmc_disable_program(struct drm_i915_private *i915) · 447 unmodified lines
546552 pipedmc_clock_gating_wa(i915, true);
547553 disable_all_event_handlers(i915);
548554 pipedmc_clock_gating_wa(i915, false);
555+
556+ intel_dmc_wl_disable(i915);
549557 }
550558
551559 void assert_dmc_loaded(struct drm_i915_private *i915)
@@ -949,7 +957,7 @@ static void dmc_load_work_fn(struct work_struct *work) · 397 unmodified lines
949957 " Disabling runtime power management.\n",
950958 dmc->fw_path);
951959 drm_notice(&i915->drm, "DMC firmware homepage: %s",
952− INTEL_UC_FIRMWARE_URL);
960+ INTEL_DMC_FIRMWARE_URL);
953961 }
954962
955963 release_firmware(fw);
@@ -987,7 +995,10 @@ void intel_dmc_init(struct drm_i915_private *i915) · 31 unmodified lines
987995
988996 INIT_WORK(&dmc->work, dmc_load_work_fn);
989997
990− if (DISPLAY_VER_FULL(i915) == IP_VER(14, 0)) {
998+ if (DISPLAY_VER_FULL(i915) == IP_VER(20, 0)) {
999+ dmc->fw_path = XE2LPD_DMC_PATH;
1000+ dmc->max_fw_size = XE2LPD_DMC_MAX_FW_SIZE;
1001+ } else if (DISPLAY_VER_FULL(i915) == IP_VER(14, 0)) {
9911002 dmc->fw_path = MTL_DMC_PATH;
9921003 dmc->max_fw_size = XELPDP_DMC_MAX_FW_SIZE;
9931004 } else if (IS_DG2(i915)) {
@@ -1072,6 +1083,8 @@ void intel_dmc_suspend(struct drm_i915_private *i915) · 78 unmodified lines
10721083 if (dmc)
10731084 flush_work(&dmc->work);
10741085
1086+ intel_dmc_wl_disable(i915);
1087+
10751088 /* Drop the reference held in case DMC isn't loaded. */
10761089 if (!intel_dmc_has_payload(i915))
10771090 intel_dmc_runtime_pm_put(i915);
drivers/gpu/drm/i915/display/intel_dmc_regs.h+6−0
@@ -97,4 +97,10 @@ · 96 unmodified lines
9797 #define TGL_DMC_DEBUG3 _MMIO(0x101090)
9898 #define DG1_DMC_DEBUG3 _MMIO(0x13415c)
9999
100+#define DMC_WAKELOCK_CFG _MMIO(0x8F1B0)
101+#define DMC_WAKELOCK_CFG_ENABLE REG_BIT(31)
102+#define DMC_WAKELOCK1_CTL _MMIO(0x8F140)
103+#define DMC_WAKELOCK_CTL_REQ REG_BIT(31)
104+#define DMC_WAKELOCK_CTL_ACK REG_BIT(15)
105+
100106 #endif /* __INTEL_DMC_REGS_H__ */
drivers/gpu/drm/i915/display/intel_dmc_wl.c+262−0
@@ -0,0 +1,262 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright (C) 2024 Intel Corporation
4+ */
5+
6+#include <linux/kernel.h>
7+
8+#include "intel_de.h"
9+#include "intel_dmc.h"
10+#include "intel_dmc_regs.h"
11+#include "intel_dmc_wl.h"
12+
13+/**
14+ * DOC: DMC wakelock support
15+ *
16+ * Wake lock is the mechanism to cause display engine to exit DC
17+ * states to allow programming to registers that are powered down in
18+ * those states. Previous projects exited DC states automatically when
19+ * detecting programming. Now software controls the exit by
20+ * programming the wake lock. This improves system performance and
21+ * system interactions and better fits the flip queue style of
22+ * programming. Wake lock is only required when DC5, DC6, or DC6v have
23+ * been enabled in DC_STATE_EN and the wake lock mode of operation has
24+ * been enabled.
25+ *
26+ * The wakelock mechanism in DMC allows the display engine to exit DC
27+ * states explicitly before programming registers that may be powered
28+ * down. In earlier hardware, this was done automatically and
29+ * implicitly when the display engine accessed a register. With the
30+ * wakelock implementation, the driver asserts a wakelock in DMC,
31+ * which forces it to exit the DC state until the wakelock is
32+ * deasserted.
33+ *
34+ * The mechanism can be enabled and disabled by writing to the
35+ * DMC_WAKELOCK_CFG register. There are also 13 control registers
36+ * that can be used to hold and release different wakelocks. In the
37+ * current implementation, we only need one wakelock, so only
38+ * DMC_WAKELOCK1_CTL is used. The other definitions are here for
39+ * potential future use.
40+ */
41+
42+#define DMC_WAKELOCK_CTL_TIMEOUT 5
43+#define DMC_WAKELOCK_HOLD_TIME 50
44+
45+struct intel_dmc_wl_range {
46+ u32 start;
47+ u32 end;
48+};
49+
50+static struct intel_dmc_wl_range lnl_wl_range[] = {
51+ { .start = 0x60000, .end = 0x7ffff },
52+};
53+
54+static void __intel_dmc_wl_release(struct drm_i915_private *i915)
55+{
56+ struct intel_dmc_wl *wl = &i915->display.wl;
57+
58+ WARN_ON(refcount_read(&wl->refcount));
59+
60+ queue_delayed_work(i915->unordered_wq, &wl->work,
61+ msecs_to_jiffies(DMC_WAKELOCK_HOLD_TIME));
62+}
63+
64+static void intel_dmc_wl_work(struct work_struct *work)
65+{
66+ struct intel_dmc_wl *wl =
67+ container_of(work, struct intel_dmc_wl, work.work);
68+ struct drm_i915_private *i915 =
69+ container_of(wl, struct drm_i915_private, display.wl);
70+ unsigned long flags;
71+
72+ spin_lock_irqsave(&wl->lock, flags);
73+
74+ /* Bail out if refcount reached zero while waiting for the spinlock */
75+ if (!refcount_read(&wl->refcount))
76+ goto out_unlock;
77+
78+ __intel_de_rmw_nowl(i915, DMC_WAKELOCK1_CTL, DMC_WAKELOCK_CTL_REQ, 0);
79+
80+ if (__intel_wait_for_register_nowl(i915, DMC_WAKELOCK1_CTL,
81+ DMC_WAKELOCK_CTL_ACK, 0,
82+ DMC_WAKELOCK_CTL_TIMEOUT)) {
83+ WARN_RATELIMIT(1, "DMC wakelock release timed out");
84+ goto out_unlock;
85+ }
86+
87+ wl->taken = false;
88+
89+out_unlock:
90+ spin_unlock_irqrestore(&wl->lock, flags);
91+}
92+
93+static bool intel_dmc_wl_check_range(u32 address)
94+{
95+ int i;
96+ bool wl_needed = false;
97+
98+ for (i = 0; i < ARRAY_SIZE(lnl_wl_range); i++) {
99+ if (address >= lnl_wl_range[i].start &&
100+ address <= lnl_wl_range[i].end) {
101+ wl_needed = true;
102+ break;
103+ }
104+ }
105+
106+ return wl_needed;
107+}
108+
109+static bool __intel_dmc_wl_supported(struct drm_i915_private *i915)
110+{
111+ if (DISPLAY_VER(i915) < 20 ||
112+ !intel_dmc_has_payload(i915) ||
113+ !i915->display.params.enable_dmc_wl)
114+ return false;
115+
116+ return true;
117+}
118+
119+void intel_dmc_wl_init(struct drm_i915_private *i915)
120+{
121+ struct intel_dmc_wl *wl = &i915->display.wl;
122+
123+ /* don't call __intel_dmc_wl_supported(), DMC is not loaded yet */
124+ if (DISPLAY_VER(i915) < 20 ||
125+ !i915->display.params.enable_dmc_wl)
126+ return;
127+
128+ INIT_DELAYED_WORK(&wl->work, intel_dmc_wl_work);
129+ spin_lock_init(&wl->lock);
130+ refcount_set(&wl->refcount, 0);
131+}
132+
133+void intel_dmc_wl_enable(struct drm_i915_private *i915)
134+{
135+ struct intel_dmc_wl *wl = &i915->display.wl;
136+ unsigned long flags;
137+
138+ if (!__intel_dmc_wl_supported(i915))
139+ return;
140+
141+ spin_lock_irqsave(&wl->lock, flags);
142+
143+ if (wl->enabled)
144+ goto out_unlock;
145+
146+ /*
147+ * Enable wakelock in DMC. We shouldn't try to take the
148+ * wakelock, because we're just enabling it, so call the
149+ * non-locking version directly here.
150+ */
151+ __intel_de_rmw_nowl(i915, DMC_WAKELOCK_CFG, 0, DMC_WAKELOCK_CFG_ENABLE);
152+
153+ wl->enabled = true;
154+ wl->taken = false;
155+
156+out_unlock:
157+ spin_unlock_irqrestore(&wl->lock, flags);
158+}
159+
160+void intel_dmc_wl_disable(struct drm_i915_private *i915)
161+{
162+ struct intel_dmc_wl *wl = &i915->display.wl;
163+ unsigned long flags;
164+
165+ if (!__intel_dmc_wl_supported(i915))
166+ return;
167+
168+ flush_delayed_work(&wl->work);
169+
170+ spin_lock_irqsave(&wl->lock, flags);
171+
172+ if (!wl->enabled)
173+ goto out_unlock;
174+
175+ /* Disable wakelock in DMC */
176+ __intel_de_rmw_nowl(i915, DMC_WAKELOCK_CFG, DMC_WAKELOCK_CFG_ENABLE, 0);
177+
178+ refcount_set(&wl->refcount, 0);
179+ wl->enabled = false;
180+ wl->taken = false;
181+
182+out_unlock:
183+ spin_unlock_irqrestore(&wl->lock, flags);
184+}
185+
186+void intel_dmc_wl_get(struct drm_i915_private *i915, i915_reg_t reg)
187+{
188+ struct intel_dmc_wl *wl = &i915->display.wl;
189+ unsigned long flags;
190+
191+ if (!__intel_dmc_wl_supported(i915))
192+ return;
193+
194+ if (!intel_dmc_wl_check_range(reg.reg))
195+ return;
196+
197+ spin_lock_irqsave(&wl->lock, flags);
198+
199+ if (!wl->enabled)
200+ goto out_unlock;
201+
202+ cancel_delayed_work(&wl->work);
203+
204+ if (refcount_inc_not_zero(&wl->refcount))
205+ goto out_unlock;
206+
207+ refcount_set(&wl->refcount, 1);
208+
209+ /*
210+ * Only try to take the wakelock if it's not marked as taken
211+ * yet. It may be already taken at this point if we have
212+ * already released the last reference, but the work has not
213+ * run yet.
214+ */
215+ if (!wl->taken) {
216+ __intel_de_rmw_nowl(i915, DMC_WAKELOCK1_CTL, 0,
217+ DMC_WAKELOCK_CTL_REQ);
218+
219+ if (__intel_wait_for_register_nowl(i915, DMC_WAKELOCK1_CTL,
220+ DMC_WAKELOCK_CTL_ACK,
221+ DMC_WAKELOCK_CTL_ACK,
222+ DMC_WAKELOCK_CTL_TIMEOUT)) {
223+ WARN_RATELIMIT(1, "DMC wakelock ack timed out");
224+ goto out_unlock;
225+ }
226+
227+ wl->taken = true;
228+ }
229+
230+out_unlock:
231+ spin_unlock_irqrestore(&wl->lock, flags);
232+}
233+
234+void intel_dmc_wl_put(struct drm_i915_private *i915, i915_reg_t reg)
235+{
236+ struct intel_dmc_wl *wl = &i915->display.wl;
237+ unsigned long flags;
238+
239+ if (!__intel_dmc_wl_supported(i915))
240+ return;
241+
242+ if (!intel_dmc_wl_check_range(reg.reg))
243+ return;
244+
245+ spin_lock_irqsave(&wl->lock, flags);
246+
247+ if (!wl->enabled)
248+ goto out_unlock;
249+
250+ if (WARN_RATELIMIT(!refcount_read(&wl->refcount),
251+ "Tried to put wakelock with refcount zero\n"))
252+ goto out_unlock;
253+
254+ if (refcount_dec_and_test(&wl->refcount)) {
255+ __intel_dmc_wl_release(i915);
256+
257+ goto out_unlock;
258+ }
259+
260+out_unlock:
261+ spin_unlock_irqrestore(&wl->lock, flags);
262+}
drivers/gpu/drm/i915/display/intel_dmc_wl.h+31−0
@@ -0,0 +1,31 @@
1+/* SPDX-License-Identifier: MIT */
2+/*
3+ * Copyright (C) 2024 Intel Corporation
4+ */
5+
6+#ifndef __INTEL_WAKELOCK_H__
7+#define __INTEL_WAKELOCK_H__
8+
9+#include <linux/types.h>
10+#include <linux/workqueue.h>
11+#include <linux/refcount.h>
12+
13+#include "i915_reg_defs.h"
14+
15+struct drm_i915_private;
16+
17+struct intel_dmc_wl {
18+ spinlock_t lock; /* protects enabled, taken and refcount */
19+ bool enabled;
20+ bool taken;
21+ refcount_t refcount;
22+ struct delayed_work work;
23+};
24+
25+void intel_dmc_wl_init(struct drm_i915_private *i915);
26+void intel_dmc_wl_enable(struct drm_i915_private *i915);
27+void intel_dmc_wl_disable(struct drm_i915_private *i915);
28+void intel_dmc_wl_get(struct drm_i915_private *i915, i915_reg_t reg);
29+void intel_dmc_wl_put(struct drm_i915_private *i915, i915_reg_t reg);
30+
31+#endif /* __INTEL_WAKELOCK_H__ */
drivers/gpu/drm/i915/display/intel_dp.c+243−67
@@ -123,6 +123,14 @@ bool intel_dp_is_edp(struct intel_dp *intel_dp) · 122 unmodified lines
123123 return dig_port->base.type == INTEL_OUTPUT_EDP;
124124 }
125125
126+bool intel_dp_as_sdp_supported(struct intel_dp *intel_dp)
127+{
128+ struct drm_i915_private *i915 = dp_to_i915(intel_dp);
129+
130+ return HAS_AS_SDP(i915) &&
131+ drm_dp_as_sdp_supported(&intel_dp->aux, intel_dp->dpcd);
132+}
133+
126134 static void intel_dp_unset_edid(struct intel_dp *intel_dp);
127135
128136 /* Is link rate UHBR and thus 128b/132b? */
@@ -425,7 +433,7 @@ int intel_dp_max_link_data_rate(struct intel_dp *intel_dp, · 296 unmodified lines
425433 return max_rate;
426434 }
427435
428−bool intel_dp_can_bigjoiner(struct intel_dp *intel_dp)
436+bool intel_dp_has_bigjoiner(struct intel_dp *intel_dp)
429437 {
430438 struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
431439 struct intel_encoder *encoder = &intel_dig_port->base;
@@ -443,11 +451,9 @@ static int dg2_max_source_rate(struct intel_dp *intel_dp) · 11 unmodified lines
443451
444452 static int icl_max_source_rate(struct intel_dp *intel_dp)
445453 {
446− struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
447− struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
448− enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port);
454+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
449455
450− if (intel_phy_is_combo(dev_priv, phy) && !intel_dp_is_edp(intel_dp))
456+ if (intel_encoder_is_combo(encoder) && !intel_dp_is_edp(intel_dp))
451457 return 540000;
452458
453459 return 810000;
@@ -463,11 +469,9 @@ static int ehl_max_source_rate(struct intel_dp *intel_dp) · 9 unmodified lines
463469
464470 static int mtl_max_source_rate(struct intel_dp *intel_dp)
465471 {
466− struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
467− struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
468− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
472+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
469473
470− if (intel_is_c10phy(i915, phy))
474+ if (intel_encoder_is_c10phy(encoder))
471475 return 810000;
472476
473477 return 2000000;
@@ -499,7 +503,7 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp) · 25 unmodified lines
499503 /* The values must be in increasing order */
500504 static const int mtl_rates[] = {
501505 162000, 216000, 243000, 270000, 324000, 432000, 540000, 675000,
502− 810000, 1000000, 1350000, 2000000,
506+ 810000, 1000000, 2000000,
503507 };
504508 static const int icl_rates[] = {
505509 162000, 216000, 270000, 324000, 432000, 540000, 648000, 810000,
@@ -1198,15 +1202,15 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector, · 692 unmodified lines
11981202 }
11991203
12001204 bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
1205+ struct intel_connector *connector,
12011206 int hdisplay, int clock)
12021207 {
12031208 struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1204− struct intel_connector *connector = intel_dp->attached_connector;
12051209
1206− if (!intel_dp_can_bigjoiner(intel_dp))
1210+ if (!intel_dp_has_bigjoiner(intel_dp))
12071211 return false;
12081212
1209− return clock > i915->max_dotclk_freq || hdisplay > 5120 ||
1213+ return clock > i915->display.cdclk.max_dotclk_freq || hdisplay > 5120 ||
12101214 connector->force_bigjoiner_enable;
12111215 }
12121216
@@ -1220,7 +1224,7 @@ intel_dp_mode_valid(struct drm_connector *_connector, · 7 unmodified lines
12201224 const struct drm_display_mode *fixed_mode;
12211225 int target_clock = mode->clock;
12221226 int max_rate, mode_rate, max_lanes, max_link_clock;
1223− int max_dotclk = dev_priv->max_dotclk_freq;
1227+ int max_dotclk = dev_priv->display.cdclk.max_dotclk_freq;
12241228 u16 dsc_max_compressed_bpp = 0;
12251229 u8 dsc_slice_count = 0;
12261230 enum drm_mode_status status;
@@ -1233,6 +1237,9 @@ intel_dp_mode_valid(struct drm_connector *_connector, · 6 unmodified lines
12331237 if (mode->flags & DRM_MODE_FLAG_DBLCLK)
12341238 return MODE_H_ILLEGAL;
12351239
1240+ if (mode->clock < 10000)
1241+ return MODE_CLOCK_LOW;
1242+
12361243 fixed_mode = intel_panel_fixed_mode(connector, mode);
12371244 if (intel_dp_is_edp(intel_dp) && fixed_mode) {
12381245 status = intel_panel_mode_valid(connector, mode);
@@ -1242,10 +1249,8 @@ intel_dp_mode_valid(struct drm_connector *_connector, · 3 unmodified lines
12421249 target_clock = fixed_mode->clock;
12431250 }
12441251
1245− if (mode->clock < 10000)
1246− return MODE_CLOCK_LOW;
1247−
1248− if (intel_dp_need_bigjoiner(intel_dp, mode->hdisplay, target_clock)) {
1252+ if (intel_dp_need_bigjoiner(intel_dp, connector,
1253+ mode->hdisplay, target_clock)) {
12491254 bigjoiner = true;
12501255 max_dotclk *= 2;
12511256 }
@@ -1306,11 +1311,7 @@ intel_dp_mode_valid(struct drm_connector *_connector, · 54 unmodified lines
13061311 dsc = dsc_max_compressed_bpp && dsc_slice_count;
13071312 }
13081313
1309− /*
1310− * Big joiner configuration needs DSC for TGL which is not true for
1311− * XE_LPD where uncompressed joiner is supported.
1312− */
1313− if (DISPLAY_VER(dev_priv) < 13 && bigjoiner && !dsc)
1314+ if (intel_dp_joiner_needs_dsc(dev_priv, bigjoiner) && !dsc)
13141315 return MODE_CLOCK_HIGH;
13151316
13161317 if (mode_rate > max_rate && !dsc)
@@ -1422,7 +1423,8 @@ static bool intel_dp_source_supports_fec(struct intel_dp *intel_dp, · 105 unmodified lines
14221423 if (DISPLAY_VER(dev_priv) >= 12)
14231424 return true;
14241425
1425− if (DISPLAY_VER(dev_priv) == 11 && encoder->port != PORT_A)
1426+ if (DISPLAY_VER(dev_priv) == 11 && encoder->port != PORT_A &&
1427+ !intel_crtc_has_type(pipe_config, INTEL_OUTPUT_DP_MST))
14261428 return true;
14271429
14281430 return false;
@@ -1917,8 +1919,9 @@ icl_dsc_compute_link_config(struct intel_dp *intel_dp, · 488 unmodified lines
19171919 dsc_max_bpp = min(dsc_max_bpp, pipe_bpp - 1);
19181920
19191921 for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp); i++) {
1920− if (valid_dsc_bpp[i] < dsc_min_bpp ||
1921− valid_dsc_bpp[i] > dsc_max_bpp)
1922+ if (valid_dsc_bpp[i] < dsc_min_bpp)
1923+ continue;
1924+ if (valid_dsc_bpp[i] > dsc_max_bpp)
19221925 break;
19231926
19241927 ret = dsc_compute_link_config(intel_dp,
@@ -2399,6 +2402,16 @@ int intel_dp_config_required_rate(const struct intel_crtc_state *crtc_state) · 474 unmodified lines
23992402 return intel_dp_link_required(adjusted_mode->crtc_clock, bpp);
24002403 }
24012404
2405+bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner)
2406+{
2407+ /*
2408+ * Pipe joiner needs compression up to display 12 due to bandwidth
2409+ * limitation. DG2 onwards pipe joiner can be enabled without
2410+ * compression.
2411+ */
2412+ return DISPLAY_VER(i915) < 13 && use_joiner;
2413+}
2414+
24022415 static int
24032416 intel_dp_compute_link_config(struct intel_encoder *encoder,
24042417 struct intel_crtc_state *pipe_config,
@@ -2407,30 +2420,25 @@ intel_dp_compute_link_config(struct intel_encoder *encoder, · 2 unmodified lines
24072420 {
24082421 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
24092422 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
2410− const struct intel_connector *connector =
2423+ struct intel_connector *connector =
24112424 to_intel_connector(conn_state->connector);
24122425 const struct drm_display_mode *adjusted_mode =
24132426 &pipe_config->hw.adjusted_mode;
24142427 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
24152428 struct link_config_limits limits;
2416− bool joiner_needs_dsc = false;
2417− bool dsc_needed;
2429+ bool dsc_needed, joiner_needs_dsc;
24182430 int ret = 0;
24192431
24202432 if (pipe_config->fec_enable &&
24212433 !intel_dp_supports_fec(intel_dp, connector, pipe_config))
24222434 return -EINVAL;
24232435
2424− if (intel_dp_need_bigjoiner(intel_dp, adjusted_mode->crtc_hdisplay,
2436+ if (intel_dp_need_bigjoiner(intel_dp, connector,
2437+ adjusted_mode->crtc_hdisplay,
24252438 adjusted_mode->crtc_clock))
24262439 pipe_config->bigjoiner_pipes = GENMASK(crtc->pipe + 1, crtc->pipe);
24272440
2428− /*
2429− * Pipe joiner needs compression up to display 12 due to bandwidth
2430− * limitation. DG2 onwards pipe joiner can be enabled without
2431− * compression.
2432− */
2433− joiner_needs_dsc = DISPLAY_VER(i915) < 13 && pipe_config->bigjoiner_pipes;
2441+ joiner_needs_dsc = intel_dp_joiner_needs_dsc(i915, pipe_config->bigjoiner_pipes);
24342442
24352443 dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
24362444 !intel_dp_compute_config_limits(intel_dp, pipe_config,
@@ -2613,6 +2621,29 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc · 176 unmodified lines
26132621 vsc->content_type = DP_CONTENT_TYPE_NOT_DEFINED;
26142622 }
26152623
2624+static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
2625+ struct intel_crtc_state *crtc_state)
2626+{
2627+ struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
2628+ const struct drm_display_mode *adjusted_mode =
2629+ &crtc_state->hw.adjusted_mode;
2630+
2631+ if (!crtc_state->vrr.enable ||
2632+ !intel_dp_as_sdp_supported(intel_dp))
2633+ return;
2634+
2635+ crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
2636+
2637+ /* Currently only DP_AS_SDP_AVT_FIXED_VTOTAL mode supported */
2638+ as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
2639+ as_sdp->length = 0x9;
2640+ as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
2641+ as_sdp->vtotal = adjusted_mode->vtotal;
2642+ as_sdp->target_rr = 0;
2643+ as_sdp->duration_incr_ms = 0;
2644+ as_sdp->duration_incr_ms = 0;
2645+}
2646+
26162647 static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,
26172648 struct intel_crtc_state *crtc_state,
26182649 const struct drm_connector_state *conn_state)
@@ -2723,7 +2754,11 @@ intel_dp_drrs_compute_config(struct intel_connector *connector, · 104 unmodified lines
27232754 intel_panel_downclock_mode(connector, &pipe_config->hw.adjusted_mode);
27242755 int pixel_clock;
27252756
2726− if (has_seamless_m_n(connector))
2757+ /*
2758+ * FIXME all joined pipes share the same transcoder.
2759+ * Need to account for that when updating M/N live.
2760+ */
2761+ if (has_seamless_m_n(connector) && !pipe_config->bigjoiner_pipes)
27272762 pipe_config->update_m_n = true;
27282763
27292764 if (!can_enable_drrs(connector, pipe_config, downclock_mode)) {
@@ -2964,6 +2999,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, · 234 unmodified lines
29642999 g4x_dp_set_clock(encoder, pipe_config);
29653000
29663001 intel_vrr_compute_config(pipe_config, conn_state);
3002+ intel_dp_compute_as_sdp(intel_dp, pipe_config);
29673003 intel_psr_compute_config(intel_dp, pipe_config, conn_state);
29683004 intel_dp_drrs_compute_config(connector, pipe_config, link_bpp_x16);
29693005 intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state);
@@ -3356,6 +3392,14 @@ bool intel_dp_initial_fastset_check(struct intel_encoder *encoder, · 386 unmodified lines
33563392 fastset = false;
33573393 }
33583394
3395+ if (CAN_PANEL_REPLAY(intel_dp)) {
3396+ drm_dbg_kms(&i915->drm,
3397+ "[ENCODER:%d:%s] Forcing full modeset to compute panel replay state\n",
3398+ encoder->base.base.id, encoder->base.name);
3399+ crtc_state->uapi.mode_changed = true;
3400+ fastset = false;
3401+ }
3402+
33593403 return fastset;
33603404 }
33613405
@@ -4039,39 +4083,84 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) · 677 unmodified lines
40394083 intel_dp->downstream_ports) == 0;
40404084 }
40414085
4042−static bool
4043−intel_dp_can_mst(struct intel_dp *intel_dp)
4086+static const char *intel_dp_mst_mode_str(enum drm_dp_mst_mode mst_mode)
4087+{
4088+ if (mst_mode == DRM_DP_MST)
4089+ return "MST";
4090+ else if (mst_mode == DRM_DP_SST_SIDEBAND_MSG)
4091+ return "SST w/ sideband messaging";
4092+ else
4093+ return "SST";
4094+}
4095+
4096+static enum drm_dp_mst_mode
4097+intel_dp_mst_mode_choose(struct intel_dp *intel_dp,
4098+ enum drm_dp_mst_mode sink_mst_mode)
40444099 {
40454100 struct drm_i915_private *i915 = dp_to_i915(intel_dp);
40464101
4047− return i915->display.params.enable_dp_mst &&
4048− intel_dp_mst_source_support(intel_dp) &&
4049− drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd);
4102+ if (!i915->display.params.enable_dp_mst)
4103+ return DRM_DP_SST;
4104+
4105+ if (!intel_dp_mst_source_support(intel_dp))
4106+ return DRM_DP_SST;
4107+
4108+ if (sink_mst_mode == DRM_DP_SST_SIDEBAND_MSG &&
4109+ !(intel_dp->dpcd[DP_MAIN_LINK_CHANNEL_CODING] & DP_CAP_ANSI_128B132B))
4110+ return DRM_DP_SST;
4111+
4112+ return sink_mst_mode;
40504113 }
40514114
4052−static void
4053−intel_dp_configure_mst(struct intel_dp *intel_dp)
4115+static enum drm_dp_mst_mode
4116+intel_dp_mst_detect(struct intel_dp *intel_dp)
40544117 {
40554118 struct drm_i915_private *i915 = dp_to_i915(intel_dp);
4056− struct intel_encoder *encoder =
4057− &dp_to_dig_port(intel_dp)->base;
4058− bool sink_can_mst = drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd);
4119+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
4120+ enum drm_dp_mst_mode sink_mst_mode;
4121+ enum drm_dp_mst_mode mst_detect;
4122+
4123+ sink_mst_mode = drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd);
4124+
4125+ mst_detect = intel_dp_mst_mode_choose(intel_dp, sink_mst_mode);
40594126
40604127 drm_dbg_kms(&i915->drm,
4061− "[ENCODER:%d:%s] MST support: port: %s, sink: %s, modparam: %s\n",
4128+ "[ENCODER:%d:%s] MST support: port: %s, sink: %s, modparam: %s -> enable: %s\n",
40624129 encoder->base.base.id, encoder->base.name,
40634130 str_yes_no(intel_dp_mst_source_support(intel_dp)),
4064− str_yes_no(sink_can_mst),
4065− str_yes_no(i915->display.params.enable_dp_mst));
4131+ intel_dp_mst_mode_str(sink_mst_mode),
4132+ str_yes_no(i915->display.params.enable_dp_mst),
4133+ intel_dp_mst_mode_str(mst_detect));
4134+
4135+ return mst_detect;
4136+}
40664137
4138+static void
4139+intel_dp_mst_configure(struct intel_dp *intel_dp)
4140+{
40674141 if (!intel_dp_mst_source_support(intel_dp))
40684142 return;
40694143
4070− intel_dp->is_mst = sink_can_mst &&
4071− i915->display.params.enable_dp_mst;
4144+ intel_dp->is_mst = intel_dp->mst_detect != DRM_DP_SST;
4145+
4146+ drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
4147+
4148+ /* Avoid stale info on the next detect cycle. */
4149+ intel_dp->mst_detect = DRM_DP_SST;
4150+}
4151+
4152+static void
4153+intel_dp_mst_disconnect(struct intel_dp *intel_dp)
4154+{
4155+ struct drm_i915_private *i915 = dp_to_i915(intel_dp);
4156+
4157+ if (!intel_dp->is_mst)
4158+ return;
40724159
4073− drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
4074− intel_dp->is_mst);
4160+ drm_dbg_kms(&i915->drm, "MST device may have disappeared %d vs %d\n",
4161+ intel_dp->is_mst, intel_dp->mst_mgr.mst_state);
4162+ intel_dp->is_mst = false;
4163+ drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
40754164 }
40764165
40774166 static bool
@@ -4119,6 +4208,32 @@ intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state, · 41 unmodified lines
41194208 return false;
41204209 }
41214210
4211+static ssize_t intel_dp_as_sdp_pack(const struct drm_dp_as_sdp *as_sdp,
4212+ struct dp_sdp *sdp, size_t size)
4213+{
4214+ size_t length = sizeof(struct dp_sdp);
4215+
4216+ if (size < length)
4217+ return -ENOSPC;
4218+
4219+ memset(sdp, 0, size);
4220+
4221+ /* Prepare AS (Adaptive Sync) SDP Header */
4222+ sdp->sdp_header.HB0 = 0;
4223+ sdp->sdp_header.HB1 = as_sdp->sdp_type;
4224+ sdp->sdp_header.HB2 = 0x02;
4225+ sdp->sdp_header.HB3 = as_sdp->length;
4226+
4227+ /* Fill AS (Adaptive Sync) SDP Payload */
4228+ sdp->db[0] = as_sdp->mode;
4229+ sdp->db[1] = as_sdp->vtotal & 0xFF;
4230+ sdp->db[2] = (as_sdp->vtotal >> 8) & 0xFF;
4231+ sdp->db[3] = as_sdp->target_rr & 0xFF;
4232+ sdp->db[4] = (as_sdp->target_rr >> 8) & 0x3;
4233+
4234+ return length;
4235+}
4236+
41224237 static ssize_t
41234238 intel_dp_hdr_metadata_infoframe_sdp_pack(struct drm_i915_private *i915,
41244239 const struct hdmi_drm_infoframe *drm_infoframe,
@@ -4218,6 +4333,10 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, · 93 unmodified lines
42184333 &crtc_state->infoframes.drm.drm,
42194334 &sdp, sizeof(sdp));
42204335 break;
4336+ case DP_SDP_ADAPTIVE_SYNC:
4337+ len = intel_dp_as_sdp_pack(&crtc_state->infoframes.as_sdp, &sdp,
4338+ sizeof(sdp));
4339+ break;
42214340 default:
42224341 MISSING_CASE(type);
42234342 return;
@@ -4239,6 +4358,10 @@ void intel_dp_set_infoframes(struct intel_encoder *encoder, · 15 unmodified lines
42394358 u32 dip_enable = VIDEO_DIP_ENABLE_AVI_HSW | VIDEO_DIP_ENABLE_GCP_HSW |
42404359 VIDEO_DIP_ENABLE_VS_HSW | VIDEO_DIP_ENABLE_GMP_HSW |
42414360 VIDEO_DIP_ENABLE_SPD_HSW | VIDEO_DIP_ENABLE_DRM_GLK;
4361+
4362+ if (HAS_AS_SDP(dev_priv))
4363+ dip_enable |= VIDEO_DIP_ENABLE_AS_ADL;
4364+
42424365 u32 val = intel_de_read(dev_priv, reg) & ~dip_enable;
42434366
42444367 /* TODO: Sanitize DSC enabling wrt. intel_dsc_dp_pps_write(). */
@@ -4256,10 +4379,42 @@ void intel_dp_set_infoframes(struct intel_encoder *encoder, · 11 unmodified lines
42564379 return;
42574380
42584381 intel_write_dp_sdp(encoder, crtc_state, DP_SDP_VSC);
4382+ intel_write_dp_sdp(encoder, crtc_state, DP_SDP_ADAPTIVE_SYNC);
42594383
42604384 intel_write_dp_sdp(encoder, crtc_state, HDMI_PACKET_TYPE_GAMUT_METADATA);
42614385 }
42624386
4387+static
4388+int intel_dp_as_sdp_unpack(struct drm_dp_as_sdp *as_sdp,
4389+ const void *buffer, size_t size)
4390+{
4391+ const struct dp_sdp *sdp = buffer;
4392+
4393+ if (size < sizeof(struct dp_sdp))
4394+ return -EINVAL;
4395+
4396+ memset(as_sdp, 0, sizeof(*as_sdp));
4397+
4398+ if (sdp->sdp_header.HB0 != 0)
4399+ return -EINVAL;
4400+
4401+ if (sdp->sdp_header.HB1 != DP_SDP_ADAPTIVE_SYNC)
4402+ return -EINVAL;
4403+
4404+ if (sdp->sdp_header.HB2 != 0x02)
4405+ return -EINVAL;
4406+
4407+ if ((sdp->sdp_header.HB3 & 0x3F) != 9)
4408+ return -EINVAL;
4409+
4410+ as_sdp->length = sdp->sdp_header.HB3 & DP_ADAPTIVE_SYNC_SDP_LENGTH;
4411+ as_sdp->mode = sdp->db[0] & DP_ADAPTIVE_SYNC_SDP_OPERATION_MODE;
4412+ as_sdp->vtotal = (sdp->db[2] << 8) | sdp->db[1];
4413+ as_sdp->target_rr = (u64)sdp->db[3] | ((u64)sdp->db[4] & 0x3);
4414+
4415+ return 0;
4416+}
4417+
42634418 static int intel_dp_vsc_sdp_unpack(struct drm_dp_vsc_sdp *vsc,
42644419 const void *buffer, size_t size)
42654420 {
@@ -4330,6 +4485,29 @@ static int intel_dp_vsc_sdp_unpack(struct drm_dp_vsc_sdp *vsc, · 64 unmodified lines
43304485 return 0;
43314486 }
43324487
4488+static void
4489+intel_read_dp_as_sdp(struct intel_encoder *encoder,
4490+ struct intel_crtc_state *crtc_state,
4491+ struct drm_dp_as_sdp *as_sdp)
4492+{
4493+ struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
4494+ struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
4495+ unsigned int type = DP_SDP_ADAPTIVE_SYNC;
4496+ struct dp_sdp sdp = {};
4497+ int ret;
4498+
4499+ if ((crtc_state->infoframes.enable &
4500+ intel_hdmi_infoframe_enable(type)) == 0)
4501+ return;
4502+
4503+ dig_port->read_infoframe(encoder, crtc_state, type, &sdp,
4504+ sizeof(sdp));
4505+
4506+ ret = intel_dp_as_sdp_unpack(as_sdp, &sdp, sizeof(sdp));
4507+ if (ret)
4508+ drm_dbg_kms(&dev_priv->drm, "Failed to unpack DP AS SDP\n");
4509+}
4510+
43334511 static int
43344512 intel_dp_hdr_metadata_infoframe_sdp_unpack(struct hdmi_drm_infoframe *drm_infoframe,
43354513 const void *buffer, size_t size)
@@ -4436,6 +4614,10 @@ void intel_read_dp_sdp(struct intel_encoder *encoder, · 100 unmodified lines
44364614 intel_read_dp_hdr_metadata_infoframe_sdp(encoder, crtc_state,
44374615 &crtc_state->infoframes.drm.drm);
44384616 break;
4617+ case DP_SDP_ADAPTIVE_SYNC:
4618+ intel_read_dp_as_sdp(encoder, crtc_state,
4619+ &crtc_state->infoframes.as_sdp);
4620+ break;
44394621 default:
44404622 MISSING_CASE(type);
44414623 break;
@@ -5363,6 +5545,8 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) · 921 unmodified lines
53635545 if (!intel_dp_get_dpcd(intel_dp))
53645546 return connector_status_disconnected;
53655547
5548+ intel_dp->mst_detect = intel_dp_mst_detect(intel_dp);
5549+
53665550 /* if there's no downstream port, we're done */
53675551 if (!drm_dp_is_branch(dpcd))
53685552 return connector_status_connected;
@@ -5374,7 +5558,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) · 5 unmodified lines
53745558 connector_status_connected : connector_status_disconnected;
53755559 }
53765560
5377− if (intel_dp_can_mst(intel_dp))
5561+ if (intel_dp->mst_detect == DRM_DP_MST)
53785562 return connector_status_connected;
53795563
53805564 /* If no HPD, poke DDC gently */
@@ -5679,15 +5863,7 @@ intel_dp_detect(struct drm_connector *connector, · 298 unmodified lines
56795863 memset(intel_connector->dp.dsc_dpcd, 0, sizeof(intel_connector->dp.dsc_dpcd));
56805864 intel_dp->psr.sink_panel_replay_support = false;
56815865
5682− if (intel_dp->is_mst) {
5683− drm_dbg_kms(&dev_priv->drm,
5684− "MST device may have disappeared %d vs %d\n",
5685− intel_dp->is_mst,
5686− intel_dp->mst_mgr.mst_state);
5687− intel_dp->is_mst = false;
5688− drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
5689− intel_dp->is_mst);
5690− }
5866+ intel_dp_mst_disconnect(intel_dp);
56915867
56925868 intel_dp_tunnel_disconnect(intel_dp);
56935869
@@ -5706,7 +5882,7 @@ intel_dp_detect(struct drm_connector *connector, · 12 unmodified lines
57065882
57075883 intel_dp_detect_dsc_caps(intel_dp, intel_connector);
57085884
5709− intel_dp_configure_mst(intel_dp);
5885+ intel_dp_mst_configure(intel_dp);
57105886
57115887 /*
57125888 * TODO: Reset link params when switching to MST mode, until MST
@@ -6489,7 +6665,6 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, · 776 unmodified lines
64896665 struct drm_device *dev = intel_encoder->base.dev;
64906666 struct drm_i915_private *dev_priv = to_i915(dev);
64916667 enum port port = intel_encoder->port;
6492− enum phy phy = intel_port_to_phy(dev_priv, port);
64936668 int type;
64946669
64956670 /* Initialize the work for modeset in case of link train failure */
@@ -6514,7 +6689,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, · 18 unmodified lines
65146689 * Currently we don't support eDP on TypeC ports, although in
65156690 * theory it could work on TypeC legacy ports.
65166691 */
6517− drm_WARN_ON(dev, intel_phy_is_tc(dev_priv, phy));
6692+ drm_WARN_ON(dev, intel_encoder_is_tc(intel_encoder));
65186693 type = DRM_MODE_CONNECTOR_eDP;
65196694 intel_encoder->type = INTEL_OUTPUT_EDP;
65206695
@@ -6557,6 +6732,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, · 36 unmodified lines
65576732 intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
65586733 else
65596734 intel_connector->get_hw_state = intel_connector_get_hw_state;
6735+ intel_connector->sync_state = intel_dp_connector_sync_state;
65606736
65616737 if (!intel_edp_init_connector(intel_dp, intel_connector)) {
65626738 intel_dp_aux_fini(intel_dp);
drivers/gpu/drm/i915/display/intel_dp.h+4−1
@@ -88,6 +88,7 @@ void intel_dp_audio_compute_config(struct intel_encoder *encoder, · 87 unmodified lines
8888 struct drm_connector_state *conn_state);
8989 bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);
9090 bool intel_dp_is_edp(struct intel_dp *intel_dp);
91+bool intel_dp_as_sdp_supported(struct intel_dp *intel_dp);
9192 bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
9293 int intel_dp_link_symbol_size(int rate);
9394 int intel_dp_link_symbol_clock(int rate);
@@ -119,7 +120,8 @@ int intel_dp_effective_data_rate(int pixel_clock, int bpp_x16, · 25 unmodified lines
119120 int bw_overhead);
120121 int intel_dp_max_link_data_rate(struct intel_dp *intel_dp,
121122 int max_dprx_rate, int max_dprx_lanes);
122−bool intel_dp_can_bigjoiner(struct intel_dp *intel_dp);
123+bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner);
124+bool intel_dp_has_bigjoiner(struct intel_dp *intel_dp);
123125 bool intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state,
124126 const struct drm_connector_state *conn_state);
125127 void intel_dp_set_infoframes(struct intel_encoder *encoder, bool enable,
@@ -149,6 +151,7 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector, · 23 unmodified lines
149151 int mode_clock, int mode_hdisplay,
150152 bool bigjoiner);
151153 bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
154+ struct intel_connector *connector,
152155 int hdisplay, int clock);
153156
154157 static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
drivers/gpu/drm/i915/display/intel_dp_aux.c+10−5
@@ -61,9 +61,8 @@ intel_dp_aux_wait_done(struct intel_dp *intel_dp) · 60 unmodified lines
6161 u32 status;
6262 int ret;
6363
64− ret = __intel_de_wait_for_register(i915, ch_ctl,
65− DP_AUX_CH_CTL_SEND_BUSY, 0,
66− 2, timeout_ms, &status);
64+ ret = intel_de_wait_custom(i915, ch_ctl, DP_AUX_CH_CTL_SEND_BUSY, 0,
65+ 2, timeout_ms, &status);
6766
6867 if (ret == -ETIMEDOUT)
6968 drm_err(&i915->drm,
@@ -143,9 +142,15 @@ static int intel_dp_aux_sync_len(void) · 73 unmodified lines
143142 return precharge + preamble;
144143 }
145144
146−static int intel_dp_aux_fw_sync_len(void)
145+int intel_dp_aux_fw_sync_len(void)
147146 {
148− int precharge = 10; /* 10-16 */
147+ /*
148+ * We faced some glitches on Dell Precision 5490 MTL laptop with panel:
149+ * "Manufacturer: AUO, Model: 63898" when using HW default 18. Using 20
150+ * is fixing these problems with the panel. It is still within range
151+ * mentioned in eDP specification.
152+ */
153+ int precharge = 12; /* 10-16 */
149154 int preamble = 8;
150155
151156 return precharge + preamble;
drivers/gpu/drm/i915/display/intel_dp_aux.h+1−0
@@ -20,5 +20,6 @@ enum aux_ch intel_dp_aux_ch(struct intel_encoder *encoder); · 19 unmodified lines
2020
2121 void intel_dp_aux_irq_handler(struct drm_i915_private *i915);
2222 u32 intel_dp_aux_pack(const u8 *src, int src_bytes);
23+int intel_dp_aux_fw_sync_len(void);
2324
2425 #endif /* __INTEL_DP_AUX_H__ */
drivers/gpu/drm/i915/display/intel_dp_hdcp.c+11−11
@@ -691,12 +691,15 @@ int intel_dp_hdcp_get_remote_capability(struct intel_connector *connector, · 690 unmodified lines
691691 u8 bcaps;
692692 int ret;
693693
694+ *hdcp_capable = false;
695+ *hdcp2_capable = false;
694696 if (!intel_encoder_is_mst(connector->encoder))
695697 return -EINVAL;
696698
697699 ret = _intel_dp_hdcp2_get_capability(aux, hdcp2_capable);
698700 if (ret)
699− return ret;
701+ drm_dbg_kms(&i915->drm,
702+ "HDCP2 DPCD capability read failed err: %d\n", ret);
700703
701704 ret = intel_dp_hdcp_read_bcaps(aux, i915, &bcaps);
702705 if (ret)
@@ -766,11 +769,9 @@ intel_dp_mst_hdcp_stream_encryption(struct intel_connector *connector, · 63 unmodified lines
766769 return -EINVAL;
767770
768771 /* Wait for encryption confirmation */
769− if (intel_de_wait_for_register(i915,
770− HDCP_STATUS(i915, cpu_transcoder, port),
771− stream_enc_status,
772− enable ? stream_enc_status : 0,
773− HDCP_ENCRYPT_STATUS_CHANGE_TIMEOUT_MS)) {
772+ if (intel_de_wait(i915, HDCP_STATUS(i915, cpu_transcoder, port),
773+ stream_enc_status, enable ? stream_enc_status : 0,
774+ HDCP_ENCRYPT_STATUS_CHANGE_TIMEOUT_MS)) {
774775 drm_err(&i915->drm, "Timed out waiting for transcoder: %s stream encryption %s\n",
775776 transcoder_name(cpu_transcoder), enable ? "enabled" : "disabled");
776777 return -ETIMEDOUT;
@@ -801,11 +802,10 @@ intel_dp_mst_hdcp2_stream_encryption(struct intel_connector *connector, · 24 unmodified lines
801802 return ret;
802803
803804 /* Wait for encryption confirmation */
804− if (intel_de_wait_for_register(i915,
805− HDCP2_STREAM_STATUS(i915, cpu_transcoder, pipe),
806− STREAM_ENCRYPTION_STATUS,
807− enable ? STREAM_ENCRYPTION_STATUS : 0,
808− HDCP_ENCRYPT_STATUS_CHANGE_TIMEOUT_MS)) {
805+ if (intel_de_wait(i915, HDCP2_STREAM_STATUS(i915, cpu_transcoder, pipe),
806+ STREAM_ENCRYPTION_STATUS,
807+ enable ? STREAM_ENCRYPTION_STATUS : 0,
808+ HDCP_ENCRYPT_STATUS_CHANGE_TIMEOUT_MS)) {
809809 drm_err(&i915->drm, "Timed out waiting for transcoder: %s stream encryption %s\n",
810810 transcoder_name(cpu_transcoder), enable ? "enabled" : "disabled");
811811 return -ETIMEDOUT;
drivers/gpu/drm/i915/display/intel_dp_mst.c+96−46
@@ -88,11 +88,10 @@ static int intel_dp_mst_bw_overhead(const struct intel_crtc_state *crtc_state, · 87 unmodified lines
8888
8989 if (dsc) {
9090 flags |= DRM_DP_BW_OVERHEAD_DSC;
91− /* TODO: add support for bigjoiner */
9291 dsc_slice_count = intel_dp_dsc_get_slice_count(connector,
9392 adjusted_mode->clock,
9493 adjusted_mode->hdisplay,
95− false);
94+ crtc_state->bigjoiner_pipes);
9695 }
9796
9897 overhead = drm_dp_bw_overhead(crtc_state->lane_count,
@@ -525,14 +524,15 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder, · 426 unmodified lines
525524 {
526525 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
527526 struct intel_atomic_state *state = to_intel_atomic_state(conn_state->state);
527+ struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
528528 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
529529 struct intel_dp *intel_dp = &intel_mst->primary->dp;
530− const struct intel_connector *connector =
530+ struct intel_connector *connector =
531531 to_intel_connector(conn_state->connector);
532532 const struct drm_display_mode *adjusted_mode =
533533 &pipe_config->hw.adjusted_mode;
534534 struct link_config_limits limits;
535− bool dsc_needed;
535+ bool dsc_needed, joiner_needs_dsc;
536536 int ret = 0;
537537
538538 if (pipe_config->fec_enable &&
@@ -542,11 +542,18 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder, · 3 unmodified lines
542542 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
543543 return -EINVAL;
544544
545+ if (intel_dp_need_bigjoiner(intel_dp, connector,
546+ adjusted_mode->crtc_hdisplay,
547+ adjusted_mode->crtc_clock))
548+ pipe_config->bigjoiner_pipes = GENMASK(crtc->pipe + 1, crtc->pipe);
549+
545550 pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB;
546551 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
547552 pipe_config->has_pch_encoder = false;
548553
549− dsc_needed = intel_dp->force_dsc_en ||
554+ joiner_needs_dsc = intel_dp_joiner_needs_dsc(dev_priv, pipe_config->bigjoiner_pipes);
555+
556+ dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
550557 !intel_dp_mst_compute_config_limits(intel_dp,
551558 connector,
552559 pipe_config,
@@ -566,8 +573,8 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder, · 13 unmodified lines
566573
567574 /* enable compression if the mode doesn't fit available BW */
568575 if (dsc_needed) {
569− drm_dbg_kms(&dev_priv->drm, "Try DSC (fallback=%s, force=%s)\n",
570− str_yes_no(ret),
576+ drm_dbg_kms(&dev_priv->drm, "Try DSC (fallback=%s, joiner=%s, force=%s)\n",
577+ str_yes_no(ret), str_yes_no(joiner_needs_dsc),
571578 str_yes_no(intel_dp->force_dsc_en));
572579
573580 if (!intel_dp_mst_dsc_source_support(pipe_config))
@@ -954,6 +961,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, · 380 unmodified lines
954961 struct drm_dp_mst_atomic_payload *new_payload =
955962 drm_atomic_get_mst_payload_state(new_mst_state, connector->port);
956963 struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
964+ struct intel_crtc *pipe_crtc;
957965 bool last_mst_stream;
958966
959967 intel_dp->active_mst_links--;
@@ -962,7 +970,13 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, · 2 unmodified lines
962970 DISPLAY_VER(dev_priv) >= 12 && last_mst_stream &&
963971 !intel_dp_mst_is_master_trans(old_crtc_state));
964972
965− intel_crtc_vblank_off(old_crtc_state);
973+ for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
974+ intel_crtc_joined_pipe_mask(old_crtc_state)) {
975+ const struct intel_crtc_state *old_pipe_crtc_state =
976+ intel_atomic_get_old_crtc_state(state, pipe_crtc);
977+
978+ intel_crtc_vblank_off(old_pipe_crtc_state);
979+ }
966980
967981 intel_disable_transcoder(old_crtc_state);
968982
@@ -980,12 +994,18 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, · 11 unmodified lines
980994
981995 intel_ddi_disable_transcoder_func(old_crtc_state);
982996
983− intel_dsc_disable(old_crtc_state);
997+ for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
998+ intel_crtc_joined_pipe_mask(old_crtc_state)) {
999+ const struct intel_crtc_state *old_pipe_crtc_state =
1000+ intel_atomic_get_old_crtc_state(state, pipe_crtc);
9841001
985− if (DISPLAY_VER(dev_priv) >= 9)
986− skl_scaler_disable(old_crtc_state);
987− else
988− ilk_pfit_disable(old_crtc_state);
1002+ intel_dsc_disable(old_pipe_crtc_state);
1003+
1004+ if (DISPLAY_VER(dev_priv) >= 9)
1005+ skl_scaler_disable(old_pipe_crtc_state);
1006+ else
1007+ ilk_pfit_disable(old_pipe_crtc_state);
1008+ }
9891009
9901010 /*
9911011 * Power down mst path before disabling the port, otherwise we end
@@ -1117,6 +1137,39 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state, · 125 unmodified lines
11171137 intel_ddi_set_dp_msa(pipe_config, conn_state);
11181138 }
11191139
1140+static void enable_bs_jitter_was(const struct intel_crtc_state *crtc_state)
1141+{
1142+ struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
1143+ u32 clear = 0;
1144+ u32 set = 0;
1145+
1146+ if (!IS_ALDERLAKE_P(i915))
1147+ return;
1148+
1149+ if (!IS_DISPLAY_STEP(i915, STEP_D0, STEP_FOREVER))
1150+ return;
1151+
1152+ /* Wa_14013163432:adlp */
1153+ if (crtc_state->fec_enable || intel_dp_is_uhbr(crtc_state))
1154+ set |= DP_MST_FEC_BS_JITTER_WA(crtc_state->cpu_transcoder);
1155+
1156+ /* Wa_14014143976:adlp */
1157+ if (IS_DISPLAY_STEP(i915, STEP_E0, STEP_FOREVER)) {
1158+ if (intel_dp_is_uhbr(crtc_state))
1159+ set |= DP_MST_SHORT_HBLANK_WA(crtc_state->cpu_transcoder);
1160+ else if (crtc_state->fec_enable)
1161+ clear |= DP_MST_SHORT_HBLANK_WA(crtc_state->cpu_transcoder);
1162+
1163+ if (crtc_state->fec_enable || intel_dp_is_uhbr(crtc_state))
1164+ set |= DP_MST_DPT_DPTP_ALIGN_WA(crtc_state->cpu_transcoder);
1165+ }
1166+
1167+ if (!clear && !set)
1168+ return;
1169+
1170+ intel_de_rmw(i915, CHICKEN_MISC_3, clear, set);
1171+}
1172+
11201173 static void intel_mst_enable_dp(struct intel_atomic_state *state,
11211174 struct intel_encoder *encoder,
11221175 const struct intel_crtc_state *pipe_config,
@@ -1131,6 +1184,7 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state, · 8 unmodified lines
11311184 drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst_mgr);
11321185 enum transcoder trans = pipe_config->cpu_transcoder;
11331186 bool first_mst_stream = intel_dp->active_mst_links == 1;
1187+ struct intel_crtc *pipe_crtc;
11341188
11351189 drm_WARN_ON(&dev_priv->drm, pipe_config->has_pch_encoder);
11361190
@@ -1145,6 +1199,8 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state, · 8 unmodified lines
11451199 TRANS_DP2_VFREQ_PIXEL_CLOCK(crtc_clock_hz & 0xffffff));
11461200 }
11471201
1202+ enable_bs_jitter_was(pipe_config);
1203+
11481204 intel_ddi_enable_transcoder_func(encoder, pipe_config);
11491205
11501206 clear_act_sent(encoder, pipe_config);
@@ -1172,7 +1228,13 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state, · 21 unmodified lines
11721228
11731229 intel_enable_transcoder(pipe_config);
11741230
1175− intel_crtc_vblank_on(pipe_config);
1231+ for_each_intel_crtc_in_pipe_mask_reverse(&dev_priv->drm, pipe_crtc,
1232+ intel_crtc_joined_pipe_mask(pipe_config)) {
1233+ const struct intel_crtc_state *pipe_crtc_state =
1234+ intel_atomic_get_new_crtc_state(state, pipe_crtc);
1235+
1236+ intel_crtc_vblank_on(pipe_crtc_state);
1237+ }
11761238
11771239 intel_hdcp_enable(state, encoder, pipe_config, conn_state);
11781240 }
@@ -1285,7 +1347,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, · 106 unmodified lines
12851347 struct drm_dp_mst_topology_mgr *mgr = &intel_dp->mst_mgr;
12861348 struct drm_dp_mst_port *port = intel_connector->port;
12871349 const int min_bpp = 18;
1288− int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
1350+ int max_dotclk = to_i915(connector->dev)->display.cdclk.max_dotclk_freq;
12891351 int max_rate, mode_rate, max_lanes, max_link_clock;
12901352 int ret;
12911353 bool dsc = false, bigjoiner = false;
@@ -1302,8 +1364,13 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, · 10 unmodified lines
13021364 if (*status != MODE_OK)
13031365 return 0;
13041366
1305− if (mode->flags & DRM_MODE_FLAG_DBLSCAN) {
1306− *status = MODE_NO_DBLESCAN;
1367+ if (mode->flags & DRM_MODE_FLAG_DBLCLK) {
1368+ *status = MODE_H_ILLEGAL;
1369+ return 0;
1370+ }
1371+
1372+ if (mode->clock < 10000) {
1373+ *status = MODE_CLOCK_LOW;
13071374 return 0;
13081375 }
13091376
@@ -1314,10 +1381,6 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, · 4 unmodified lines
13141381 max_link_clock, max_lanes);
13151382 mode_rate = intel_dp_link_required(mode->clock, min_bpp);
13161383
1317− ret = drm_modeset_lock(&mgr->base.lock, ctx);
1318− if (ret)
1319− return ret;
1320−
13211384 /*
13221385 * TODO:
13231386 * - Also check if compression would allow for the mode
@@ -1330,32 +1393,23 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, · 6 unmodified lines
13301393 * corresponding link capabilities of the sink) in case the
13311394 * stream is uncompressed for it by the last branch device.
13321395 */
1333− if (mode_rate > max_rate || mode->clock > max_dotclk ||
1334− drm_dp_calc_pbn_mode(mode->clock, min_bpp << 4) > port->full_pbn) {
1335− *status = MODE_CLOCK_HIGH;
1336− return 0;
1337− }
1338−
1339− if (mode->clock < 10000) {
1340− *status = MODE_CLOCK_LOW;
1341− return 0;
1342− }
1343−
1344− if (mode->flags & DRM_MODE_FLAG_DBLCLK) {
1345− *status = MODE_H_ILLEGAL;
1346− return 0;
1347− }
1348−
1349− if (intel_dp_need_bigjoiner(intel_dp, mode->hdisplay, target_clock)) {
1396+ if (intel_dp_need_bigjoiner(intel_dp, intel_connector,
1397+ mode->hdisplay, target_clock)) {
13501398 bigjoiner = true;
13511399 max_dotclk *= 2;
1400+ }
13521401
1353− /* TODO: add support for bigjoiner */
1402+ ret = drm_modeset_lock(&mgr->base.lock, ctx);
1403+ if (ret)
1404+ return ret;
1405+
1406+ if (mode_rate > max_rate || mode->clock > max_dotclk ||
1407+ drm_dp_calc_pbn_mode(mode->clock, min_bpp << 4) > port->full_pbn) {
13541408 *status = MODE_CLOCK_HIGH;
13551409 return 0;
13561410 }
13571411
1358− if (DISPLAY_VER(dev_priv) >= 10 &&
1412+ if (HAS_DSC_MST(dev_priv) &&
13591413 drm_dp_sink_supports_dsc(intel_connector->dp.dsc_dpcd)) {
13601414 /*
13611415 * TBD pass the connector BPC,
@@ -1383,11 +1437,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, · 21 unmodified lines
13831437 dsc = dsc_max_compressed_bpp && dsc_slice_count;
13841438 }
13851439
1386− /*
1387− * Big joiner configuration needs DSC for TGL which is not true for
1388− * XE_LPD where uncompressed joiner is supported.
1389− */
1390− if (DISPLAY_VER(dev_priv) < 13 && bigjoiner && !dsc) {
1440+ if (intel_dp_joiner_needs_dsc(dev_priv, bigjoiner) && !dsc) {
13911441 *status = MODE_CLOCK_HIGH;
13921442 return 0;
13931443 }
@@ -1397,7 +1447,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector, · 3 unmodified lines
13971447 return 0;
13981448 }
13991449
1400− *status = intel_mode_valid_max_plane_size(dev_priv, mode, false);
1450+ *status = intel_mode_valid_max_plane_size(dev_priv, mode, bigjoiner);
14011451 return 0;
14021452 }
14031453
drivers/gpu/drm/i915/display/intel_dp_tunnel.c+1−1
@@ -348,7 +348,7 @@ void intel_dp_tunnel_resume(struct intel_dp *intel_dp, · 347 unmodified lines
348348
349349 out_err:
350350 drm_dbg_kms(&i915->drm,
351− "[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s] Tunnel can't be resumed, will drop and redect it (err %pe)\n",
351+ "[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s] Tunnel can't be resumed, will drop and reject it (err %pe)\n",
352352 drm_dp_tunnel_name(intel_dp->tunnel),
353353 connector->base.base.id, connector->base.name,
354354 encoder->base.base.id, encoder->base.name,
drivers/gpu/drm/i915/display/intel_dpio_phy.c+2−5
@@ -399,11 +399,8 @@ static void _bxt_ddi_phy_init(struct drm_i915_private *dev_priv, · 398 unmodified lines
399399 * The flag should get set in 100us according to the HW team, but
400400 * use 1ms due to occasional timeouts observed with that.
401401 */
402− if (intel_wait_for_register_fw(&dev_priv->uncore,
403− BXT_PORT_CL1CM_DW0(phy),
404− PHY_RESERVED | PHY_POWER_GOOD,
405− PHY_POWER_GOOD,
406− 1))
402+ if (intel_de_wait_fw(dev_priv, BXT_PORT_CL1CM_DW0(phy),
403+ PHY_RESERVED | PHY_POWER_GOOD, PHY_POWER_GOOD, 1))
407404 drm_err(&dev_priv->drm, "timeout during PHY%d power on\n",
408405 phy);
409406
drivers/gpu/drm/i915/display/intel_dpll_mgr.c+54−73
@@ -107,7 +107,7 @@ struct intel_dpll_mgr { · 106 unmodified lines
107107 struct intel_crtc *crtc,
108108 struct intel_encoder *encoder);
109109 void (*update_ref_clks)(struct drm_i915_private *i915);
110− void (*dump_hw_state)(struct drm_i915_private *i915,
110+ void (*dump_hw_state)(struct drm_printer *p,
111111 const struct intel_dpll_hw_state *hw_state);
112112 bool (*compare_hw_state)(const struct intel_dpll_hw_state *a,
113113 const struct intel_dpll_hw_state *b);
@@ -634,16 +634,15 @@ static int ibx_get_dpll(struct intel_atomic_state *state, · 520 unmodified lines
634634 return 0;
635635 }
636636
637−static void ibx_dump_hw_state(struct drm_i915_private *i915,
637+static void ibx_dump_hw_state(struct drm_printer *p,
638638 const struct intel_dpll_hw_state *hw_state)
639639 {
640− drm_dbg_kms(&i915->drm,
641− "dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, "
642− "fp0: 0x%x, fp1: 0x%x\n",
643− hw_state->dpll,
644− hw_state->dpll_md,
645− hw_state->fp0,
646− hw_state->fp1);
640+ drm_printf(p, "dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, "
641+ "fp0: 0x%x, fp1: 0x%x\n",
642+ hw_state->dpll,
643+ hw_state->dpll_md,
644+ hw_state->fp0,
645+ hw_state->fp1);
647646 }
648647
649648 static bool ibx_compare_hw_state(const struct intel_dpll_hw_state *a,
@@ -1225,11 +1224,11 @@ static void hsw_update_dpll_ref_clks(struct drm_i915_private *i915) · 575 unmodified lines
12251224 i915->display.dpll.ref_clks.nssc = 135000;
12261225 }
12271226
1228−static void hsw_dump_hw_state(struct drm_i915_private *i915,
1227+static void hsw_dump_hw_state(struct drm_printer *p,
12291228 const struct intel_dpll_hw_state *hw_state)
12301229 {
1231− drm_dbg_kms(&i915->drm, "dpll_hw_state: wrpll: 0x%x spll: 0x%x\n",
1232− hw_state->wrpll, hw_state->spll);
1230+ drm_printf(p, "dpll_hw_state: wrpll: 0x%x spll: 0x%x\n",
1231+ hw_state->wrpll, hw_state->spll);
12331232 }
12341233
12351234 static bool hsw_compare_hw_state(const struct intel_dpll_hw_state *a,
@@ -1939,14 +1938,11 @@ static void skl_update_dpll_ref_clks(struct drm_i915_private *i915) · 703 unmodified lines
19391938 i915->display.dpll.ref_clks.nssc = i915->display.cdclk.hw.ref;
19401939 }
19411940
1942−static void skl_dump_hw_state(struct drm_i915_private *i915,
1941+static void skl_dump_hw_state(struct drm_printer *p,
19431942 const struct intel_dpll_hw_state *hw_state)
19441943 {
1945− drm_dbg_kms(&i915->drm, "dpll_hw_state: "
1946− "ctrl1: 0x%x, cfgcr1: 0x%x, cfgcr2: 0x%x\n",
1947− hw_state->ctrl1,
1948− hw_state->cfgcr1,
1949− hw_state->cfgcr2);
1944+ drm_printf(p, "dpll_hw_state: ctrl1: 0x%x, cfgcr1: 0x%x, cfgcr2: 0x%x\n",
1945+ hw_state->ctrl1, hw_state->cfgcr1, hw_state->cfgcr2);
19501946 }
19511947
19521948 static bool skl_compare_hw_state(const struct intel_dpll_hw_state *a,
@@ -2402,23 +2398,16 @@ static void bxt_update_dpll_ref_clks(struct drm_i915_private *i915) · 449 unmodified lines
24022398 /* DSI non-SSC ref 19.2MHz */
24032399 }
24042400
2405−static void bxt_dump_hw_state(struct drm_i915_private *i915,
2401+static void bxt_dump_hw_state(struct drm_printer *p,
24062402 const struct intel_dpll_hw_state *hw_state)
24072403 {
2408− drm_dbg_kms(&i915->drm, "dpll_hw_state: ebb0: 0x%x, ebb4: 0x%x,"
2409− "pll0: 0x%x, pll1: 0x%x, pll2: 0x%x, pll3: 0x%x, "
2410− "pll6: 0x%x, pll8: 0x%x, pll9: 0x%x, pll10: 0x%x, pcsdw12: 0x%x\n",
2411− hw_state->ebb0,
2412− hw_state->ebb4,
2413− hw_state->pll0,
2414− hw_state->pll1,
2415− hw_state->pll2,
2416− hw_state->pll3,
2417− hw_state->pll6,
2418− hw_state->pll8,
2419− hw_state->pll9,
2420− hw_state->pll10,
2421− hw_state->pcsdw12);
2404+ drm_printf(p, "dpll_hw_state: ebb0: 0x%x, ebb4: 0x%x,"
2405+ "pll0: 0x%x, pll1: 0x%x, pll2: 0x%x, pll3: 0x%x, "
2406+ "pll6: 0x%x, pll8: 0x%x, pll9: 0x%x, pll10: 0x%x, pcsdw12: 0x%x\n",
2407+ hw_state->ebb0, hw_state->ebb4,
2408+ hw_state->pll0, hw_state->pll1, hw_state->pll2, hw_state->pll3,
2409+ hw_state->pll6, hw_state->pll8, hw_state->pll9, hw_state->pll10,
2410+ hw_state->pcsdw12);
24222411 }
24232412
24242413 static bool bxt_compare_hw_state(const struct intel_dpll_hw_state *a,
@@ -3389,7 +3378,6 @@ static int icl_get_tc_phy_dplls(struct intel_atomic_state *state, · 964 unmodified lines
33893378 struct intel_crtc *crtc,
33903379 struct intel_encoder *encoder)
33913380 {
3392− struct drm_i915_private *i915 = to_i915(state->base.dev);
33933381 struct intel_crtc_state *crtc_state =
33943382 intel_atomic_get_new_crtc_state(state, crtc);
33953383 struct icl_port_dpll *port_dpll =
@@ -3408,8 +3396,7 @@ static int icl_get_tc_phy_dplls(struct intel_atomic_state *state, · 12 unmodified lines
34083396
34093397
34103398 port_dpll = &crtc_state->icl_port_dplls[ICL_PORT_DPLL_MG_PHY];
3411− dpll_id = icl_tc_port_to_pll_id(intel_port_to_tc(i915,
3412− encoder->port));
3399+ dpll_id = icl_tc_port_to_pll_id(intel_encoder_to_tc(encoder));
34133400 port_dpll->pll = intel_find_shared_dpll(state, crtc,
34143401 &port_dpll->hw_state,
34153402 BIT(dpll_id));
@@ -3435,15 +3422,12 @@ static int icl_compute_dplls(struct intel_atomic_state *state, · 19 unmodified lines
34353422 struct intel_crtc *crtc,
34363423 struct intel_encoder *encoder)
34373424 {
3438− struct drm_i915_private *i915 = to_i915(state->base.dev);
3439− enum phy phy = intel_port_to_phy(i915, encoder->port);
3440−
3441− if (intel_phy_is_combo(i915, phy))
3425+ if (intel_encoder_is_combo(encoder))
34423426 return icl_compute_combo_phy_dpll(state, crtc);
3443− else if (intel_phy_is_tc(i915, phy))
3427+ else if (intel_encoder_is_tc(encoder))
34443428 return icl_compute_tc_phy_dplls(state, crtc);
34453429
3446− MISSING_CASE(phy);
3430+ MISSING_CASE(encoder->port);
34473431
34483432 return 0;
34493433 }
@@ -3452,15 +3436,12 @@ static int icl_get_dplls(struct intel_atomic_state *state, · 2 unmodified lines
34523436 struct intel_crtc *crtc,
34533437 struct intel_encoder *encoder)
34543438 {
3455− struct drm_i915_private *i915 = to_i915(state->base.dev);
3456− enum phy phy = intel_port_to_phy(i915, encoder->port);
3457−
3458− if (intel_phy_is_combo(i915, phy))
3439+ if (intel_encoder_is_combo(encoder))
34593440 return icl_get_combo_phy_dpll(state, crtc, encoder);
3460− else if (intel_phy_is_tc(i915, phy))
3441+ else if (intel_encoder_is_tc(encoder))
34613442 return icl_get_tc_phy_dplls(state, crtc, encoder);
34623443
3463− MISSING_CASE(phy);
3444+ MISSING_CASE(encoder->port);
34643445
34653446 return -EINVAL;
34663447 }
@@ -4026,28 +4007,26 @@ static void icl_update_dpll_ref_clks(struct drm_i915_private *i915) · 559 unmodified lines
40264007 i915->display.dpll.ref_clks.nssc = i915->display.cdclk.hw.ref;
40274008 }
40284009
4029−static void icl_dump_hw_state(struct drm_i915_private *i915,
4010+static void icl_dump_hw_state(struct drm_printer *p,
40304011 const struct intel_dpll_hw_state *hw_state)
40314012 {
4032− drm_dbg_kms(&i915->drm,
4033− "dpll_hw_state: cfgcr0: 0x%x, cfgcr1: 0x%x, div0: 0x%x, "
4034− "mg_refclkin_ctl: 0x%x, hg_clktop2_coreclkctl1: 0x%x, "
4035− "mg_clktop2_hsclkctl: 0x%x, mg_pll_div0: 0x%x, "
4036− "mg_pll_div2: 0x%x, mg_pll_lf: 0x%x, "
4037− "mg_pll_frac_lock: 0x%x, mg_pll_ssc: 0x%x, "
4038− "mg_pll_bias: 0x%x, mg_pll_tdc_coldst_bias: 0x%x\n",
4039− hw_state->cfgcr0, hw_state->cfgcr1,
4040− hw_state->div0,
4041− hw_state->mg_refclkin_ctl,
4042− hw_state->mg_clktop2_coreclkctl1,
4043− hw_state->mg_clktop2_hsclkctl,
4044− hw_state->mg_pll_div0,
4045− hw_state->mg_pll_div1,
4046− hw_state->mg_pll_lf,
4047− hw_state->mg_pll_frac_lock,
4048− hw_state->mg_pll_ssc,
4049− hw_state->mg_pll_bias,
4050− hw_state->mg_pll_tdc_coldst_bias);
4013+ drm_printf(p, "dpll_hw_state: cfgcr0: 0x%x, cfgcr1: 0x%x, div0: 0x%x, "
4014+ "mg_refclkin_ctl: 0x%x, hg_clktop2_coreclkctl1: 0x%x, "
4015+ "mg_clktop2_hsclkctl: 0x%x, mg_pll_div0: 0x%x, "
4016+ "mg_pll_div2: 0x%x, mg_pll_lf: 0x%x, "
4017+ "mg_pll_frac_lock: 0x%x, mg_pll_ssc: 0x%x, "
4018+ "mg_pll_bias: 0x%x, mg_pll_tdc_coldst_bias: 0x%x\n",
4019+ hw_state->cfgcr0, hw_state->cfgcr1, hw_state->div0,
4020+ hw_state->mg_refclkin_ctl,
4021+ hw_state->mg_clktop2_coreclkctl1,
4022+ hw_state->mg_clktop2_hsclkctl,
4023+ hw_state->mg_pll_div0,
4024+ hw_state->mg_pll_div1,
4025+ hw_state->mg_pll_lf,
4026+ hw_state->mg_pll_frac_lock,
4027+ hw_state->mg_pll_ssc,
4028+ hw_state->mg_pll_bias,
4029+ hw_state->mg_pll_tdc_coldst_bias);
40514030 }
40524031
40534032 static bool icl_compare_hw_state(const struct intel_dpll_hw_state *a,
@@ -4514,22 +4493,24 @@ void intel_dpll_sanitize_state(struct drm_i915_private *i915) · 460 unmodified lines
45144493 }
45154494
45164495 /**
4517− * intel_dpll_dump_hw_state - write hw_state to dmesg
4496+ * intel_dpll_dump_hw_state - dump hw_state
45184497 * @i915: i915 drm device
4519− * @hw_state: hw state to be written to the log
4498+ * @p: where to print the state to
4499+ * @hw_state: hw state to be dumped
45204500 *
4521− * Write the relevant values in @hw_state to dmesg using drm_dbg_kms.
4501+ * Dumo out the relevant values in @hw_state.
45224502 */
45234503 void intel_dpll_dump_hw_state(struct drm_i915_private *i915,
4504+ struct drm_printer *p,
45244505 const struct intel_dpll_hw_state *hw_state)
45254506 {
45264507 if (i915->display.dpll.mgr) {
4527− i915->display.dpll.mgr->dump_hw_state(i915, hw_state);
4508+ i915->display.dpll.mgr->dump_hw_state(p, hw_state);
45284509 } else {
45294510 /* fallback for platforms that don't use the shared dpll
45304511 * infrastructure
45314512 */
4532− ibx_dump_hw_state(i915, hw_state);
4513+ ibx_dump_hw_state(p, hw_state);
45334514 }
45344515 }
45354516
drivers/gpu/drm/i915/display/intel_dpll_mgr.h+2−0
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636
3737 enum tc_port;
3838 struct drm_i915_private;
39+struct drm_printer;
3940 struct intel_atomic_state;
4041 struct intel_crtc;
4142 struct intel_crtc_state;
@@ -377,6 +378,7 @@ void intel_dpll_readout_hw_state(struct drm_i915_private *i915); · 335 unmodified lines
377378 void intel_dpll_sanitize_state(struct drm_i915_private *i915);
378379
379380 void intel_dpll_dump_hw_state(struct drm_i915_private *i915,
381+ struct drm_printer *p,
380382 const struct intel_dpll_hw_state *hw_state);
381383 bool intel_dpll_compare_hw_state(struct drm_i915_private *i915,
382384 const struct intel_dpll_hw_state *a,
drivers/gpu/drm/i915/display/intel_dsb.c+3−2
@@ -343,12 +343,13 @@ static int intel_dsb_dewake_scanline(const struct intel_crtc_state *crtc_state) · 342 unmodified lines
343343 static u32 dsb_chicken(struct intel_crtc *crtc)
344344 {
345345 if (crtc->mode_flags & I915_MODE_FLAG_VRR)
346− return DSB_CTRL_WAIT_SAFE_WINDOW |
346+ return DSB_SKIP_WAITS_EN |
347+ DSB_CTRL_WAIT_SAFE_WINDOW |
347348 DSB_CTRL_NO_WAIT_VBLANK |
348349 DSB_INST_WAIT_SAFE_WINDOW |
349350 DSB_INST_NO_WAIT_VBLANK;
350351 else
351− return 0;
352+ return DSB_SKIP_WAITS_EN;
352353 }
353354
354355 static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
drivers/gpu/drm/i915/display/intel_dsi.c+1−4
@@ -64,14 +64,11 @@ enum drm_mode_status intel_dsi_mode_valid(struct drm_connector *connector, · 63 unmodified lines
6464 struct intel_connector *intel_connector = to_intel_connector(connector);
6565 const struct drm_display_mode *fixed_mode =
6666 intel_panel_fixed_mode(intel_connector, mode);
67− int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
67+ int max_dotclk = to_i915(connector->dev)->display.cdclk.max_dotclk_freq;
6868 enum drm_mode_status status;
6969
7070 drm_dbg_kms(&dev_priv->drm, "\n");
7171
72− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
73− return MODE_NO_DBLESCAN;
74−
7572 status = intel_panel_mode_valid(intel_connector, mode);
7673 if (status != MODE_OK)
7774 return status;
drivers/gpu/drm/i915/display/intel_dvo.c+1−4
@@ -223,7 +223,7 @@ intel_dvo_mode_valid(struct drm_connector *_connector, · 222 unmodified lines
223223 struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
224224 const struct drm_display_mode *fixed_mode =
225225 intel_panel_fixed_mode(connector, mode);
226− int max_dotclk = to_i915(connector->base.dev)->max_dotclk_freq;
226+ int max_dotclk = to_i915(connector->base.dev)->display.cdclk.max_dotclk_freq;
227227 int target_clock = mode->clock;
228228 enum drm_mode_status status;
229229
@@ -231,9 +231,6 @@ intel_dvo_mode_valid(struct drm_connector *_connector, · 1 unmodified line
231231 if (status != MODE_OK)
232232 return status;
233233
234− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
235− return MODE_NO_DBLESCAN;
236−
237234 /* XXX: Validate clock range */
238235
239236 if (fixed_mode) {
drivers/gpu/drm/i915/display/intel_fb.c+3−3
@@ -1106,7 +1106,7 @@ static int intel_fb_offset_to_xy(int *x, int *y, · 1105 unmodified lines
11061106 {
11071107 struct drm_i915_private *i915 = to_i915(fb->dev);
11081108 unsigned int height;
1109− u32 alignment;
1109+ u32 alignment, unused;
11101110
11111111 if (DISPLAY_VER(i915) >= 12 &&
11121112 !intel_fb_needs_pot_stride_remap(to_intel_framebuffer(fb)) &&
@@ -1128,8 +1128,8 @@ static int intel_fb_offset_to_xy(int *x, int *y, · 15 unmodified lines
11281128 height = ALIGN(height, intel_tile_height(fb, color_plane));
11291129
11301130 /* Catch potential overflows early */
1131− if (add_overflows_t(u32, mul_u32_u32(height, fb->pitches[color_plane]),
1132− fb->offsets[color_plane])) {
1131+ if (check_add_overflow(mul_u32_u32(height, fb->pitches[color_plane]),
1132+ fb->offsets[color_plane], &unused)) {
11331133 drm_dbg_kms(&i915->drm,
11341134 "Bad offset 0x%08x or pitch %d for color plane %d\n",
11351135 fb->offsets[color_plane], fb->pitches[color_plane],
drivers/gpu/drm/i915/display/intel_fbc.c+29−3
@@ -826,10 +826,36 @@ static void intel_fbc_program_cfb(struct intel_fbc *fbc) · 825 unmodified lines
826826
827827 static void intel_fbc_program_workarounds(struct intel_fbc *fbc)
828828 {
829+ struct drm_i915_private *i915 = fbc->i915;
830+
831+ if (IS_SKYLAKE(i915) || IS_BROXTON(i915)) {
832+ /*
833+ * WaFbcHighMemBwCorruptionAvoidance:skl,bxt
834+ * Display WA #0883: skl,bxt
835+ */
836+ intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
837+ 0, DPFC_DISABLE_DUMMY0);
838+ }
839+
840+ if (IS_SKYLAKE(i915) || IS_KABYLAKE(i915) ||
841+ IS_COFFEELAKE(i915) || IS_COMETLAKE(i915)) {
842+ /*
843+ * WaFbcNukeOnHostModify:skl,kbl,cfl
844+ * Display WA #0873: skl,kbl,cfl
845+ */
846+ intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
847+ 0, DPFC_NUKE_ON_ANY_MODIFICATION);
848+ }
849+
850+ /* Wa_1409120013:icl,jsl,tgl,dg1 */
851+ if (IS_DISPLAY_VER(i915, 11, 12))
852+ intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
853+ 0, DPFC_CHICKEN_COMP_DUMMY_PIXEL);
854+
829855 /* Wa_22014263786:icl,jsl,tgl,dg1,rkl,adls,adlp,mtl */
830− if (DISPLAY_VER(fbc->i915) >= 11 && !IS_DG2(fbc->i915))
831− intel_de_rmw(fbc->i915, ILK_DPFC_CHICKEN(fbc->id), 0,
832− DPFC_CHICKEN_FORCE_SLB_INVALIDATION);
856+ if (DISPLAY_VER(i915) >= 11 && !IS_DG2(i915))
857+ intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
858+ 0, DPFC_CHICKEN_FORCE_SLB_INVALIDATION);
833859 }
834860
835861 static void __intel_fbc_cleanup_cfb(struct intel_fbc *fbc)
drivers/gpu/drm/i915/display/intel_fbdev.c+5−0
@@ -135,6 +135,9 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma) · 134 unmodified lines
135135 return i915_gem_fb_mmap(obj, vma);
136136 }
137137
138+__diag_push();
139+__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for fb ops");
140+
138141 static const struct fb_ops intelfb_ops = {
139142 .owner = THIS_MODULE,
140143 __FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
@@ -146,6 +149,8 @@ static const struct fb_ops intelfb_ops = { · 5 unmodified lines
146149 .fb_mmap = intel_fbdev_mmap,
147150 };
148151
152+__diag_pop();
153+
149154 static int intelfb_create(struct drm_fb_helper *helper,
150155 struct drm_fb_helper_surface_size *sizes)
151156 {
drivers/gpu/drm/i915/display/intel_fixed.hrenamed from drivers/gpu/drm/i915/i915_fixed.h+0−0

File renamed without changes.

drivers/gpu/drm/i915/display/intel_gmbus.c+1−1
@@ -411,7 +411,7 @@ gmbus_wait_idle(struct drm_i915_private *i915) · 410 unmodified lines
411411 add_wait_queue(&i915->display.gmbus.wait_queue, &wait);
412412 intel_de_write_fw(i915, GMBUS4(i915), irq_enable);
413413
414− ret = intel_de_wait_for_register_fw(i915, GMBUS2(i915), GMBUS_ACTIVE, 0, 10);
414+ ret = intel_de_wait_fw(i915, GMBUS2(i915), GMBUS_ACTIVE, 0, 10);
415415
416416 intel_de_write_fw(i915, GMBUS4(i915), 0);
417417 remove_wait_queue(&i915->display.gmbus.wait_queue, &wait);
drivers/gpu/drm/i915/display/intel_hdcp.c+3−3
@@ -369,9 +369,9 @@ static int intel_hdcp_load_keys(struct drm_i915_private *i915) · 368 unmodified lines
369369 }
370370
371371 /* Wait for the keys to load (500us) */
372− ret = __intel_wait_for_register(&i915->uncore, HDCP_KEY_STATUS,
373− HDCP_KEY_LOAD_DONE, HDCP_KEY_LOAD_DONE,
374− 10, 1, &val);
372+ ret = intel_de_wait_custom(i915, HDCP_KEY_STATUS,
373+ HDCP_KEY_LOAD_DONE, HDCP_KEY_LOAD_DONE,
374+ 10, 1, &val);
375375 if (ret)
376376 return ret;
377377 else if (!(val & HDCP_KEY_LOAD_STATUS))
drivers/gpu/drm/i915/display/intel_hdmi.c+56−40
@@ -114,6 +114,8 @@ static u32 g4x_infoframe_enable(unsigned int type) · 113 unmodified lines
114114 return VIDEO_DIP_ENABLE_GAMUT;
115115 case DP_SDP_VSC:
116116 return 0;
117+ case DP_SDP_ADAPTIVE_SYNC:
118+ return 0;
117119 case HDMI_INFOFRAME_TYPE_AVI:
118120 return VIDEO_DIP_ENABLE_AVI;
119121 case HDMI_INFOFRAME_TYPE_SPD:
@@ -137,6 +139,8 @@ static u32 hsw_infoframe_enable(unsigned int type) · 17 unmodified lines
137139 return VIDEO_DIP_ENABLE_GMP_HSW;
138140 case DP_SDP_VSC:
139141 return VIDEO_DIP_ENABLE_VSC_HSW;
142+ case DP_SDP_ADAPTIVE_SYNC:
143+ return VIDEO_DIP_ENABLE_AS_ADL;
140144 case DP_SDP_PPS:
141145 return VDIP_ENABLE_PPS;
142146 case HDMI_INFOFRAME_TYPE_AVI:
@@ -164,6 +168,8 @@ hsw_dip_data_reg(struct drm_i915_private *dev_priv, · 21 unmodified lines
164168 return HSW_TVIDEO_DIP_GMP_DATA(cpu_transcoder, i);
165169 case DP_SDP_VSC:
166170 return HSW_TVIDEO_DIP_VSC_DATA(cpu_transcoder, i);
171+ case DP_SDP_ADAPTIVE_SYNC:
172+ return ADL_TVIDEO_DIP_AS_SDP_DATA(cpu_transcoder, i);
167173 case DP_SDP_PPS:
168174 return ICL_VIDEO_DIP_PPS_DATA(cpu_transcoder, i);
169175 case HDMI_INFOFRAME_TYPE_AVI:
@@ -186,6 +192,8 @@ static int hsw_dip_data_size(struct drm_i915_private *dev_priv, · 16 unmodified lines
186192 switch (type) {
187193 case DP_SDP_VSC:
188194 return VIDEO_DIP_VSC_DATA_SIZE;
195+ case DP_SDP_ADAPTIVE_SYNC:
196+ return VIDEO_DIP_ASYNC_DATA_SIZE;
189197 case DP_SDP_PPS:
190198 return VIDEO_DIP_PPS_DATA_SIZE;
191199 case HDMI_PACKET_TYPE_GAMUT_METADATA:
@@ -563,6 +571,9 @@ static u32 hsw_infoframes_enabled(struct intel_encoder *encoder, · 371 unmodified lines
563571 if (DISPLAY_VER(dev_priv) >= 10)
564572 mask |= VIDEO_DIP_ENABLE_DRM_GLK;
565573
574+ if (HAS_AS_SDP(dev_priv))
575+ mask |= VIDEO_DIP_ENABLE_AS_ADL;
576+
566577 return val & mask;
567578 }
568579
@@ -570,6 +581,7 @@ static const u8 infoframe_type_to_idx[] = { · 1 unmodified line
570581 HDMI_PACKET_TYPE_GENERAL_CONTROL,
571582 HDMI_PACKET_TYPE_GAMUT_METADATA,
572583 DP_SDP_VSC,
584+ DP_SDP_ADAPTIVE_SYNC,
573585 HDMI_INFOFRAME_TYPE_AVI,
574586 HDMI_INFOFRAME_TYPE_SPD,
575587 HDMI_INFOFRAME_TYPE_VENDOR,
@@ -1212,7 +1224,7 @@ static void hsw_set_infoframes(struct intel_encoder *encoder, · 636 unmodified lines
12121224 val &= ~(VIDEO_DIP_ENABLE_VSC_HSW | VIDEO_DIP_ENABLE_AVI_HSW |
12131225 VIDEO_DIP_ENABLE_GCP_HSW | VIDEO_DIP_ENABLE_VS_HSW |
12141226 VIDEO_DIP_ENABLE_GMP_HSW | VIDEO_DIP_ENABLE_SPD_HSW |
1215− VIDEO_DIP_ENABLE_DRM_GLK);
1227+ VIDEO_DIP_ENABLE_DRM_GLK | VIDEO_DIP_ENABLE_AS_ADL);
12161228
12171229 if (!enable) {
12181230 intel_de_write(dev_priv, reg, val);
@@ -1832,7 +1844,7 @@ hdmi_port_clock_valid(struct intel_hdmi *hdmi, · 613 unmodified lines
18321844 bool has_hdmi_sink)
18331845 {
18341846 struct drm_i915_private *dev_priv = intel_hdmi_to_i915(hdmi);
1835− enum phy phy = intel_port_to_phy(dev_priv, hdmi_to_dig_port(hdmi)->base.port);
1847+ struct intel_encoder *encoder = &hdmi_to_dig_port(hdmi)->base;
18361848
18371849 if (clock < 25000)
18381850 return MODE_CLOCK_LOW;
@@ -1854,11 +1866,11 @@ hdmi_port_clock_valid(struct intel_hdmi *hdmi, · 15 unmodified lines
18541866 return MODE_CLOCK_RANGE;
18551867
18561868 /* ICL+ combo PHY PLL can't generate 500-533.2 MHz */
1857− if (intel_phy_is_combo(dev_priv, phy) && clock > 500000 && clock < 533200)
1869+ if (intel_encoder_is_combo(encoder) && clock > 500000 && clock < 533200)
18581870 return MODE_CLOCK_RANGE;
18591871
18601872 /* ICL+ TC PHY PLL can't generate 500-532.8 MHz */
1861− if (intel_phy_is_tc(dev_priv, phy) && clock > 500000 && clock < 532800)
1873+ if (intel_encoder_is_tc(encoder) && clock > 500000 && clock < 532800)
18621874 return MODE_CLOCK_RANGE;
18631875
18641876 /*
@@ -1981,7 +1993,7 @@ intel_hdmi_mode_valid(struct drm_connector *connector, · 116 unmodified lines
19811993 struct drm_i915_private *dev_priv = intel_hdmi_to_i915(hdmi);
19821994 enum drm_mode_status status;
19831995 int clock = mode->clock;
1984− int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
1996+ int max_dotclk = to_i915(connector->dev)->display.cdclk.max_dotclk_freq;
19851997 bool has_hdmi_sink = intel_has_hdmi_sink(hdmi, connector->state);
19861998 bool ycbcr_420_only;
19871999 enum intel_output_format sink_format;
@@ -2664,8 +2676,9 @@ bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder, · 676 unmodified lines
26642676 drm_scdc_set_scrambling(connector, scrambling);
26652677 }
26662678
2667−static u8 chv_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2679+static u8 chv_encoder_to_ddc_pin(struct intel_encoder *encoder)
26682680 {
2681+ enum port port = encoder->port;
26692682 u8 ddc_pin;
26702683
26712684 switch (port) {
@@ -2686,8 +2699,9 @@ static u8 chv_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port) · 14 unmodified lines
26862699 return ddc_pin;
26872700 }
26882701
2689−static u8 bxt_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2702+static u8 bxt_encoder_to_ddc_pin(struct intel_encoder *encoder)
26902703 {
2704+ enum port port = encoder->port;
26912705 u8 ddc_pin;
26922706
26932707 switch (port) {
@@ -2705,9 +2719,9 @@ static u8 bxt_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port) · 11 unmodified lines
27052719 return ddc_pin;
27062720 }
27072721
2708−static u8 cnp_port_to_ddc_pin(struct drm_i915_private *dev_priv,
2709− enum port port)
2722+static u8 cnp_encoder_to_ddc_pin(struct intel_encoder *encoder)
27102723 {
2724+ enum port port = encoder->port;
27112725 u8 ddc_pin;
27122726
27132727 switch (port) {
@@ -2731,22 +2745,23 @@ static u8 cnp_port_to_ddc_pin(struct drm_i915_private *dev_priv, · 17 unmodified lines
27312745 return ddc_pin;
27322746 }
27332747
2734−static u8 icl_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2748+static u8 icl_encoder_to_ddc_pin(struct intel_encoder *encoder)
27352749 {
2736− enum phy phy = intel_port_to_phy(dev_priv, port);
2750+ struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
2751+ enum port port = encoder->port;
27372752
2738− if (intel_phy_is_combo(dev_priv, phy))
2753+ if (intel_encoder_is_combo(encoder))
27392754 return GMBUS_PIN_1_BXT + port;
2740− else if (intel_phy_is_tc(dev_priv, phy))
2741− return GMBUS_PIN_9_TC1_ICP + intel_port_to_tc(dev_priv, port);
2755+ else if (intel_encoder_is_tc(encoder))
2756+ return GMBUS_PIN_9_TC1_ICP + intel_encoder_to_tc(encoder);
27422757
27432758 drm_WARN(&dev_priv->drm, 1, "Unknown port:%c\n", port_name(port));
27442759 return GMBUS_PIN_2_BXT;
27452760 }
27462761
2747−static u8 mcc_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2762+static u8 mcc_encoder_to_ddc_pin(struct intel_encoder *encoder)
27482763 {
2749− enum phy phy = intel_port_to_phy(dev_priv, port);
2764+ enum phy phy = intel_encoder_to_phy(encoder);
27502765 u8 ddc_pin;
27512766
27522767 switch (phy) {
@@ -2767,11 +2782,12 @@ static u8 mcc_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port) · 14 unmodified lines
27672782 return ddc_pin;
27682783 }
27692784
2770−static u8 rkl_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2785+static u8 rkl_encoder_to_ddc_pin(struct intel_encoder *encoder)
27712786 {
2772− enum phy phy = intel_port_to_phy(dev_priv, port);
2787+ struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
2788+ enum phy phy = intel_encoder_to_phy(encoder);
27732789
2774− WARN_ON(port == PORT_C);
2790+ WARN_ON(encoder->port == PORT_C);
27752791
27762792 /*
27772793 * Pin mapping for RKL depends on which PCH is present. With TGP, the
@@ -2785,11 +2801,12 @@ static u8 rkl_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port) · 7 unmodified lines
27852801 return GMBUS_PIN_1_BXT + phy;
27862802 }
27872803
2788−static u8 gen9bc_tgp_port_to_ddc_pin(struct drm_i915_private *i915, enum port port)
2804+static u8 gen9bc_tgp_encoder_to_ddc_pin(struct intel_encoder *encoder)
27892805 {
2790− enum phy phy = intel_port_to_phy(i915, port);
2806+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
2807+ enum phy phy = intel_encoder_to_phy(encoder);
27912808
2792− drm_WARN_ON(&i915->drm, port == PORT_A);
2809+ drm_WARN_ON(&i915->drm, encoder->port == PORT_A);
27932810
27942811 /*
27952812 * Pin mapping for GEN9 BC depends on which PCH is present. With TGP,
@@ -2803,16 +2820,16 @@ static u8 gen9bc_tgp_port_to_ddc_pin(struct drm_i915_private *i915, enum port po · 7 unmodified lines
28032820 return GMBUS_PIN_1_BXT + phy;
28042821 }
28052822
2806−static u8 dg1_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2823+static u8 dg1_encoder_to_ddc_pin(struct intel_encoder *encoder)
28072824 {
2808− return intel_port_to_phy(dev_priv, port) + 1;
2825+ return intel_encoder_to_phy(encoder) + 1;
28092826 }
28102827
2811−static u8 adls_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
2828+static u8 adls_encoder_to_ddc_pin(struct intel_encoder *encoder)
28122829 {
2813− enum phy phy = intel_port_to_phy(dev_priv, port);
2830+ enum phy phy = intel_encoder_to_phy(encoder);
28142831
2815− WARN_ON(port == PORT_B || port == PORT_C);
2832+ WARN_ON(encoder->port == PORT_B || encoder->port == PORT_C);
28162833
28172834 /*
28182835 * Pin mapping for ADL-S requires TC pins for all combo phy outputs
@@ -2824,9 +2841,9 @@ static u8 adls_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port · 5 unmodified lines
28242841 return GMBUS_PIN_9_TC1_ICP + phy - PHY_B;
28252842 }
28262843
2827−static u8 g4x_port_to_ddc_pin(struct drm_i915_private *dev_priv,
2828− enum port port)
2844+static u8 g4x_encoder_to_ddc_pin(struct intel_encoder *encoder)
28292845 {
2846+ enum port port = encoder->port;
28302847 u8 ddc_pin;
28312848
28322849 switch (port) {
@@ -2850,30 +2867,29 @@ static u8 g4x_port_to_ddc_pin(struct drm_i915_private *dev_priv, · 17 unmodified lines
28502867 static u8 intel_hdmi_default_ddc_pin(struct intel_encoder *encoder)
28512868 {
28522869 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
2853− enum port port = encoder->port;
28542870 u8 ddc_pin;
28552871
28562872 if (IS_ALDERLAKE_S(dev_priv))
2857− ddc_pin = adls_port_to_ddc_pin(dev_priv, port);
2873+ ddc_pin = adls_encoder_to_ddc_pin(encoder);
28582874 else if (INTEL_PCH_TYPE(dev_priv) >= PCH_DG1)
2859− ddc_pin = dg1_port_to_ddc_pin(dev_priv, port);
2875+ ddc_pin = dg1_encoder_to_ddc_pin(encoder);
28602876 else if (IS_ROCKETLAKE(dev_priv))
2861− ddc_pin = rkl_port_to_ddc_pin(dev_priv, port);
2877+ ddc_pin = rkl_encoder_to_ddc_pin(encoder);
28622878 else if (DISPLAY_VER(dev_priv) == 9 && HAS_PCH_TGP(dev_priv))
2863− ddc_pin = gen9bc_tgp_port_to_ddc_pin(dev_priv, port);
2879+ ddc_pin = gen9bc_tgp_encoder_to_ddc_pin(encoder);
28642880 else if ((IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) &&
28652881 HAS_PCH_TGP(dev_priv))
2866− ddc_pin = mcc_port_to_ddc_pin(dev_priv, port);
2882+ ddc_pin = mcc_encoder_to_ddc_pin(encoder);
28672883 else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP)
2868− ddc_pin = icl_port_to_ddc_pin(dev_priv, port);
2884+ ddc_pin = icl_encoder_to_ddc_pin(encoder);
28692885 else if (HAS_PCH_CNP(dev_priv))
2870− ddc_pin = cnp_port_to_ddc_pin(dev_priv, port);
2886+ ddc_pin = cnp_encoder_to_ddc_pin(encoder);
28712887 else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
2872− ddc_pin = bxt_port_to_ddc_pin(dev_priv, port);
2888+ ddc_pin = bxt_encoder_to_ddc_pin(encoder);
28732889 else if (IS_CHERRYVIEW(dev_priv))
2874− ddc_pin = chv_port_to_ddc_pin(dev_priv, port);
2890+ ddc_pin = chv_encoder_to_ddc_pin(encoder);
28752891 else
2876− ddc_pin = g4x_port_to_ddc_pin(dev_priv, port);
2892+ ddc_pin = g4x_encoder_to_ddc_pin(encoder);
28772893
28782894 return ddc_pin;
28792895 }
drivers/gpu/drm/i915/display/intel_hotplug_irq.c+1−1
@@ -1444,7 +1444,7 @@ void intel_hpd_enable_detection(struct intel_encoder *encoder) · 1443 unmodified lines
14441444
14451445 void intel_hpd_irq_setup(struct drm_i915_private *i915)
14461446 {
1447− if (i915->display_irqs_enabled && i915->display.funcs.hotplug)
1447+ if (i915->display.irq.display_irqs_enabled && i915->display.funcs.hotplug)
14481448 i915->display.funcs.hotplug->hpd_irq_setup(i915);
14491449 }
14501450
drivers/gpu/drm/i915/display/intel_lvds.c+1−4
@@ -392,16 +392,13 @@ intel_lvds_mode_valid(struct drm_connector *_connector, · 391 unmodified lines
392392 struct drm_i915_private *i915 = to_i915(connector->base.dev);
393393 const struct drm_display_mode *fixed_mode =
394394 intel_panel_fixed_mode(connector, mode);
395− int max_pixclk = to_i915(connector->base.dev)->max_dotclk_freq;
395+ int max_pixclk = to_i915(connector->base.dev)->display.cdclk.max_dotclk_freq;
396396 enum drm_mode_status status;
397397
398398 status = intel_cpu_transcoder_mode_valid(i915, mode);
399399 if (status != MODE_OK)
400400 return status;
401401
402− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
403− return MODE_NO_DBLESCAN;
404−
405402 status = intel_panel_mode_valid(connector, mode);
406403 if (status != MODE_OK)
407404 return status;
drivers/gpu/drm/i915/display/intel_opregion.c+11−47
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727
2828 #include <linux/acpi.h>
2929 #include <linux/dmi.h>
30−#include <linux/firmware.h>
3130 #include <acpi/video.h>
3231
3332 #include <drm/drm_edid.h>
@@ -263,7 +262,6 @@ struct intel_opregion { · 229 unmodified lines
263262 struct opregion_asle *asle;
264263 struct opregion_asle_ext *asle_ext;
265264 void *rvda;
266− void *vbt_firmware;
267265 const void *vbt;
268266 u32 vbt_size;
269267 struct work_struct asle_work;
@@ -869,46 +867,6 @@ static const struct dmi_system_id intel_no_opregion_vbt[] = { · 599 unmodified lines
869867 { }
870868 };
871869
872−static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv)
873−{
874− struct intel_opregion *opregion = dev_priv->display.opregion;
875− const struct firmware *fw = NULL;
876− const char *name = dev_priv->display.params.vbt_firmware;
877− int ret;
878−
879− if (!name || !*name)
880− return -ENOENT;
881−
882− ret = request_firmware(&fw, name, dev_priv->drm.dev);
883− if (ret) {
884− drm_err(&dev_priv->drm,
885− "Requesting VBT firmware \"%s\" failed (%d)\n",
886− name, ret);
887− return ret;
888− }
889−
890− if (intel_bios_is_valid_vbt(dev_priv, fw->data, fw->size)) {
891− opregion->vbt_firmware = kmemdup(fw->data, fw->size, GFP_KERNEL);
892− if (opregion->vbt_firmware) {
893− drm_dbg_kms(&dev_priv->drm,
894− "Found valid VBT firmware \"%s\"\n", name);
895− opregion->vbt = opregion->vbt_firmware;
896− opregion->vbt_size = fw->size;
897− ret = 0;
898− } else {
899− ret = -ENOMEM;
900− }
901− } else {
902− drm_dbg_kms(&dev_priv->drm, "Invalid VBT firmware \"%s\"\n",
903− name);
904− ret = -EINVAL;
905− }
906−
907− release_firmware(fw);
908−
909− return ret;
910−}
911−
912870 int intel_opregion_setup(struct drm_i915_private *dev_priv)
913871 {
914872 struct intel_opregion *opregion;
@@ -1006,9 +964,6 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv) · 91 unmodified lines
1006964 drm_dbg(&dev_priv->drm, "Mailbox #2 for backlight present\n");
1007965 }
1008966
1009− if (intel_load_vbt_firmware(dev_priv) == 0)
1010− goto out;
1011−
1012967 if (dmi_check_system(intel_no_opregion_vbt))
1013968 goto out;
1014969
@@ -1176,6 +1131,16 @@ const struct drm_edid *intel_opregion_get_edid(struct intel_connector *intel_con · 161 unmodified lines
11761131 return drm_edid;
11771132 }
11781133
1134+bool intel_opregion_vbt_present(struct drm_i915_private *i915)
1135+{
1136+ struct intel_opregion *opregion = i915->display.opregion;
1137+
1138+ if (!opregion || !opregion->vbt)
1139+ return false;
1140+
1141+ return true;
1142+}
1143+
11791144 const void *intel_opregion_get_vbt(struct drm_i915_private *i915, size_t *size)
11801145 {
11811146 struct intel_opregion *opregion = i915->display.opregion;
@@ -1186,7 +1151,7 @@ const void *intel_opregion_get_vbt(struct drm_i915_private *i915, size_t *size) · 4 unmodified lines
11861151 if (size)
11871152 *size = opregion->vbt_size;
11881153
1189− return opregion->vbt;
1154+ return kmemdup(opregion->vbt, opregion->vbt_size, GFP_KERNEL);
11901155 }
11911156
11921157 bool intel_opregion_headless_sku(struct drm_i915_private *i915)
@@ -1312,7 +1277,6 @@ void intel_opregion_cleanup(struct drm_i915_private *i915) · 119 unmodified lines
13121277 memunmap(opregion->header);
13131278 if (opregion->rvda)
13141279 memunmap(opregion->rvda);
1315− kfree(opregion->vbt_firmware);
13161280 kfree(opregion);
13171281 i915->display.opregion = NULL;
13181282 }
drivers/gpu/drm/i915/display/intel_opregion.h+6−0
@@ -53,6 +53,7 @@ int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv, · 52 unmodified lines
5353 int intel_opregion_get_panel_type(struct drm_i915_private *dev_priv);
5454 const struct drm_edid *intel_opregion_get_edid(struct intel_connector *connector);
5555
56+bool intel_opregion_vbt_present(struct drm_i915_private *i915);
5657 const void *intel_opregion_get_vbt(struct drm_i915_private *i915, size_t *size);
5758
5859 bool intel_opregion_headless_sku(struct drm_i915_private *i915);
@@ -119,6 +120,11 @@ intel_opregion_get_edid(struct intel_connector *connector) · 60 unmodified lines
119120 return NULL;
120121 }
121122
123+static inline bool intel_opregion_vbt_present(struct drm_i915_private *i915)
124+{
125+ return false;
126+}
127+
122128 static inline const void *
123129 intel_opregion_get_vbt(struct drm_i915_private *i915, size_t *size)
124130 {
drivers/gpu/drm/i915/display/intel_overlay.c+4−3
@@ -972,10 +972,11 @@ static int check_overlay_dst(struct intel_overlay *overlay, · 971 unmodified lines
972972 rec->dst_width, rec->dst_height);
973973
974974 clipped = req;
975− drm_rect_intersect(&clipped, &crtc_state->pipe_src);
976975
977− if (!drm_rect_visible(&clipped) ||
978− !drm_rect_equals(&clipped, &req))
976+ if (!drm_rect_intersect(&clipped, &crtc_state->pipe_src))
977+ return -EINVAL;
978+
979+ if (!drm_rect_equals(&clipped, &req))
979980 return -EINVAL;
980981
981982 return 0;
drivers/gpu/drm/i915/display/intel_pmdemand.c+4−10
@@ -119,10 +119,11 @@ intel_pmdemand_update_phys_mask(struct drm_i915_private *i915, · 118 unmodified lines
119119 if (!encoder)
120120 return;
121121
122− phy = intel_port_to_phy(i915, encoder->port);
123− if (intel_phy_is_tc(i915, phy))
122+ if (intel_encoder_is_tc(encoder))
124123 return;
125124
125+ phy = intel_encoder_to_phy(encoder);
126+
126127 if (set_bit)
127128 pmdemand_state->active_combo_phys_mask |= BIT(phy);
128129 else
@@ -222,14 +223,7 @@ static bool · 93 unmodified lines
222223 intel_pmdemand_encoder_has_tc_phy(struct drm_i915_private *i915,
223224 struct intel_encoder *encoder)
224225 {
225− enum phy phy;
226−
227− if (!encoder)
228− return false;
229−
230− phy = intel_port_to_phy(i915, encoder->port);
231−
232− return intel_phy_is_tc(i915, phy);
226+ return encoder && intel_encoder_is_tc(encoder);
233227 }
234228
235229 static bool
drivers/gpu/drm/i915/display/intel_pmdemand.h+2−3
@@ -43,9 +43,8 @@ struct intel_pmdemand_state { · 42 unmodified lines
4343 struct pmdemand_params params;
4444 };
4545
46−#define to_intel_pmdemand_state(x) container_of((x), \
47− struct intel_pmdemand_state, \
48− base)
46+#define to_intel_pmdemand_state(global_state) \
47+ container_of_const((global_state), struct intel_pmdemand_state, base)
4948
5049 void intel_pmdemand_init_early(struct drm_i915_private *i915);
5150 int intel_pmdemand_init(struct drm_i915_private *i915);
drivers/gpu/drm/i915/display/intel_pps.c+32−2
@@ -605,8 +605,7 @@ static void wait_panel_status(struct intel_dp *intel_dp, · 604 unmodified lines
605605 intel_de_read(dev_priv, pp_stat_reg),
606606 intel_de_read(dev_priv, pp_ctrl_reg));
607607
608− if (intel_de_wait_for_register(dev_priv, pp_stat_reg,
609− mask, value, 5000))
608+ if (intel_de_wait(dev_priv, pp_stat_reg, mask, value, 5000))
610609 drm_err(&dev_priv->drm,
611610 "[ENCODER:%d:%s] %s panel status timeout: PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n",
612611 dig_port->base.base.base.id, dig_port->base.base.name,
@@ -1671,6 +1670,37 @@ void intel_pps_setup(struct drm_i915_private *i915) · 1058 unmodified lines
16711670 i915->display.pps.mmio_base = PPS_BASE;
16721671 }
16731672
1673+static int intel_pps_show(struct seq_file *m, void *data)
1674+{
1675+ struct intel_connector *connector = m->private;
1676+ struct intel_dp *intel_dp = intel_attached_dp(connector);
1677+
1678+ if (connector->base.status != connector_status_connected)
1679+ return -ENODEV;
1680+
1681+ seq_printf(m, "Panel power up delay: %d\n",
1682+ intel_dp->pps.panel_power_up_delay);
1683+ seq_printf(m, "Panel power down delay: %d\n",
1684+ intel_dp->pps.panel_power_down_delay);
1685+ seq_printf(m, "Backlight on delay: %d\n",
1686+ intel_dp->pps.backlight_on_delay);
1687+ seq_printf(m, "Backlight off delay: %d\n",
1688+ intel_dp->pps.backlight_off_delay);
1689+
1690+ return 0;
1691+}
1692+DEFINE_SHOW_ATTRIBUTE(intel_pps);
1693+
1694+void intel_pps_connector_debugfs_add(struct intel_connector *connector)
1695+{
1696+ struct dentry *root = connector->base.debugfs_entry;
1697+ int connector_type = connector->base.connector_type;
1698+
1699+ if (connector_type == DRM_MODE_CONNECTOR_eDP)
1700+ debugfs_create_file("i915_panel_timings", 0444, root,
1701+ connector, &intel_pps_fops);
1702+}
1703+
16741704 void assert_pps_unlocked(struct drm_i915_private *dev_priv, enum pipe pipe)
16751705 {
16761706 i915_reg_t pp_reg;
drivers/gpu/drm/i915/display/intel_pps.h+2−0
@@ -51,6 +51,8 @@ void vlv_pps_init(struct intel_encoder *encoder, · 50 unmodified lines
5151 void intel_pps_unlock_regs_wa(struct drm_i915_private *i915);
5252 void intel_pps_setup(struct drm_i915_private *i915);
5353
54+void intel_pps_connector_debugfs_add(struct intel_connector *connector);
55+
5456 void assert_pps_unlocked(struct drm_i915_private *i915, enum pipe pipe);
5557
5658 #endif /* __INTEL_PPS_H__ */
drivers/gpu/drm/i915/display/intel_psr.c+430−103
@@ -171,14 +171,27 @@ · 170 unmodified lines
171171 *
172172 * The rest of the bits are more self-explanatory and/or
173173 * irrelevant for normal operation.
174+ *
175+ * Description of intel_crtc_state variables. has_psr, has_panel_replay and
176+ * has_sel_update:
177+ *
178+ * has_psr (alone): PSR1
179+ * has_psr + has_sel_update: PSR2
180+ * has_psr + has_panel_replay: Panel Replay
181+ * has_psr + has_panel_replay + has_sel_update: Panel Replay Selective Update
182+ *
183+ * Description of some intel_psr varibles. enabled, panel_replay_enabled,
184+ * sel_update_enabled
185+ *
186+ * enabled (alone): PSR1
187+ * enabled + sel_update_enabled: PSR2
188+ * enabled + panel_replay_enabled: Panel Replay
189+ * enabled + panel_replay_enabled + sel_update_enabled: Panel Replay SU
174190 */
175191
176192 #define CAN_PSR(intel_dp) ((intel_dp)->psr.sink_support && \
177193 (intel_dp)->psr.source_support)
178194
179−#define CAN_PANEL_REPLAY(intel_dp) ((intel_dp)->psr.sink_panel_replay_support && \
180− (intel_dp)->psr.source_panel_replay_support)
181−
182195 bool intel_encoder_can_psr(struct intel_encoder *encoder)
183196 {
184197 if (intel_encoder_is_dp(encoder) || encoder->type == INTEL_OUTPUT_DP_MST)
@@ -330,6 +343,9 @@ static void psr_irq_control(struct intel_dp *intel_dp) · 145 unmodified lines
330343 enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
331344 u32 mask;
332345
346+ if (intel_dp->psr.panel_replay_enabled)
347+ return;
348+
333349 mask = psr_irq_psr_error_bit_get(intel_dp);
334350 if (intel_dp->psr.debug & I915_PSR_DEBUG_IRQ)
335351 mask |= psr_irq_post_exit_bit_get(intel_dp) |
@@ -619,40 +635,59 @@ static bool psr2_su_region_et_valid(struct intel_dp *intel_dp) · 283 unmodified lines
619635 return false;
620636 }
621637
622−static void intel_psr_enable_sink(struct intel_dp *intel_dp)
638+static unsigned int intel_psr_get_enable_sink_offset(struct intel_dp *intel_dp)
639+{
640+ return intel_dp->psr.panel_replay_enabled ?
641+ PANEL_REPLAY_CONFIG : DP_PSR_EN_CFG;
642+}
643+
644+/*
645+ * Note: Most of the bits are same in PANEL_REPLAY_CONFIG and DP_PSR_EN_CFG. We
646+ * are relying on PSR definitions on these "common" bits.
647+ */
648+void intel_psr_enable_sink(struct intel_dp *intel_dp,
649+ const struct intel_crtc_state *crtc_state)
623650 {
624651 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
625652 u8 dpcd_val = DP_PSR_ENABLE;
626653
627− if (intel_dp->psr.panel_replay_enabled)
628− return;
629−
630− if (intel_dp->psr.psr2_enabled) {
654+ if (crtc_state->has_psr2) {
631655 /* Enable ALPM at sink for psr2 */
632− drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG,
633− DP_ALPM_ENABLE |
634− DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE);
656+ if (!crtc_state->has_panel_replay) {
657+ drm_dp_dpcd_writeb(&intel_dp->aux,
658+ DP_RECEIVER_ALPM_CONFIG,
659+ DP_ALPM_ENABLE |
660+ DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE);
661+
662+ if (psr2_su_region_et_valid(intel_dp))
663+ dpcd_val |= DP_PSR_ENABLE_SU_REGION_ET;
664+ }
635665
636666 dpcd_val |= DP_PSR_ENABLE_PSR2 | DP_PSR_IRQ_HPD_WITH_CRC_ERRORS;
637− if (psr2_su_region_et_valid(intel_dp))
638− dpcd_val |= DP_PSR_ENABLE_SU_REGION_ET;
639667 } else {
640668 if (intel_dp->psr.link_standby)
641669 dpcd_val |= DP_PSR_MAIN_LINK_ACTIVE;
642670
643− if (DISPLAY_VER(dev_priv) >= 8)
671+ if (!crtc_state->has_panel_replay && DISPLAY_VER(dev_priv) >= 8)
644672 dpcd_val |= DP_PSR_CRC_VERIFICATION;
645673 }
646674
647− if (intel_dp->psr.req_psr2_sdp_prior_scanline)
675+ if (crtc_state->has_panel_replay)
676+ dpcd_val |= DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN |
677+ DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN;
678+
679+ if (crtc_state->req_psr2_sdp_prior_scanline)
648680 dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE;
649681
650682 if (intel_dp->psr.entry_setup_frames > 0)
651683 dpcd_val |= DP_PSR_FRAME_CAPTURE;
652684
653− drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, dpcd_val);
685+ drm_dp_dpcd_writeb(&intel_dp->aux,
686+ intel_psr_get_enable_sink_offset(intel_dp),
687+ dpcd_val);
654688
655− drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
689+ if (intel_dp_is_edp(intel_dp))
690+ drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
656691 }
657692
658693 static u32 intel_psr1_get_tp_time(struct intel_dp *intel_dp)
@@ -1126,6 +1161,141 @@ static bool _compute_psr2_sdp_prior_scanline_indication(struct intel_dp *intel_d · 467 unmodified lines
11261161 return true;
11271162 }
11281163
1164+/*
1165+ * See Bspec: 71632 for the table
1166+ *
1167+ * Silence_period = tSilence,Min + ((tSilence,Max - tSilence,Min) / 2)
1168+ *
1169+ * Half cycle duration:
1170+ *
1171+ * Link rates 1.62 - 4.32 and tLFPS_Cycle = 70 ns
1172+ * FLOOR( (Link Rate * tLFPS_Cycle) / (2 * 10) )
1173+ *
1174+ * Link rates 5.4 - 8.1
1175+ * PORT_ALPM_LFPS_CTL[ LFPS Cycle Count ] = 10
1176+ * LFPS Period chosen is the mid-point of the min:max values from the table
1177+ * FLOOR( LFPS Period in Symbol clocks /
1178+ * (2 * PORT_ALPM_LFPS_CTL[ LFPS Cycle Count ]) )
1179+ */
1180+static bool _lnl_get_silence_period_and_lfps_half_cycle(int link_rate,
1181+ int *silence_period,
1182+ int *lfps_half_cycle)
1183+{
1184+ switch (link_rate) {
1185+ case 162000:
1186+ *silence_period = 20;
1187+ *lfps_half_cycle = 5;
1188+ break;
1189+ case 216000:
1190+ *silence_period = 27;
1191+ *lfps_half_cycle = 7;
1192+ break;
1193+ case 243000:
1194+ *silence_period = 31;
1195+ *lfps_half_cycle = 8;
1196+ break;
1197+ case 270000:
1198+ *silence_period = 34;
1199+ *lfps_half_cycle = 9;
1200+ break;
1201+ case 324000:
1202+ *silence_period = 41;
1203+ *lfps_half_cycle = 11;
1204+ break;
1205+ case 432000:
1206+ *silence_period = 56;
1207+ *lfps_half_cycle = 15;
1208+ break;
1209+ case 540000:
1210+ *silence_period = 69;
1211+ *lfps_half_cycle = 12;
1212+ break;
1213+ case 648000:
1214+ *silence_period = 84;
1215+ *lfps_half_cycle = 15;
1216+ break;
1217+ case 675000:
1218+ *silence_period = 87;
1219+ *lfps_half_cycle = 15;
1220+ break;
1221+ case 810000:
1222+ *silence_period = 104;
1223+ *lfps_half_cycle = 19;
1224+ break;
1225+ default:
1226+ *silence_period = *lfps_half_cycle = -1;
1227+ return false;
1228+ }
1229+ return true;
1230+}
1231+
1232+/*
1233+ * AUX-Less Wake Time = CEILING( ((PHY P2 to P0) + tLFPS_Period, Max+
1234+ * tSilence, Max+ tPHY Establishment + tCDS) / tline)
1235+ * For the "PHY P2 to P0" latency see the PHY Power Control page
1236+ * (PHY P2 to P0) : https://gfxspecs.intel.com/Predator/Home/Index/68965
1237+ * : 12 us
1238+ * The tLFPS_Period, Max term is 800ns
1239+ * The tSilence, Max term is 180ns
1240+ * The tPHY Establishment (a.k.a. t1) term is 50us
1241+ * The tCDS term is 1 or 2 times t2
1242+ * t2 = Number ML_PHY_LOCK * tML_PHY_LOCK
1243+ * Number ML_PHY_LOCK = ( 7 + CEILING( 6.5us / tML_PHY_LOCK ) + 1)
1244+ * Rounding up the 6.5us padding to the next ML_PHY_LOCK boundary and
1245+ * adding the "+ 1" term ensures all ML_PHY_LOCK sequences that start
1246+ * within the CDS period complete within the CDS period regardless of
1247+ * entry into the period
1248+ * tML_PHY_LOCK = TPS4 Length * ( 10 / (Link Rate in MHz) )
1249+ * TPS4 Length = 252 Symbols
1250+ */
1251+static int _lnl_compute_aux_less_wake_time(int port_clock)
1252+{
1253+ int tphy2_p2_to_p0 = 12 * 1000;
1254+ int tlfps_period_max = 800;
1255+ int tsilence_max = 180;
1256+ int t1 = 50 * 1000;
1257+ int tps4 = 252;
1258+ int tml_phy_lock = 1000 * 1000 * tps4 * 10 / port_clock;
1259+ int num_ml_phy_lock = 7 + DIV_ROUND_UP(6500, tml_phy_lock) + 1;
1260+ int t2 = num_ml_phy_lock * tml_phy_lock;
1261+ int tcds = 1 * t2;
1262+
1263+ return DIV_ROUND_UP(tphy2_p2_to_p0 + tlfps_period_max + tsilence_max +
1264+ t1 + tcds, 1000);
1265+}
1266+
1267+static int _lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp,
1268+ struct intel_crtc_state *crtc_state)
1269+{
1270+ struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1271+ int aux_less_wake_time, aux_less_wake_lines, silence_period,
1272+ lfps_half_cycle;
1273+
1274+ aux_less_wake_time =
1275+ _lnl_compute_aux_less_wake_time(crtc_state->port_clock);
1276+ aux_less_wake_lines = intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode,
1277+ aux_less_wake_time);
1278+
1279+ if (!_lnl_get_silence_period_and_lfps_half_cycle(crtc_state->port_clock,
1280+ &silence_period,
1281+ &lfps_half_cycle))
1282+ return false;
1283+
1284+ if (aux_less_wake_lines > ALPM_CTL_AUX_LESS_WAKE_TIME_MASK ||
1285+ silence_period > PORT_ALPM_CTL_SILENCE_PERIOD_MASK ||
1286+ lfps_half_cycle > PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK)
1287+ return false;
1288+
1289+ if (i915->display.params.psr_safest_params)
1290+ aux_less_wake_lines = ALPM_CTL_AUX_LESS_WAKE_TIME_MASK;
1291+
1292+ intel_dp->psr.alpm_parameters.fast_wake_lines = aux_less_wake_lines;
1293+ intel_dp->psr.alpm_parameters.silence_period_sym_clocks = silence_period;
1294+ intel_dp->psr.alpm_parameters.lfps_half_cycle_num_of_syms = lfps_half_cycle;
1295+
1296+ return true;
1297+}
1298+
11291299 static bool _lnl_compute_alpm_params(struct intel_dp *intel_dp,
11301300 struct intel_crtc_state *crtc_state)
11311301 {
@@ -1142,6 +1312,9 @@ static bool _lnl_compute_alpm_params(struct intel_dp *intel_dp, · 10 unmodified lines
11421312 if (check_entry_lines > 15)
11431313 return false;
11441314
1315+ if (!_lnl_compute_aux_less_alpm_params(intel_dp, crtc_state))
1316+ return false;
1317+
11451318 if (i915->display.params.psr_safest_params)
11461319 check_entry_lines = 15;
11471320
@@ -1150,28 +1323,52 @@ static bool _lnl_compute_alpm_params(struct intel_dp *intel_dp, · 2 unmodified lines
11501323 return true;
11511324 }
11521325
1326+/*
1327+ * IO wake time for DISPLAY_VER < 12 is not directly mentioned in Bspec. There
1328+ * are 50 us io wake time and 32 us fast wake time. Clearly preharge pulses are
1329+ * not (improperly) included in 32 us fast wake time. 50 us - 32 us = 18 us.
1330+ */
1331+static int skl_io_buffer_wake_time(void)
1332+{
1333+ return 18;
1334+}
1335+
1336+static int tgl_io_buffer_wake_time(void)
1337+{
1338+ return 10;
1339+}
1340+
1341+static int io_buffer_wake_time(const struct intel_crtc_state *crtc_state)
1342+{
1343+ struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
1344+
1345+ if (DISPLAY_VER(i915) >= 12)
1346+ return tgl_io_buffer_wake_time();
1347+ else
1348+ return skl_io_buffer_wake_time();
1349+}
1350+
11531351 static bool _compute_alpm_params(struct intel_dp *intel_dp,
11541352 struct intel_crtc_state *crtc_state)
11551353 {
11561354 struct drm_i915_private *i915 = dp_to_i915(intel_dp);
11571355 int io_wake_lines, io_wake_time, fast_wake_lines, fast_wake_time;
1356+ int tfw_exit_latency = 20; /* eDP spec */
1357+ int phy_wake = 4; /* eDP spec */
1358+ int preamble = 8; /* eDP spec */
1359+ int precharge = intel_dp_aux_fw_sync_len() - preamble;
11581360 u8 max_wake_lines;
11591361
1160− if (DISPLAY_VER(i915) >= 12) {
1161− io_wake_time = 42;
1162− /*
1163− * According to Bspec it's 42us, but based on testing
1164− * it is not enough -> use 45 us.
1165− */
1166− fast_wake_time = 45;
1362+ io_wake_time = max(precharge, io_buffer_wake_time(crtc_state)) +
1363+ preamble + phy_wake + tfw_exit_latency;
1364+ fast_wake_time = precharge + preamble + phy_wake +
1365+ tfw_exit_latency;
11671366
1367+ if (DISPLAY_VER(i915) >= 12)
11681368 /* TODO: Check how we can use ALPM_CTL fast wake extended field */
11691369 max_wake_lines = 12;
1170− } else {
1171− io_wake_time = 50;
1172− fast_wake_time = 32;
1370+ else
11731371 max_wake_lines = 8;
1174− }
11751372
11761373 io_wake_lines = intel_usecs_to_scanlines(
11771374 &crtc_state->hw.adjusted_mode, io_wake_time);
@@ -1422,12 +1619,24 @@ void intel_psr_compute_config(struct intel_dp *intel_dp, · 244 unmodified lines
14221619 return;
14231620 }
14241621
1622+ /*
1623+ * FIXME figure out what is wrong with PSR+bigjoiner and
1624+ * fix it. Presumably something related to the fact that
1625+ * PSR is a transcoder level feature.
1626+ */
1627+ if (crtc_state->bigjoiner_pipes) {
1628+ drm_dbg_kms(&dev_priv->drm,
1629+ "PSR disabled due to bigjoiner\n");
1630+ return;
1631+ }
1632+
14251633 if (CAN_PANEL_REPLAY(intel_dp))
14261634 crtc_state->has_panel_replay = true;
1427− else
1428− crtc_state->has_psr = _psr_compute_config(intel_dp, crtc_state);
14291635
1430− if (!(crtc_state->has_panel_replay || crtc_state->has_psr))
1636+ crtc_state->has_psr = crtc_state->has_panel_replay ? true :
1637+ _psr_compute_config(intel_dp, crtc_state);
1638+
1639+ if (!crtc_state->has_psr)
14311640 return;
14321641
14331642 crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp, crtc_state);
@@ -1454,7 +1663,7 @@ void intel_psr_get_config(struct intel_encoder *encoder, · 20 unmodified lines
14541663 goto unlock;
14551664
14561665 if (intel_dp->psr.panel_replay_enabled) {
1457− pipe_config->has_panel_replay = true;
1666+ pipe_config->has_psr = pipe_config->has_panel_replay = true;
14581667 } else {
14591668 /*
14601669 * Not possible to read EDP_PSR/PSR2_CTL registers as it is
@@ -1559,14 +1768,44 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp) · 98 unmodified lines
15591768 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
15601769 enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
15611770 struct intel_psr *psr = &intel_dp->psr;
1771+ u32 alpm_ctl;
15621772
1563− if (DISPLAY_VER(dev_priv) < 20)
1773+ if (DISPLAY_VER(dev_priv) < 20 || (!intel_dp->psr.psr2_enabled &&
1774+ !intel_dp_is_edp(intel_dp)))
15641775 return;
15651776
1566− intel_de_write(dev_priv, ALPM_CTL(cpu_transcoder),
1567− ALPM_CTL_EXTENDED_FAST_WAKE_ENABLE |
1568− ALPM_CTL_ALPM_ENTRY_CHECK(psr->alpm_parameters.check_entry_lines) |
1569− ALPM_CTL_EXTENDED_FAST_WAKE_TIME(psr->alpm_parameters.fast_wake_lines));
1777+ /*
1778+ * Panel Replay on eDP is always using ALPM aux less. I.e. no need to
1779+ * check panel support at this point.
1780+ */
1781+ if (intel_dp->psr.panel_replay_enabled && intel_dp_is_edp(intel_dp)) {
1782+ alpm_ctl = ALPM_CTL_ALPM_ENABLE |
1783+ ALPM_CTL_ALPM_AUX_LESS_ENABLE |
1784+ ALPM_CTL_AUX_LESS_SLEEP_HOLD_TIME_50_SYMBOLS;
1785+
1786+ intel_de_write(dev_priv, PORT_ALPM_CTL(cpu_transcoder),
1787+ PORT_ALPM_CTL_ALPM_AUX_LESS_ENABLE |
1788+ PORT_ALPM_CTL_MAX_PHY_SWING_SETUP(15) |
1789+ PORT_ALPM_CTL_MAX_PHY_SWING_HOLD(0) |
1790+ PORT_ALPM_CTL_SILENCE_PERIOD(
1791+ psr->alpm_parameters.silence_period_sym_clocks));
1792+
1793+ intel_de_write(dev_priv, PORT_ALPM_LFPS_CTL(cpu_transcoder),
1794+ PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT(10) |
1795+ PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION(
1796+ psr->alpm_parameters.lfps_half_cycle_num_of_syms) |
1797+ PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION(
1798+ psr->alpm_parameters.lfps_half_cycle_num_of_syms) |
1799+ PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION(
1800+ psr->alpm_parameters.lfps_half_cycle_num_of_syms));
1801+ } else {
1802+ alpm_ctl = ALPM_CTL_EXTENDED_FAST_WAKE_ENABLE |
1803+ ALPM_CTL_EXTENDED_FAST_WAKE_TIME(psr->alpm_parameters.fast_wake_lines);
1804+ }
1805+
1806+ alpm_ctl |= ALPM_CTL_ALPM_ENTRY_CHECK(psr->alpm_parameters.check_entry_lines);
1807+
1808+ intel_de_write(dev_priv, ALPM_CTL(cpu_transcoder), alpm_ctl);
15701809 }
15711810
15721811 static void intel_psr_enable_source(struct intel_dp *intel_dp,
@@ -1574,7 +1813,7 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp, · 1 unmodified line
15741813 {
15751814 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
15761815 enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
1577− u32 mask;
1816+ u32 mask = 0;
15781817
15791818 /*
15801819 * Only HSW and BDW have PSR AUX registers that need to be setup.
@@ -1588,34 +1827,46 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp, · 7 unmodified lines
15881827 * mask LPSP to avoid dependency on other drivers that might block
15891828 * runtime_pm besides preventing other hw tracking issues now we
15901829 * can rely on frontbuffer tracking.
1830+ *
1831+ * From bspec prior LunarLake:
1832+ * Only PSR_MASK[Mask FBC modify] and PSR_MASK[Mask Hotplug] are used in
1833+ * panel replay mode.
1834+ *
1835+ * From bspec beyod LunarLake:
1836+ * Panel Replay on DP: No bits are applicable
1837+ * Panel Replay on eDP: All bits are applicable
15911838 */
1592− mask = EDP_PSR_DEBUG_MASK_MEMUP |
1593− EDP_PSR_DEBUG_MASK_HPD;
1839+ if (DISPLAY_VER(dev_priv) < 20 || intel_dp_is_edp(intel_dp))
1840+ mask = EDP_PSR_DEBUG_MASK_HPD;
15941841
1595− /*
1596− * For some unknown reason on HSW non-ULT (or at least on
1597− * Dell Latitude E6540) external displays start to flicker
1598− * when PSR is enabled on the eDP. SR/PC6 residency is much
1599− * higher than should be possible with an external display.
1600− * As a workaround leave LPSP unmasked to prevent PSR entry
1601− * when external displays are active.
1602− */
1603− if (DISPLAY_VER(dev_priv) >= 8 || IS_HASWELL_ULT(dev_priv))
1604− mask |= EDP_PSR_DEBUG_MASK_LPSP;
1842+ if (intel_dp_is_edp(intel_dp)) {
1843+ mask |= EDP_PSR_DEBUG_MASK_MEMUP;
16051844
1606− if (DISPLAY_VER(dev_priv) < 20)
1607− mask |= EDP_PSR_DEBUG_MASK_MAX_SLEEP;
1845+ /*
1846+ * For some unknown reason on HSW non-ULT (or at least on
1847+ * Dell Latitude E6540) external displays start to flicker
1848+ * when PSR is enabled on the eDP. SR/PC6 residency is much
1849+ * higher than should be possible with an external display.
1850+ * As a workaround leave LPSP unmasked to prevent PSR entry
1851+ * when external displays are active.
1852+ */
1853+ if (DISPLAY_VER(dev_priv) >= 8 || IS_HASWELL_ULT(dev_priv))
1854+ mask |= EDP_PSR_DEBUG_MASK_LPSP;
16081855
1609− /*
1610− * No separate pipe reg write mask on hsw/bdw, so have to unmask all
1611− * registers in order to keep the CURSURFLIVE tricks working :(
1612− */
1613− if (IS_DISPLAY_VER(dev_priv, 9, 10))
1614− mask |= EDP_PSR_DEBUG_MASK_DISP_REG_WRITE;
1856+ if (DISPLAY_VER(dev_priv) < 20)
1857+ mask |= EDP_PSR_DEBUG_MASK_MAX_SLEEP;
16151858
1616− /* allow PSR with sprite enabled */
1617− if (IS_HASWELL(dev_priv))
1618− mask |= EDP_PSR_DEBUG_MASK_SPRITE_ENABLE;
1859+ /*
1860+ * No separate pipe reg write mask on hsw/bdw, so have to unmask all
1861+ * registers in order to keep the CURSURFLIVE tricks working :(
1862+ */
1863+ if (IS_DISPLAY_VER(dev_priv, 9, 10))
1864+ mask |= EDP_PSR_DEBUG_MASK_DISP_REG_WRITE;
1865+
1866+ /* allow PSR with sprite enabled */
1867+ if (IS_HASWELL(dev_priv))
1868+ mask |= EDP_PSR_DEBUG_MASK_SPRITE_ENABLE;
1869+ }
16191870
16201871 intel_de_write(dev_priv, psr_debug_reg(dev_priv, cpu_transcoder), mask);
16211872
@@ -1634,7 +1885,8 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp, · 12 unmodified lines
16341885 intel_dp->psr.psr2_sel_fetch_enabled ?
16351886 IGNORE_PSR2_HW_TRACKING : 0);
16361887
1637− lnl_alpm_configure(intel_dp);
1888+ if (intel_dp_is_edp(intel_dp))
1889+ lnl_alpm_configure(intel_dp);
16381890
16391891 /*
16401892 * Wa_16013835468
@@ -1675,6 +1927,9 @@ static bool psr_interrupt_error_check(struct intel_dp *intel_dp) · 34 unmodified lines
16751927 enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
16761928 u32 val;
16771929
1930+ if (intel_dp->psr.panel_replay_enabled)
1931+ goto no_err;
1932+
16781933 /*
16791934 * If a PSR error happened and the driver is reloaded, the EDP_PSR_IIR
16801935 * will still keep the error set even after the reset done in the
@@ -1692,6 +1947,7 @@ static bool psr_interrupt_error_check(struct intel_dp *intel_dp) · 11 unmodified lines
16921947 return false;
16931948 }
16941949
1950+no_err:
16951951 return true;
16961952 }
16971953
@@ -1700,7 +1956,6 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp, · 2 unmodified lines
17001956 {
17011957 struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
17021958 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
1703− enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port);
17041959 u32 val;
17051960
17061961 drm_WARN_ON(&dev_priv->drm, intel_dp->psr.enabled);
@@ -1722,14 +1977,22 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp, · 15 unmodified lines
17221977 if (!psr_interrupt_error_check(intel_dp))
17231978 return;
17241979
1725− if (intel_dp->psr.panel_replay_enabled)
1980+ if (intel_dp->psr.panel_replay_enabled) {
17261981 drm_dbg_kms(&dev_priv->drm, "Enabling Panel Replay\n");
1727− else
1982+ } else {
17281983 drm_dbg_kms(&dev_priv->drm, "Enabling PSR%s\n",
17291984 intel_dp->psr.psr2_enabled ? "2" : "1");
17301985
1731− intel_snps_phy_update_psr_power_state(dev_priv, phy, true);
1732− intel_psr_enable_sink(intel_dp);
1986+ /*
1987+ * Panel replay has to be enabled before link training: doing it
1988+ * only for PSR here.
1989+ */
1990+ intel_psr_enable_sink(intel_dp, crtc_state);
1991+ }
1992+
1993+ if (intel_dp_is_edp(intel_dp))
1994+ intel_snps_phy_update_psr_power_state(&dig_port->base, true);
1995+
17331996 intel_psr_enable_source(intel_dp, crtc_state);
17341997 intel_dp->psr.enabled = true;
17351998 intel_dp->psr.paused = false;
@@ -1799,8 +2062,6 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp) · 63 unmodified lines
17992062 {
18002063 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
18012064 enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
1802− enum phy phy = intel_port_to_phy(dev_priv,
1803− dp_to_dig_port(intel_dp)->base.port);
18042065
18052066 lockdep_assert_held(&intel_dp->psr.lock);
18062067
@@ -1835,12 +2096,25 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp) · 28 unmodified lines
18352096 CLKGATE_DIS_MISC_DMASC_GATING_DIS, 0);
18362097 }
18372098
1838− intel_snps_phy_update_psr_power_state(dev_priv, phy, false);
2099+ if (intel_dp_is_edp(intel_dp))
2100+ intel_snps_phy_update_psr_power_state(&dp_to_dig_port(intel_dp)->base, false);
2101+
2102+ /* Panel Replay on eDP is always using ALPM aux less. */
2103+ if (intel_dp->psr.panel_replay_enabled && intel_dp_is_edp(intel_dp)) {
2104+ intel_de_rmw(dev_priv, ALPM_CTL(cpu_transcoder),
2105+ ALPM_CTL_ALPM_ENABLE |
2106+ ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0);
2107+
2108+ intel_de_rmw(dev_priv, PORT_ALPM_CTL(cpu_transcoder),
2109+ PORT_ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0);
2110+ }
18392111
18402112 /* Disable PSR on Sink */
1841− drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
2113+ drm_dp_dpcd_writeb(&intel_dp->aux,
2114+ intel_psr_get_enable_sink_offset(intel_dp), 0);
18422115
1843− if (intel_dp->psr.psr2_enabled)
2116+ if (!intel_dp->psr.panel_replay_enabled &&
2117+ intel_dp->psr.psr2_enabled)
18442118 drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG, 0);
18452119
18462120 intel_dp->psr.enabled = false;
@@ -1888,7 +2162,7 @@ void intel_psr_pause(struct intel_dp *intel_dp) · 41 unmodified lines
18882162 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
18892163 struct intel_psr *psr = &intel_dp->psr;
18902164
1891− if (!CAN_PSR(intel_dp))
2165+ if (!CAN_PSR(intel_dp) && !CAN_PANEL_REPLAY(intel_dp))
18922166 return;
18932167
18942168 mutex_lock(&psr->lock);
@@ -1921,7 +2195,7 @@ void intel_psr_resume(struct intel_dp *intel_dp) · 26 unmodified lines
19212195 {
19222196 struct intel_psr *psr = &intel_dp->psr;
19232197
1924− if (!CAN_PSR(intel_dp))
2198+ if (!CAN_PSR(intel_dp) && !CAN_PANEL_REPLAY(intel_dp))
19252199 return;
19262200
19272201 mutex_lock(&psr->lock);
@@ -1994,6 +2268,7 @@ static void psr_force_hw_tracking_exit(struct intel_dp *intel_dp) · 66 unmodified lines
19942268
19952269 void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_state)
19962270 {
2271+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
19972272 struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
19982273 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
19992274 struct intel_encoder *encoder;
@@ -2013,6 +2288,12 @@ void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_st · 13 unmodified lines
20132288
20142289 intel_de_write(dev_priv, PSR2_MAN_TRK_CTL(cpu_transcoder),
20152290 crtc_state->psr2_man_track_ctl);
2291+
2292+ if (!crtc_state->enable_psr2_su_region_et)
2293+ return;
2294+
2295+ intel_de_write(dev_priv, PIPE_SRCSZ_ERLY_TPT(crtc->pipe),
2296+ crtc_state->pipe_srcsz_early_tpt);
20162297 }
20172298
20182299 static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
@@ -2051,6 +2332,25 @@ exit: · 32 unmodified lines
20512332 crtc_state->psr2_man_track_ctl = val;
20522333 }
20532334
2335+static u32
2336+psr2_pipe_srcsz_early_tpt_calc(struct intel_crtc_state *crtc_state,
2337+ bool full_update, bool cursor_in_su_area)
2338+{
2339+ int width, height;
2340+
2341+ if (!crtc_state->enable_psr2_su_region_et || full_update)
2342+ return 0;
2343+
2344+ if (!cursor_in_su_area)
2345+ return PIPESRC_WIDTH(0) |
2346+ PIPESRC_HEIGHT(drm_rect_height(&crtc_state->pipe_src));
2347+
2348+ width = drm_rect_width(&crtc_state->psr2_su_area);
2349+ height = drm_rect_height(&crtc_state->psr2_su_area);
2350+
2351+ return PIPESRC_WIDTH(width - 1) | PIPESRC_HEIGHT(height - 1);
2352+}
2353+
20542354 static void clip_area_update(struct drm_rect *overlap_damage_area,
20552355 struct drm_rect *damage_area,
20562356 struct drm_rect *pipe_src)
@@ -2095,21 +2395,38 @@ static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_st · 38 unmodified lines
20952395 * cursor fully when cursor is in SU area.
20962396 */
20972397 static void
2098−intel_psr2_sel_fetch_et_alignment(struct intel_crtc_state *crtc_state,
2099− struct intel_plane_state *cursor_state)
2398+intel_psr2_sel_fetch_et_alignment(struct intel_atomic_state *state,
2399+ struct intel_crtc *crtc,
2400+ bool *cursor_in_su_area)
21002401 {
2101− struct drm_rect inter;
2402+ struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
2403+ struct intel_plane_state *new_plane_state;
2404+ struct intel_plane *plane;
2405+ int i;
21022406
2103− if (!crtc_state->enable_psr2_su_region_et ||
2104− !cursor_state->uapi.visible)
2407+ if (!crtc_state->enable_psr2_su_region_et)
21052408 return;
21062409
2107− inter = crtc_state->psr2_su_area;
2108− if (!drm_rect_intersect(&inter, &cursor_state->uapi.dst))
2109− return;
2410+ for_each_new_intel_plane_in_state(state, plane, new_plane_state, i) {
2411+ struct drm_rect inter;
21102412
2111− clip_area_update(&crtc_state->psr2_su_area, &cursor_state->uapi.dst,
2112− &crtc_state->pipe_src);
2413+ if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc)
2414+ continue;
2415+
2416+ if (plane->id != PLANE_CURSOR)
2417+ continue;
2418+
2419+ if (!new_plane_state->uapi.visible)
2420+ continue;
2421+
2422+ inter = crtc_state->psr2_su_area;
2423+ if (!drm_rect_intersect(&inter, &new_plane_state->uapi.dst))
2424+ continue;
2425+
2426+ clip_area_update(&crtc_state->psr2_su_area, &new_plane_state->uapi.dst,
2427+ &crtc_state->pipe_src);
2428+ *cursor_in_su_area = true;
2429+ }
21132430 }
21142431
21152432 /*
@@ -2152,10 +2469,9 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 36 unmodified lines
21522469 {
21532470 struct drm_i915_private *dev_priv = to_i915(state->base.dev);
21542471 struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
2155− struct intel_plane_state *new_plane_state, *old_plane_state,
2156− *cursor_plane_state = NULL;
2472+ struct intel_plane_state *new_plane_state, *old_plane_state;
21572473 struct intel_plane *plane;
2158− bool full_update = false;
2474+ bool full_update = false, cursor_in_su_area = false;
21592475 int i, ret;
21602476
21612477 if (!crtc_state->enable_psr2_sel_fetch)
@@ -2238,13 +2554,6 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 76 unmodified lines
22382554 damaged_area.x2 += new_plane_state->uapi.dst.x1 - src.x1;
22392555
22402556 clip_area_update(&crtc_state->psr2_su_area, &damaged_area, &crtc_state->pipe_src);
2241−
2242− /*
2243− * Cursor plane new state is stored to adjust su area to cover
2244− * cursor are fully.
2245− */
2246− if (plane->id == PLANE_CURSOR)
2247− cursor_plane_state = new_plane_state;
22482557 }
22492558
22502559 /*
@@ -2273,9 +2582,13 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 22 unmodified lines
22732582 if (ret)
22742583 return ret;
22752584
2276− /* Adjust su area to cover cursor fully as necessary */
2277− if (cursor_plane_state)
2278− intel_psr2_sel_fetch_et_alignment(crtc_state, cursor_plane_state);
2585+ /*
2586+ * Adjust su area to cover cursor fully as necessary (early
2587+ * transport). This needs to be done after
2588+ * drm_atomic_add_affected_planes to ensure visible cursor is added into
2589+ * affected planes even when cursor is not updated by itself.
2590+ */
2591+ intel_psr2_sel_fetch_et_alignment(state, crtc, &cursor_in_su_area);
22792592
22802593 intel_psr2_sel_fetch_pipe_alignment(crtc_state);
22812594
@@ -2338,6 +2651,9 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, · 56 unmodified lines
23382651
23392652 skip_sel_fetch_set_loop:
23402653 psr2_man_trk_ctl_calc(crtc_state, full_update);
2654+ crtc_state->pipe_srcsz_early_tpt =
2655+ psr2_pipe_srcsz_early_tpt_calc(crtc_state, full_update,
2656+ cursor_in_su_area);
23412657 return 0;
23422658 }
23432659
@@ -2394,7 +2710,7 @@ void intel_psr_post_plane_update(struct intel_atomic_state *state, · 50 unmodified lines
23942710 intel_atomic_get_new_crtc_state(state, crtc);
23952711 struct intel_encoder *encoder;
23962712
2397− if (!(crtc_state->has_psr || crtc_state->has_panel_replay))
2713+ if (!crtc_state->has_psr)
23982714 return;
23992715
24002716 for_each_intel_encoder_mask_with_psr(state->base.dev, encoder,
@@ -2994,6 +3310,13 @@ static void psr_capability_changed_check(struct intel_dp *intel_dp) · 593 unmodified lines
29943310 }
29953311 }
29963312
3313+/*
3314+ * On common bits:
3315+ * DP_PSR_RFB_STORAGE_ERROR == DP_PANEL_REPLAY_RFB_STORAGE_ERROR
3316+ * DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR == DP_PANEL_REPLAY_VSC_SDP_UNCORRECTABLE_ERROR
3317+ * DP_PSR_LINK_CRC_ERROR == DP_PANEL_REPLAY_LINK_CRC_ERROR
3318+ * this function is relying on PSR definitions
3319+ */
29973320 void intel_psr_short_pulse(struct intel_dp *intel_dp)
29983321 {
29993322 struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
@@ -3003,7 +3326,7 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp) · 3 unmodified lines
30033326 DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR |
30043327 DP_PSR_LINK_CRC_ERROR;
30053328
3006− if (!CAN_PSR(intel_dp))
3329+ if (!CAN_PSR(intel_dp) && !CAN_PANEL_REPLAY(intel_dp))
30073330 return;
30083331
30093332 mutex_lock(&psr->lock);
@@ -3017,12 +3340,14 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp) · 7 unmodified lines
30173340 goto exit;
30183341 }
30193342
3020− if (status == DP_PSR_SINK_INTERNAL_ERROR || (error_status & errors)) {
3343+ if ((!psr->panel_replay_enabled && status == DP_PSR_SINK_INTERNAL_ERROR) ||
3344+ (error_status & errors)) {
30213345 intel_psr_disable_locked(intel_dp);
30223346 psr->sink_not_reliable = true;
30233347 }
30243348
3025− if (status == DP_PSR_SINK_INTERNAL_ERROR && !error_status)
3349+ if (!psr->panel_replay_enabled && status == DP_PSR_SINK_INTERNAL_ERROR &&
3350+ !error_status)
30263351 drm_dbg_kms(&dev_priv->drm,
30273352 "PSR sink internal error, disabling PSR\n");
30283353 if (error_status & DP_PSR_RFB_STORAGE_ERROR)
@@ -3042,8 +3367,10 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp) · 13 unmodified lines
30423367 /* clear status register */
30433368 drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_ERROR_STATUS, error_status);
30443369
3045− psr_alpm_check(intel_dp);
3046− psr_capability_changed_check(intel_dp);
3370+ if (!psr->panel_replay_enabled) {
3371+ psr_alpm_check(intel_dp);
3372+ psr_capability_changed_check(intel_dp);
3373+ }
30473374
30483375 exit:
30493376 mutex_unlock(&psr->lock);
drivers/gpu/drm/i915/display/intel_psr.h+5−0
@@ -21,8 +21,13 @@ struct intel_encoder; · 20 unmodified lines
2121 struct intel_plane;
2222 struct intel_plane_state;
2323
24+#define CAN_PANEL_REPLAY(intel_dp) ((intel_dp)->psr.sink_panel_replay_support && \
25+ (intel_dp)->psr.source_panel_replay_support)
26+
2427 bool intel_encoder_can_psr(struct intel_encoder *encoder);
2528 void intel_psr_init_dpcd(struct intel_dp *intel_dp);
29+void intel_psr_enable_sink(struct intel_dp *intel_dp,
30+ const struct intel_crtc_state *crtc_state);
2631 void intel_psr_pre_plane_update(struct intel_atomic_state *state,
2732 struct intel_crtc *crtc);
2833 void intel_psr_post_plane_update(struct intel_atomic_state *state,
drivers/gpu/drm/i915/display/intel_psr_regs.h+8−4
@@ -348,9 +348,13 @@ · 347 unmodified lines
348348 #define PORT_ALPM_LFPS_CTL(tran) _MMIO_TRANS2(tran, _PORT_ALPM_LFPS_CTL_A)
349349 #define PORT_ALPM_LFPS_CTL_LFPS_START_POLARITY REG_BIT(31)
350350 #define PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MASK REG_GENMASK(27, 24)
351−#define ALPM_CTL_EXTENDED_FAST_WAKE_MIN_LINES 5
352−#define ALPM_CTL_EXTENDED_FAST_WAKE_TIME(lines) REG_FIELD_PREP(ALPM_CTL_EXTENDED_FAST_WAKE_TIME_MASK, (lines) - ALPM_CTL_EXTENDED_FAST_WAKE_MIN_LINES)
353−#define ALPM_CTL_AUX_LESS_WAKE_TIME_MASK REG_GENMASK(5, 0)
354−#define ALPM_CTL_AUX_LESS_WAKE_TIME(val) REG_FIELD_PREP(ALPM_CTL_AUX_LESS_WAKE_TIME_MASK, val)
351+#define PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MIN 7
352+#define PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT(val) REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MASK, (val) - PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MIN)
353+#define PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK REG_GENMASK(20, 16)
354+#define PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION(val) REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK, val)
355+#define PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION_MASK REG_GENMASK(12, 8)
356+#define PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION(val) REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK, val)
357+#define PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK REG_GENMASK(4, 0)
358+#define PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION(val) REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK, val)
355359
356360 #endif /* __INTEL_PSR_REGS_H__ */
drivers/gpu/drm/i915/display/intel_sdvo.c+3−6
@@ -193,7 +193,7 @@ to_intel_sdvo_connector(struct drm_connector *connector) · 192 unmodified lines
193193 }
194194
195195 #define to_intel_sdvo_connector_state(conn_state) \
196− container_of((conn_state), struct intel_sdvo_connector_state, base.base)
196+ container_of_const((conn_state), struct intel_sdvo_connector_state, base.base)
197197
198198 static bool
199199 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo);
@@ -1944,7 +1944,7 @@ intel_sdvo_mode_valid(struct drm_connector *connector, · 1744 unmodified lines
19441944 struct intel_sdvo_connector *intel_sdvo_connector =
19451945 to_intel_sdvo_connector(connector);
19461946 bool has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo_connector, connector->state);
1947− int max_dotclk = i915->max_dotclk_freq;
1947+ int max_dotclk = i915->display.cdclk.max_dotclk_freq;
19481948 enum drm_mode_status status;
19491949 int clock = mode->clock;
19501950
@@ -1952,9 +1952,6 @@ intel_sdvo_mode_valid(struct drm_connector *connector, · 1 unmodified line
19521952 if (status != MODE_OK)
19531953 return status;
19541954
1955− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
1956− return MODE_NO_DBLESCAN;
1957−
19581955 if (clock > max_dotclk)
19591956 return MODE_CLOCK_HIGH;
19601957
@@ -2378,7 +2375,7 @@ intel_sdvo_connector_atomic_get_property(struct drm_connector *connector, · 417 unmodified lines
23782375 u64 *val)
23792376 {
23802377 struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
2381− const struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state((void *)state);
2378+ const struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state(state);
23822379
23832380 if (property == intel_sdvo_connector->tv_format) {
23842381 int i;
drivers/gpu/drm/i915/display/intel_snps_phy.c+9−7
@@ -44,12 +44,14 @@ void intel_snps_phy_wait_for_calibration(struct drm_i915_private *i915) · 43 unmodified lines
4444 }
4545 }
4646
47−void intel_snps_phy_update_psr_power_state(struct drm_i915_private *i915,
48− enum phy phy, bool enable)
47+void intel_snps_phy_update_psr_power_state(struct intel_encoder *encoder,
48+ bool enable)
4949 {
50+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
51+ enum phy phy = intel_encoder_to_phy(encoder);
5052 u32 val;
5153
52− if (!intel_phy_is_snps(i915, phy))
54+ if (!intel_encoder_is_snps(encoder))
5355 return;
5456
5557 val = REG_FIELD_PREP(SNPS_PHY_TX_REQ_LN_DIS_PWR_STATE_PSR,
@@ -63,7 +65,7 @@ void intel_snps_phy_set_signal_levels(struct intel_encoder *encoder, · 7 unmodified lines
6365 {
6466 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
6567 const struct intel_ddi_buf_trans *trans;
66− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
68+ enum phy phy = intel_encoder_to_phy(encoder);
6769 int n_entries, ln;
6870
6971 trans = encoder->get_buf_trans(encoder, crtc_state, &n_entries);
@@ -1822,7 +1824,7 @@ void intel_mpllb_enable(struct intel_encoder *encoder, · 1752 unmodified lines
18221824 {
18231825 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
18241826 const struct intel_mpllb_state *pll_state = &crtc_state->mpllb_state;
1825− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
1827+ enum phy phy = intel_encoder_to_phy(encoder);
18261828 i915_reg_t enable_reg = (phy <= PHY_D ?
18271829 DG2_PLL_ENABLE(phy) : MG_PLL_ENABLE(0));
18281830
@@ -1879,7 +1881,7 @@ void intel_mpllb_enable(struct intel_encoder *encoder, · 50 unmodified lines
18791881 void intel_mpllb_disable(struct intel_encoder *encoder)
18801882 {
18811883 struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1882− enum phy phy = intel_port_to_phy(i915, encoder->port);
1884+ enum phy phy = intel_encoder_to_phy(encoder);
18831885 i915_reg_t enable_reg = (phy <= PHY_D ?
18841886 DG2_PLL_ENABLE(phy) : MG_PLL_ENABLE(0));
18851887
@@ -1951,7 +1953,7 @@ void intel_mpllb_readout_hw_state(struct intel_encoder *encoder, · 65 unmodified lines
19511953 struct intel_mpllb_state *pll_state)
19521954 {
19531955 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1954− enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
1956+ enum phy phy = intel_encoder_to_phy(encoder);
19551957
19561958 pll_state->mpllb_cp = intel_de_read(dev_priv, SNPS_PHY_MPLLB_CP(phy));
19571959 pll_state->mpllb_div = intel_de_read(dev_priv, SNPS_PHY_MPLLB_DIV(phy));
drivers/gpu/drm/i915/display/intel_snps_phy.h+2−2
@@ -17,8 +17,8 @@ struct intel_mpllb_state; · 16 unmodified lines
1717 enum phy;
1818
1919 void intel_snps_phy_wait_for_calibration(struct drm_i915_private *dev_priv);
20−void intel_snps_phy_update_psr_power_state(struct drm_i915_private *dev_priv,
21− enum phy phy, bool enable);
20+void intel_snps_phy_update_psr_power_state(struct intel_encoder *encoder,
21+ bool enable);
2222
2323 int intel_mpllb_calc_state(struct intel_crtc_state *crtc_state,
2424 struct intel_encoder *encoder);
drivers/gpu/drm/i915/display/intel_tc.c+10−23
@@ -100,11 +100,9 @@ static struct drm_i915_private *tc_to_i915(struct intel_tc_port *tc) · 99 unmodified lines
100100 static bool intel_tc_port_in_mode(struct intel_digital_port *dig_port,
101101 enum tc_port_mode mode)
102102 {
103− struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
104− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
105103 struct intel_tc_port *tc = to_tc_port(dig_port);
106104
107− return intel_phy_is_tc(i915, phy) && tc->mode == mode;
105+ return intel_encoder_is_tc(&dig_port->base) && tc->mode == mode;
108106 }
109107
110108 bool intel_tc_port_in_tbt_alt_mode(struct intel_digital_port *dig_port)
@@ -124,11 +122,9 @@ bool intel_tc_port_in_legacy_mode(struct intel_digital_port *dig_port) · 13 unmodified lines
124122
125123 bool intel_tc_port_handles_hpd_glitches(struct intel_digital_port *dig_port)
126124 {
127− struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
128− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
129125 struct intel_tc_port *tc = to_tc_port(dig_port);
130126
131− return intel_phy_is_tc(i915, phy) && !tc->legacy_port;
127+ return intel_encoder_is_tc(&dig_port->base) && !tc->legacy_port;
132128 }
133129
134130 /*
@@ -254,8 +250,7 @@ assert_tc_cold_blocked(struct intel_tc_port *tc) · 119 unmodified lines
254250 static enum intel_display_power_domain
255251 tc_port_power_domain(struct intel_tc_port *tc)
256252 {
257− struct drm_i915_private *i915 = tc_to_i915(tc);
258− enum tc_port tc_port = intel_port_to_tc(i915, tc->dig_port->base.port);
253+ enum tc_port tc_port = intel_encoder_to_tc(&tc->dig_port->base);
259254
260255 return POWER_DOMAIN_PORT_DDI_LANES_TC1 + tc_port - TC_PORT_1;
261256 }
@@ -302,7 +297,7 @@ u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port) · 40 unmodified lines
302297 static int lnl_tc_port_get_max_lane_count(struct intel_digital_port *dig_port)
303298 {
304299 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
305− enum tc_port tc_port = intel_port_to_tc(i915, dig_port->base.port);
300+ enum tc_port tc_port = intel_encoder_to_tc(&dig_port->base);
306301 intel_wakeref_t wakeref;
307302 u32 val, pin_assignment;
308303
@@ -375,9 +370,8 @@ int intel_tc_port_max_lane_count(struct intel_digital_port *dig_port) · 66 unmodified lines
375370 {
376371 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
377372 struct intel_tc_port *tc = to_tc_port(dig_port);
378− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
379373
380− if (!intel_phy_is_tc(i915, phy) || tc->mode != TC_PORT_DP_ALT)
374+ if (!intel_encoder_is_tc(&dig_port->base) || tc->mode != TC_PORT_DP_ALT)
381375 return 4;
382376
383377 assert_tc_cold_blocked(tc);
@@ -458,9 +452,7 @@ static void tc_port_fixup_legacy_flag(struct intel_tc_port *tc, · 74 unmodified lines
458452
459453 static void tc_phy_load_fia_params(struct intel_tc_port *tc, bool modular_fia)
460454 {
461− struct drm_i915_private *i915 = tc_to_i915(tc);
462− enum port port = tc->dig_port->base.port;
463− enum tc_port tc_port = intel_port_to_tc(i915, port);
455+ enum tc_port tc_port = intel_encoder_to_tc(&tc->dig_port->base);
464456
465457 /*
466458 * Each Modular FIA instance houses 2 TC ports. In SOC that has more
@@ -812,7 +804,7 @@ static u32 adlp_tc_phy_hpd_live_status(struct intel_tc_port *tc) · 345 unmodified lines
812804 static bool adlp_tc_phy_is_ready(struct intel_tc_port *tc)
813805 {
814806 struct drm_i915_private *i915 = tc_to_i915(tc);
815− enum tc_port tc_port = intel_port_to_tc(i915, tc->dig_port->base.port);
807+ enum tc_port tc_port = intel_encoder_to_tc(&tc->dig_port->base);
816808 u32 val;
817809
818810 assert_display_core_power_enabled(tc);
@@ -1635,10 +1627,7 @@ static bool __intel_tc_port_link_needs_reset(struct intel_tc_port *tc) · 816 unmodified lines
16351627
16361628 bool intel_tc_port_link_needs_reset(struct intel_digital_port *dig_port)
16371629 {
1638− struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
1639− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
1640−
1641− if (!intel_phy_is_tc(i915, phy))
1630+ if (!intel_encoder_is_tc(&dig_port->base))
16421631 return false;
16431632
16441633 return __intel_tc_port_link_needs_reset(to_tc_port(dig_port));
@@ -1740,11 +1729,9 @@ bool intel_tc_port_link_reset(struct intel_digital_port *dig_port) · 95 unmodified lines
17401729
17411730 void intel_tc_port_link_cancel_reset_work(struct intel_digital_port *dig_port)
17421731 {
1743− struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
1744− enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
17451732 struct intel_tc_port *tc = to_tc_port(dig_port);
17461733
1747− if (!intel_phy_is_tc(i915, phy))
1734+ if (!intel_encoder_is_tc(&dig_port->base))
17481735 return;
17491736
17501737 cancel_delayed_work(&tc->link_reset_work);
@@ -1861,7 +1848,7 @@ int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy) · 110 unmodified lines
18611848 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
18621849 struct intel_tc_port *tc;
18631850 enum port port = dig_port->base.port;
1864− enum tc_port tc_port = intel_port_to_tc(i915, port);
1851+ enum tc_port tc_port = intel_encoder_to_tc(&dig_port->base);
18651852
18661853 if (drm_WARN_ON(&i915->drm, tc_port == TC_PORT_NONE))
18671854 return -EINVAL;
drivers/gpu/drm/i915/display/intel_tv.c+3−5
@@ -885,7 +885,8 @@ struct intel_tv_connector_state { · 884 unmodified lines
885885 bool bypass_vfilter;
886886 };
887887
888−#define to_intel_tv_connector_state(x) container_of(x, struct intel_tv_connector_state, base)
888+#define to_intel_tv_connector_state(conn_state) \
889+ container_of_const((conn_state), struct intel_tv_connector_state, base)
889890
890891 static struct drm_connector_state *
891892 intel_tv_connector_duplicate_state(struct drm_connector *connector)
@@ -961,16 +962,13 @@ intel_tv_mode_valid(struct drm_connector *connector, · 69 unmodified lines
961962 {
962963 struct drm_i915_private *i915 = to_i915(connector->dev);
963964 const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state);
964− int max_dotclk = i915->max_dotclk_freq;
965+ int max_dotclk = i915->display.cdclk.max_dotclk_freq;
965966 enum drm_mode_status status;
966967
967968 status = intel_cpu_transcoder_mode_valid(i915, mode);
968969 if (status != MODE_OK)
969970 return status;
970971
971− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
972− return MODE_NO_DBLESCAN;
973−
974972 if (mode->clock > max_dotclk)
975973 return MODE_CLOCK_HIGH;
976974
drivers/gpu/drm/i915/display/intel_vbt_defs.h+19−17
@@ -485,6 +485,7 @@ struct child_device_config { · 484 unmodified lines
485485 u8 hdmi_iboost_level:4; /* 196+ */
486486 u8 dp_max_link_rate:3; /* 216+ */
487487 u8 dp_max_link_rate_reserved:5; /* 216+ */
488+ u8 efp_index; /* 256+ */
488489 } __packed;
489490
490491 struct bdb_general_definitions {
@@ -602,22 +603,22 @@ struct bdb_driver_features { · 111 unmodified lines
602603 u8 custom_vbt_version; /* 155+ */
603604
604605 /* Driver Feature Flags */
605− u16 rmpm_enabled:1; /* 165+ */
606− u16 s2ddt_enabled:1; /* 165+ */
607− u16 dpst_enabled:1; /* 165-227 */
608− u16 bltclt_enabled:1; /* 165+ */
609− u16 adb_enabled:1; /* 165-227 */
610− u16 drrs_enabled:1; /* 165-227 */
611− u16 grs_enabled:1; /* 165+ */
612− u16 gpmt_enabled:1; /* 165+ */
613− u16 tbt_enabled:1; /* 165+ */
606+ u16 rmpm_enabled:1; /* 159+ */
607+ u16 s2ddt_enabled:1; /* 159+ */
608+ u16 dpst_enabled:1; /* 159-227 */
609+ u16 bltclt_enabled:1; /* 159+ */
610+ u16 adb_enabled:1; /* 159-227 */
611+ u16 drrs_enabled:1; /* 159-227 */
612+ u16 grs_enabled:1; /* 159+ */
613+ u16 gpmt_enabled:1; /* 159+ */
614+ u16 tbt_enabled:1; /* 159+ */
614615 u16 psr_enabled:1; /* 165-227 */
615616 u16 ips_enabled:1; /* 165+ */
616− u16 dpfs_enabled:1; /* 165+ */
617+ u16 dfps_enabled:1; /* 165+ */
617618 u16 dmrrs_enabled:1; /* 174-227 */
618619 u16 adt_enabled:1; /* ???-228 */
619620 u16 hpd_wake:1; /* 201-240 */
620− u16 pc_feature_valid:1;
621+ u16 pc_feature_valid:1; /* 159+ */
621622 } __packed;
622623
623624 /*
@@ -880,11 +881,12 @@ struct bdb_lvds_lfp_data_tail { · 256 unmodified lines
880881 struct lfp_backlight_data_entry {
881882 u8 type:2;
882883 u8 active_low_pwm:1;
883− u8 obsolete1:5;
884+ u8 i2c_pin:3; /* obsolete since ? */
885+ u8 i2c_speed:2; /* obsolete since ? */
884886 u16 pwm_freq_hz;
885887 u8 min_brightness; /* ???-233 */
886− u8 obsolete2;
887− u8 obsolete3;
888+ u8 i2c_address; /* obsolete since ? */
889+ u8 i2c_command; /* obsolete since ? */
888890 } __packed;
889891
890892 struct lfp_backlight_control_method {
@@ -905,8 +907,8 @@ struct lfp_brightness_level { · 14 unmodified lines
905907 struct bdb_lfp_backlight_data {
906908 u8 entry_size;
907909 struct lfp_backlight_data_entry data[16];
908− u8 level[16]; /* ???-233 */
909− struct lfp_backlight_control_method backlight_control[16];
910+ u8 level[16]; /* 162-233 */
911+ struct lfp_backlight_control_method backlight_control[16]; /* 191+ */
910912 struct lfp_brightness_level brightness_level[16]; /* 234+ */
911913 struct lfp_brightness_level brightness_min_level[16]; /* 234+ */
912914 u8 brightness_precision_bits[16]; /* 236+ */
@@ -917,7 +919,7 @@ struct bdb_lfp_backlight_data { · 4 unmodified lines
917919 * Block 44 - LFP Power Conservation Features Block
918920 */
919921 struct lfp_power_features {
920− u8 reserved1:1;
922+ u8 dpst_support:1; /* ???-159 */
921923 u8 power_conservation_pref:3;
922924 u8 reserved2:1;
923925 u8 lace_enabled_status:1; /* 210+ */
drivers/gpu/drm/i915/display/intel_vrr.c+38−2
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include "intel_de.h"
1010 #include "intel_display_types.h"
1111 #include "intel_vrr.h"
12+#include "intel_dp.h"
1213
1314 bool intel_vrr_is_capable(struct intel_connector *connector)
1415 {
@@ -113,10 +114,18 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, · 98 unmodified lines
113114 struct drm_i915_private *i915 = to_i915(crtc->base.dev);
114115 struct intel_connector *connector =
115116 to_intel_connector(conn_state->connector);
117+ struct intel_dp *intel_dp = intel_attached_dp(connector);
116118 struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
117119 const struct drm_display_info *info = &connector->base.display_info;
118120 int vmin, vmax;
119121
122+ /*
123+ * FIXME all joined pipes share the same transcoder.
124+ * Need to account for that during VRR toggle/push/etc.
125+ */
126+ if (crtc_state->bigjoiner_pipes)
127+ return;
128+
120129 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
121130 return;
122131
@@ -165,6 +174,14 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, · 42 unmodified lines
165174 if (crtc_state->uapi.vrr_enabled) {
166175 crtc_state->vrr.enable = true;
167176 crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
177+ if (intel_dp_as_sdp_supported(intel_dp)) {
178+ crtc_state->vrr.vsync_start =
179+ (crtc_state->hw.adjusted_mode.crtc_vtotal -
180+ crtc_state->hw.adjusted_mode.vsync_start);
181+ crtc_state->vrr.vsync_end =
182+ (crtc_state->hw.adjusted_mode.crtc_vtotal -
183+ crtc_state->hw.adjusted_mode.vsync_end);
184+ }
168185 }
169186 }
170187
@@ -240,6 +257,12 @@ void intel_vrr_enable(const struct intel_crtc_state *crtc_state) · 69 unmodified lines
240257 return;
241258
242259 intel_de_write(dev_priv, TRANS_PUSH(cpu_transcoder), TRANS_PUSH_EN);
260+
261+ if (HAS_AS_SDP(dev_priv))
262+ intel_de_write(dev_priv, TRANS_VRR_VSYNC(cpu_transcoder),
263+ VRR_VSYNC_END(crtc_state->vrr.vsync_end) |
264+ VRR_VSYNC_START(crtc_state->vrr.vsync_start));
265+
243266 intel_de_write(dev_priv, TRANS_VRR_CTL(cpu_transcoder),
244267 VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state));
245268 }
@@ -258,13 +281,16 @@ void intel_vrr_disable(const struct intel_crtc_state *old_crtc_state) · 12 unmodified lines
258281 intel_de_wait_for_clear(dev_priv, TRANS_VRR_STATUS(cpu_transcoder),
259282 VRR_STATUS_VRR_EN_LIVE, 1000);
260283 intel_de_write(dev_priv, TRANS_PUSH(cpu_transcoder), 0);
284+
285+ if (HAS_AS_SDP(dev_priv))
286+ intel_de_write(dev_priv, TRANS_VRR_VSYNC(cpu_transcoder), 0);
261287 }
262288
263289 void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
264290 {
265291 struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
266292 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
267− u32 trans_vrr_ctl;
293+ u32 trans_vrr_ctl, trans_vrr_vsync;
268294
269295 trans_vrr_ctl = intel_de_read(dev_priv, TRANS_VRR_CTL(cpu_transcoder));
270296
@@ -284,6 +310,16 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state) · 13 unmodified lines
284310 crtc_state->vrr.vmin = intel_de_read(dev_priv, TRANS_VRR_VMIN(cpu_transcoder)) + 1;
285311 }
286312
287− if (crtc_state->vrr.enable)
313+ if (crtc_state->vrr.enable) {
288314 crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
315+
316+ if (HAS_AS_SDP(dev_priv)) {
317+ trans_vrr_vsync =
318+ intel_de_read(dev_priv, TRANS_VRR_VSYNC(cpu_transcoder));
319+ crtc_state->vrr.vsync_start =
320+ REG_FIELD_GET(VRR_VSYNC_START_MASK, trans_vrr_vsync);
321+ crtc_state->vrr.vsync_end =
322+ REG_FIELD_GET(VRR_VSYNC_END_MASK, trans_vrr_vsync);
323+ }
324+ }
289325 }
drivers/gpu/drm/i915/display/skl_scaler.c+4−3
@@ -213,10 +213,11 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, · 212 unmodified lines
213213 * The pipe scaler does not use all the bits of PIPESRC, at least
214214 * on the earlier platforms. So even when we're scaling a plane
215215 * the *pipe* source size must not be too large. For simplicity
216− * we assume the limits match the scaler source size limits. Might
217− * not be 100% accurate on all platforms, but good enough for now.
216+ * we assume the limits match the scaler destination size limits.
217+ * Might not be 100% accurate on all platforms, but good enough for
218+ * now.
218219 */
219− if (pipe_src_w > max_src_w || pipe_src_h > max_src_h) {
220+ if (pipe_src_w > max_dst_w || pipe_src_h > max_dst_h) {
220221 drm_dbg_kms(&dev_priv->drm,
221222 "scaler_user index %u.%u: pipe src size %ux%u "
222223 "is out of scaler range\n",
drivers/gpu/drm/i915/display/skl_watermark.c+225−95
@@ -6,18 +6,19 @@ · 5 unmodified lines
66 #include <drm/drm_blend.h>
77
88 #include "i915_drv.h"
9−#include "i915_fixed.h"
109 #include "i915_reg.h"
1110 #include "i9xx_wm.h"
1211 #include "intel_atomic.h"
1312 #include "intel_atomic_plane.h"
1413 #include "intel_bw.h"
14+#include "intel_cdclk.h"
1515 #include "intel_crtc.h"
1616 #include "intel_de.h"
1717 #include "intel_display.h"
1818 #include "intel_display_power.h"
1919 #include "intel_display_types.h"
2020 #include "intel_fb.h"
21+#include "intel_fixed.h"
2122 #include "intel_pcode.h"
2223 #include "intel_wm.h"
2324 #include "skl_watermark.h"
@@ -2601,10 +2602,17 @@ skl_compute_ddb(struct intel_atomic_state *state) · 2577 unmodified lines
26012602 return ret;
26022603 }
26032604
2604− if (HAS_MBUS_JOINING(i915))
2605+ if (HAS_MBUS_JOINING(i915)) {
26052606 new_dbuf_state->joined_mbus =
26062607 adlp_check_mbus_joined(new_dbuf_state->active_pipes);
26072608
2609+ if (old_dbuf_state->joined_mbus != new_dbuf_state->joined_mbus) {
2610+ ret = intel_cdclk_state_set_joined_mbus(state, new_dbuf_state->joined_mbus);
2611+ if (ret)
2612+ return ret;
2613+ }
2614+ }
2615+
26082616 for_each_intel_crtc(&i915->drm, crtc) {
26092617 enum pipe pipe = crtc->pipe;
26102618
@@ -2628,13 +2636,6 @@ skl_compute_ddb(struct intel_atomic_state *state) · 17 unmodified lines
26282636 if (ret)
26292637 return ret;
26302638
2631− if (old_dbuf_state->joined_mbus != new_dbuf_state->joined_mbus) {
2632− /* TODO: Implement vblank synchronized MBUS joining changes */
2633− ret = intel_modeset_all_pipes_late(state, "MBUS joining change");
2634− if (ret)
2635− return ret;
2636− }
2637−
26382639 drm_dbg_kms(&i915->drm,
26392640 "Enabled dbuf slices 0x%x -> 0x%x (total dbuf slices 0x%x), mbus joined? %s->%s\n",
26402641 old_dbuf_state->enabled_slices,
@@ -3057,6 +3058,8 @@ static void skl_wm_get_hw_state(struct drm_i915_private *i915) · 416 unmodified lines
30573058 if (HAS_MBUS_JOINING(i915))
30583059 dbuf_state->joined_mbus = intel_de_read(i915, MBUS_CTL) & MBUS_JOIN;
30593060
3061+ dbuf_state->mdclk_cdclk_ratio = intel_mdclk_cdclk_ratio(i915, &i915->display.cdclk.hw);
3062+
30603063 for_each_intel_crtc(&i915->drm, crtc) {
30613064 struct intel_crtc_state *crtc_state =
30623065 to_intel_crtc_state(crtc->base.state);
@@ -3530,85 +3533,6 @@ int intel_dbuf_init(struct drm_i915_private *i915) · 467 unmodified lines
35303533 return 0;
35313534 }
35323535
3533−/*
3534− * Configure MBUS_CTL and all DBUF_CTL_S of each slice to join_mbus state before
3535− * update the request state of all DBUS slices.
3536− */
3537−static void update_mbus_pre_enable(struct intel_atomic_state *state)
3538−{
3539− struct drm_i915_private *i915 = to_i915(state->base.dev);
3540− u32 mbus_ctl, dbuf_min_tracker_val;
3541− enum dbuf_slice slice;
3542− const struct intel_dbuf_state *dbuf_state =
3543− intel_atomic_get_new_dbuf_state(state);
3544−
3545− if (!HAS_MBUS_JOINING(i915))
3546− return;
3547−
3548− /*
3549− * TODO: Implement vblank synchronized MBUS joining changes.
3550− * Must be properly coordinated with dbuf reprogramming.
3551− */
3552− if (dbuf_state->joined_mbus) {
3553− mbus_ctl = MBUS_HASHING_MODE_1x4 | MBUS_JOIN |
3554− MBUS_JOIN_PIPE_SELECT_NONE;
3555− dbuf_min_tracker_val = DBUF_MIN_TRACKER_STATE_SERVICE(3);
3556− } else {
3557− mbus_ctl = MBUS_HASHING_MODE_2x2 |
3558− MBUS_JOIN_PIPE_SELECT_NONE;
3559− dbuf_min_tracker_val = DBUF_MIN_TRACKER_STATE_SERVICE(1);
3560− }
3561−
3562− intel_de_rmw(i915, MBUS_CTL,
3563− MBUS_HASHING_MODE_MASK | MBUS_JOIN |
3564− MBUS_JOIN_PIPE_SELECT_MASK, mbus_ctl);
3565−
3566− for_each_dbuf_slice(i915, slice)
3567− intel_de_rmw(i915, DBUF_CTL_S(slice),
3568− DBUF_MIN_TRACKER_STATE_SERVICE_MASK,
3569− dbuf_min_tracker_val);
3570−}
3571−
3572−void intel_dbuf_pre_plane_update(struct intel_atomic_state *state)
3573−{
3574− struct drm_i915_private *i915 = to_i915(state->base.dev);
3575− const struct intel_dbuf_state *new_dbuf_state =
3576− intel_atomic_get_new_dbuf_state(state);
3577− const struct intel_dbuf_state *old_dbuf_state =
3578− intel_atomic_get_old_dbuf_state(state);
3579−
3580− if (!new_dbuf_state ||
3581− (new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices &&
3582− new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus))
3583− return;
3584−
3585− WARN_ON(!new_dbuf_state->base.changed);
3586−
3587− update_mbus_pre_enable(state);
3588− gen9_dbuf_slices_update(i915,
3589− old_dbuf_state->enabled_slices |
3590− new_dbuf_state->enabled_slices);
3591−}
3592−
3593−void intel_dbuf_post_plane_update(struct intel_atomic_state *state)
3594−{
3595− struct drm_i915_private *i915 = to_i915(state->base.dev);
3596− const struct intel_dbuf_state *new_dbuf_state =
3597− intel_atomic_get_new_dbuf_state(state);
3598− const struct intel_dbuf_state *old_dbuf_state =
3599− intel_atomic_get_old_dbuf_state(state);
3600−
3601− if (!new_dbuf_state ||
3602− (new_dbuf_state->enabled_slices == old_dbuf_state->enabled_slices &&
3603− new_dbuf_state->joined_mbus == old_dbuf_state->joined_mbus))
3604− return;
3605−
3606− WARN_ON(!new_dbuf_state->base.changed);
3607−
3608− gen9_dbuf_slices_update(i915,
3609− new_dbuf_state->enabled_slices);
3610−}
3611−
36123536 static bool xelpdp_is_only_pipe_per_dbuf_bank(enum pipe pipe, u8 active_pipes)
36133537 {
36143538 switch (pipe) {
@@ -3628,14 +3552,12 @@ static bool xelpdp_is_only_pipe_per_dbuf_bank(enum pipe pipe, u8 active_pipes) · 13 unmodified lines
36283552 return false;
36293553 }
36303554
3631−void intel_mbus_dbox_update(struct intel_atomic_state *state)
3555+static void intel_mbus_dbox_update(struct intel_atomic_state *state)
36323556 {
36333557 struct drm_i915_private *i915 = to_i915(state->base.dev);
36343558 const struct intel_dbuf_state *new_dbuf_state, *old_dbuf_state;
3635− const struct intel_crtc_state *new_crtc_state;
36363559 const struct intel_crtc *crtc;
36373560 u32 val = 0;
3638− int i;
36393561
36403562 if (DISPLAY_VER(i915) < 11)
36413563 return;
@@ -3679,12 +3601,9 @@ void intel_mbus_dbox_update(struct intel_atomic_state *state) · 37 unmodified lines
36793601 val |= MBUS_DBOX_B_CREDIT(8);
36803602 }
36813603
3682− for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
3604+ for_each_intel_crtc_in_pipe_mask(&i915->drm, crtc, new_dbuf_state->active_pipes) {
36833605 u32 pipe_val = val;
36843606
3685− if (!new_crtc_state->hw.active)
3686− continue;
3687−
36883607 if (DISPLAY_VER(i915) >= 14) {
36893608 if (xelpdp_is_only_pipe_per_dbuf_bank(crtc->pipe,
36903609 new_dbuf_state->active_pipes))
@@ -3697,6 +3616,217 @@ void intel_mbus_dbox_update(struct intel_atomic_state *state) · 6 unmodified lines
36973616 }
36983617 }
36993618
3619+int intel_dbuf_state_set_mdclk_cdclk_ratio(struct intel_atomic_state *state,
3620+ int ratio)
3621+{
3622+ struct intel_dbuf_state *dbuf_state;
3623+
3624+ dbuf_state = intel_atomic_get_dbuf_state(state);
3625+ if (IS_ERR(dbuf_state))
3626+ return PTR_ERR(dbuf_state);
3627+
3628+ dbuf_state->mdclk_cdclk_ratio = ratio;
3629+
3630+ return intel_atomic_lock_global_state(&dbuf_state->base);
3631+}
3632+
3633+void intel_dbuf_mdclk_cdclk_ratio_update(struct drm_i915_private *i915,
3634+ int ratio, bool joined_mbus)
3635+{
3636+ enum dbuf_slice slice;
3637+
3638+ if (!HAS_MBUS_JOINING(i915))
3639+ return;
3640+
3641+ if (DISPLAY_VER(i915) >= 20)
3642+ intel_de_rmw(i915, MBUS_CTL, MBUS_TRANSLATION_THROTTLE_MIN_MASK,
3643+ MBUS_TRANSLATION_THROTTLE_MIN(ratio - 1));
3644+
3645+ if (joined_mbus)
3646+ ratio *= 2;
3647+
3648+ drm_dbg_kms(&i915->drm, "Updating dbuf ratio to %d (mbus joined: %s)\n",
3649+ ratio, str_yes_no(joined_mbus));
3650+
3651+ for_each_dbuf_slice(i915, slice)
3652+ intel_de_rmw(i915, DBUF_CTL_S(slice),
3653+ DBUF_MIN_TRACKER_STATE_SERVICE_MASK,
3654+ DBUF_MIN_TRACKER_STATE_SERVICE(ratio - 1));
3655+}
3656+
3657+static void intel_dbuf_mdclk_min_tracker_update(struct intel_atomic_state *state)
3658+{
3659+ struct drm_i915_private *i915 = to_i915(state->base.dev);
3660+ const struct intel_dbuf_state *old_dbuf_state =
3661+ intel_atomic_get_old_dbuf_state(state);
3662+ const struct intel_dbuf_state *new_dbuf_state =
3663+ intel_atomic_get_new_dbuf_state(state);
3664+ int mdclk_cdclk_ratio;
3665+
3666+ if (intel_cdclk_is_decreasing_later(state)) {
3667+ /* cdclk/mdclk will be changed later by intel_set_cdclk_post_plane_update() */
3668+ mdclk_cdclk_ratio = old_dbuf_state->mdclk_cdclk_ratio;
3669+ } else {
3670+ /* cdclk/mdclk already changed by intel_set_cdclk_pre_plane_update() */
3671+ mdclk_cdclk_ratio = new_dbuf_state->mdclk_cdclk_ratio;
3672+ }
3673+
3674+ intel_dbuf_mdclk_cdclk_ratio_update(i915, mdclk_cdclk_ratio,
3675+ new_dbuf_state->joined_mbus);
3676+}
3677+
3678+static enum pipe intel_mbus_joined_pipe(struct intel_atomic_state *state,
3679+ const struct intel_dbuf_state *dbuf_state)
3680+{
3681+ struct drm_i915_private *i915 = to_i915(state->base.dev);
3682+ enum pipe pipe = ffs(dbuf_state->active_pipes) - 1;
3683+ const struct intel_crtc_state *new_crtc_state;
3684+ struct intel_crtc *crtc;
3685+
3686+ drm_WARN_ON(&i915->drm, !dbuf_state->joined_mbus);
3687+ drm_WARN_ON(&i915->drm, !is_power_of_2(dbuf_state->active_pipes));
3688+
3689+ crtc = intel_crtc_for_pipe(i915, pipe);
3690+ new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
3691+
3692+ if (new_crtc_state && !intel_crtc_needs_modeset(new_crtc_state))
3693+ return pipe;
3694+ else
3695+ return INVALID_PIPE;
3696+}
3697+
3698+static void intel_dbuf_mbus_join_update(struct intel_atomic_state *state,
3699+ enum pipe pipe)
3700+{
3701+ struct drm_i915_private *i915 = to_i915(state->base.dev);
3702+ const struct intel_dbuf_state *old_dbuf_state =
3703+ intel_atomic_get_old_dbuf_state(state);
3704+ const struct intel_dbuf_state *new_dbuf_state =
3705+ intel_atomic_get_new_dbuf_state(state);
3706+ u32 mbus_ctl;
3707+
3708+ drm_dbg_kms(&i915->drm, "Changing mbus joined: %s -> %s (pipe: %c)\n",
3709+ str_yes_no(old_dbuf_state->joined_mbus),
3710+ str_yes_no(new_dbuf_state->joined_mbus),
3711+ pipe != INVALID_PIPE ? pipe_name(pipe) : '*');
3712+
3713+ if (new_dbuf_state->joined_mbus)
3714+ mbus_ctl = MBUS_HASHING_MODE_1x4 | MBUS_JOIN;
3715+ else
3716+ mbus_ctl = MBUS_HASHING_MODE_2x2;
3717+
3718+ if (pipe != INVALID_PIPE)
3719+ mbus_ctl |= MBUS_JOIN_PIPE_SELECT(pipe);
3720+ else
3721+ mbus_ctl |= MBUS_JOIN_PIPE_SELECT_NONE;
3722+
3723+ intel_de_rmw(i915, MBUS_CTL,
3724+ MBUS_HASHING_MODE_MASK | MBUS_JOIN |
3725+ MBUS_JOIN_PIPE_SELECT_MASK, mbus_ctl);
3726+}
3727+
3728+void intel_dbuf_mbus_pre_ddb_update(struct intel_atomic_state *state)
3729+{
3730+ const struct intel_dbuf_state *new_dbuf_state =
3731+ intel_atomic_get_new_dbuf_state(state);
3732+ const struct intel_dbuf_state *old_dbuf_state =
3733+ intel_atomic_get_old_dbuf_state(state);
3734+
3735+ if (!new_dbuf_state)
3736+ return;
3737+
3738+ if (!old_dbuf_state->joined_mbus && new_dbuf_state->joined_mbus) {
3739+ enum pipe pipe = intel_mbus_joined_pipe(state, new_dbuf_state);
3740+
3741+ WARN_ON(!new_dbuf_state->base.changed);
3742+
3743+ intel_dbuf_mbus_join_update(state, pipe);
3744+ intel_mbus_dbox_update(state);
3745+ intel_dbuf_mdclk_min_tracker_update(state);
3746+ }
3747+}
3748+
3749+void intel_dbuf_mbus_post_ddb_update(struct intel_atomic_state *state)
3750+{
3751+ struct drm_i915_private *i915 = to_i915(state->base.dev);
3752+ const struct intel_dbuf_state *new_dbuf_state =
3753+ intel_atomic_get_new_dbuf_state(state);
3754+ const struct intel_dbuf_state *old_dbuf_state =
3755+ intel_atomic_get_old_dbuf_state(state);
3756+
3757+ if (!new_dbuf_state)
3758+ return;
3759+
3760+ if (old_dbuf_state->joined_mbus && !new_dbuf_state->joined_mbus) {
3761+ enum pipe pipe = intel_mbus_joined_pipe(state, old_dbuf_state);
3762+
3763+ WARN_ON(!new_dbuf_state->base.changed);
3764+
3765+ intel_dbuf_mdclk_min_tracker_update(state);
3766+ intel_mbus_dbox_update(state);
3767+ intel_dbuf_mbus_join_update(state, pipe);
3768+
3769+ if (pipe != INVALID_PIPE) {
3770+ struct intel_crtc *crtc = intel_crtc_for_pipe(i915, pipe);
3771+
3772+ intel_crtc_wait_for_next_vblank(crtc);
3773+ }
3774+ } else if (old_dbuf_state->joined_mbus == new_dbuf_state->joined_mbus &&
3775+ old_dbuf_state->active_pipes != new_dbuf_state->active_pipes) {
3776+ WARN_ON(!new_dbuf_state->base.changed);
3777+
3778+ intel_dbuf_mdclk_min_tracker_update(state);
3779+ intel_mbus_dbox_update(state);
3780+ }
3781+
3782+}
3783+
3784+void intel_dbuf_pre_plane_update(struct intel_atomic_state *state)
3785+{
3786+ struct drm_i915_private *i915 = to_i915(state->base.dev);
3787+ const struct intel_dbuf_state *new_dbuf_state =
3788+ intel_atomic_get_new_dbuf_state(state);
3789+ const struct intel_dbuf_state *old_dbuf_state =
3790+ intel_atomic_get_old_dbuf_state(state);
3791+ u8 old_slices, new_slices;
3792+
3793+ if (!new_dbuf_state)
3794+ return;
3795+
3796+ old_slices = old_dbuf_state->enabled_slices;
3797+ new_slices = old_dbuf_state->enabled_slices | new_dbuf_state->enabled_slices;
3798+
3799+ if (old_slices == new_slices)
3800+ return;
3801+
3802+ WARN_ON(!new_dbuf_state->base.changed);
3803+
3804+ gen9_dbuf_slices_update(i915, new_slices);
3805+}
3806+
3807+void intel_dbuf_post_plane_update(struct intel_atomic_state *state)
3808+{
3809+ struct drm_i915_private *i915 = to_i915(state->base.dev);
3810+ const struct intel_dbuf_state *new_dbuf_state =
3811+ intel_atomic_get_new_dbuf_state(state);
3812+ const struct intel_dbuf_state *old_dbuf_state =
3813+ intel_atomic_get_old_dbuf_state(state);
3814+ u8 old_slices, new_slices;
3815+
3816+ if (!new_dbuf_state)
3817+ return;
3818+
3819+ old_slices = old_dbuf_state->enabled_slices | new_dbuf_state->enabled_slices;
3820+ new_slices = new_dbuf_state->enabled_slices;
3821+
3822+ if (old_slices == new_slices)
3823+ return;
3824+
3825+ WARN_ON(!new_dbuf_state->base.changed);
3826+
3827+ gen9_dbuf_slices_update(i915, new_slices);
3828+}
3829+
37003830 static int skl_watermark_ipc_status_show(struct seq_file *m, void *data)
37013831 {
37023832 struct drm_i915_private *i915 = m->private;
drivers/gpu/drm/i915/display/skl_watermark.h+11−2
@@ -58,22 +58,31 @@ struct intel_dbuf_state { · 57 unmodified lines
5858 u8 slices[I915_MAX_PIPES];
5959 u8 enabled_slices;
6060 u8 active_pipes;
61+ u8 mdclk_cdclk_ratio;
6162 bool joined_mbus;
6263 };
6364
6465 struct intel_dbuf_state *
6566 intel_atomic_get_dbuf_state(struct intel_atomic_state *state);
6667
67−#define to_intel_dbuf_state(x) container_of((x), struct intel_dbuf_state, base)
68+#define to_intel_dbuf_state(global_state) \
69+ container_of_const((global_state), struct intel_dbuf_state, base)
70+
6871 #define intel_atomic_get_old_dbuf_state(state) \
6972 to_intel_dbuf_state(intel_atomic_get_old_global_obj_state(state, &to_i915(state->base.dev)->display.dbuf.obj))
7073 #define intel_atomic_get_new_dbuf_state(state) \
7174 to_intel_dbuf_state(intel_atomic_get_new_global_obj_state(state, &to_i915(state->base.dev)->display.dbuf.obj))
7275
7376 int intel_dbuf_init(struct drm_i915_private *i915);
77+int intel_dbuf_state_set_mdclk_cdclk_ratio(struct intel_atomic_state *state,
78+ int ratio);
79+
7480 void intel_dbuf_pre_plane_update(struct intel_atomic_state *state);
7581 void intel_dbuf_post_plane_update(struct intel_atomic_state *state);
76−void intel_mbus_dbox_update(struct intel_atomic_state *state);
82+void intel_dbuf_mdclk_cdclk_ratio_update(struct drm_i915_private *i915,
83+ int ratio, bool joined_mbus);
84+void intel_dbuf_mbus_pre_ddb_update(struct intel_atomic_state *state);
85+void intel_dbuf_mbus_post_ddb_update(struct intel_atomic_state *state);
7786
7887 #endif /* __SKL_WATERMARK_H__ */
7988
drivers/gpu/drm/i915/display/skl_watermark_regs.h+10−8
@@ -32,14 +32,16 @@ · 31 unmodified lines
3232 #define MBUS_BBOX_CTL_S1 _MMIO(0x45040)
3333 #define MBUS_BBOX_CTL_S2 _MMIO(0x45044)
3434
35−#define MBUS_CTL _MMIO(0x4438C)
36−#define MBUS_JOIN REG_BIT(31)
37−#define MBUS_HASHING_MODE_MASK REG_BIT(30)
38−#define MBUS_HASHING_MODE_2x2 REG_FIELD_PREP(MBUS_HASHING_MODE_MASK, 0)
39−#define MBUS_HASHING_MODE_1x4 REG_FIELD_PREP(MBUS_HASHING_MODE_MASK, 1)
40−#define MBUS_JOIN_PIPE_SELECT_MASK REG_GENMASK(28, 26)
41−#define MBUS_JOIN_PIPE_SELECT(pipe) REG_FIELD_PREP(MBUS_JOIN_PIPE_SELECT_MASK, pipe)
42−#define MBUS_JOIN_PIPE_SELECT_NONE MBUS_JOIN_PIPE_SELECT(7)
35+#define MBUS_CTL _MMIO(0x4438C)
36+#define MBUS_JOIN REG_BIT(31)
37+#define MBUS_HASHING_MODE_MASK REG_BIT(30)
38+#define MBUS_HASHING_MODE_2x2 REG_FIELD_PREP(MBUS_HASHING_MODE_MASK, 0)
39+#define MBUS_HASHING_MODE_1x4 REG_FIELD_PREP(MBUS_HASHING_MODE_MASK, 1)
40+#define MBUS_JOIN_PIPE_SELECT_MASK REG_GENMASK(28, 26)
41+#define MBUS_JOIN_PIPE_SELECT(pipe) REG_FIELD_PREP(MBUS_JOIN_PIPE_SELECT_MASK, pipe)
42+#define MBUS_JOIN_PIPE_SELECT_NONE MBUS_JOIN_PIPE_SELECT(7)
43+#define MBUS_TRANSLATION_THROTTLE_MIN_MASK REG_GENMASK(15, 13)
44+#define MBUS_TRANSLATION_THROTTLE_MIN(val) REG_FIELD_PREP(MBUS_TRANSLATION_THROTTLE_MIN_MASK, val)
4345
4446 /* Watermark register definitions for SKL */
4547 #define _CUR_WM_A_0 0x70140
drivers/gpu/drm/i915/display/vlv_dsi.c+1−2
@@ -273,8 +273,7 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder, · 272 unmodified lines
273273 struct drm_connector_state *conn_state)
274274 {
275275 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
276− struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
277− base);
276+ struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
278277 struct intel_connector *intel_connector = intel_dsi->attached_connector;
279278 struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
280279 int ret;
drivers/gpu/drm/i915/gem/i915_gem_object_types.h+1−1
@@ -386,7 +386,7 @@ struct drm_i915_gem_object { · 385 unmodified lines
386386 * and kernel mode driver for caching policy control after GEN12.
387387 * In the meantime platform specific tables are created to translate
388388 * i915_cache_level into pat index, for more details check the macros
389− * defined i915/i915_pci.c, e.g. PVC_CACHELEVEL.
389+ * defined i915/i915_pci.c, e.g. TGL_CACHELEVEL.
390390 * For backward compatibility, this field contains values exactly match
391391 * the entries of enum i915_cache_level for pre-GEN12 platforms (See
392392 * LEGACY_CACHELEVEL), so that the PTE encode functions for these
drivers/gpu/drm/i915/gem/selftests/huge_pages.c+2−2
@@ -713,7 +713,7 @@ static int igt_ppgtt_huge_fill(void *arg) · 712 unmodified lines
713713 {
714714 struct drm_i915_private *i915 = arg;
715715 unsigned int supported = RUNTIME_INFO(i915)->page_sizes;
716− bool has_pte64 = GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50);
716+ bool has_pte64 = GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55);
717717 struct i915_address_space *vm;
718718 struct i915_gem_context *ctx;
719719 unsigned long max_pages;
@@ -857,7 +857,7 @@ out: · 137 unmodified lines
857857 static int igt_ppgtt_64K(void *arg)
858858 {
859859 struct drm_i915_private *i915 = arg;
860− bool has_pte64 = GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50);
860+ bool has_pte64 = GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55);
861861 struct drm_i915_gem_object *obj;
862862 struct i915_address_space *vm;
863863 struct i915_gem_context *ctx;
drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c+4−4
@@ -117,7 +117,7 @@ static bool fastblit_supports_x_tiling(const struct drm_i915_private *i915) · 116 unmodified lines
117117 if (gen < 12)
118118 return true;
119119
120− if (GRAPHICS_VER_FULL(i915) < IP_VER(12, 50))
120+ if (GRAPHICS_VER_FULL(i915) < IP_VER(12, 55))
121121 return false;
122122
123123 return HAS_DISPLAY(i915);
@@ -166,7 +166,7 @@ static int prepare_blit(const struct tiled_blits *t, · 42 unmodified lines
166166 src_pitch = t->width; /* in dwords */
167167 if (src->tiling == CLIENT_TILING_Y) {
168168 src_tiles = XY_FAST_COPY_BLT_D0_SRC_TILE_MODE(YMAJOR);
169− if (GRAPHICS_VER_FULL(to_i915(batch->base.dev)) >= IP_VER(12, 50))
169+ if (GRAPHICS_VER_FULL(to_i915(batch->base.dev)) >= IP_VER(12, 55))
170170 src_4t = XY_FAST_COPY_BLT_D1_SRC_TILE4;
171171 } else if (src->tiling == CLIENT_TILING_X) {
172172 src_tiles = XY_FAST_COPY_BLT_D0_SRC_TILE_MODE(TILE_X);
@@ -177,7 +177,7 @@ static int prepare_blit(const struct tiled_blits *t, · 4 unmodified lines
177177 dst_pitch = t->width; /* in dwords */
178178 if (dst->tiling == CLIENT_TILING_Y) {
179179 dst_tiles = XY_FAST_COPY_BLT_D0_DST_TILE_MODE(YMAJOR);
180− if (GRAPHICS_VER_FULL(to_i915(batch->base.dev)) >= IP_VER(12, 50))
180+ if (GRAPHICS_VER_FULL(to_i915(batch->base.dev)) >= IP_VER(12, 55))
181181 dst_4t = XY_FAST_COPY_BLT_D1_DST_TILE4;
182182 } else if (dst->tiling == CLIENT_TILING_X) {
183183 dst_tiles = XY_FAST_COPY_BLT_D0_DST_TILE_MODE(TILE_X);
@@ -365,7 +365,7 @@ static u64 tiled_offset(const struct intel_gt *gt, · 181 unmodified lines
365365 v += x;
366366
367367 swizzle = gt->ggtt->bit_6_swizzle_x;
368− } else if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 50)) {
368+ } else if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 55)) {
369369 /* Y-major tiling layout is Tile4 for Xe_HP and beyond */
370370 v = linear_x_y_to_ftiled_pos(x_pos, y_pos, stride, 32);
371371
drivers/gpu/drm/i915/gt/gen8_engine_cs.c+1−4
@@ -189,9 +189,6 @@ static bool gen12_needs_ccs_aux_inv(struct intel_engine_cs *engine) · 188 unmodified lines
189189 {
190190 i915_reg_t reg = gen12_get_aux_inv_reg(engine);
191191
192− if (IS_PONTEVECCHIO(engine->i915))
193− return false;
194−
195192 /*
196193 * So far platforms supported by i915 having flat ccs do not require
197194 * AUX invalidation. Check also whether the engine requires it.
@@ -827,7 +824,7 @@ u32 *gen12_emit_fini_breadcrumb_rcs(struct i915_request *rq, u32 *cs) · 629 unmodified lines
827824 cs = gen12_emit_pipe_control(cs, 0,
828825 PIPE_CONTROL_DEPTH_CACHE_FLUSH, 0);
829826
830− if (GRAPHICS_VER(i915) == 12 && GRAPHICS_VER_FULL(i915) < IP_VER(12, 50))
827+ if (GRAPHICS_VER(i915) == 12 && GRAPHICS_VER_FULL(i915) < IP_VER(12, 55))
831828 /* Wa_1409600907 */
832829 flags |= PIPE_CONTROL_DEPTH_STALL;
833830
drivers/gpu/drm/i915/gt/gen8_ppgtt.c+20−20
@@ -500,11 +500,11 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, · 499 unmodified lines
500500 }
501501
502502 static void
503−xehpsdv_ppgtt_insert_huge(struct i915_address_space *vm,
504− struct i915_vma_resource *vma_res,
505− struct sgt_dma *iter,
506− unsigned int pat_index,
507− u32 flags)
503+xehp_ppgtt_insert_huge(struct i915_address_space *vm,
504+ struct i915_vma_resource *vma_res,
505+ struct sgt_dma *iter,
506+ unsigned int pat_index,
507+ u32 flags)
508508 {
509509 const gen8_pte_t pte_encode = vm->pte_encode(0, pat_index, flags);
510510 unsigned int rem = sg_dma_len(iter->sg);
@@ -741,8 +741,8 @@ static void gen8_ppgtt_insert(struct i915_address_space *vm, · 230 unmodified lines
741741 struct sgt_dma iter = sgt_dma(vma_res);
742742
743743 if (vma_res->bi.page_sizes.sg > I915_GTT_PAGE_SIZE) {
744− if (GRAPHICS_VER_FULL(vm->i915) >= IP_VER(12, 50))
745− xehpsdv_ppgtt_insert_huge(vm, vma_res, &iter, pat_index, flags);
744+ if (GRAPHICS_VER_FULL(vm->i915) >= IP_VER(12, 55))
745+ xehp_ppgtt_insert_huge(vm, vma_res, &iter, pat_index, flags);
746746 else
747747 gen8_ppgtt_insert_huge(vm, vma_res, &iter, pat_index, flags);
748748 } else {
@@ -781,11 +781,11 @@ static void gen8_ppgtt_insert_entry(struct i915_address_space *vm, · 32 unmodified lines
781781 drm_clflush_virt_range(&vaddr[gen8_pd_index(idx, 0)], sizeof(*vaddr));
782782 }
783783
784−static void __xehpsdv_ppgtt_insert_entry_lm(struct i915_address_space *vm,
785− dma_addr_t addr,
786− u64 offset,
787− unsigned int pat_index,
788− u32 flags)
784+static void xehp_ppgtt_insert_entry_lm(struct i915_address_space *vm,
785+ dma_addr_t addr,
786+ u64 offset,
787+ unsigned int pat_index,
788+ u32 flags)
789789 {
790790 u64 idx = offset >> GEN8_PTE_SHIFT;
791791 struct i915_page_directory * const pdp =
@@ -810,15 +810,15 @@ static void __xehpsdv_ppgtt_insert_entry_lm(struct i915_address_space *vm, · 18 unmodified lines
810810 vaddr[gen8_pd_index(idx, 0) / 16] = vm->pte_encode(addr, pat_index, flags);
811811 }
812812
813−static void xehpsdv_ppgtt_insert_entry(struct i915_address_space *vm,
814− dma_addr_t addr,
815− u64 offset,
816− unsigned int pat_index,
817− u32 flags)
813+static void xehp_ppgtt_insert_entry(struct i915_address_space *vm,
814+ dma_addr_t addr,
815+ u64 offset,
816+ unsigned int pat_index,
817+ u32 flags)
818818 {
819819 if (flags & PTE_LM)
820− return __xehpsdv_ppgtt_insert_entry_lm(vm, addr, offset,
821− pat_index, flags);
820+ return xehp_ppgtt_insert_entry_lm(vm, addr, offset,
821+ pat_index, flags);
822822
823823 return gen8_ppgtt_insert_entry(vm, addr, offset, pat_index, flags);
824824 }
@@ -1042,7 +1042,7 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt, · 217 unmodified lines
10421042 ppgtt->vm.bind_async_flags = I915_VMA_LOCAL_BIND;
10431043 ppgtt->vm.insert_entries = gen8_ppgtt_insert;
10441044 if (HAS_64K_PAGES(gt->i915))
1045− ppgtt->vm.insert_page = xehpsdv_ppgtt_insert_entry;
1045+ ppgtt->vm.insert_page = xehp_ppgtt_insert_entry;
10461046 else
10471047 ppgtt->vm.insert_page = gen8_ppgtt_insert_entry;
10481048 ppgtt->vm.allocate_va_range = gen8_ppgtt_alloc;
drivers/gpu/drm/i915/gt/intel_engine_cs.c+4−39
@@ -497,9 +497,8 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id, · 496 unmodified lines
497497 engine->logical_mask = BIT(logical_instance);
498498 __sprint_engine_name(engine);
499499
500− if ((engine->class == COMPUTE_CLASS && !RCS_MASK(engine->gt) &&
501− __ffs(CCS_MASK(engine->gt)) == engine->instance) ||
502− engine->class == RENDER_CLASS)
500+ if ((engine->class == COMPUTE_CLASS || engine->class == RENDER_CLASS) &&
501+ __ffs(CCS_MASK(engine->gt) | RCS_MASK(engine->gt)) == engine->instance)
503502 engine->flags |= I915_ENGINE_FIRST_RENDER_COMPUTE;
504503
505504 /* features common between engines sharing EUs */
@@ -765,14 +764,14 @@ static void engine_mask_apply_media_fuses(struct intel_gt *gt) · 259 unmodified lines
765764 * and bits have disable semantices.
766765 */
767766 media_fuse = intel_uncore_read(gt->uncore, GEN11_GT_VEBOX_VDBOX_DISABLE);
768− if (MEDIA_VER_FULL(i915) < IP_VER(12, 50))
767+ if (MEDIA_VER_FULL(i915) < IP_VER(12, 55))
769768 media_fuse = ~media_fuse;
770769
771770 vdbox_mask = media_fuse & GEN11_GT_VDBOX_DISABLE_MASK;
772771 vebox_mask = (media_fuse & GEN11_GT_VEBOX_DISABLE_MASK) >>
773772 GEN11_GT_VEBOX_DISABLE_SHIFT;
774773
775− if (MEDIA_VER_FULL(i915) >= IP_VER(12, 50)) {
774+ if (MEDIA_VER_FULL(i915) >= IP_VER(12, 55)) {
776775 fuse1 = intel_uncore_read(gt->uncore, HSW_PAVP_FUSE1);
777776 gt->info.sfc_mask = REG_FIELD_GET(XEHP_SFC_ENABLE_MASK, fuse1);
778777 } else {
@@ -839,38 +838,6 @@ static void engine_mask_apply_compute_fuses(struct intel_gt *gt) · 60 unmodified lines
839838 }
840839 }
841840
842−static void engine_mask_apply_copy_fuses(struct intel_gt *gt)
843−{
844− struct drm_i915_private *i915 = gt->i915;
845− struct intel_gt_info *info = &gt->info;
846− unsigned long meml3_mask;
847− unsigned long quad;
848−
849− if (!(GRAPHICS_VER_FULL(i915) >= IP_VER(12, 60) &&
850− GRAPHICS_VER_FULL(i915) < IP_VER(12, 70)))
851− return;
852−
853− meml3_mask = intel_uncore_read(gt->uncore, GEN10_MIRROR_FUSE3);
854− meml3_mask = REG_FIELD_GET(GEN12_MEML3_EN_MASK, meml3_mask);
855−
856− /*
857− * Link Copy engines may be fused off according to meml3_mask. Each
858− * bit is a quad that houses 2 Link Copy and two Sub Copy engines.
859− */
860− for_each_clear_bit(quad, &meml3_mask, GEN12_MAX_MSLICES) {
861− unsigned int instance = quad * 2 + 1;
862− intel_engine_mask_t mask = GENMASK(_BCS(instance + 1),
863− _BCS(instance));
864−
865− if (mask & info->engine_mask) {
866− gt_dbg(gt, "bcs%u fused off\n", instance);
867− gt_dbg(gt, "bcs%u fused off\n", instance + 1);
868−
869− info->engine_mask &= ~mask;
870− }
871− }
872−}
873−
874841 /*
875842 * Determine which engines are fused off in our particular hardware.
876843 * Note that we have a catch-22 situation where we need to be able to access
@@ -889,7 +856,6 @@ static intel_engine_mask_t init_engine_mask(struct intel_gt *gt) · 12 unmodified lines
889856
890857 engine_mask_apply_media_fuses(gt);
891858 engine_mask_apply_compute_fuses(gt);
892− engine_mask_apply_copy_fuses(gt);
893859
894860 /*
895861 * The only use of the GSC CS is to load and communicate with the GSC
@@ -1193,7 +1159,6 @@ static int intel_engine_init_tlb_invalidation(struct intel_engine_cs *engine) · 297 unmodified lines
11931159 if (GRAPHICS_VER_FULL(i915) == IP_VER(12, 74) ||
11941160 GRAPHICS_VER_FULL(i915) == IP_VER(12, 71) ||
11951161 GRAPHICS_VER_FULL(i915) == IP_VER(12, 70) ||
1196− GRAPHICS_VER_FULL(i915) == IP_VER(12, 50) ||
11971162 GRAPHICS_VER_FULL(i915) == IP_VER(12, 55)) {
11981163 regs = xehp_regs;
11991164 num = ARRAY_SIZE(xehp_regs);
drivers/gpu/drm/i915/gt/intel_execlists_submission.c+5−5
@@ -493,7 +493,7 @@ __execlists_schedule_in(struct i915_request *rq) · 492 unmodified lines
493493 /* Use a fixed tag for OA and friends */
494494 GEM_BUG_ON(ce->tag <= BITS_PER_LONG);
495495 ce->lrc.ccid = ce->tag;
496− } else if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50)) {
496+ } else if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55)) {
497497 /* We don't need a strict matching tag, just different values */
498498 unsigned int tag = ffs(READ_ONCE(engine->context_tag));
499499
@@ -613,7 +613,7 @@ static void __execlists_schedule_out(struct i915_request * const rq, · 113 unmodified lines
613613 intel_engine_add_retire(engine, ce->timeline);
614614
615615 ccid = ce->lrc.ccid;
616− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50)) {
616+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55)) {
617617 ccid >>= XEHP_SW_CTX_ID_SHIFT - 32;
618618 ccid &= XEHP_MAX_CONTEXT_HW_ID;
619619 } else {
@@ -1907,7 +1907,7 @@ process_csb(struct intel_engine_cs *engine, struct i915_request **inactive) · 1287 unmodified lines
19071907 ENGINE_TRACE(engine, "csb[%d]: status=0x%08x:0x%08x\n",
19081908 head, upper_32_bits(csb), lower_32_bits(csb));
19091909
1910− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
1910+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
19111911 promote = xehp_csb_parse(csb);
19121912 else if (GRAPHICS_VER(engine->i915) >= 12)
19131913 promote = gen12_csb_parse(csb);
@@ -3482,7 +3482,7 @@ logical_ring_default_vfuncs(struct intel_engine_cs *engine) · 1568 unmodified lines
34823482 }
34833483 }
34843484
3485− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50)) {
3485+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55)) {
34863486 if (intel_engine_has_preemption(engine))
34873487 engine->emit_bb_start = xehp_emit_bb_start;
34883488 else
@@ -3585,7 +3585,7 @@ int intel_execlists_submission_setup(struct intel_engine_cs *engine) · 96 unmodified lines
35853585
35863586 engine->context_tag = GENMASK(BITS_PER_LONG - 2, 0);
35873587 if (GRAPHICS_VER(engine->i915) >= 11 &&
3588− GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 50)) {
3588+ GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 55)) {
35893589 execlists->ccid |= engine->instance << (GEN11_ENGINE_INSTANCE_SHIFT - 32);
35903590 execlists->ccid |= engine->class << (GEN11_ENGINE_CLASS_SHIFT - 32);
35913591 }
drivers/gpu/drm/i915/gt/intel_gsc.c+0−15
@@ -103,19 +103,6 @@ static const struct gsc_def gsc_def_dg1[] = { · 102 unmodified lines
103103 }
104104 };
105105
106−static const struct gsc_def gsc_def_xehpsdv[] = {
107− {
108− /* HECI1 not enabled on the device. */
109− },
110− {
111− .name = "mei-gscfi",
112− .bar = DG1_GSC_HECI2_BASE,
113− .bar_size = GSC_BAR_LENGTH,
114− .use_polling = true,
115− .slow_firmware = true,
116− }
117−};
118−
119106 static const struct gsc_def gsc_def_dg2[] = {
120107 {
121108 .name = "mei-gsc",
@@ -188,8 +175,6 @@ static void gsc_init_one(struct drm_i915_private *i915, struct intel_gsc *gsc, · 66 unmodified lines
188175
189176 if (IS_DG1(i915)) {
190177 def = &gsc_def_dg1[intf_id];
191− } else if (IS_XEHPSDV(i915)) {
192− def = &gsc_def_xehpsdv[intf_id];
193178 } else if (IS_DG2(i915)) {
194179 def = &gsc_def_dg2[intf_id];
195180 } else {
drivers/gpu/drm/i915/gt/intel_gt.c+2−2
@@ -278,7 +278,7 @@ intel_gt_clear_error_registers(struct intel_gt *gt, · 277 unmodified lines
278278 intel_uncore_posting_read(uncore,
279279 XELPMP_RING_FAULT_REG);
280280
281− } else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50)) {
281+ } else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55)) {
282282 intel_gt_mcr_multicast_rmw(gt, XEHP_RING_FAULT_REG,
283283 RING_FAULT_VALID, 0);
284284 intel_gt_mcr_read_any(gt, XEHP_RING_FAULT_REG);
@@ -403,7 +403,7 @@ void intel_gt_check_and_clear_faults(struct intel_gt *gt) · 118 unmodified lines
403403 struct drm_i915_private *i915 = gt->i915;
404404
405405 /* From GEN8 onwards we only have one 'All Engine Fault Register' */
406− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
406+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
407407 xehp_check_faults(gt);
408408 else if (GRAPHICS_VER(i915) >= 8)
409409 gen8_check_faults(gt);
drivers/gpu/drm/i915/gt/intel_gt_mcr.c+4−48
@@ -57,51 +57,18 @@ static const struct intel_mmio_range icl_l3bank_steering_table[] = { · 56 unmodified lines
5757 * are of a "GAM" subclass that has special rules. Thus we use a separate
5858 * GAM table farther down for those.
5959 */
60−static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
60+static const struct intel_mmio_range dg2_mslice_steering_table[] = {
6161 { 0x00DD00, 0x00DDFF },
6262 { 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
6363 {},
6464 };
6565
66−static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
67− { 0x004000, 0x004AFF },
68− { 0x00C800, 0x00CFFF },
69− {},
70−};
71−
72−static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
73− { 0x00B000, 0x00B0FF },
74− { 0x00D800, 0x00D8FF },
75− {},
76−};
77−
7866 static const struct intel_mmio_range dg2_lncf_steering_table[] = {
7967 { 0x00B000, 0x00B0FF },
8068 { 0x00D880, 0x00D8FF },
8169 {},
8270 };
8371
84−/*
85− * We have several types of MCR registers on PVC where steering to (0,0)
86− * will always provide us with a non-terminated value. We'll stick them
87− * all in the same table for simplicity.
88− */
89−static const struct intel_mmio_range pvc_instance0_steering_table[] = {
90− { 0x004000, 0x004AFF }, /* HALF-BSLICE */
91− { 0x008800, 0x00887F }, /* CC */
92− { 0x008A80, 0x008AFF }, /* TILEPSMI */
93− { 0x00B000, 0x00B0FF }, /* HALF-BSLICE */
94− { 0x00B100, 0x00B3FF }, /* L3BANK */
95− { 0x00C800, 0x00CFFF }, /* HALF-BSLICE */
96− { 0x00D800, 0x00D8FF }, /* HALF-BSLICE */
97− { 0x00DD00, 0x00DDFF }, /* BSLICE */
98− { 0x00E900, 0x00E9FF }, /* HALF-BSLICE */
99− { 0x00EC00, 0x00EEFF }, /* HALF-BSLICE */
100− { 0x00F000, 0x00FFFF }, /* HALF-BSLICE */
101− { 0x024180, 0x0241FF }, /* HALF-BSLICE */
102− {},
103−};
104−
10572 static const struct intel_mmio_range xelpg_instance0_steering_table[] = {
10673 { 0x000B00, 0x000BFF }, /* SQIDI */
10774 { 0x001000, 0x001FFF }, /* SQIDI */
@@ -185,22 +152,16 @@ void intel_gt_mcr_init(struct intel_gt *gt) · 77 unmodified lines
185152 gt->steering_table[INSTANCE0] = xelpg_instance0_steering_table;
186153 gt->steering_table[L3BANK] = xelpg_l3bank_steering_table;
187154 gt->steering_table[DSS] = xelpg_dss_steering_table;
188− } else if (IS_PONTEVECCHIO(i915)) {
189− gt->steering_table[INSTANCE0] = pvc_instance0_steering_table;
190155 } else if (IS_DG2(i915)) {
191− gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
156+ gt->steering_table[MSLICE] = dg2_mslice_steering_table;
192157 gt->steering_table[LNCF] = dg2_lncf_steering_table;
193158 /*
194159 * No need to hook up the GAM table since it has a dedicated
195160 * steering control register on DG2 and can use implicit
196161 * steering.
197162 */
198− } else if (IS_XEHPSDV(i915)) {
199− gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
200− gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
201− gt->steering_table[GAM] = xehpsdv_gam_steering_table;
202163 } else if (GRAPHICS_VER(i915) >= 11 &&
203− GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
164+ GRAPHICS_VER_FULL(i915) < IP_VER(12, 55)) {
204165 gt->steering_table[L3BANK] = icl_l3bank_steering_table;
205166 gt->info.l3bank_mask =
206167 ~intel_uncore_read(gt->uncore, GEN10_MIRROR_FUSE3) &
@@ -821,8 +782,6 @@ void intel_gt_mcr_report_steering(struct drm_printer *p, struct intel_gt *gt, · 614 unmodified lines
821782 for (int i = 0; i < NUM_STEERING_TYPES; i++)
822783 if (gt->steering_table[i])
823784 report_steering_type(p, gt, i, dump_table);
824− } else if (IS_PONTEVECCHIO(gt->i915)) {
825− report_steering_type(p, gt, INSTANCE0, dump_table);
826785 } else if (HAS_MSLICE_STEERING(gt->i915)) {
827786 report_steering_type(p, gt, MSLICE, dump_table);
828787 report_steering_type(p, gt, LNCF, dump_table);
@@ -842,10 +801,7 @@ void intel_gt_mcr_report_steering(struct drm_printer *p, struct intel_gt *gt, · 13 unmodified lines
842801 void intel_gt_mcr_get_ss_steering(struct intel_gt *gt, unsigned int dss,
843802 unsigned int *group, unsigned int *instance)
844803 {
845− if (IS_PONTEVECCHIO(gt->i915)) {
846− *group = dss / GEN_DSS_PER_CSLICE;
847− *instance = dss % GEN_DSS_PER_CSLICE;
848− } else if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 50)) {
804+ if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 55)) {
849805 *group = dss / GEN_DSS_PER_GSLICE;
850806 *instance = dss % GEN_DSS_PER_GSLICE;
851807 } else {
drivers/gpu/drm/i915/gt/intel_gt_mcr.h+1−1
@@ -54,7 +54,7 @@ int intel_gt_mcr_wait_for_reg(struct intel_gt *gt, · 53 unmodified lines
5454 * the topology, so we lookup the DSS ID directly in "slice 0."
5555 */
5656 #define _HAS_SS(ss_, gt_, group_, instance_) ( \
57− GRAPHICS_VER_FULL(gt_->i915) >= IP_VER(12, 50) ? \
57+ GRAPHICS_VER_FULL(gt_->i915) >= IP_VER(12, 55) ? \
5858 intel_sseu_has_subslice(&(gt_)->info.sseu, 0, ss_) : \
5959 intel_sseu_has_subslice(&(gt_)->info.sseu, group_, instance_))
6060
drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c+0−4
@@ -392,10 +392,6 @@ void intel_gt_pm_frequency_dump(struct intel_gt *gt, struct drm_printer *p) · 391 unmodified lines
392392 drm_puts(p, "no P-state info available\n");
393393 }
394394
395− drm_printf(p, "Current CD clock frequency: %d kHz\n", i915->display.cdclk.hw.cdclk);
396− drm_printf(p, "Max CD clock frequency: %d kHz\n", i915->display.cdclk.max_cdclk_freq);
397− drm_printf(p, "Max pixel clock frequency: %d kHz\n", i915->max_dotclk_freq);
398−
399395 intel_runtime_pm_put(uncore->rpm, wakeref);
400396 }
401397
drivers/gpu/drm/i915/gt/intel_gt_regs.h+0−59
@@ -718,44 +718,11 @@ · 717 unmodified lines
718718
719719 #define UNSLICE_UNIT_LEVEL_CLKGATE _MMIO(0x9434)
720720 #define VFUNIT_CLKGATE_DIS REG_BIT(20)
721−#define TSGUNIT_CLKGATE_DIS REG_BIT(17) /* XEHPSDV */
722721 #define CG3DDISCFEG_CLKGATE_DIS REG_BIT(17) /* DG2 */
723722 #define GAMEDIA_CLKGATE_DIS REG_BIT(11)
724723 #define HSUNIT_CLKGATE_DIS REG_BIT(8)
725724 #define VSUNIT_CLKGATE_DIS REG_BIT(3)
726725
727−#define UNSLCGCTL9440 _MMIO(0x9440)
728−#define GAMTLBOACS_CLKGATE_DIS REG_BIT(28)
729−#define GAMTLBVDBOX5_CLKGATE_DIS REG_BIT(27)
730−#define GAMTLBVDBOX6_CLKGATE_DIS REG_BIT(26)
731−#define GAMTLBVDBOX3_CLKGATE_DIS REG_BIT(24)
732−#define GAMTLBVDBOX4_CLKGATE_DIS REG_BIT(23)
733−#define GAMTLBVDBOX7_CLKGATE_DIS REG_BIT(22)
734−#define GAMTLBVDBOX2_CLKGATE_DIS REG_BIT(21)
735−#define GAMTLBVDBOX0_CLKGATE_DIS REG_BIT(17)
736−#define GAMTLBKCR_CLKGATE_DIS REG_BIT(16)
737−#define GAMTLBGUC_CLKGATE_DIS REG_BIT(15)
738−#define GAMTLBBLT_CLKGATE_DIS REG_BIT(14)
739−#define GAMTLBVDBOX1_CLKGATE_DIS REG_BIT(6)
740−
741−#define UNSLCGCTL9444 _MMIO(0x9444)
742−#define GAMTLBGFXA0_CLKGATE_DIS REG_BIT(30)
743−#define GAMTLBGFXA1_CLKGATE_DIS REG_BIT(29)
744−#define GAMTLBCOMPA0_CLKGATE_DIS REG_BIT(28)
745−#define GAMTLBCOMPA1_CLKGATE_DIS REG_BIT(27)
746−#define GAMTLBCOMPB0_CLKGATE_DIS REG_BIT(26)
747−#define GAMTLBCOMPB1_CLKGATE_DIS REG_BIT(25)
748−#define GAMTLBCOMPC0_CLKGATE_DIS REG_BIT(24)
749−#define GAMTLBCOMPC1_CLKGATE_DIS REG_BIT(23)
750−#define GAMTLBCOMPD0_CLKGATE_DIS REG_BIT(22)
751−#define GAMTLBCOMPD1_CLKGATE_DIS REG_BIT(21)
752−#define GAMTLBMERT_CLKGATE_DIS REG_BIT(20)
753−#define GAMTLBVEBOX3_CLKGATE_DIS REG_BIT(19)
754−#define GAMTLBVEBOX2_CLKGATE_DIS REG_BIT(18)
755−#define GAMTLBVEBOX1_CLKGATE_DIS REG_BIT(17)
756−#define GAMTLBVEBOX0_CLKGATE_DIS REG_BIT(16)
757−#define LTCDD_CLKGATE_DIS REG_BIT(10)
758−
759726 #define GEN11_SLICE_UNIT_LEVEL_CLKGATE _MMIO(0x94d4)
760727 #define XEHP_SLICE_UNIT_LEVEL_CLKGATE MCR_REG(0x94d4)
761728 #define SARBUNIT_CLKGATE_DIS (1 << 5)
@@ -765,9 +732,6 @@ · 3 unmodified lines
765732 #define L3_CLKGATE_DIS REG_BIT(16)
766733 #define L3_CR2X_CLKGATE_DIS REG_BIT(17)
767734
768−#define SCCGCTL94DC MCR_REG(0x94dc)
769−#define CG3DDISURB REG_BIT(14)
770−
771735 #define UNSLICE_UNIT_LEVEL_CLKGATE2 _MMIO(0x94e4)
772736 #define VSUNIT_CLKGATE_DIS_TGL REG_BIT(19)
773737 #define PSDUNIT_CLKGATE_DIS REG_BIT(5)
@@ -989,10 +953,6 @@ · 215 unmodified lines
989953 #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C47FF8C
990954 #define GEN7_L3AGDIS (1 << 19)
991955
992−#define XEHPC_LNCFMISCCFGREG0 MCR_REG(0xb01c)
993−#define XEHPC_HOSTCACHEEN REG_BIT(1)
994−#define XEHPC_OVRLSCCC REG_BIT(0)
995−
996956 #define GEN7_L3CNTLREG2 _MMIO(0xb020)
997957
998958 /* MOCS (Memory Object Control State) registers */
@@ -1046,20 +1006,9 @@ · 47 unmodified lines
10461006 #define XEHP_L3SQCREG5 MCR_REG(0xb158)
10471007 #define L3_PWM_TIMER_INIT_VAL_MASK REG_GENMASK(9, 0)
10481008
1049−#define MLTICTXCTL MCR_REG(0xb170)
1050−#define TDONRENDER REG_BIT(2)
1051−
10521009 #define XEHP_L3SCQREG7 MCR_REG(0xb188)
10531010 #define BLEND_FILL_CACHING_OPT_DIS REG_BIT(3)
10541011
1055−#define XEHPC_L3SCRUB MCR_REG(0xb18c)
1056−#define SCRUB_CL_DWNGRADE_SHARED REG_BIT(12)
1057−#define SCRUB_RATE_PER_BANK_MASK REG_GENMASK(2, 0)
1058−#define SCRUB_RATE_4B_PER_CLK REG_FIELD_PREP(SCRUB_RATE_PER_BANK_MASK, 0x6)
1059−
1060−#define L3SQCREG1_CCS0 MCR_REG(0xb200)
1061−#define FLUSHALLNONCOH REG_BIT(5)
1062−
10631012 #define GEN11_GLBLINVL _MMIO(0xb404)
10641013 #define GEN11_BANK_HASH_ADDR_EXCL_MASK (0x7f << 5)
10651014 #define GEN11_BANK_HASH_ADDR_EXCL_BIT0 (1 << 5)
@@ -1109,7 +1058,6 @@ · 43 unmodified lines
11091058 #define XEHP_COMPCTX_TLB_INV_CR MCR_REG(0xcf04)
11101059 #define XELPMP_GSC_TLB_INV_CR _MMIO(0xcf04) /* media GT only */
11111060
1112−#define XEHP_MERT_MOD_CTRL MCR_REG(0xcf28)
11131061 #define RENDER_MOD_CTRL MCR_REG(0xcf2c)
11141062 #define COMP_MOD_CTRL MCR_REG(0xcf30)
11151063 #define XELPMP_GSC_MOD_CTRL _MMIO(0xcf30) /* media GT only */
@@ -1185,7 +1133,6 @@ · 69 unmodified lines
11851133 #define EU_PERF_CNTL4 PERF_REG(0xe45c)
11861134
11871135 #define GEN9_ROW_CHICKEN4 MCR_REG(0xe48c)
1188−#define GEN12_DISABLE_GRF_CLEAR REG_BIT(13)
11891136 #define XEHP_DIS_BBL_SYSPIPE REG_BIT(11)
11901137 #define GEN12_DISABLE_TDL_PUSH REG_BIT(9)
11911138 #define GEN11_DIS_PICK_2ND_EU REG_BIT(7)
@@ -1202,7 +1149,6 @@ · 10 unmodified lines
12021149 #define FLOW_CONTROL_ENABLE REG_BIT(15)
12031150 #define UGM_BACKUP_MODE REG_BIT(13)
12041151 #define MDQ_ARBITRATION_MODE REG_BIT(12)
1205−#define SYSTOLIC_DOP_CLOCK_GATING_DIS REG_BIT(10)
12061152 #define PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE REG_BIT(8)
12071153 #define STALL_DOP_GATING_DISABLE REG_BIT(5)
12081154 #define THROTTLE_12_5 REG_GENMASK(4, 2)
@@ -1679,11 +1625,6 @@ · 470 unmodified lines
16791625
16801626 #define GEN12_SFC_DONE(n) _MMIO(0x1cc000 + (n) * 0x1000)
16811627
1682−#define GT0_PACKAGE_ENERGY_STATUS _MMIO(0x250004)
1683−#define GT0_PACKAGE_RAPL_LIMIT _MMIO(0x250008)
1684−#define GT0_PACKAGE_POWER_SKU_UNIT _MMIO(0x250068)
1685−#define GT0_PLATFORM_ENERGY_STATUS _MMIO(0x25006c)
1686−
16871628 /*
16881629 * Standalone Media's non-engine GT registers are located at their regular GT
16891630 * offsets plus 0x380000. This extra offset is stored inside the intel_uncore
drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c+6−15
@@ -573,7 +573,6 @@ static ssize_t media_freq_factor_show(struct kobject *kobj, · 572 unmodified lines
573573 char *buff)
574574 {
575575 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name);
576− struct intel_guc_slpc *slpc = &gt->uc.guc.slpc;
577576 intel_wakeref_t wakeref;
578577 u32 mode;
579578
@@ -581,20 +580,12 @@ static ssize_t media_freq_factor_show(struct kobject *kobj, · 1 unmodified line
581580 * Retrieve media_ratio_mode from GEN6_RPNSWREQ bit 13 set by
582581 * GuC. GEN6_RPNSWREQ:13 value 0 represents 1:2 and 1 represents 1:1
583582 */
584− if (IS_XEHPSDV(gt->i915) &&
585− slpc->media_ratio_mode == SLPC_MEDIA_RATIO_MODE_DYNAMIC_CONTROL) {
586− /*
587− * For XEHPSDV dynamic mode GEN6_RPNSWREQ:13 does not contain
588− * the media_ratio_mode, just return the cached media ratio
589− */
590− mode = slpc->media_ratio_mode;
591− } else {
592− with_intel_runtime_pm(gt->uncore->rpm, wakeref)
593− mode = intel_uncore_read(gt->uncore, GEN6_RPNSWREQ);
594− mode = REG_FIELD_GET(GEN12_MEDIA_FREQ_RATIO, mode) ?
595− SLPC_MEDIA_RATIO_MODE_FIXED_ONE_TO_ONE :
596− SLPC_MEDIA_RATIO_MODE_FIXED_ONE_TO_TWO;
597− }
583+ with_intel_runtime_pm(gt->uncore->rpm, wakeref)
584+ mode = intel_uncore_read(gt->uncore, GEN6_RPNSWREQ);
585+
586+ mode = REG_FIELD_GET(GEN12_MEDIA_FREQ_RATIO, mode) ?
587+ SLPC_MEDIA_RATIO_MODE_FIXED_ONE_TO_ONE :
588+ SLPC_MEDIA_RATIO_MODE_FIXED_ONE_TO_TWO;
598589
599590 return sysfs_emit(buff, "%u\n", media_ratio_mode_to_factor(mode));
600591 }
drivers/gpu/drm/i915/gt/intel_gtt.c+1−1
@@ -680,7 +680,7 @@ void setup_private_pat(struct intel_gt *gt) · 679 unmodified lines
680680
681681 if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70))
682682 xelpg_setup_private_ppat(gt);
683− else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
683+ else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
684684 xehp_setup_private_ppat(gt);
685685 else if (GRAPHICS_VER(i915) >= 12)
686686 tgl_setup_private_ppat(uncore);
drivers/gpu/drm/i915/gt/intel_lrc.c+4−47
@@ -546,47 +546,6 @@ static const u8 gen12_rcs_offsets[] = { · 545 unmodified lines
546546 END
547547 };
548548
549−static const u8 xehp_rcs_offsets[] = {
550− NOP(1),
551− LRI(13, POSTED),
552− REG16(0x244),
553− REG(0x034),
554− REG(0x030),
555− REG(0x038),
556− REG(0x03c),
557− REG(0x168),
558− REG(0x140),
559− REG(0x110),
560− REG(0x1c0),
561− REG(0x1c4),
562− REG(0x1c8),
563− REG(0x180),
564− REG16(0x2b4),
565−
566− NOP(5),
567− LRI(9, POSTED),
568− REG16(0x3a8),
569− REG16(0x28c),
570− REG16(0x288),
571− REG16(0x284),
572− REG16(0x280),
573− REG16(0x27c),
574− REG16(0x278),
575− REG16(0x274),
576− REG16(0x270),
577−
578− LRI(3, POSTED),
579− REG(0x1b0),
580− REG16(0x5a8),
581− REG16(0x5ac),
582−
583− NOP(6),
584− LRI(1, 0),
585− REG(0x0c8),
586−
587− END
588−};
589−
590549 static const u8 dg2_rcs_offsets[] = {
591550 NOP(1),
592551 LRI(15, POSTED),
@@ -695,8 +654,6 @@ static const u8 *reg_offsets(const struct intel_engine_cs *engine) · 102 unmodified lines
695654 return mtl_rcs_offsets;
696655 else if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
697656 return dg2_rcs_offsets;
698− else if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
699− return xehp_rcs_offsets;
700657 else if (GRAPHICS_VER(engine->i915) >= 12)
701658 return gen12_rcs_offsets;
702659 else if (GRAPHICS_VER(engine->i915) >= 11)
@@ -719,7 +676,7 @@ static const u8 *reg_offsets(const struct intel_engine_cs *engine) · 16 unmodified lines
719676
720677 static int lrc_ring_mi_mode(const struct intel_engine_cs *engine)
721678 {
722− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
679+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
723680 return 0x70;
724681 else if (GRAPHICS_VER(engine->i915) >= 12)
725682 return 0x60;
@@ -733,7 +690,7 @@ static int lrc_ring_mi_mode(const struct intel_engine_cs *engine) · 7 unmodified lines
733690
734691 static int lrc_ring_bb_offset(const struct intel_engine_cs *engine)
735692 {
736− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
693+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
737694 return 0x80;
738695 else if (GRAPHICS_VER(engine->i915) >= 12)
739696 return 0x70;
@@ -748,7 +705,7 @@ static int lrc_ring_bb_offset(const struct intel_engine_cs *engine) · 8 unmodified lines
748705
749706 static int lrc_ring_gpr0(const struct intel_engine_cs *engine)
750707 {
751− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
708+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
752709 return 0x84;
753710 else if (GRAPHICS_VER(engine->i915) >= 12)
754711 return 0x74;
@@ -795,7 +752,7 @@ static int lrc_ring_indirect_offset(const struct intel_engine_cs *engine) · 40 unmodified lines
795752 static int lrc_ring_cmd_buf_cctl(const struct intel_engine_cs *engine)
796753 {
797754
798− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
755+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
799756 /*
800757 * Note that the CSFE context has a dummy slot for CMD_BUF_CCTL
801758 * simply to match the RCS context image layout.
drivers/gpu/drm/i915/gt/intel_migrate.c+11−11
@@ -35,9 +35,9 @@ static bool engine_supports_migration(struct intel_engine_cs *engine) · 34 unmodified lines
3535 return true;
3636 }
3737
38−static void xehpsdv_toggle_pdes(struct i915_address_space *vm,
39− struct i915_page_table *pt,
40− void *data)
38+static void xehp_toggle_pdes(struct i915_address_space *vm,
39+ struct i915_page_table *pt,
40+ void *data)
4141 {
4242 struct insert_pte_data *d = data;
4343
@@ -52,9 +52,9 @@ static void xehpsdv_toggle_pdes(struct i915_address_space *vm, · 8 unmodified lines
5252 d->offset += SZ_2M;
5353 }
5454
55−static void xehpsdv_insert_pte(struct i915_address_space *vm,
56− struct i915_page_table *pt,
57− void *data)
55+static void xehp_insert_pte(struct i915_address_space *vm,
56+ struct i915_page_table *pt,
57+ void *data)
5858 {
5959 struct insert_pte_data *d = data;
6060
@@ -120,7 +120,7 @@ static struct i915_address_space *migrate_vm(struct intel_gt *gt) · 59 unmodified lines
120120 * 512 entry layout using 4K GTT pages. The other two windows just map
121121 * lmem pages and must use the new compact 32 entry layout using 64K GTT
122122 * pages, which ensures we can address any lmem object that the user
123− * throws at us. We then also use the xehpsdv_toggle_pdes as a way of
123+ * throws at us. We then also use the xehp_toggle_pdes as a way of
124124 * just toggling the PDE bit(GEN12_PDE_64K) for us, to enable the
125125 * compact layout for each of these page-tables, that fall within the
126126 * [CHUNK_SIZE, 3 * CHUNK_SIZE) range.
@@ -209,12 +209,12 @@ static struct i915_address_space *migrate_vm(struct intel_gt *gt) · 82 unmodified lines
209209 /* Now allow the GPU to rewrite the PTE via its own ppGTT */
210210 if (HAS_64K_PAGES(gt->i915)) {
211211 vm->vm.foreach(&vm->vm, base, d.offset - base,
212− xehpsdv_insert_pte, &d);
212+ xehp_insert_pte, &d);
213213 d.offset = base + CHUNK_SZ;
214214 vm->vm.foreach(&vm->vm,
215215 d.offset,
216216 2 * CHUNK_SZ,
217− xehpsdv_toggle_pdes, &d);
217+ xehp_toggle_pdes, &d);
218218 } else {
219219 vm->vm.foreach(&vm->vm, base, d.offset - base,
220220 insert_pte, &d);
@@ -925,7 +925,7 @@ static int emit_clear(struct i915_request *rq, u32 offset, int size, · 704 unmodified lines
925925
926926 GEM_BUG_ON(size >> PAGE_SHIFT > S16_MAX);
927927
928− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
928+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
929929 ring_sz = XY_FAST_COLOR_BLT_DW;
930930 else if (ver >= 8)
931931 ring_sz = 8;
@@ -936,7 +936,7 @@ static int emit_clear(struct i915_request *rq, u32 offset, int size, · 4 unmodified lines
936936 if (IS_ERR(cs))
937937 return PTR_ERR(cs);
938938
939− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50)) {
939+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55)) {
940940 *cs++ = XY_FAST_COLOR_BLT_CMD | XY_FAST_COLOR_BLT_DEPTH_32 |
941941 (XY_FAST_COLOR_BLT_DW - 2);
942942 *cs++ = FIELD_PREP(XY_FAST_COLOR_BLT_MOCS_MASK, mocs) |
drivers/gpu/drm/i915/gt/intel_mocs.c+1−51
@@ -53,7 +53,6 @@ struct drm_i915_mocs_table { · 52 unmodified lines
5353
5454 /* Helper defines */
5555 #define GEN9_NUM_MOCS_ENTRIES 64 /* 63-64 are reserved, but configured. */
56−#define PVC_NUM_MOCS_ENTRIES 3
5756 #define MTL_NUM_MOCS_ENTRIES 16
5857
5958 /* (e)LLC caching options */
@@ -367,31 +366,6 @@ static const struct drm_i915_mocs_entry gen12_mocs_table[] = { · 307 unmodified lines
367366 L3_3_WB),
368367 };
369368
370−static const struct drm_i915_mocs_entry xehpsdv_mocs_table[] = {
371− /* wa_1608975824 */
372− MOCS_ENTRY(0, 0, L3_3_WB | L3_LKUP(1)),
373−
374− /* UC - Coherent; GO:L3 */
375− MOCS_ENTRY(1, 0, L3_1_UC | L3_LKUP(1)),
376− /* UC - Coherent; GO:Memory */
377− MOCS_ENTRY(2, 0, L3_1_UC | L3_GLBGO(1) | L3_LKUP(1)),
378− /* UC - Non-Coherent; GO:Memory */
379− MOCS_ENTRY(3, 0, L3_1_UC | L3_GLBGO(1)),
380− /* UC - Non-Coherent; GO:L3 */
381− MOCS_ENTRY(4, 0, L3_1_UC),
382−
383− /* WB */
384− MOCS_ENTRY(5, 0, L3_3_WB | L3_LKUP(1)),
385−
386− /* HW Reserved - SW program but never use. */
387− MOCS_ENTRY(48, 0, L3_3_WB | L3_LKUP(1)),
388− MOCS_ENTRY(49, 0, L3_1_UC | L3_LKUP(1)),
389− MOCS_ENTRY(60, 0, L3_1_UC),
390− MOCS_ENTRY(61, 0, L3_1_UC),
391− MOCS_ENTRY(62, 0, L3_1_UC),
392− MOCS_ENTRY(63, 0, L3_1_UC),
393−};
394−
395369 static const struct drm_i915_mocs_entry dg2_mocs_table[] = {
396370 /* UC - Coherent; GO:L3 */
397371 MOCS_ENTRY(0, 0, L3_1_UC | L3_LKUP(1)),
@@ -404,17 +378,6 @@ static const struct drm_i915_mocs_entry dg2_mocs_table[] = { · 6 unmodified lines
404378 MOCS_ENTRY(3, 0, L3_3_WB | L3_LKUP(1)),
405379 };
406380
407−static const struct drm_i915_mocs_entry pvc_mocs_table[] = {
408− /* Error */
409− MOCS_ENTRY(0, 0, L3_3_WB),
410−
411− /* UC */
412− MOCS_ENTRY(1, 0, L3_1_UC),
413−
414− /* WB */
415− MOCS_ENTRY(2, 0, L3_3_WB),
416−};
417−
418381 static const struct drm_i915_mocs_entry mtl_mocs_table[] = {
419382 /* Error - Reserved for Non-Use */
420383 MOCS_ENTRY(0,
@@ -501,25 +464,12 @@ static unsigned int get_mocs_settings(struct drm_i915_private *i915, · 80 unmodified lines
501464 table->n_entries = MTL_NUM_MOCS_ENTRIES;
502465 table->uc_index = 9;
503466 table->unused_entries_index = 1;
504− } else if (IS_PONTEVECCHIO(i915)) {
505− table->size = ARRAY_SIZE(pvc_mocs_table);
506− table->table = pvc_mocs_table;
507− table->n_entries = PVC_NUM_MOCS_ENTRIES;
508− table->uc_index = 1;
509− table->wb_index = 2;
510− table->unused_entries_index = 2;
511467 } else if (IS_DG2(i915)) {
512468 table->size = ARRAY_SIZE(dg2_mocs_table);
513469 table->table = dg2_mocs_table;
514470 table->uc_index = 1;
515471 table->n_entries = GEN9_NUM_MOCS_ENTRIES;
516472 table->unused_entries_index = 3;
517− } else if (IS_XEHPSDV(i915)) {
518− table->size = ARRAY_SIZE(xehpsdv_mocs_table);
519− table->table = xehpsdv_mocs_table;
520− table->uc_index = 2;
521− table->n_entries = GEN9_NUM_MOCS_ENTRIES;
522− table->unused_entries_index = 5;
523473 } else if (IS_DG1(i915)) {
524474 table->size = ARRAY_SIZE(dg1_mocs_table);
525475 table->table = dg1_mocs_table;
@@ -670,7 +620,7 @@ static void init_l3cc_table(struct intel_gt *gt, · 144 unmodified lines
670620
671621 intel_gt_mcr_lock(gt, &flags);
672622 for_each_l3cc(l3cc, table, i)
673− if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 50))
623+ if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 55))
674624 intel_gt_mcr_multicast_write_fw(gt, XEHP_LNCFCMOCS(i), l3cc);
675625 else
676626 intel_uncore_write_fw(gt->uncore, GEN9_LNCFCMOCS(i), l3cc);
drivers/gpu/drm/i915/gt/intel_rps.c+1−5
@@ -1086,11 +1086,7 @@ static u32 intel_rps_read_state_cap(struct intel_rps *rps) · 1085 unmodified lines
10861086 struct drm_i915_private *i915 = rps_to_i915(rps);
10871087 struct intel_uncore *uncore = rps_to_uncore(rps);
10881088
1089− if (IS_PONTEVECCHIO(i915))
1090− return intel_uncore_read(uncore, PVC_RP_STATE_CAP);
1091− else if (IS_XEHPSDV(i915))
1092− return intel_uncore_read(uncore, XEHPSDV_RP_STATE_CAP);
1093− else if (IS_GEN9_LP(i915))
1089+ if (IS_GEN9_LP(i915))
10941090 return intel_uncore_read(uncore, BXT_RP_STATE_CAP);
10951091 else
10961092 return intel_uncore_read(uncore, GEN6_RP_STATE_CAP);
drivers/gpu/drm/i915/gt/intel_sseu.c+4−9
@@ -214,13 +214,8 @@ static void xehp_sseu_info_init(struct intel_gt *gt) · 213 unmodified lines
214214 int num_compute_regs, num_geometry_regs;
215215 int eu;
216216
217− if (IS_PONTEVECCHIO(gt->i915)) {
218− num_geometry_regs = 0;
219− num_compute_regs = 2;
220− } else {
221− num_geometry_regs = 1;
222− num_compute_regs = 1;
223− }
217+ num_geometry_regs = 1;
218+ num_compute_regs = 1;
224219
225220 /*
226221 * The concept of slice has been removed in Xe_HP. To be compatible
@@ -642,7 +637,7 @@ void intel_sseu_info_init(struct intel_gt *gt) · 415 unmodified lines
642637 {
643638 struct drm_i915_private *i915 = gt->i915;
644639
645− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
640+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
646641 xehp_sseu_info_init(gt);
647642 else if (GRAPHICS_VER(i915) >= 12)
648643 gen12_sseu_info_init(gt);
@@ -851,7 +846,7 @@ void intel_sseu_print_topology(struct drm_i915_private *i915, · 202 unmodified lines
851846 {
852847 if (sseu->max_slices == 0)
853848 drm_printf(p, "Unavailable\n");
854− else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
849+ else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
855850 sseu_print_xehp_topology(sseu, p);
856851 else
857852 sseu_print_hsw_topology(sseu, p);
drivers/gpu/drm/i915/gt/intel_workarounds.c+4−179
@@ -257,12 +257,6 @@ wa_write(struct i915_wa_list *wal, i915_reg_t reg, u32 set) · 256 unmodified lines
257257 wa_write_clr_set(wal, reg, ~0, set);
258258 }
259259
260−static void
261−wa_mcr_write(struct i915_wa_list *wal, i915_mcr_reg_t reg, u32 set)
262−{
263− wa_mcr_write_clr_set(wal, reg, ~0, set);
264−}
265−
266260 static void
267261 wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 set)
268262 {
@@ -918,12 +912,8 @@ __intel_engine_init_ctx_wa(struct intel_engine_cs *engine, · 649 unmodified lines
918912
919913 if (IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 74)))
920914 xelpg_ctx_workarounds_init(engine, wal);
921− else if (IS_PONTEVECCHIO(i915))
922− ; /* noop; none at this time */
923915 else if (IS_DG2(i915))
924916 dg2_ctx_workarounds_init(engine, wal);
925− else if (IS_XEHPSDV(i915))
926− ; /* noop; none at this time */
927917 else if (IS_DG1(i915))
928918 dg1_ctx_workarounds_init(engine, wal);
929919 else if (GRAPHICS_VER(i915) == 12)
@@ -1350,9 +1340,6 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal) · 420 unmodified lines
13501340 gt->steering_table[MSLICE] = NULL;
13511341 }
13521342
1353− if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
1354− gt->steering_table[GAM] = NULL;
1355−
13561343 slice = __ffs(slice_mask);
13571344 subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
13581345 GEN_DSS_PER_GSLICE;
@@ -1379,20 +1366,6 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal) · 20 unmodified lines
13791366 __set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
13801367 }
13811368
1382−static void
1383−pvc_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
1384−{
1385− unsigned int dss;
1386−
1387− /*
1388− * Setup implicit steering for COMPUTE and DSS ranges to the first
1389− * non-fused-off DSS. All other types of MCR registers will be
1390− * explicitly steered.
1391− */
1392− dss = intel_sseu_find_first_xehp_dss(&gt->info.sseu, 0, 0);
1393− __add_mcr_wa(gt, wal, dss / GEN_DSS_PER_CSLICE, dss % GEN_DSS_PER_CSLICE);
1394−}
1395−
13961369 static void
13971370 icl_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
13981371 {
@@ -1519,76 +1492,6 @@ dg1_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal) · 120 unmodified lines
15191492 wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE2, VSUNIT_CLKGATE_DIS_TGL);
15201493 }
15211494
1522−static void
1523−xehpsdv_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
1524−{
1525− struct drm_i915_private *i915 = gt->i915;
1526−
1527− xehp_init_mcr(gt, wal);
1528−
1529− /* Wa_1409757795:xehpsdv */
1530− wa_mcr_write_or(wal, SCCGCTL94DC, CG3DDISURB);
1531−
1532− /* Wa_18011725039:xehpsdv */
1533− if (IS_XEHPSDV_GRAPHICS_STEP(i915, STEP_A1, STEP_B0)) {
1534− wa_mcr_masked_dis(wal, MLTICTXCTL, TDONRENDER);
1535− wa_mcr_write_or(wal, L3SQCREG1_CCS0, FLUSHALLNONCOH);
1536− }
1537−
1538− /* Wa_16011155590:xehpsdv */
1539− if (IS_XEHPSDV_GRAPHICS_STEP(i915, STEP_A0, STEP_B0))
1540− wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE,
1541− TSGUNIT_CLKGATE_DIS);
1542−
1543− /* Wa_14011780169:xehpsdv */
1544− if (IS_XEHPSDV_GRAPHICS_STEP(i915, STEP_B0, STEP_FOREVER)) {
1545− wa_write_or(wal, UNSLCGCTL9440, GAMTLBOACS_CLKGATE_DIS |
1546− GAMTLBVDBOX7_CLKGATE_DIS |
1547− GAMTLBVDBOX6_CLKGATE_DIS |
1548− GAMTLBVDBOX5_CLKGATE_DIS |
1549− GAMTLBVDBOX4_CLKGATE_DIS |
1550− GAMTLBVDBOX3_CLKGATE_DIS |
1551− GAMTLBVDBOX2_CLKGATE_DIS |
1552− GAMTLBVDBOX1_CLKGATE_DIS |
1553− GAMTLBVDBOX0_CLKGATE_DIS |
1554− GAMTLBKCR_CLKGATE_DIS |
1555− GAMTLBGUC_CLKGATE_DIS |
1556− GAMTLBBLT_CLKGATE_DIS);
1557− wa_write_or(wal, UNSLCGCTL9444, GAMTLBGFXA0_CLKGATE_DIS |
1558− GAMTLBGFXA1_CLKGATE_DIS |
1559− GAMTLBCOMPA0_CLKGATE_DIS |
1560− GAMTLBCOMPA1_CLKGATE_DIS |
1561− GAMTLBCOMPB0_CLKGATE_DIS |
1562− GAMTLBCOMPB1_CLKGATE_DIS |
1563− GAMTLBCOMPC0_CLKGATE_DIS |
1564− GAMTLBCOMPC1_CLKGATE_DIS |
1565− GAMTLBCOMPD0_CLKGATE_DIS |
1566− GAMTLBCOMPD1_CLKGATE_DIS |
1567− GAMTLBMERT_CLKGATE_DIS |
1568− GAMTLBVEBOX3_CLKGATE_DIS |
1569− GAMTLBVEBOX2_CLKGATE_DIS |
1570− GAMTLBVEBOX1_CLKGATE_DIS |
1571− GAMTLBVEBOX0_CLKGATE_DIS);
1572− }
1573−
1574− /* Wa_16012725990:xehpsdv */
1575− if (IS_XEHPSDV_GRAPHICS_STEP(i915, STEP_A1, STEP_FOREVER))
1576− wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE, VFUNIT_CLKGATE_DIS);
1577−
1578− /* Wa_14011060649:xehpsdv */
1579− wa_14011060649(gt, wal);
1580−
1581− /* Wa_14012362059:xehpsdv */
1582− wa_mcr_write_or(wal, XEHP_MERT_MOD_CTRL, FORCE_MISS_FTLB);
1583−
1584− /* Wa_14014368820:xehpsdv */
1585− wa_mcr_write_or(wal, XEHP_GAMCNTRL_CTRL,
1586− INVALIDATION_BROADCAST_MODE_DIS | GLOBAL_INVALIDATION_MODE);
1587−
1588− /* Wa_14010670810:xehpsdv */
1589− wa_mcr_write_or(wal, XEHP_L3NODEARBCFG, XEHP_LNESPARE);
1590−}
1591−
15921495 static void
15931496 dg2_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
15941497 {
@@ -1631,24 +1534,6 @@ dg2_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal) · 36 unmodified lines
16311534 wa_mcr_write_or(wal, XEHP_L3NODEARBCFG, XEHP_LNESPARE);
16321535 }
16331536
1634−static void
1635−pvc_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
1636−{
1637− pvc_init_mcr(gt, wal);
1638−
1639− /* Wa_14015795083 */
1640− wa_write_clr(wal, GEN7_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE);
1641−
1642− /* Wa_18018781329 */
1643− wa_mcr_write_or(wal, RENDER_MOD_CTRL, FORCE_MISS_FTLB);
1644− wa_mcr_write_or(wal, COMP_MOD_CTRL, FORCE_MISS_FTLB);
1645− wa_mcr_write_or(wal, XEHP_VDBX_MOD_CTRL, FORCE_MISS_FTLB);
1646− wa_mcr_write_or(wal, XEHP_VEBX_MOD_CTRL, FORCE_MISS_FTLB);
1647−
1648− /* Wa_16016694945 */
1649− wa_mcr_masked_en(wal, XEHPC_LNCFMISCCFGREG0, XEHPC_OVRLSCCC);
1650−}
1651−
16521537 static void
16531538 xelpg_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
16541539 {
@@ -1725,12 +1610,6 @@ static void gt_tuning_settings(struct intel_gt *gt, struct i915_wa_list *wal) · 70 unmodified lines
17251610 wa_mcr_write_or(wal, XEHP_SQCM, EN_32B_ACCESS);
17261611 }
17271612
1728− if (IS_PONTEVECCHIO(gt->i915)) {
1729− wa_mcr_write(wal, XEHPC_L3SCRUB,
1730− SCRUB_CL_DWNGRADE_SHARED | SCRUB_RATE_4B_PER_CLK);
1731− wa_mcr_masked_en(wal, XEHPC_LNCFMISCCFGREG0, XEHPC_HOSTCACHEEN);
1732− }
1733−
17341613 if (IS_DG2(gt->i915)) {
17351614 wa_mcr_write_or(wal, XEHP_L3SCQREG7, BLEND_FILL_CACHING_OPT_DIS);
17361615 wa_mcr_write_or(wal, XEHP_SQCM, EN_32B_ACCESS);
@@ -1755,12 +1634,8 @@ gt_init_workarounds(struct intel_gt *gt, struct i915_wa_list *wal) · 18 unmodified lines
17551634
17561635 if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 74)))
17571636 xelpg_gt_workarounds_init(gt, wal);
1758− else if (IS_PONTEVECCHIO(i915))
1759− pvc_gt_workarounds_init(gt, wal);
17601637 else if (IS_DG2(i915))
17611638 dg2_gt_workarounds_init(gt, wal);
1762− else if (IS_XEHPSDV(i915))
1763− xehpsdv_gt_workarounds_init(gt, wal);
17641639 else if (IS_DG1(i915))
17651640 dg1_gt_workarounds_init(gt, wal);
17661641 else if (GRAPHICS_VER(i915) == 12)
@@ -2178,30 +2053,6 @@ static void dg2_whitelist_build(struct intel_engine_cs *engine) · 411 unmodified lines
21782053 }
21792054 }
21802055
2181−static void blacklist_trtt(struct intel_engine_cs *engine)
2182−{
2183− struct i915_wa_list *w = &engine->whitelist;
2184−
2185− /*
2186− * Prevent read/write access to [0x4400, 0x4600) which covers
2187− * the TRTT range across all engines. Note that normally userspace
2188− * cannot access the other engines' trtt control, but for simplicity
2189− * we cover the entire range on each engine.
2190− */
2191− whitelist_reg_ext(w, _MMIO(0x4400),
2192− RING_FORCE_TO_NONPRIV_DENY |
2193− RING_FORCE_TO_NONPRIV_RANGE_64);
2194− whitelist_reg_ext(w, _MMIO(0x4500),
2195− RING_FORCE_TO_NONPRIV_DENY |
2196− RING_FORCE_TO_NONPRIV_RANGE_64);
2197−}
2198−
2199−static void pvc_whitelist_build(struct intel_engine_cs *engine)
2200−{
2201− /* Wa_16014440446:pvc */
2202− blacklist_trtt(engine);
2203−}
2204−
22052056 static void xelpg_whitelist_build(struct intel_engine_cs *engine)
22062057 {
22072058 struct i915_wa_list *w = &engine->whitelist;
@@ -2228,12 +2079,8 @@ void intel_engine_init_whitelist(struct intel_engine_cs *engine) · 20 unmodified lines
22282079 ; /* none yet */
22292080 else if (IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 74)))
22302081 xelpg_whitelist_build(engine);
2231− else if (IS_PONTEVECCHIO(i915))
2232− pvc_whitelist_build(engine);
22332082 else if (IS_DG2(i915))
22342083 dg2_whitelist_build(engine);
2235− else if (IS_XEHPSDV(i915))
2236− ; /* none needed */
22372084 else if (GRAPHICS_VER(i915) == 12)
22382085 tgl_whitelist_build(engine);
22392086 else if (GRAPHICS_VER(i915) == 11)
@@ -2814,10 +2661,7 @@ xcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) · 574 unmodified lines
28142661 static void
28152662 ccs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
28162663 {
2817− if (IS_PVC_CT_STEP(engine->i915, STEP_A0, STEP_C0)) {
2818− /* Wa_14014999345:pvc */
2819− wa_mcr_masked_en(wal, GEN10_CACHE_MODE_SS, DISABLE_ECC);
2820− }
2664+ /* boilerplate for any CCS engine workaround */
28212665 }
28222666
28232667 /*
@@ -2850,7 +2694,7 @@ add_render_compute_tuning_settings(struct intel_gt *gt, · 26 unmodified lines
28502694 wa_mcr_masked_field_set(wal, GEN9_ROW_CHICKEN4, THREAD_EX_ARB_MODE,
28512695 THREAD_EX_ARB_MODE_RR_AFTER_DEP);
28522696
2853− if (GRAPHICS_VER(i915) == 12 && GRAPHICS_VER_FULL(i915) < IP_VER(12, 50))
2697+ if (GRAPHICS_VER(i915) == 12 && GRAPHICS_VER_FULL(i915) < IP_VER(12, 55))
28542698 wa_write_clr(wal, GEN8_GARBCNTL, GEN12_BUS_HASH_CTL_BIT_EXC);
28552699 }
28562700
@@ -2923,21 +2767,18 @@ general_render_compute_wa_init(struct intel_engine_cs *engine, struct i915_wa_li · 66 unmodified lines
29232767
29242768 if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) ||
29252769 IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0) ||
2926− IS_PONTEVECCHIO(i915) ||
29272770 IS_DG2(i915)) {
29282771 /* Wa_22014226127 */
29292772 wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0, DISABLE_D8_D16_COASLESCE);
29302773 }
29312774
2932− if (IS_PONTEVECCHIO(i915) || IS_DG2(i915)) {
2775+ if (IS_DG2(i915)) {
29332776 /* Wa_14015227452:dg2,pvc */
29342777 wa_mcr_masked_en(wal, GEN9_ROW_CHICKEN4, XEHP_DIS_BBL_SYSPIPE);
29352778
29362779 /* Wa_16015675438:dg2,pvc */
29372780 wa_masked_en(wal, FF_SLICE_CS_CHICKEN2, GEN12_PERF_FIX_BALANCING_CFE_DISABLE);
2938− }
29392781
2940− if (IS_DG2(i915)) {
29412782 /*
29422783 * Wa_16011620976:dg2_g11
29432784 * Wa_22015475538:dg2
@@ -2973,22 +2814,6 @@ general_render_compute_wa_init(struct intel_engine_cs *engine, struct i915_wa_li · 29 unmodified lines
29732814 0 /* write-only, so skip validation */,
29742815 true);
29752816 }
2976−
2977− if (IS_XEHPSDV(i915)) {
2978− /* Wa_1409954639 */
2979− wa_mcr_masked_en(wal,
2980− GEN8_ROW_CHICKEN,
2981− SYSTOLIC_DOP_CLOCK_GATING_DIS);
2982−
2983− /* Wa_1607196519 */
2984− wa_mcr_masked_en(wal,
2985− GEN9_ROW_CHICKEN4,
2986− GEN12_DISABLE_GRF_CLEAR);
2987−
2988− /* Wa_14010449647:xehpsdv */
2989− wa_mcr_masked_en(wal, GEN8_HALF_SLICE_CHICKEN1,
2990− GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE);
2991− }
29922817 }
29932818
29942819 static void
@@ -3069,7 +2894,7 @@ static bool mcr_range(struct drm_i915_private *i915, u32 offset) · 74 unmodified lines
30692894 const struct i915_range *mcr_ranges;
30702895 int i;
30712896
3072− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
2897+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
30732898 mcr_ranges = mcr_ranges_xehp;
30742899 else if (GRAPHICS_VER(i915) >= 12)
30752900 mcr_ranges = mcr_ranges_gen12;
drivers/gpu/drm/i915/gt/uc/intel_guc.c+2−6
@@ -286,7 +286,7 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc) · 285 unmodified lines
286286
287287 /* Wa_22012773006:gen11,gen12 < XeHP */
288288 if (GRAPHICS_VER(gt->i915) >= 11 &&
289− GRAPHICS_VER_FULL(gt->i915) < IP_VER(12, 50))
289+ GRAPHICS_VER_FULL(gt->i915) < IP_VER(12, 55))
290290 flags |= GUC_WA_POLLCS;
291291
292292 /* Wa_14014475959 */
@@ -315,13 +315,9 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc) · 22 unmodified lines
315315 if (IS_DG2_G11(gt->i915))
316316 flags |= GUC_WA_CONTEXT_ISOLATION;
317317
318− /* Wa_16015675438 */
319− if (!RCS_MASK(gt))
320− flags |= GUC_WA_RCS_REGS_IN_CCS_REGS_LIST;
321−
322318 /* Wa_14018913170 */
323319 if (GUC_FIRMWARE_VER(guc) >= MAKE_GUC_VER(70, 7, 0)) {
324− if (IS_DG2(gt->i915) || IS_METEORLAKE(gt->i915) || IS_PONTEVECCHIO(gt->i915))
320+ if (IS_DG2(gt->i915) || IS_METEORLAKE(gt->i915))
325321 flags |= GUC_WA_ENABLE_TSC_CHECK_ON_RC6;
326322 }
327323
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c+2−2
@@ -393,7 +393,7 @@ static int guc_mmio_regset_init(struct temp_regset *regset, · 392 unmodified lines
393393
394394 /* add in local MOCS registers */
395395 for (i = 0; i < LNCFCMOCS_REG_COUNT; i++)
396− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
396+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
397397 ret |= GUC_MCR_REG_ADD(gt, regset, XEHP_LNCFCMOCS(i), false);
398398 else
399399 ret |= GUC_MMIO_REG_ADD(gt, regset, GEN9_LNCFCMOCS(i), false);
@@ -503,7 +503,7 @@ static void fill_engine_enable_masks(struct intel_gt *gt, · 103 unmodified lines
503503
504504 #define LR_HW_CONTEXT_SIZE (80 * sizeof(u32))
505505 #define XEHP_LR_HW_CONTEXT_SIZE (96 * sizeof(u32))
506−#define LR_HW_CONTEXT_SZ(i915) (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50) ? \
506+#define LR_HW_CONTEXT_SZ(i915) (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55) ? \
507507 XEHP_LR_HW_CONTEXT_SIZE : \
508508 LR_HW_CONTEXT_SIZE)
509509 #define LRC_SKIP_SIZE(i915) (LRC_PPHWSP_SZ * PAGE_SIZE + LR_HW_CONTEXT_SZ(i915))
drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c+1−1
@@ -26,7 +26,7 @@ static void guc_prepare_xfer(struct intel_gt *gt) · 25 unmodified lines
2626 GUC_ENABLE_READ_CACHE_FOR_WOPCM_DATA |
2727 GUC_ENABLE_MIA_CLOCK_GATING;
2828
29− if (GRAPHICS_VER_FULL(uncore->i915) < IP_VER(12, 50))
29+ if (GRAPHICS_VER_FULL(uncore->i915) < IP_VER(12, 55))
3030 shim_flags |= GUC_DISABLE_SRAM_INIT_TO_ZEROES |
3131 GUC_ENABLE_MIA_CACHING;
3232
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c+1−1
@@ -4507,7 +4507,7 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine) · 4506 unmodified lines
45074507 */
45084508
45094509 engine->emit_bb_start = gen8_emit_bb_start;
4510− if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
4510+ if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
45114511 engine->emit_bb_start = xehp_emit_bb_start;
45124512 }
45134513
drivers/gpu/drm/i915/gt/uc/intel_uc.c+0−4
@@ -50,10 +50,6 @@ static void uc_expand_default_options(struct intel_uc *uc) · 49 unmodified lines
5050
5151 /* Default: enable HuC authentication and GuC submission */
5252 i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;
53−
54− /* XEHPSDV and PVC do not use HuC */
55− if (IS_XEHPSDV(i915) || IS_PONTEVECCHIO(i915))
56− i915->params.enable_guc &= ~ENABLE_GUC_LOAD_HUC;
5753 }
5854
5955 /* Reset GuC providing us with fresh state for both GuC and HuC.
drivers/gpu/drm/i915/i915_debugfs.c+0−12
@@ -156,18 +156,6 @@ static const char *i915_cache_level_str(struct drm_i915_gem_object *obj) · 155 unmodified lines
156156 case 4: return " WB (2-Way Coh)";
157157 default: return " not defined";
158158 }
159− } else if (IS_PONTEVECCHIO(i915)) {
160− switch (obj->pat_index) {
161− case 0: return " UC";
162− case 1: return " WC";
163− case 2: return " WT";
164− case 3: return " WB";
165− case 4: return " WT (CLOS1)";
166− case 5: return " WB (CLOS1)";
167− case 6: return " WT (CLOS2)";
168− case 7: return " WT (CLOS2)";
169− default: return " not defined";
170− }
171159 } else if (GRAPHICS_VER(i915) >= 12) {
172160 switch (obj->pat_index) {
173161 case 0: return " WB";
drivers/gpu/drm/i915/i915_drv.h+1−25
@@ -235,25 +235,17 @@ struct drm_i915_private { · 234 unmodified lines
235235 /* protects the irq masks */
236236 spinlock_t irq_lock;
237237
238− bool display_irqs_enabled;
239−
240238 /* Sideband mailbox protection */
241239 struct mutex sb_lock;
242240 struct pm_qos_request sb_qos;
243241
244242 /** Cached value of IMR to avoid reads in updating the bitfield */
245− union {
246− u32 irq_mask;
247− u32 de_irq_mask[I915_MAX_PIPES];
248− };
249− u32 pipestat_irq_mask[I915_MAX_PIPES];
243+ u32 irq_mask;
250244
251245 bool preserve_bios_swizzle;
252246
253247 unsigned int fsb_freq, mem_freq, is_ddr3;
254− unsigned int skl_preferred_vco_freq;
255248
256− unsigned int max_dotclk_freq;
257249 unsigned int hpll_freq;
258250 unsigned int czclk_freq;
259251
@@ -350,9 +342,6 @@ struct drm_i915_private { · 90 unmodified lines
350342
351343 struct intel_pxp *pxp;
352344
353− /* For i915gm/i945gm vblank irq workaround */
354− u8 vblank_enabled;
355−
356345 bool irq_enabled;
357346
358347 struct i915_pmu pmu;
@@ -544,9 +533,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, · 185 unmodified lines
544533 #define IS_DG1(i915) IS_PLATFORM(i915, INTEL_DG1)
545534 #define IS_ALDERLAKE_S(i915) IS_PLATFORM(i915, INTEL_ALDERLAKE_S)
546535 #define IS_ALDERLAKE_P(i915) IS_PLATFORM(i915, INTEL_ALDERLAKE_P)
547−#define IS_XEHPSDV(i915) IS_PLATFORM(i915, INTEL_XEHPSDV)
548536 #define IS_DG2(i915) IS_PLATFORM(i915, INTEL_DG2)
549−#define IS_PONTEVECCHIO(i915) IS_PLATFORM(i915, INTEL_PONTEVECCHIO)
550537 #define IS_METEORLAKE(i915) IS_PLATFORM(i915, INTEL_METEORLAKE)
551538 #define IS_LUNARLAKE(i915) 0
552539
@@ -621,17 +608,6 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, · 68 unmodified lines
621608 #define IS_TIGERLAKE_UY(i915) \
622609 IS_SUBPLATFORM(i915, INTEL_TIGERLAKE, INTEL_SUBPLATFORM_UY)
623610
624−#define IS_XEHPSDV_GRAPHICS_STEP(__i915, since, until) \
625− (IS_XEHPSDV(__i915) && IS_GRAPHICS_STEP(__i915, since, until))
626−
627−#define IS_PVC_BD_STEP(__i915, since, until) \
628− (IS_PONTEVECCHIO(__i915) && \
629− IS_BASEDIE_STEP(__i915, since, until))
630−
631−#define IS_PVC_CT_STEP(__i915, since, until) \
632− (IS_PONTEVECCHIO(__i915) && \
633− IS_GRAPHICS_STEP(__i915, since, until))
634−
635611 #define IS_LP(i915) (INTEL_INFO(i915)->is_lp)
636612 #define IS_GEN9_LP(i915) (GRAPHICS_VER(i915) == 9 && IS_LP(i915))
637613 #define IS_GEN9_BC(i915) (GRAPHICS_VER(i915) == 9 && !IS_LP(i915))
drivers/gpu/drm/i915/i915_getparam.c+2−2
@@ -160,7 +160,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, · 159 unmodified lines
160160 break;
161161 case I915_PARAM_SLICE_MASK:
162162 /* Not supported from Xe_HP onward; use topology queries */
163− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
163+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
164164 return -EINVAL;
165165
166166 value = sseu->slice_mask;
@@ -169,7 +169,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, · 2 unmodified lines
169169 break;
170170 case I915_PARAM_SUBSLICE_MASK:
171171 /* Not supported from Xe_HP onward; use topology queries */
172− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
172+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
173173 return -EINVAL;
174174
175175 /* Only copy bits from the first slice */
drivers/gpu/drm/i915/i915_gpu_error.c+2−3
@@ -1245,8 +1245,7 @@ static void engine_record_registers(struct intel_engine_coredump *ee) · 1244 unmodified lines
12451245 if (MEDIA_VER(i915) >= 13 && engine->gt->type == GT_MEDIA)
12461246 ee->fault_reg = intel_uncore_read(engine->uncore,
12471247 XELPMP_RING_FAULT_REG);
1248−
1249− else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
1248+ else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
12501249 ee->fault_reg = intel_gt_mcr_read_any(engine->gt,
12511250 XEHP_RING_FAULT_REG);
12521251 else if (GRAPHICS_VER(i915) >= 12)
@@ -1852,7 +1851,7 @@ static void gt_record_global_regs(struct intel_gt_coredump *gt) · 599 unmodified lines
18521851 if (GRAPHICS_VER(i915) == 7)
18531852 gt->err_int = intel_uncore_read(uncore, GEN7_ERR_INT);
18541853
1855− if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50)) {
1854+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55)) {
18561855 gt->fault_data0 = intel_gt_mcr_read_any((struct intel_gt *)gt->_gt,
18571856 XEHP_FAULT_TLB_DATA0);
18581857 gt->fault_data1 = intel_gt_mcr_read_any((struct intel_gt *)gt->_gt,
drivers/gpu/drm/i915/i915_hwmon.c+0−6
@@ -739,12 +739,6 @@ hwm_get_preregistration_info(struct drm_i915_private *i915) · 738 unmodified lines
739739 hwmon->rg.pkg_rapl_limit = PCU_PACKAGE_RAPL_LIMIT;
740740 hwmon->rg.energy_status_all = PCU_PACKAGE_ENERGY_STATUS;
741741 hwmon->rg.energy_status_tile = INVALID_MMIO_REG;
742− } else if (IS_XEHPSDV(i915)) {
743− hwmon->rg.pkg_power_sku_unit = GT0_PACKAGE_POWER_SKU_UNIT;
744− hwmon->rg.pkg_power_sku = INVALID_MMIO_REG;
745− hwmon->rg.pkg_rapl_limit = GT0_PACKAGE_RAPL_LIMIT;
746− hwmon->rg.energy_status_all = GT0_PLATFORM_ENERGY_STATUS;
747− hwmon->rg.energy_status_tile = GT0_PACKAGE_ENERGY_STATUS;
748742 } else {
749743 hwmon->rg.pkg_power_sku_unit = INVALID_MMIO_REG;
750744 hwmon->rg.pkg_power_sku = INVALID_MMIO_REG;
drivers/gpu/drm/i915/i915_irq.c+4−4
@@ -702,7 +702,7 @@ static void valleyview_irq_reset(struct drm_i915_private *dev_priv) · 701 unmodified lines
702702 gen5_gt_irq_reset(to_gt(dev_priv));
703703
704704 spin_lock_irq(&dev_priv->irq_lock);
705− if (dev_priv->display_irqs_enabled)
705+ if (dev_priv->display.irq.display_irqs_enabled)
706706 vlv_display_irq_reset(dev_priv);
707707 spin_unlock_irq(&dev_priv->irq_lock);
708708 }
@@ -767,7 +767,7 @@ static void cherryview_irq_reset(struct drm_i915_private *dev_priv) · 58 unmodified lines
767767 GEN3_IRQ_RESET(uncore, GEN8_PCU_);
768768
769769 spin_lock_irq(&dev_priv->irq_lock);
770− if (dev_priv->display_irqs_enabled)
770+ if (dev_priv->display.irq.display_irqs_enabled)
771771 vlv_display_irq_reset(dev_priv);
772772 spin_unlock_irq(&dev_priv->irq_lock);
773773 }
@@ -784,7 +784,7 @@ static void valleyview_irq_postinstall(struct drm_i915_private *dev_priv) · 10 unmodified lines
784784 gen5_gt_irq_postinstall(to_gt(dev_priv));
785785
786786 spin_lock_irq(&dev_priv->irq_lock);
787− if (dev_priv->display_irqs_enabled)
787+ if (dev_priv->display.irq.display_irqs_enabled)
788788 vlv_display_irq_postinstall(dev_priv);
789789 spin_unlock_irq(&dev_priv->irq_lock);
790790
@@ -838,7 +838,7 @@ static void cherryview_irq_postinstall(struct drm_i915_private *dev_priv) · 47 unmodified lines
838838 gen8_gt_irq_postinstall(to_gt(dev_priv));
839839
840840 spin_lock_irq(&dev_priv->irq_lock);
841− if (dev_priv->display_irqs_enabled)
841+ if (dev_priv->display.irq.display_irqs_enabled)
842842 vlv_display_irq_postinstall(dev_priv);
843843 spin_unlock_irq(&dev_priv->irq_lock);
844844
drivers/gpu/drm/i915/i915_pci.c+7−59
@@ -38,6 +38,9 @@ · 37 unmodified lines
3838 #include "i915_reg.h"
3939 #include "intel_pci_config.h"
4040
41+__diag_push();
42+__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for device info");
43+
4144 #define PLATFORM(x) .platform = (x)
4245 #define GEN(x) \
4346 .__runtime.graphics.ip.ver = (x), \
@@ -59,14 +62,6 @@ · 15 unmodified lines
5962 [I915_CACHE_WT] = 2, \
6063 }
6164
62−#define PVC_CACHELEVEL \
63− .cachelevel_to_pat = { \
64− [I915_CACHE_NONE] = 0, \
65− [I915_CACHE_LLC] = 3, \
66− [I915_CACHE_L3_LLC] = 3, \
67− [I915_CACHE_WT] = 2, \
68− }
69−
7065 #define MTL_CACHELEVEL \
7166 .cachelevel_to_pat = { \
7267 [I915_CACHE_NONE] = 2, \
@@ -705,8 +700,6 @@ static const struct intel_device_info adl_p_info = { · 632 unmodified lines
705700 I915_GTT_PAGE_SIZE_2M
706701
707702 #define XE_HP_FEATURES \
708− .__runtime.graphics.ip.ver = 12, \
709− .__runtime.graphics.ip.rel = 50, \
710703 XE_HP_PAGE_SIZES, \
711704 TGL_CACHELEVEL, \
712705 .dma_mask_size = 46, \
@@ -730,32 +723,12 @@ static const struct intel_device_info adl_p_info = { · 17 unmodified lines
730723 .__runtime.ppgtt_size = 48, \
731724 .__runtime.ppgtt_type = INTEL_PPGTT_FULL
732725
733−#define XE_HPM_FEATURES \
734− .__runtime.media.ip.ver = 12, \
735− .__runtime.media.ip.rel = 50
736−
737−__maybe_unused
738−static const struct intel_device_info xehpsdv_info = {
739− XE_HP_FEATURES,
740− XE_HPM_FEATURES,
741− DGFX_FEATURES,
742− PLATFORM(INTEL_XEHPSDV),
743− .has_64k_pages = 1,
744− .has_media_ratio_mode = 1,
745− .platform_engine_mask =
746− BIT(RCS0) | BIT(BCS0) |
747− BIT(VECS0) | BIT(VECS1) | BIT(VECS2) | BIT(VECS3) |
748− BIT(VCS0) | BIT(VCS1) | BIT(VCS2) | BIT(VCS3) |
749− BIT(VCS4) | BIT(VCS5) | BIT(VCS6) | BIT(VCS7) |
750− BIT(CCS0) | BIT(CCS1) | BIT(CCS2) | BIT(CCS3),
751− .require_force_probe = 1,
752−};
753−
754726 #define DG2_FEATURES \
755727 XE_HP_FEATURES, \
756− XE_HPM_FEATURES, \
757728 DGFX_FEATURES, \
729+ .__runtime.graphics.ip.ver = 12, \
758730 .__runtime.graphics.ip.rel = 55, \
731+ .__runtime.media.ip.ver = 12, \
759732 .__runtime.media.ip.rel = 55, \
760733 PLATFORM(INTEL_DG2), \
761734 .has_64k_pages = 1, \
@@ -778,33 +751,6 @@ static const struct intel_device_info ats_m_info = { · 16 unmodified lines
778751 .tuning_thread_rr_after_dep = 1,
779752 };
780753
781−#define XE_HPC_FEATURES \
782− XE_HP_FEATURES, \
783− .dma_mask_size = 52, \
784− .has_3d_pipeline = 0, \
785− .has_guc_deprivilege = 1, \
786− .has_l3_ccs_read = 1, \
787− .has_mslice_steering = 0, \
788− .has_one_eu_per_fuse_bit = 1
789−
790−__maybe_unused
791−static const struct intel_device_info pvc_info = {
792− XE_HPC_FEATURES,
793− XE_HPM_FEATURES,
794− DGFX_FEATURES,
795− .__runtime.graphics.ip.rel = 60,
796− .__runtime.media.ip.rel = 60,
797− PLATFORM(INTEL_PONTEVECCHIO),
798− .has_flat_ccs = 0,
799− .max_pat_index = 7,
800− .platform_engine_mask =
801− BIT(BCS0) |
802− BIT(VCS0) |
803− BIT(CCS0) | BIT(CCS1) | BIT(CCS2) | BIT(CCS3),
804− .require_force_probe = 1,
805− PVC_CACHELEVEL,
806−};
807−
808754 static const struct intel_gt_definition xelpmp_extra_gt[] = {
809755 {
810756 .type = GT_MEDIA,
@@ -842,6 +788,8 @@ static const struct intel_device_info mtl_info = { · 31 unmodified lines
842788
843789 #undef PLATFORM
844790
791+__diag_pop();
792+
845793 /*
846794 * Make sure any device matches here are from most specific to most
847795 * general. For example, since the Quanta match is based on the subsystem
drivers/gpu/drm/i915/i915_perf.c+9−10
@@ -292,7 +292,7 @@ static u32 i915_perf_stream_paranoid = true; · 291 unmodified lines
292292 #define OAREPORT_REASON_CTX_SWITCH (1<<3)
293293 #define OAREPORT_REASON_CLK_RATIO (1<<5)
294294
295−#define HAS_MI_SET_PREDICATE(i915) (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
295+#define HAS_MI_SET_PREDICATE(i915) (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55))
296296
297297 /* For sysctl proc_dointvec_minmax of i915_oa_max_sample_rate
298298 *
@@ -817,7 +817,7 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream, · 518 unmodified lines
817817 */
818818
819819 if (oa_report_ctx_invalid(stream, report) &&
820− GRAPHICS_VER_FULL(stream->engine->i915) < IP_VER(12, 50)) {
820+ GRAPHICS_VER_FULL(stream->engine->i915) < IP_VER(12, 55)) {
821821 ctx_id = INVALID_CTX_ID;
822822 oa_context_id_squash(stream, report32);
823823 }
@@ -1419,7 +1419,7 @@ static int gen12_get_render_context_id(struct i915_perf_stream *stream) · 595 unmodified lines
14191419
14201420 mask = ((1U << GEN12_GUC_SW_CTX_ID_WIDTH) - 1) <<
14211421 (GEN12_GUC_SW_CTX_ID_SHIFT - 32);
1422− } else if (GRAPHICS_VER_FULL(stream->engine->i915) >= IP_VER(12, 50)) {
1422+ } else if (GRAPHICS_VER_FULL(stream->engine->i915) >= IP_VER(12, 55)) {
14231423 ctx_id = (XEHP_MAX_CONTEXT_HW_ID - 1) <<
14241424 (XEHP_SW_CTX_ID_SHIFT - 32);
14251425
@@ -2881,11 +2881,11 @@ gen12_enable_metric_set(struct i915_perf_stream *stream, · 1455 unmodified lines
28812881 int ret;
28822882
28832883 /*
2884− * Wa_1508761755:xehpsdv, dg2
2884+ * Wa_1508761755
28852885 * EU NOA signals behave incorrectly if EU clock gating is enabled.
28862886 * Disable thread stall DOP gating and EU DOP gating.
28872887 */
2888− if (IS_XEHPSDV(i915) || IS_DG2(i915)) {
2888+ if (IS_DG2(i915)) {
28892889 intel_gt_mcr_multicast_write(uncore->gt, GEN8_ROW_CHICKEN,
28902890 _MASKED_BIT_ENABLE(STALL_DOP_GATING_DISABLE));
28912891 intel_uncore_write(uncore, GEN7_ROW_CHICKEN2,
@@ -2911,7 +2911,7 @@ gen12_enable_metric_set(struct i915_perf_stream *stream, · 19 unmodified lines
29112911 /*
29122912 * Initialize Super Queue Internal Cnt Register
29132913 * Set PMON Enable in order to collect valid metrics.
2914− * Enable byets per clock reporting in OA for XEHPSDV onward.
2914+ * Enable bytes per clock reporting in OA.
29152915 */
29162916 sqcnt1 = GEN12_SQCNT1_PMON_ENABLE |
29172917 (HAS_OA_BPC_REPORTING(i915) ? GEN12_SQCNT1_OABPC : 0);
@@ -2971,10 +2971,9 @@ static void gen12_disable_metric_set(struct i915_perf_stream *stream) · 53 unmodified lines
29712971 u32 sqcnt1;
29722972
29732973 /*
2974− * Wa_1508761755:xehpsdv, dg2
2975− * Enable thread stall DOP gating and EU DOP gating.
2974+ * Wa_1508761755: Enable thread stall DOP gating and EU DOP gating.
29762975 */
2977− if (IS_XEHPSDV(i915) || IS_DG2(i915)) {
2976+ if (IS_DG2(i915)) {
29782977 intel_gt_mcr_multicast_write(uncore->gt, GEN8_ROW_CHICKEN,
29792978 _MASKED_BIT_DISABLE(STALL_DOP_GATING_DISABLE));
29802979 intel_uncore_write(uncore, GEN7_ROW_CHICKEN2,
@@ -4123,7 +4122,7 @@ static int read_properties_unlocked(struct i915_perf *perf, · 1142 unmodified lines
41234122 props->hold_preemption = !!value;
41244123 break;
41254124 case DRM_I915_PERF_PROP_GLOBAL_SSEU: {
4126− if (GRAPHICS_VER_FULL(perf->i915) >= IP_VER(12, 50)) {
4125+ if (GRAPHICS_VER_FULL(perf->i915) >= IP_VER(12, 55)) {
41274126 drm_dbg(&perf->i915->drm,
41284127 "SSEU config not supported on gfx %x\n",
41294128 GRAPHICS_VER_FULL(perf->i915));
drivers/gpu/drm/i915/i915_query.c+1−1
@@ -105,7 +105,7 @@ static int query_geometry_subslices(struct drm_i915_private *i915, · 104 unmodified lines
105105 struct intel_engine_cs *engine;
106106 struct i915_engine_class_instance classinstance;
107107
108− if (GRAPHICS_VER_FULL(i915) < IP_VER(12, 50))
108+ if (GRAPHICS_VER_FULL(i915) < IP_VER(12, 55))
109109 return -ENODEV;
110110
111111 classinstance = *((struct i915_engine_class_instance *)&query_item->flags);
drivers/gpu/drm/i915/i915_reg.h+30−13
@@ -1750,8 +1750,6 @@ · 1749 unmodified lines
17501750
17511751 #define BXT_RP_STATE_CAP _MMIO(0x138170)
17521752 #define GEN9_RP_STATE_LIMITS _MMIO(0x138148)
1753−#define XEHPSDV_RP_STATE_CAP _MMIO(0x250014)
1754−#define PVC_RP_STATE_CAP _MMIO(0x281014)
17551753
17561754 #define MTL_RP_STATE_CAP _MMIO(0x138000)
17571755 #define MTL_MEDIAP_STATE_CAP _MMIO(0x138020)
@@ -2095,6 +2093,13 @@ · 337 unmodified lines
20952093 #define TRANS_PUSH_EN REG_BIT(31)
20962094 #define TRANS_PUSH_SEND REG_BIT(30)
20972095
2096+#define _TRANS_VRR_VSYNC_A 0x60078
2097+#define TRANS_VRR_VSYNC(trans) _MMIO_TRANS2(trans, _TRANS_VRR_VSYNC_A)
2098+#define VRR_VSYNC_END_MASK REG_GENMASK(28, 16)
2099+#define VRR_VSYNC_END(vsync_end) REG_FIELD_PREP(VRR_VSYNC_END_MASK, (vsync_end))
2100+#define VRR_VSYNC_START_MASK REG_GENMASK(12, 0)
2101+#define VRR_VSYNC_START(vsync_start) REG_FIELD_PREP(VRR_VSYNC_START_MASK, (vsync_start))
2102+
20982103 /* VGA port control */
20992104 #define ADPA _MMIO(0x61100)
21002105 #define PCH_ADPA _MMIO(0xe1100)
@@ -2312,6 +2317,7 @@ · 211 unmodified lines
23122317 * (Haswell and newer) to see which VIDEO_DIP_DATA byte corresponds to each byte
23132318 * of the infoframe structure specified by CEA-861. */
23142319 #define VIDEO_DIP_DATA_SIZE 32
2320+#define VIDEO_DIP_ASYNC_DATA_SIZE 36
23152321 #define VIDEO_DIP_GMP_DATA_SIZE 36
23162322 #define VIDEO_DIP_VSC_DATA_SIZE 36
23172323 #define VIDEO_DIP_PPS_DATA_SIZE 132
@@ -2350,6 +2356,8 @@ · 32 unmodified lines
23502356 #define VIDEO_DIP_ENABLE_VS_HSW (1 << 8)
23512357 #define VIDEO_DIP_ENABLE_GMP_HSW (1 << 4)
23522358 #define VIDEO_DIP_ENABLE_SPD_HSW (1 << 0)
2359+/* ADL and later: */
2360+#define VIDEO_DIP_ENABLE_AS_ADL REG_BIT(23)
23532361
23542362 /* Panel fitting */
23552363 #define PFIT_CONTROL _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x61230)
@@ -2588,6 +2596,9 @@ · 232 unmodified lines
25882596 #define TRANSCONF_DITHER_TYPE_ST1 REG_FIELD_PREP(TRANSCONF_DITHER_TYPE_MASK, 1)
25892597 #define TRANSCONF_DITHER_TYPE_ST2 REG_FIELD_PREP(TRANSCONF_DITHER_TYPE_MASK, 2)
25902598 #define TRANSCONF_DITHER_TYPE_TEMP REG_FIELD_PREP(TRANSCONF_DITHER_TYPE_MASK, 3)
2599+#define TRANSCONF_PIXEL_COUNT_SCALING_MASK REG_GENMASK(1, 0)
2600+#define TRANSCONF_PIXEL_COUNT_SCALING_X4 1
2601+
25912602 #define _PIPEASTAT 0x70024
25922603 #define PIPE_FIFO_UNDERRUN_STATUS (1UL << 31)
25932604 #define SPRITE1_FLIP_DONE_INT_EN_VLV (1UL << 30)
@@ -3053,6 +3064,7 @@ · 459 unmodified lines
30533064 #define MCURSOR_MODE_DISABLE 0x00
30543065 #define MCURSOR_MODE_128_32B_AX 0x02
30553066 #define MCURSOR_MODE_256_32B_AX 0x03
3067+#define MCURSOR_MODE_64_2B 0x04
30563068 #define MCURSOR_MODE_64_32B_AX 0x07
30573069 #define MCURSOR_MODE_128_ARGB_AX (0x20 | MCURSOR_MODE_128_32B_AX)
30583070 #define MCURSOR_MODE_256_ARGB_AX (0x20 | MCURSOR_MODE_256_32B_AX)
@@ -4555,6 +4567,11 @@ · 1496 unmodified lines
45554567 #define GLK_CL1_PWR_DOWN REG_BIT(11)
45564568 #define GLK_CL0_PWR_DOWN REG_BIT(10)
45574569
4570+#define CHICKEN_MISC_3 _MMIO(0x42088)
4571+#define DP_MST_DPT_DPTP_ALIGN_WA(trans) REG_BIT(9 + (trans) - TRANSCODER_A)
4572+#define DP_MST_SHORT_HBLANK_WA(trans) REG_BIT(5 + (trans) - TRANSCODER_A)
4573+#define DP_MST_FEC_BS_JITTER_WA(trans) REG_BIT(0 + (trans) - TRANSCODER_A)
4574+
45584575 #define CHICKEN_MISC_4 _MMIO(0x4208c)
45594576 #define CHICKEN_FBC_STRIDE_OVERRIDE REG_BIT(13)
45604577 #define CHICKEN_FBC_STRIDE_MASK REG_GENMASK(12, 0)
@@ -4611,7 +4628,9 @@ · 50 unmodified lines
46114628 #define DDIE_TRAINING_OVERRIDE_ENABLE REG_BIT(17) /* CHICKEN_TRANS_A only */
46124629 #define DDIE_TRAINING_OVERRIDE_VALUE REG_BIT(16) /* CHICKEN_TRANS_A only */
46134630 #define PSR2_ADD_VERTICAL_LINE_COUNT REG_BIT(15)
4631+#define DP_FEC_BS_JITTER_WA REG_BIT(15)
46144632 #define PSR2_VSC_ENABLE_PROG_HEADER REG_BIT(12)
4633+#define DP_DSC_INSERT_SF_AT_EOL_WA REG_BIT(4)
46154634
46164635 #define DISP_ARB_CTL _MMIO(0x45000)
46174636 #define DISP_FBC_MEMORY_WAKE REG_BIT(31)
@@ -5040,6 +5059,7 @@ · 422 unmodified lines
50405059 #define _HSW_VIDEO_DIP_SPD_DATA_A 0x602A0
50415060 #define _HSW_VIDEO_DIP_GMP_DATA_A 0x602E0
50425061 #define _HSW_VIDEO_DIP_VSC_DATA_A 0x60320
5062+#define _ADL_VIDEO_DIP_AS_DATA_A 0x60484
50435063 #define _GLK_VIDEO_DIP_DRM_DATA_A 0x60440
50445064 #define _HSW_VIDEO_DIP_AVI_ECC_A 0x60240
50455065 #define _HSW_VIDEO_DIP_VS_ECC_A 0x60280
@@ -5054,6 +5074,7 @@ · 8 unmodified lines
50545074 #define _HSW_VIDEO_DIP_SPD_DATA_B 0x612A0
50555075 #define _HSW_VIDEO_DIP_GMP_DATA_B 0x612E0
50565076 #define _HSW_VIDEO_DIP_VSC_DATA_B 0x61320
5077+#define _ADL_VIDEO_DIP_AS_DATA_B 0x61484
50575078 #define _GLK_VIDEO_DIP_DRM_DATA_B 0x61440
50585079 #define _HSW_VIDEO_DIP_BVI_ECC_B 0x61240
50595080 #define _HSW_VIDEO_DIP_VS_ECC_B 0x61280
@@ -5083,6 +5104,9 @@ · 23 unmodified lines
50835104 #define GLK_TVIDEO_DIP_DRM_DATA(trans, i) _MMIO_TRANS2(trans, _GLK_VIDEO_DIP_DRM_DATA_A + (i) * 4)
50845105 #define ICL_VIDEO_DIP_PPS_DATA(trans, i) _MMIO_TRANS2(trans, _ICL_VIDEO_DIP_PPS_DATA_A + (i) * 4)
50855106 #define ICL_VIDEO_DIP_PPS_ECC(trans, i) _MMIO_TRANS2(trans, _ICL_VIDEO_DIP_PPS_ECC_A + (i) * 4)
5107+/*ADLP and later: */
5108+#define ADL_TVIDEO_DIP_AS_SDP_DATA(trans, i) _MMIO_TRANS2(trans,\
5109+ _ADL_VIDEO_DIP_AS_DATA_A + (i) * 4)
50865110
50875111 #define _HSW_STEREO_3D_CTL_A 0x70020
50885112 #define S3D_ENABLE (1 << 31)
@@ -5401,7 +5425,7 @@ · 312 unmodified lines
54015425 #define POWER_SETUP_I1_SHIFT 6 /* 10.6 fixed point format */
54025426 #define POWER_SETUP_I1_DATA_MASK REG_GENMASK(15, 0)
54035427 #define GEN12_PCODE_READ_SAGV_BLOCK_TIME_US 0x23
5404−#define XEHP_PCODE_FREQUENCY_CONFIG 0x6e /* xehpsdv, pvc */
5428+#define XEHP_PCODE_FREQUENCY_CONFIG 0x6e /* pvc */
54055429 /* XEHP_PCODE_FREQUENCY_CONFIG sub-commands (param1) */
54065430 #define PCODE_MBOX_FC_SC_READ_FUSED_P0 0x0
54075431 #define PCODE_MBOX_FC_SC_READ_FUSED_PN 0x1
@@ -5566,15 +5590,6 @@ enum skl_power_gate { · 158 unmodified lines
55665590 ((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1)
55675591 #define SKL_FUSE_PG_DIST_STATUS(pg) (1 << (27 - (pg)))
55685592
5569−#define _ICL_AUX_REG_IDX(pw_idx) ((pw_idx) - ICL_PW_CTL_IDX_AUX_A)
5570−#define _ICL_AUX_ANAOVRD1_A 0x162398
5571−#define _ICL_AUX_ANAOVRD1_B 0x6C398
5572−#define ICL_AUX_ANAOVRD1(pw_idx) _MMIO(_PICK(_ICL_AUX_REG_IDX(pw_idx), \
5573− _ICL_AUX_ANAOVRD1_A, \
5574− _ICL_AUX_ANAOVRD1_B))
5575−#define ICL_AUX_ANAOVRD1_LDO_BYPASS (1 << 7)
5576−#define ICL_AUX_ANAOVRD1_ENABLE (1 << 0)
5577−
55785593 /* Per-pipe DDI Function Control */
55795594 #define _TRANS_DDI_FUNC_CTL_A 0x60400
55805595 #define _TRANS_DDI_FUNC_CTL_B 0x61400
@@ -5900,7 +5915,9 @@ enum skl_power_gate { · 319 unmodified lines
59005915 #define CDCLK_FREQ_540 REG_FIELD_PREP(CDCLK_FREQ_SEL_MASK, 1)
59015916 #define CDCLK_FREQ_337_308 REG_FIELD_PREP(CDCLK_FREQ_SEL_MASK, 2)
59025917 #define CDCLK_FREQ_675_617 REG_FIELD_PREP(CDCLK_FREQ_SEL_MASK, 3)
5903−#define MDCLK_SOURCE_SEL_CDCLK_PLL REG_BIT(25)
5918+#define MDCLK_SOURCE_SEL_MASK REG_GENMASK(25, 25)
5919+#define MDCLK_SOURCE_SEL_CD2XCLK REG_FIELD_PREP(MDCLK_SOURCE_SEL_MASK, 0)
5920+#define MDCLK_SOURCE_SEL_CDCLK_PLL REG_FIELD_PREP(MDCLK_SOURCE_SEL_MASK, 1)
59045921 #define BXT_CDCLK_CD2X_DIV_SEL_MASK REG_GENMASK(23, 22)
59055922 #define BXT_CDCLK_CD2X_DIV_SEL_1 REG_FIELD_PREP(BXT_CDCLK_CD2X_DIV_SEL_MASK, 0)
59065923 #define BXT_CDCLK_CD2X_DIV_SEL_1_5 REG_FIELD_PREP(BXT_CDCLK_CD2X_DIV_SEL_MASK, 1)
drivers/gpu/drm/i915/i915_utils.h+0−14
@@ -73,20 +73,6 @@ bool i915_error_injected(void); · 72 unmodified lines
7373 __i915_printk(i915, i915_error_injected() ? KERN_DEBUG : KERN_ERR, \
7474 fmt, ##__VA_ARGS__)
7575
76−#if defined(GCC_VERSION) && GCC_VERSION >= 70000
77−#define add_overflows_t(T, A, B) \
78− __builtin_add_overflow_p((A), (B), (T)0)
79−#else
80−#define add_overflows_t(T, A, B) ({ \
81− typeof(A) a = (A); \
82− typeof(B) b = (B); \
83− (T)(a + b) < a; \
84−})
85−#endif
86−
87−#define add_overflows(A, B) \
88− add_overflows_t(typeof((A) + (B)), (A), (B))
89−
9076 #define range_overflows(start, size, max) ({ \
9177 typeof(start) start__ = (start); \
9278 typeof(size) size__ = (size); \
drivers/gpu/drm/i915/intel_clock_gating.c+1−58
@@ -105,12 +105,6 @@ static void bxt_init_clock_gating(struct drm_i915_private *i915) · 104 unmodified lines
105105 * Display WA #0562: bxt
106106 */
107107 intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
108−
109− /*
110− * WaFbcHighMemBwCorruptionAvoidance:bxt
111− * Display WA #0883: bxt
112− */
113− intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A), 0, DPFC_DISABLE_DUMMY0);
114108 }
115109
116110 static void glk_init_clock_gating(struct drm_i915_private *i915)
@@ -349,13 +343,6 @@ static void gen8_set_l3sqc_credits(struct drm_i915_private *i915, · 232 unmodified lines
349343 intel_uncore_write(&i915->uncore, GEN7_MISCCPCTL, misccpctl);
350344 }
351345
352−static void xehpsdv_init_clock_gating(struct drm_i915_private *i915)
353−{
354− /* Wa_22010146351:xehpsdv */
355− if (IS_XEHPSDV_GRAPHICS_STEP(i915, STEP_A0, STEP_B0))
356− intel_uncore_rmw(&i915->uncore, XEHP_CLOCK_GATE_DIS, 0, SGR_DIS);
357−}
358−
359346 static void dg2_init_clock_gating(struct drm_i915_private *i915)
360347 {
361348 /* Wa_22010954014:dg2 */
@@ -363,17 +350,6 @@ static void dg2_init_clock_gating(struct drm_i915_private *i915) · 1 unmodified line
363350 SGSI_SIDECLK_DIS);
364351 }
365352
366−static void pvc_init_clock_gating(struct drm_i915_private *i915)
367−{
368− /* Wa_14012385139:pvc */
369− if (IS_PVC_BD_STEP(i915, STEP_A0, STEP_B0))
370− intel_uncore_rmw(&i915->uncore, XEHP_CLOCK_GATE_DIS, 0, SGR_DIS);
371−
372− /* Wa_22010954014:pvc */
373− if (IS_PVC_BD_STEP(i915, STEP_A0, STEP_B0))
374− intel_uncore_rmw(&i915->uncore, XEHP_CLOCK_GATE_DIS, 0, SGSI_SIDECLK_DIS);
375−}
376−
377353 static void cnp_init_clock_gating(struct drm_i915_private *i915)
378354 {
379355 if (!HAS_PCH_CNP(i915))
@@ -396,13 +372,6 @@ static void cfl_init_clock_gating(struct drm_i915_private *i915) · 16 unmodified lines
396372 * Display WA #0562: cfl
397373 */
398374 intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
399−
400− /*
401− * WaFbcNukeOnHostModify:cfl
402− * Display WA #0873: cfl
403− */
404− intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A),
405− 0, DPFC_NUKE_ON_ANY_MODIFICATION);
406375 }
407376
408377 static void kbl_init_clock_gating(struct drm_i915_private *i915)
@@ -427,13 +396,6 @@ static void kbl_init_clock_gating(struct drm_i915_private *i915) · 18 unmodified lines
427396 * Display WA #0562: kbl
428397 */
429398 intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
430−
431− /*
432− * WaFbcNukeOnHostModify:kbl
433− * Display WA #0873: kbl
434− */
435− intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A),
436− 0, DPFC_NUKE_ON_ANY_MODIFICATION);
437399 }
438400
439401 static void skl_init_clock_gating(struct drm_i915_private *i915)
@@ -452,19 +414,6 @@ static void skl_init_clock_gating(struct drm_i915_private *i915) · 12 unmodified lines
452414 * Display WA #0562: skl
453415 */
454416 intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
455−
456− /*
457− * WaFbcNukeOnHostModify:skl
458− * Display WA #0873: skl
459− */
460− intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A),
461− 0, DPFC_NUKE_ON_ANY_MODIFICATION);
462−
463− /*
464− * WaFbcHighMemBwCorruptionAvoidance:skl
465− * Display WA #0883: skl
466− */
467− intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A), 0, DPFC_DISABLE_DUMMY0);
468417 }
469418
470419 static void bdw_init_clock_gating(struct drm_i915_private *i915)
@@ -762,9 +711,7 @@ static const struct drm_i915_clock_gating_funcs platform##_clock_gating_funcs = · 291 unmodified lines
762711 .init_clock_gating = platform##_init_clock_gating, \
763712 }
764713
765−CG_FUNCS(pvc);
766714 CG_FUNCS(dg2);
767−CG_FUNCS(xehpsdv);
768715 CG_FUNCS(cfl);
769716 CG_FUNCS(skl);
770717 CG_FUNCS(kbl);
@@ -797,12 +744,8 @@ CG_FUNCS(nop); · 26 unmodified lines
797744 */
798745 void intel_clock_gating_hooks_init(struct drm_i915_private *i915)
799746 {
800− if (IS_PONTEVECCHIO(i915))
801− i915->clock_gating_funcs = &pvc_clock_gating_funcs;
802− else if (IS_DG2(i915))
747+ if (IS_DG2(i915))
803748 i915->clock_gating_funcs = &dg2_clock_gating_funcs;
804− else if (IS_XEHPSDV(i915))
805− i915->clock_gating_funcs = &xehpsdv_clock_gating_funcs;
806749 else if (IS_COFFEELAKE(i915) || IS_COMETLAKE(i915))
807750 i915->clock_gating_funcs = &cfl_clock_gating_funcs;
808751 else if (IS_SKYLAKE(i915))
drivers/gpu/drm/i915/intel_device_info.c+0−2
@@ -70,9 +70,7 @@ static const char * const platform_names[] = { · 69 unmodified lines
7070 PLATFORM_NAME(DG1),
7171 PLATFORM_NAME(ALDERLAKE_S),
7272 PLATFORM_NAME(ALDERLAKE_P),
73− PLATFORM_NAME(XEHPSDV),
7473 PLATFORM_NAME(DG2),
75− PLATFORM_NAME(PONTEVECCHIO),
7674 PLATFORM_NAME(METEORLAKE),
7775 };
7876 #undef PLATFORM_NAME
drivers/gpu/drm/i915/intel_device_info.h+0−2
@@ -87,9 +87,7 @@ enum intel_platform { · 86 unmodified lines
8787 INTEL_DG1,
8888 INTEL_ALDERLAKE_S,
8989 INTEL_ALDERLAKE_P,
90− INTEL_XEHPSDV,
9190 INTEL_DG2,
92− INTEL_PONTEVECCHIO,
9391 INTEL_METEORLAKE,
9492 INTEL_MAX_PLATFORMS
9593 };
drivers/gpu/drm/i915/intel_step.c+1−79
@@ -102,13 +102,6 @@ static const struct intel_step_info adlp_revids[] = { · 101 unmodified lines
102102 [0xC] = { COMMON_GT_MEDIA_STEP(C0), .display_step = STEP_D0 },
103103 };
104104
105−static const struct intel_step_info xehpsdv_revids[] = {
106− [0x0] = { COMMON_GT_MEDIA_STEP(A0) },
107− [0x1] = { COMMON_GT_MEDIA_STEP(A1) },
108− [0x4] = { COMMON_GT_MEDIA_STEP(B0) },
109− [0x8] = { COMMON_GT_MEDIA_STEP(C0) },
110−};
111−
112105 static const struct intel_step_info dg2_g10_revid_step_tbl[] = {
113106 [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display_step = STEP_A0 },
114107 [0x1] = { COMMON_GT_MEDIA_STEP(A1), .display_step = STEP_A0 },
@@ -153,8 +146,6 @@ static u8 gmd_to_intel_step(struct drm_i915_private *i915, · 38 unmodified lines
153146 return step;
154147 }
155148
156−static void pvc_step_init(struct drm_i915_private *i915, int pci_revid);
157−
158149 void intel_step_init(struct drm_i915_private *i915)
159150 {
160151 const struct intel_step_info *revids = NULL;
@@ -178,10 +169,7 @@ void intel_step_init(struct drm_i915_private *i915) · 17 unmodified lines
178169 return;
179170 }
180171
181− if (IS_PONTEVECCHIO(i915)) {
182− pvc_step_init(i915, revid);
183− return;
184− } else if (IS_DG2_G10(i915)) {
172+ if (IS_DG2_G10(i915)) {
185173 revids = dg2_g10_revid_step_tbl;
186174 size = ARRAY_SIZE(dg2_g10_revid_step_tbl);
187175 } else if (IS_DG2_G11(i915)) {
@@ -190,9 +178,6 @@ void intel_step_init(struct drm_i915_private *i915) · 2 unmodified lines
190178 } else if (IS_DG2_G12(i915)) {
191179 revids = dg2_g12_revid_step_tbl;
192180 size = ARRAY_SIZE(dg2_g12_revid_step_tbl);
193− } else if (IS_XEHPSDV(i915)) {
194− revids = xehpsdv_revids;
195− size = ARRAY_SIZE(xehpsdv_revids);
196181 } else if (IS_ALDERLAKE_P_N(i915)) {
197182 revids = adlp_n_revids;
198183 size = ARRAY_SIZE(adlp_n_revids);
@@ -277,69 +262,6 @@ void intel_step_init(struct drm_i915_private *i915) · 78 unmodified lines
277262 RUNTIME_INFO(i915)->step = step;
278263 }
279264
280−#define PVC_BD_REVID GENMASK(5, 3)
281−#define PVC_CT_REVID GENMASK(2, 0)
282−
283−static const int pvc_bd_subids[] = {
284− [0x0] = STEP_A0,
285− [0x3] = STEP_B0,
286− [0x4] = STEP_B1,
287− [0x5] = STEP_B3,
288−};
289−
290−static const int pvc_ct_subids[] = {
291− [0x3] = STEP_A0,
292− [0x5] = STEP_B0,
293− [0x6] = STEP_B1,
294− [0x7] = STEP_C0,
295−};
296−
297−static int
298−pvc_step_lookup(struct drm_i915_private *i915, const char *type,
299− const int *table, int size, int subid)
300−{
301− if (subid < size && table[subid] != STEP_NONE)
302− return table[subid];
303−
304− drm_warn(&i915->drm, "Unknown %s id 0x%02x\n", type, subid);
305−
306− /*
307− * As on other platforms, try to use the next higher ID if we land on a
308− * gap in the table.
309− */
310− while (subid < size && table[subid] == STEP_NONE)
311− subid++;
312−
313− if (subid < size) {
314− drm_dbg(&i915->drm, "Using steppings for %s id 0x%02x\n",
315− type, subid);
316− return table[subid];
317− }
318−
319− drm_dbg(&i915->drm, "Using future steppings\n");
320− return STEP_FUTURE;
321−}
322−
323−/*
324− * PVC needs special handling since we don't lookup the
325− * revid in a table, but rather specific bitfields within
326− * the revid for various components.
327− */
328−static void pvc_step_init(struct drm_i915_private *i915, int pci_revid)
329−{
330− int ct_subid, bd_subid;
331−
332− bd_subid = FIELD_GET(PVC_BD_REVID, pci_revid);
333− ct_subid = FIELD_GET(PVC_CT_REVID, pci_revid);
334−
335− RUNTIME_INFO(i915)->step.basedie_step =
336− pvc_step_lookup(i915, "Base Die", pvc_bd_subids,
337− ARRAY_SIZE(pvc_bd_subids), bd_subid);
338− RUNTIME_INFO(i915)->step.graphics_step =
339− pvc_step_lookup(i915, "Compute Tile", pvc_ct_subids,
340− ARRAY_SIZE(pvc_ct_subids), ct_subid);
341−}
342−
343265 #define STEP_NAME_CASE(name) \
344266 case STEP_##name: \
345267 return #name;
drivers/gpu/drm/i915/intel_uncore.c+109−271
@@ -1106,45 +1106,6 @@ static const struct i915_range dg2_shadowed_regs[] = { · 1105 unmodified lines
11061106 { .start = 0x1F8510, .end = 0x1F8550 },
11071107 };
11081108
1109−static const struct i915_range pvc_shadowed_regs[] = {
1110− { .start = 0x2030, .end = 0x2030 },
1111− { .start = 0x2510, .end = 0x2550 },
1112− { .start = 0xA008, .end = 0xA00C },
1113− { .start = 0xA188, .end = 0xA188 },
1114− { .start = 0xA278, .end = 0xA278 },
1115− { .start = 0xA540, .end = 0xA56C },
1116− { .start = 0xC4C8, .end = 0xC4C8 },
1117− { .start = 0xC4E0, .end = 0xC4E0 },
1118− { .start = 0xC600, .end = 0xC600 },
1119− { .start = 0xC658, .end = 0xC658 },
1120− { .start = 0x22030, .end = 0x22030 },
1121− { .start = 0x22510, .end = 0x22550 },
1122− { .start = 0x1C0030, .end = 0x1C0030 },
1123− { .start = 0x1C0510, .end = 0x1C0550 },
1124− { .start = 0x1C4030, .end = 0x1C4030 },
1125− { .start = 0x1C4510, .end = 0x1C4550 },
1126− { .start = 0x1C8030, .end = 0x1C8030 },
1127− { .start = 0x1C8510, .end = 0x1C8550 },
1128− { .start = 0x1D0030, .end = 0x1D0030 },
1129− { .start = 0x1D0510, .end = 0x1D0550 },
1130− { .start = 0x1D4030, .end = 0x1D4030 },
1131− { .start = 0x1D4510, .end = 0x1D4550 },
1132− { .start = 0x1D8030, .end = 0x1D8030 },
1133− { .start = 0x1D8510, .end = 0x1D8550 },
1134− { .start = 0x1E0030, .end = 0x1E0030 },
1135− { .start = 0x1E0510, .end = 0x1E0550 },
1136− { .start = 0x1E4030, .end = 0x1E4030 },
1137− { .start = 0x1E4510, .end = 0x1E4550 },
1138− { .start = 0x1E8030, .end = 0x1E8030 },
1139− { .start = 0x1E8510, .end = 0x1E8550 },
1140− { .start = 0x1F0030, .end = 0x1F0030 },
1141− { .start = 0x1F0510, .end = 0x1F0550 },
1142− { .start = 0x1F4030, .end = 0x1F4030 },
1143− { .start = 0x1F4510, .end = 0x1F4550 },
1144− { .start = 0x1F8030, .end = 0x1F8030 },
1145− { .start = 0x1F8510, .end = 0x1F8550 },
1146−};
1147−
11481109 static const struct i915_range mtl_shadowed_regs[] = {
11491110 { .start = 0x2030, .end = 0x2030 },
11501111 { .start = 0x2510, .end = 0x2550 },
@@ -1471,195 +1432,31 @@ static const struct intel_forcewake_range __gen12_fw_ranges[] = { · 320 unmodified lines
14711432 0x1d3f00 - 0x1d3fff: VD2 */
14721433 };
14731434
1474−/*
1475− * Graphics IP version 12.55 brings a slight change to the 0xd800 range,
1476− * switching it from the GT domain to the render domain.
1477− */
1478−#define XEHP_FWRANGES(FW_RANGE_D800) \
1479− GEN_FW_RANGE(0x0, 0x1fff, 0), /* \
1480− 0x0 - 0xaff: reserved \
1481− 0xb00 - 0x1fff: always on */ \
1482− GEN_FW_RANGE(0x2000, 0x26ff, FORCEWAKE_RENDER), \
1483− GEN_FW_RANGE(0x2700, 0x4aff, FORCEWAKE_GT), \
1484− GEN_FW_RANGE(0x4b00, 0x51ff, 0), /* \
1485− 0x4b00 - 0x4fff: reserved \
1486− 0x5000 - 0x51ff: always on */ \
1487− GEN_FW_RANGE(0x5200, 0x7fff, FORCEWAKE_RENDER), \
1488− GEN_FW_RANGE(0x8000, 0x813f, FORCEWAKE_GT), \
1489− GEN_FW_RANGE(0x8140, 0x815f, FORCEWAKE_RENDER), \
1490− GEN_FW_RANGE(0x8160, 0x81ff, 0), /* \
1491− 0x8160 - 0x817f: reserved \
1492− 0x8180 - 0x81ff: always on */ \
1493− GEN_FW_RANGE(0x8200, 0x82ff, FORCEWAKE_GT), \
1494− GEN_FW_RANGE(0x8300, 0x84ff, FORCEWAKE_RENDER), \
1495− GEN_FW_RANGE(0x8500, 0x8cff, FORCEWAKE_GT), /* \
1496− 0x8500 - 0x87ff: gt \
1497− 0x8800 - 0x8c7f: reserved \
1498− 0x8c80 - 0x8cff: gt (DG2 only) */ \
1499− GEN_FW_RANGE(0x8d00, 0x8fff, FORCEWAKE_RENDER), /* \
1500− 0x8d00 - 0x8dff: render (DG2 only) \
1501− 0x8e00 - 0x8fff: reserved */ \
1502− GEN_FW_RANGE(0x9000, 0x94cf, FORCEWAKE_GT), /* \
1503− 0x9000 - 0x947f: gt \
1504− 0x9480 - 0x94cf: reserved */ \
1505− GEN_FW_RANGE(0x94d0, 0x955f, FORCEWAKE_RENDER), \
1506− GEN_FW_RANGE(0x9560, 0x967f, 0), /* \
1507− 0x9560 - 0x95ff: always on \
1508− 0x9600 - 0x967f: reserved */ \
1509− GEN_FW_RANGE(0x9680, 0x97ff, FORCEWAKE_RENDER), /* \
1510− 0x9680 - 0x96ff: render (DG2 only) \
1511− 0x9700 - 0x97ff: reserved */ \
1512− GEN_FW_RANGE(0x9800, 0xcfff, FORCEWAKE_GT), /* \
1513− 0x9800 - 0xb4ff: gt \
1514− 0xb500 - 0xbfff: reserved \
1515− 0xc000 - 0xcfff: gt */ \
1516− GEN_FW_RANGE(0xd000, 0xd7ff, 0), \
1517− GEN_FW_RANGE(0xd800, 0xd87f, FW_RANGE_D800), \
1518− GEN_FW_RANGE(0xd880, 0xdbff, FORCEWAKE_GT), \
1519− GEN_FW_RANGE(0xdc00, 0xdcff, FORCEWAKE_RENDER), \
1520− GEN_FW_RANGE(0xdd00, 0xde7f, FORCEWAKE_GT), /* \
1521− 0xdd00 - 0xddff: gt \
1522− 0xde00 - 0xde7f: reserved */ \
1523− GEN_FW_RANGE(0xde80, 0xe8ff, FORCEWAKE_RENDER), /* \
1524− 0xde80 - 0xdfff: render \
1525− 0xe000 - 0xe0ff: reserved \
1526− 0xe100 - 0xe8ff: render */ \
1527− GEN_FW_RANGE(0xe900, 0xffff, FORCEWAKE_GT), /* \
1528− 0xe900 - 0xe9ff: gt \
1529− 0xea00 - 0xefff: reserved \
1530− 0xf000 - 0xffff: gt */ \
1531− GEN_FW_RANGE(0x10000, 0x12fff, 0), /* \
1532− 0x10000 - 0x11fff: reserved \
1533− 0x12000 - 0x127ff: always on \
1534− 0x12800 - 0x12fff: reserved */ \
1535− GEN_FW_RANGE(0x13000, 0x131ff, FORCEWAKE_MEDIA_VDBOX0), /* DG2 only */ \
1536− GEN_FW_RANGE(0x13200, 0x13fff, FORCEWAKE_MEDIA_VDBOX2), /* \
1537− 0x13200 - 0x133ff: VD2 (DG2 only) \
1538− 0x13400 - 0x13fff: reserved */ \
1539− GEN_FW_RANGE(0x14000, 0x141ff, FORCEWAKE_MEDIA_VDBOX0), /* XEHPSDV only */ \
1540− GEN_FW_RANGE(0x14200, 0x143ff, FORCEWAKE_MEDIA_VDBOX2), /* XEHPSDV only */ \
1541− GEN_FW_RANGE(0x14400, 0x145ff, FORCEWAKE_MEDIA_VDBOX4), /* XEHPSDV only */ \
1542− GEN_FW_RANGE(0x14600, 0x147ff, FORCEWAKE_MEDIA_VDBOX6), /* XEHPSDV only */ \
1543− GEN_FW_RANGE(0x14800, 0x14fff, FORCEWAKE_RENDER), \
1544− GEN_FW_RANGE(0x15000, 0x16dff, FORCEWAKE_GT), /* \
1545− 0x15000 - 0x15fff: gt (DG2 only) \
1546− 0x16000 - 0x16dff: reserved */ \
1547− GEN_FW_RANGE(0x16e00, 0x1ffff, FORCEWAKE_RENDER), \
1548− GEN_FW_RANGE(0x20000, 0x21fff, FORCEWAKE_MEDIA_VDBOX0), /* \
1549− 0x20000 - 0x20fff: VD0 (XEHPSDV only) \
1550− 0x21000 - 0x21fff: reserved */ \
1551− GEN_FW_RANGE(0x22000, 0x23fff, FORCEWAKE_GT), \
1552− GEN_FW_RANGE(0x24000, 0x2417f, 0), /* \
1553− 0x24000 - 0x2407f: always on \
1554− 0x24080 - 0x2417f: reserved */ \
1555− GEN_FW_RANGE(0x24180, 0x249ff, FORCEWAKE_GT), /* \
1556− 0x24180 - 0x241ff: gt \
1557− 0x24200 - 0x249ff: reserved */ \
1558− GEN_FW_RANGE(0x24a00, 0x251ff, FORCEWAKE_RENDER), /* \
1559− 0x24a00 - 0x24a7f: render \
1560− 0x24a80 - 0x251ff: reserved */ \
1561− GEN_FW_RANGE(0x25200, 0x25fff, FORCEWAKE_GT), /* \
1562− 0x25200 - 0x252ff: gt \
1563− 0x25300 - 0x25fff: reserved */ \
1564− GEN_FW_RANGE(0x26000, 0x2ffff, FORCEWAKE_RENDER), /* \
1565− 0x26000 - 0x27fff: render \
1566− 0x28000 - 0x29fff: reserved \
1567− 0x2a000 - 0x2ffff: undocumented */ \
1568− GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_GT), \
1569− GEN_FW_RANGE(0x40000, 0x1bffff, 0), \
1570− GEN_FW_RANGE(0x1c0000, 0x1c3fff, FORCEWAKE_MEDIA_VDBOX0), /* \
1571− 0x1c0000 - 0x1c2bff: VD0 \
1572− 0x1c2c00 - 0x1c2cff: reserved \
1573− 0x1c2d00 - 0x1c2dff: VD0 \
1574− 0x1c2e00 - 0x1c3eff: VD0 (DG2 only) \
1575− 0x1c3f00 - 0x1c3fff: VD0 */ \
1576− GEN_FW_RANGE(0x1c4000, 0x1c7fff, FORCEWAKE_MEDIA_VDBOX1), /* \
1577− 0x1c4000 - 0x1c6bff: VD1 \
1578− 0x1c6c00 - 0x1c6cff: reserved \
1579− 0x1c6d00 - 0x1c6dff: VD1 \
1580− 0x1c6e00 - 0x1c7fff: reserved */ \
1581− GEN_FW_RANGE(0x1c8000, 0x1cbfff, FORCEWAKE_MEDIA_VEBOX0), /* \
1582− 0x1c8000 - 0x1ca0ff: VE0 \
1583− 0x1ca100 - 0x1cbfff: reserved */ \
1584− GEN_FW_RANGE(0x1cc000, 0x1ccfff, FORCEWAKE_MEDIA_VDBOX0), \
1585− GEN_FW_RANGE(0x1cd000, 0x1cdfff, FORCEWAKE_MEDIA_VDBOX2), \
1586− GEN_FW_RANGE(0x1ce000, 0x1cefff, FORCEWAKE_MEDIA_VDBOX4), \
1587− GEN_FW_RANGE(0x1cf000, 0x1cffff, FORCEWAKE_MEDIA_VDBOX6), \
1588− GEN_FW_RANGE(0x1d0000, 0x1d3fff, FORCEWAKE_MEDIA_VDBOX2), /* \
1589− 0x1d0000 - 0x1d2bff: VD2 \
1590− 0x1d2c00 - 0x1d2cff: reserved \
1591− 0x1d2d00 - 0x1d2dff: VD2 \
1592− 0x1d2e00 - 0x1d3dff: VD2 (DG2 only) \
1593− 0x1d3e00 - 0x1d3eff: reserved \
1594− 0x1d3f00 - 0x1d3fff: VD2 */ \
1595− GEN_FW_RANGE(0x1d4000, 0x1d7fff, FORCEWAKE_MEDIA_VDBOX3), /* \
1596− 0x1d4000 - 0x1d6bff: VD3 \
1597− 0x1d6c00 - 0x1d6cff: reserved \
1598− 0x1d6d00 - 0x1d6dff: VD3 \
1599− 0x1d6e00 - 0x1d7fff: reserved */ \
1600− GEN_FW_RANGE(0x1d8000, 0x1dffff, FORCEWAKE_MEDIA_VEBOX1), /* \
1601− 0x1d8000 - 0x1da0ff: VE1 \
1602− 0x1da100 - 0x1dffff: reserved */ \
1603− GEN_FW_RANGE(0x1e0000, 0x1e3fff, FORCEWAKE_MEDIA_VDBOX4), /* \
1604− 0x1e0000 - 0x1e2bff: VD4 \
1605− 0x1e2c00 - 0x1e2cff: reserved \
1606− 0x1e2d00 - 0x1e2dff: VD4 \
1607− 0x1e2e00 - 0x1e3eff: reserved \
1608− 0x1e3f00 - 0x1e3fff: VD4 */ \
1609− GEN_FW_RANGE(0x1e4000, 0x1e7fff, FORCEWAKE_MEDIA_VDBOX5), /* \
1610− 0x1e4000 - 0x1e6bff: VD5 \
1611− 0x1e6c00 - 0x1e6cff: reserved \
1612− 0x1e6d00 - 0x1e6dff: VD5 \
1613− 0x1e6e00 - 0x1e7fff: reserved */ \
1614− GEN_FW_RANGE(0x1e8000, 0x1effff, FORCEWAKE_MEDIA_VEBOX2), /* \
1615− 0x1e8000 - 0x1ea0ff: VE2 \
1616− 0x1ea100 - 0x1effff: reserved */ \
1617− GEN_FW_RANGE(0x1f0000, 0x1f3fff, FORCEWAKE_MEDIA_VDBOX6), /* \
1618− 0x1f0000 - 0x1f2bff: VD6 \
1619− 0x1f2c00 - 0x1f2cff: reserved \
1620− 0x1f2d00 - 0x1f2dff: VD6 \
1621− 0x1f2e00 - 0x1f3eff: reserved \
1622− 0x1f3f00 - 0x1f3fff: VD6 */ \
1623− GEN_FW_RANGE(0x1f4000, 0x1f7fff, FORCEWAKE_MEDIA_VDBOX7), /* \
1624− 0x1f4000 - 0x1f6bff: VD7 \
1625− 0x1f6c00 - 0x1f6cff: reserved \
1626− 0x1f6d00 - 0x1f6dff: VD7 \
1627− 0x1f6e00 - 0x1f7fff: reserved */ \
1628− GEN_FW_RANGE(0x1f8000, 0x1fa0ff, FORCEWAKE_MEDIA_VEBOX3),
1629−
1630−static const struct intel_forcewake_range __xehp_fw_ranges[] = {
1631− XEHP_FWRANGES(FORCEWAKE_GT)
1632−};
1633−
16341435 static const struct intel_forcewake_range __dg2_fw_ranges[] = {
1635− XEHP_FWRANGES(FORCEWAKE_RENDER)
1636−};
1637−
1638−static const struct intel_forcewake_range __pvc_fw_ranges[] = {
1639− GEN_FW_RANGE(0x0, 0xaff, 0),
1640− GEN_FW_RANGE(0xb00, 0xbff, FORCEWAKE_GT),
1641− GEN_FW_RANGE(0xc00, 0xfff, 0),
1642− GEN_FW_RANGE(0x1000, 0x1fff, FORCEWAKE_GT),
1436+ GEN_FW_RANGE(0x0, 0x1fff, 0), /*
1437+ 0x0 - 0xaff: reserved
1438+ 0xb00 - 0x1fff: always on */
16431439 GEN_FW_RANGE(0x2000, 0x26ff, FORCEWAKE_RENDER),
1644− GEN_FW_RANGE(0x2700, 0x2fff, FORCEWAKE_GT),
1645− GEN_FW_RANGE(0x3000, 0x3fff, FORCEWAKE_RENDER),
1646− GEN_FW_RANGE(0x4000, 0x813f, FORCEWAKE_GT), /*
1647− 0x4000 - 0x4aff: gt
1440+ GEN_FW_RANGE(0x2700, 0x4aff, FORCEWAKE_GT),
1441+ GEN_FW_RANGE(0x4b00, 0x51ff, 0), /*
16481442 0x4b00 - 0x4fff: reserved
1649− 0x5000 - 0x51ff: gt
1650− 0x5200 - 0x52ff: reserved
1651− 0x5300 - 0x53ff: gt
1652− 0x5400 - 0x7fff: reserved
1653− 0x8000 - 0x813f: gt */
1654− GEN_FW_RANGE(0x8140, 0x817f, FORCEWAKE_RENDER),
1655− GEN_FW_RANGE(0x8180, 0x81ff, 0),
1656− GEN_FW_RANGE(0x8200, 0x94cf, FORCEWAKE_GT), /*
1657− 0x8200 - 0x82ff: gt
1658− 0x8300 - 0x84ff: reserved
1659− 0x8500 - 0x887f: gt
1660− 0x8880 - 0x8a7f: reserved
1661− 0x8a80 - 0x8aff: gt
1662− 0x8b00 - 0x8fff: reserved
1443+ 0x5000 - 0x51ff: always on */
1444+ GEN_FW_RANGE(0x5200, 0x7fff, FORCEWAKE_RENDER),
1445+ GEN_FW_RANGE(0x8000, 0x813f, FORCEWAKE_GT),
1446+ GEN_FW_RANGE(0x8140, 0x815f, FORCEWAKE_RENDER),
1447+ GEN_FW_RANGE(0x8160, 0x81ff, 0), /*
1448+ 0x8160 - 0x817f: reserved
1449+ 0x8180 - 0x81ff: always on */
1450+ GEN_FW_RANGE(0x8200, 0x82ff, FORCEWAKE_GT),
1451+ GEN_FW_RANGE(0x8300, 0x84ff, FORCEWAKE_RENDER),
1452+ GEN_FW_RANGE(0x8500, 0x8cff, FORCEWAKE_GT), /*
1453+ 0x8500 - 0x87ff: gt
1454+ 0x8800 - 0x8c7f: reserved
1455+ 0x8c80 - 0x8cff: gt (DG2 only) */
1456+ GEN_FW_RANGE(0x8d00, 0x8fff, FORCEWAKE_RENDER), /*
1457+ 0x8d00 - 0x8dff: render (DG2 only)
1458+ 0x8e00 - 0x8fff: reserved */
1459+ GEN_FW_RANGE(0x9000, 0x94cf, FORCEWAKE_GT), /*
16631460 0x9000 - 0x947f: gt
16641461 0x9480 - 0x94cf: reserved */
16651462 GEN_FW_RANGE(0x94d0, 0x955f, FORCEWAKE_RENDER),
@@ -1673,65 +1470,114 @@ static const struct intel_forcewake_range __pvc_fw_ranges[] = { · 7 unmodified lines
16731470 0x9800 - 0xb4ff: gt
16741471 0xb500 - 0xbfff: reserved
16751472 0xc000 - 0xcfff: gt */
1676− GEN_FW_RANGE(0xd000, 0xd3ff, 0),
1677− GEN_FW_RANGE(0xd400, 0xdbff, FORCEWAKE_GT),
1473+ GEN_FW_RANGE(0xd000, 0xd7ff, 0),
1474+ GEN_FW_RANGE(0xd800, 0xd87f, FORCEWAKE_RENDER),
1475+ GEN_FW_RANGE(0xd880, 0xdbff, FORCEWAKE_GT),
16781476 GEN_FW_RANGE(0xdc00, 0xdcff, FORCEWAKE_RENDER),
16791477 GEN_FW_RANGE(0xdd00, 0xde7f, FORCEWAKE_GT), /*
16801478 0xdd00 - 0xddff: gt
16811479 0xde00 - 0xde7f: reserved */
16821480 GEN_FW_RANGE(0xde80, 0xe8ff, FORCEWAKE_RENDER), /*
1683− 0xde80 - 0xdeff: render
1684− 0xdf00 - 0xe1ff: reserved
1685− 0xe200 - 0xe7ff: render
1686− 0xe800 - 0xe8ff: reserved */
1687− GEN_FW_RANGE(0xe900, 0x11fff, FORCEWAKE_GT), /*
1688− 0xe900 - 0xe9ff: gt
1689− 0xea00 - 0xebff: reserved
1690− 0xec00 - 0xffff: gt
1691− 0x10000 - 0x11fff: reserved */
1692− GEN_FW_RANGE(0x12000, 0x12fff, 0), /*
1481+ 0xde80 - 0xdfff: render
1482+ 0xe000 - 0xe0ff: reserved
1483+ 0xe100 - 0xe8ff: render */
1484+ GEN_FW_RANGE(0xe900, 0xffff, FORCEWAKE_GT), /*
1485+ 0xe900 - 0xe9ff: gt
1486+ 0xea00 - 0xefff: reserved
1487+ 0xf000 - 0xffff: gt */
1488+ GEN_FW_RANGE(0x10000, 0x12fff, 0), /*
1489+ 0x10000 - 0x11fff: reserved
16931490 0x12000 - 0x127ff: always on
16941491 0x12800 - 0x12fff: reserved */
1695− GEN_FW_RANGE(0x13000, 0x19fff, FORCEWAKE_GT), /*
1696− 0x13000 - 0x135ff: gt
1697− 0x13600 - 0x147ff: reserved
1698− 0x14800 - 0x153ff: gt
1699− 0x15400 - 0x19fff: reserved */
1700− GEN_FW_RANGE(0x1a000, 0x21fff, FORCEWAKE_RENDER), /*
1701− 0x1a000 - 0x1ffff: render
1492+ GEN_FW_RANGE(0x13000, 0x131ff, FORCEWAKE_MEDIA_VDBOX0),
1493+ GEN_FW_RANGE(0x13200, 0x147ff, FORCEWAKE_MEDIA_VDBOX2), /*
1494+ 0x13200 - 0x133ff: VD2 (DG2 only)
1495+ 0x13400 - 0x147ff: reserved */
1496+ GEN_FW_RANGE(0x14800, 0x14fff, FORCEWAKE_RENDER),
1497+ GEN_FW_RANGE(0x15000, 0x16dff, FORCEWAKE_GT), /*
1498+ 0x15000 - 0x15fff: gt (DG2 only)
1499+ 0x16000 - 0x16dff: reserved */
1500+ GEN_FW_RANGE(0x16e00, 0x21fff, FORCEWAKE_RENDER), /*
1501+ 0x16e00 - 0x1ffff: render
17021502 0x20000 - 0x21fff: reserved */
17031503 GEN_FW_RANGE(0x22000, 0x23fff, FORCEWAKE_GT),
17041504 GEN_FW_RANGE(0x24000, 0x2417f, 0), /*
1705− 24000 - 0x2407f: always on
1706− 24080 - 0x2417f: reserved */
1707− GEN_FW_RANGE(0x24180, 0x25fff, FORCEWAKE_GT), /*
1505+ 0x24000 - 0x2407f: always on
1506+ 0x24080 - 0x2417f: reserved */
1507+ GEN_FW_RANGE(0x24180, 0x249ff, FORCEWAKE_GT), /*
17081508 0x24180 - 0x241ff: gt
1709− 0x24200 - 0x251ff: reserved
1509+ 0x24200 - 0x249ff: reserved */
1510+ GEN_FW_RANGE(0x24a00, 0x251ff, FORCEWAKE_RENDER), /*
1511+ 0x24a00 - 0x24a7f: render
1512+ 0x24a80 - 0x251ff: reserved */
1513+ GEN_FW_RANGE(0x25200, 0x25fff, FORCEWAKE_GT), /*
17101514 0x25200 - 0x252ff: gt
17111515 0x25300 - 0x25fff: reserved */
17121516 GEN_FW_RANGE(0x26000, 0x2ffff, FORCEWAKE_RENDER), /*
17131517 0x26000 - 0x27fff: render
1714− 0x28000 - 0x2ffff: reserved */
1518+ 0x28000 - 0x29fff: reserved
1519+ 0x2a000 - 0x2ffff: undocumented */
17151520 GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_GT),
17161521 GEN_FW_RANGE(0x40000, 0x1bffff, 0),
17171522 GEN_FW_RANGE(0x1c0000, 0x1c3fff, FORCEWAKE_MEDIA_VDBOX0), /*
17181523 0x1c0000 - 0x1c2bff: VD0
17191524 0x1c2c00 - 0x1c2cff: reserved
17201525 0x1c2d00 - 0x1c2dff: VD0
1721− 0x1c2e00 - 0x1c3eff: reserved
1526+ 0x1c2e00 - 0x1c3eff: VD0
17221527 0x1c3f00 - 0x1c3fff: VD0 */
1723− GEN_FW_RANGE(0x1c4000, 0x1cffff, FORCEWAKE_MEDIA_VDBOX1), /*
1724− 0x1c4000 - 0x1c6aff: VD1
1725− 0x1c6b00 - 0x1c7eff: reserved
1726− 0x1c7f00 - 0x1c7fff: VD1
1727− 0x1c8000 - 0x1cffff: reserved */
1728− GEN_FW_RANGE(0x1d0000, 0x23ffff, FORCEWAKE_MEDIA_VDBOX2), /*
1729− 0x1d0000 - 0x1d2aff: VD2
1730− 0x1d2b00 - 0x1d3eff: reserved
1731− 0x1d3f00 - 0x1d3fff: VD2
1732− 0x1d4000 - 0x23ffff: reserved */
1733− GEN_FW_RANGE(0x240000, 0x3dffff, 0),
1734− GEN_FW_RANGE(0x3e0000, 0x3effff, FORCEWAKE_GT),
1528+ GEN_FW_RANGE(0x1c4000, 0x1c7fff, FORCEWAKE_MEDIA_VDBOX1), /*
1529+ 0x1c4000 - 0x1c6bff: VD1
1530+ 0x1c6c00 - 0x1c6cff: reserved
1531+ 0x1c6d00 - 0x1c6dff: VD1
1532+ 0x1c6e00 - 0x1c7fff: reserved */
1533+ GEN_FW_RANGE(0x1c8000, 0x1cbfff, FORCEWAKE_MEDIA_VEBOX0), /*
1534+ 0x1c8000 - 0x1ca0ff: VE0
1535+ 0x1ca100 - 0x1cbfff: reserved */
1536+ GEN_FW_RANGE(0x1cc000, 0x1ccfff, FORCEWAKE_MEDIA_VDBOX0),
1537+ GEN_FW_RANGE(0x1cd000, 0x1cdfff, FORCEWAKE_MEDIA_VDBOX2),
1538+ GEN_FW_RANGE(0x1ce000, 0x1cefff, FORCEWAKE_MEDIA_VDBOX4),
1539+ GEN_FW_RANGE(0x1cf000, 0x1cffff, FORCEWAKE_MEDIA_VDBOX6),
1540+ GEN_FW_RANGE(0x1d0000, 0x1d3fff, FORCEWAKE_MEDIA_VDBOX2), /*
1541+ 0x1d0000 - 0x1d2bff: VD2
1542+ 0x1d2c00 - 0x1d2cff: reserved
1543+ 0x1d2d00 - 0x1d2dff: VD2
1544+ 0x1d2e00 - 0x1d3dff: VD2
1545+ 0x1d3e00 - 0x1d3eff: reserved
1546+ 0x1d3f00 - 0x1d3fff: VD2 */
1547+ GEN_FW_RANGE(0x1d4000, 0x1d7fff, FORCEWAKE_MEDIA_VDBOX3), /*
1548+ 0x1d4000 - 0x1d6bff: VD3
1549+ 0x1d6c00 - 0x1d6cff: reserved
1550+ 0x1d6d00 - 0x1d6dff: VD3
1551+ 0x1d6e00 - 0x1d7fff: reserved */
1552+ GEN_FW_RANGE(0x1d8000, 0x1dffff, FORCEWAKE_MEDIA_VEBOX1), /*
1553+ 0x1d8000 - 0x1da0ff: VE1
1554+ 0x1da100 - 0x1dffff: reserved */
1555+ GEN_FW_RANGE(0x1e0000, 0x1e3fff, FORCEWAKE_MEDIA_VDBOX4), /*
1556+ 0x1e0000 - 0x1e2bff: VD4
1557+ 0x1e2c00 - 0x1e2cff: reserved
1558+ 0x1e2d00 - 0x1e2dff: VD4
1559+ 0x1e2e00 - 0x1e3eff: reserved
1560+ 0x1e3f00 - 0x1e3fff: VD4 */
1561+ GEN_FW_RANGE(0x1e4000, 0x1e7fff, FORCEWAKE_MEDIA_VDBOX5), /*
1562+ 0x1e4000 - 0x1e6bff: VD5
1563+ 0x1e6c00 - 0x1e6cff: reserved
1564+ 0x1e6d00 - 0x1e6dff: VD5
1565+ 0x1e6e00 - 0x1e7fff: reserved */
1566+ GEN_FW_RANGE(0x1e8000, 0x1effff, FORCEWAKE_MEDIA_VEBOX2), /*
1567+ 0x1e8000 - 0x1ea0ff: VE2
1568+ 0x1ea100 - 0x1effff: reserved */
1569+ GEN_FW_RANGE(0x1f0000, 0x1f3fff, FORCEWAKE_MEDIA_VDBOX6), /*
1570+ 0x1f0000 - 0x1f2bff: VD6
1571+ 0x1f2c00 - 0x1f2cff: reserved
1572+ 0x1f2d00 - 0x1f2dff: VD6
1573+ 0x1f2e00 - 0x1f3eff: reserved
1574+ 0x1f3f00 - 0x1f3fff: VD6 */
1575+ GEN_FW_RANGE(0x1f4000, 0x1f7fff, FORCEWAKE_MEDIA_VDBOX7), /*
1576+ 0x1f4000 - 0x1f6bff: VD7
1577+ 0x1f6c00 - 0x1f6cff: reserved
1578+ 0x1f6d00 - 0x1f6dff: VD7
1579+ 0x1f6e00 - 0x1f7fff: reserved */
1580+ GEN_FW_RANGE(0x1f8000, 0x1fa0ff, FORCEWAKE_MEDIA_VEBOX3),
17351581 };
17361582
17371583 static const struct intel_forcewake_range __mtl_fw_ranges[] = {
@@ -2576,18 +2422,10 @@ static int uncore_forcewake_init(struct intel_uncore *uncore) · 838 unmodified lines
25762422 ASSIGN_FW_DOMAINS_TABLE(uncore, __mtl_fw_ranges);
25772423 ASSIGN_SHADOW_TABLE(uncore, mtl_shadowed_regs);
25782424 ASSIGN_WRITE_MMIO_VFUNCS(uncore, fwtable);
2579− } else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 60)) {
2580− ASSIGN_FW_DOMAINS_TABLE(uncore, __pvc_fw_ranges);
2581− ASSIGN_SHADOW_TABLE(uncore, pvc_shadowed_regs);
2582− ASSIGN_WRITE_MMIO_VFUNCS(uncore, fwtable);
25832425 } else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55)) {
25842426 ASSIGN_FW_DOMAINS_TABLE(uncore, __dg2_fw_ranges);
25852427 ASSIGN_SHADOW_TABLE(uncore, dg2_shadowed_regs);
25862428 ASSIGN_WRITE_MMIO_VFUNCS(uncore, fwtable);
2587− } else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50)) {
2588− ASSIGN_FW_DOMAINS_TABLE(uncore, __xehp_fw_ranges);
2589− ASSIGN_SHADOW_TABLE(uncore, gen12_shadowed_regs);
2590− ASSIGN_WRITE_MMIO_VFUNCS(uncore, fwtable);
25912429 } else if (GRAPHICS_VER(i915) >= 12) {
25922430 ASSIGN_FW_DOMAINS_TABLE(uncore, __gen12_fw_ranges);
25932431 ASSIGN_SHADOW_TABLE(uncore, gen12_shadowed_regs);
@@ -2734,7 +2572,7 @@ void intel_uncore_prune_engine_fw_domains(struct intel_uncore *uncore, · 140 unmodified lines
27342572 * the forcewake domain if any of the other engines
27352573 * in the same media slice are present.
27362574 */
2737− if (GRAPHICS_VER_FULL(uncore->i915) >= IP_VER(12, 50) && i % 2 == 0) {
2575+ if (GRAPHICS_VER_FULL(uncore->i915) >= IP_VER(12, 55) && i % 2 == 0) {
27382576 if ((i + 1 < I915_MAX_VCS) && HAS_ENGINE(gt, _VCS(i + 1)))
27392577 continue;
27402578
drivers/gpu/drm/i915/selftests/intel_uncore.c+0−3
@@ -71,7 +71,6 @@ static int intel_shadow_table_check(void) · 70 unmodified lines
7171 { gen11_shadowed_regs, ARRAY_SIZE(gen11_shadowed_regs) },
7272 { gen12_shadowed_regs, ARRAY_SIZE(gen12_shadowed_regs) },
7373 { dg2_shadowed_regs, ARRAY_SIZE(dg2_shadowed_regs) },
74− { pvc_shadowed_regs, ARRAY_SIZE(pvc_shadowed_regs) },
7574 { mtl_shadowed_regs, ARRAY_SIZE(mtl_shadowed_regs) },
7675 { xelpmp_shadowed_regs, ARRAY_SIZE(xelpmp_shadowed_regs) },
7776 };
@@ -119,8 +118,6 @@ int intel_uncore_mock_selftests(void) · 41 unmodified lines
119118 { __gen9_fw_ranges, ARRAY_SIZE(__gen9_fw_ranges), true },
120119 { __gen11_fw_ranges, ARRAY_SIZE(__gen11_fw_ranges), true },
121120 { __gen12_fw_ranges, ARRAY_SIZE(__gen12_fw_ranges), true },
122− { __xehp_fw_ranges, ARRAY_SIZE(__xehp_fw_ranges), true },
123− { __pvc_fw_ranges, ARRAY_SIZE(__pvc_fw_ranges), true },
124121 { __mtl_fw_ranges, ARRAY_SIZE(__mtl_fw_ranges), true },
125122 { __xelpmp_fw_ranges, ARRAY_SIZE(__xelpmp_fw_ranges), true },
126123 };
drivers/gpu/drm/nouveau/nouveau_dp.c+1−1
@@ -181,7 +181,7 @@ nouveau_dp_probe_dpcd(struct nouveau_connector *nv_connector, · 180 unmodified lines
181181 if (nouveau_mst) {
182182 mstm = outp->dp.mstm;
183183 if (mstm)
184− mstm->can_mst = drm_dp_read_mst_cap(aux, dpcd);
184+ mstm->can_mst = drm_dp_read_mst_cap(aux, dpcd) == DRM_DP_MST;
185185 }
186186
187187 if (nouveau_dp_has_sink_count(connector, outp)) {
drivers/gpu/drm/xe/Makefile+1−3
@@ -172,9 +172,6 @@ subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ · 171 unmodified lines
172172 -Ddrm_i915_gem_object=xe_bo \
173173 -Ddrm_i915_private=xe_device
174174
175−CFLAGS_i915-display/intel_fbdev.o = -Wno-override-init
176−CFLAGS_i915-display/intel_display_device.o = -Wno-override-init
177−
178175 # Rule to build SOC code shared with i915
179176 $(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
180177 $(call cmd,force_checksrc)
@@ -278,6 +275,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \ · 97 unmodified lines
278275 i915-display/intel_vdsc.o \
279276 i915-display/intel_vga.o \
280277 i915-display/intel_vrr.o \
278+ i915-display/intel_dmc_wl.o \
281279 i915-display/intel_wm.o \
282280 i915-display/skl_scaler.o \
283281 i915-display/skl_universal_plane.o \
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h+0−40
@@ -19,14 +19,12 @@ · 18 unmodified lines
1919 #include "xe_bo.h"
2020 #include "xe_pm.h"
2121 #include "xe_step.h"
22−#include "i915_gem.h"
2322 #include "i915_gem_stolen.h"
2423 #include "i915_gpu_error.h"
2524 #include "i915_reg_defs.h"
2625 #include "i915_utils.h"
2726 #include "intel_gt_types.h"
2827 #include "intel_step.h"
29−#include "intel_uc_fw.h"
3028 #include "intel_uncore.h"
3129 #include "intel_runtime_pm.h"
3230 #include <linux/pm_runtime.h>
@@ -41,12 +39,8 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) · 8 unmodified lines
4139 return dev_get_drvdata(kdev);
4240 }
4341
44−
45−#define INTEL_JASPERLAKE 0
46−#define INTEL_ELKHARTLAKE 0
4742 #define IS_PLATFORM(xe, x) ((xe)->info.platform == x)
4843 #define INTEL_INFO(dev_priv) (&((dev_priv)->info))
49−#define INTEL_DEVID(dev_priv) ((dev_priv)->info.devid)
5044 #define IS_I830(dev_priv) (dev_priv && 0)
5145 #define IS_I845G(dev_priv) (dev_priv && 0)
5246 #define IS_I85X(dev_priv) (dev_priv && 0)
@@ -85,9 +79,7 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) · 32 unmodified lines
8579 #define IS_DG1(dev_priv) IS_PLATFORM(dev_priv, XE_DG1)
8680 #define IS_ALDERLAKE_S(dev_priv) IS_PLATFORM(dev_priv, XE_ALDERLAKE_S)
8781 #define IS_ALDERLAKE_P(dev_priv) IS_PLATFORM(dev_priv, XE_ALDERLAKE_P)
88−#define IS_XEHPSDV(dev_priv) (dev_priv && 0)
8982 #define IS_DG2(dev_priv) IS_PLATFORM(dev_priv, XE_DG2)
90−#define IS_PONTEVECCHIO(dev_priv) IS_PLATFORM(dev_priv, XE_PVC)
9183 #define IS_METEORLAKE(dev_priv) IS_PLATFORM(dev_priv, XE_METEORLAKE)
9284 #define IS_LUNARLAKE(dev_priv) IS_PLATFORM(dev_priv, XE_LUNARLAKE)
9385
@@ -97,19 +89,12 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) · 3 unmodified lines
9789
9890 #define IP_VER(ver, rel) ((ver) << 8 | (rel))
9991
100−#define INTEL_DISPLAY_ENABLED(xe) (HAS_DISPLAY((xe)) && !intel_opregion_headless_sku((xe)))
101−
102−#define IS_GRAPHICS_VER(xe, first, last) \
103− ((xe)->info.graphics_verx100 >= first * 100 && \
104− (xe)->info.graphics_verx100 <= (last*100 + 99))
10592 #define IS_MOBILE(xe) (xe && 0)
106−#define HAS_LLC(xe) (!IS_DGFX((xe)))
10793
10894 #define HAS_GMD_ID(xe) GRAPHICS_VERx100(xe) >= 1270
10995
11096 /* Workarounds not handled yet */
11197 #define IS_DISPLAY_STEP(xe, first, last) ({u8 __step = (xe)->info.step.display; first <= __step && __step <= last; })
112−#define IS_GRAPHICS_STEP(xe, first, last) ({u8 __step = (xe)->info.step.graphics; first <= __step && __step <= last; })
11398
11499 #define IS_LP(xe) (0)
115100 #define IS_GEN9_LP(xe) (0)
@@ -126,27 +111,6 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) · 10 unmodified lines
126111 #define IS_KABYLAKE_ULT(xe) (xe && 0)
127112 #define IS_SKYLAKE_ULT(xe) (xe && 0)
128113
129−#define IS_DG1_GRAPHICS_STEP(xe, first, last) (IS_DG1(xe) && IS_GRAPHICS_STEP(xe, first, last))
130−#define IS_DG2_GRAPHICS_STEP(xe, variant, first, last) \
131− ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_ ## variant && \
132− IS_GRAPHICS_STEP(xe, first, last))
133−#define IS_XEHPSDV_GRAPHICS_STEP(xe, first, last) (IS_XEHPSDV(xe) && IS_GRAPHICS_STEP(xe, first, last))
134−
135−/* XXX: No basedie stepping support yet */
136−#define IS_PVC_BD_STEP(xe, first, last) (!WARN_ON(1) && IS_PONTEVECCHIO(xe))
137−
138−#define IS_TIGERLAKE_DISPLAY_STEP(xe, first, last) (IS_TIGERLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
139−#define IS_ROCKETLAKE_DISPLAY_STEP(xe, first, last) (IS_ROCKETLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
140−#define IS_DG1_DISPLAY_STEP(xe, first, last) (IS_DG1(xe) && IS_DISPLAY_STEP(xe, first, last))
141−#define IS_DG2_DISPLAY_STEP(xe, first, last) (IS_DG2(xe) && IS_DISPLAY_STEP(xe, first, last))
142−#define IS_ADLP_DISPLAY_STEP(xe, first, last) (IS_ALDERLAKE_P(xe) && IS_DISPLAY_STEP(xe, first, last))
143−#define IS_ADLS_DISPLAY_STEP(xe, first, last) (IS_ALDERLAKE_S(xe) && IS_DISPLAY_STEP(xe, first, last))
144−#define IS_JSL_EHL_DISPLAY_STEP(xe, first, last) (IS_JSL_EHL(xe) && IS_DISPLAY_STEP(xe, first, last))
145−#define IS_MTL_DISPLAY_STEP(xe, first, last) (IS_METEORLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
146−
147−/* FIXME: Add subplatform here */
148−#define IS_MTL_GRAPHICS_STEP(xe, sub, first, last) (IS_METEORLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
149−
150114 #define IS_DG2_G10(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_G10)
151115 #define IS_DG2_G11(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_G11)
152116 #define IS_DG2_G12(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_G12)
@@ -154,12 +118,9 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) · 1 unmodified line
154118 #define IS_ICL_WITH_PORT_F(xe) (xe && 0)
155119 #define HAS_FLAT_CCS(xe) (xe_device_has_flat_ccs(xe))
156120 #define to_intel_bo(x) gem_to_xe_bo((x))
157−#define mkwrite_device_info(xe) (INTEL_INFO(xe))
158121
159122 #define HAS_128_BYTE_Y_TILING(xe) (xe || 1)
160123
161−#define intel_has_gpu_reset(a) (a && 0)
162−
163124 #include "intel_wakeref.h"
164125
165126 static inline intel_wakeref_t intel_runtime_pm_get(struct xe_runtime_pm *pm)
@@ -217,7 +178,6 @@ struct i915_sched_attr { · 51 unmodified lines
217178 #define RUNTIME_INFO(xe) (&(xe)->info.i915_runtime)
218179
219180 #define FORCEWAKE_ALL XE_FORCEWAKE_ALL
220−#define HPD_STORM_DEFAULT_THRESHOLD 50
221181
222182 #ifdef CONFIG_ARM64
223183 /*
drivers/gpu/drm/xe/compat-i915-headers/i915_fixed.h+0−6
@@ -1,6 +0,0 @@
1−/* SPDX-License-Identifier: MIT */
2−/*
3− * Copyright © 2023 Intel Corporation
4− */
5−
6−#include "../../i915/i915_fixed.h"
drivers/gpu/drm/xe/compat-i915-headers/i915_gem.h+0−9
@@ -1,9 +0,0 @@
1−/* SPDX-License-Identifier: MIT */
2−/*
3− * Copyright © 2023 Intel Corporation
4− */
5−
6−#ifndef __I915_GEM_H__
7−#define __I915_GEM_H__
8−#define GEM_BUG_ON
9−#endif
drivers/gpu/drm/xe/compat-i915-headers/i915_vgpu.h+0−26
@@ -9,36 +9,10 @@ · 8 unmodified lines
99 #include <linux/types.h>
1010
1111 struct drm_i915_private;
12−struct i915_ggtt;
1312
14−static inline void intel_vgpu_detect(struct drm_i915_private *i915)
15−{
16−}
1713 static inline bool intel_vgpu_active(struct drm_i915_private *i915)
1814 {
1915 return false;
2016 }
21−static inline void intel_vgpu_register(struct drm_i915_private *i915)
22−{
23−}
24−static inline bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *i915)
25−{
26− return false;
27−}
28−static inline bool intel_vgpu_has_hwsp_emulation(struct drm_i915_private *i915)
29−{
30− return false;
31−}
32−static inline bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915)
33−{
34− return false;
35−}
36−static inline int intel_vgt_balloon(struct i915_ggtt *ggtt)
37−{
38− return 0;
39−}
40−static inline void intel_vgt_deballoon(struct i915_ggtt *ggtt)
41−{
42−}
4317
4418 #endif /* _I915_VGPU_H_ */
drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h+0−11
@@ -1,11 +0,0 @@
1−/* SPDX-License-Identifier: MIT */
2−/*
3− * Copyright © 2023 Intel Corporation
4− */
5−
6−#ifndef _INTEL_UC_FW_H_
7−#define _INTEL_UC_FW_H_
8−
9−#define INTEL_UC_FIRMWARE_URL "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
10−
11−#endif
drivers/gpu/drm/xe/xe_device_types.h+2−14
@@ -497,20 +497,9 @@ struct xe_device { · 496 unmodified lines
497497 /* For pcode */
498498 struct mutex sb_lock;
499499
500− /* Should be in struct intel_display */
501− u32 skl_preferred_vco_freq, max_dotclk_freq, hti_state;
502− u8 snps_phy_failed_calibration;
503− struct drm_atomic_state *modeset_restore_state;
504− struct list_head global_obj_list;
505−
506− union {
507− /* only to allow build, not used functionally */
508− u32 irq_mask;
509− u32 de_irq_mask[I915_MAX_PIPES];
510− };
511− u32 pipestat_irq_mask[I915_MAX_PIPES];
500+ /* only to allow build, not used functionally */
501+ u32 irq_mask;
512502
513− bool display_irqs_enabled;
514503 u32 enabled_irq_mask;
515504
516505 struct intel_uncore {
@@ -522,7 +511,6 @@ struct xe_device { · 5 unmodified lines
522511 unsigned int hpll_freq;
523512 unsigned int czclk_freq;
524513 unsigned int fsb_freq, mem_freq, is_ddr3;
525− u8 vblank_enabled;
526514 };
527515 struct {
528516 const char *dmc_firmware_path;
drivers/gpu/drm/xe/xe_pci.c+1−0
@@ -333,6 +333,7 @@ static const struct xe_device_desc mtl_desc = { · 332 unmodified lines
333333
334334 static const struct xe_device_desc lnl_desc = {
335335 PLATFORM(XE_LUNARLAKE),
336+ .has_display = true,
336337 .require_force_probe = true,
337338 };
338339
include/drm/display/drm_dp.h+11−0
@@ -1150,6 +1150,8 @@ · 1149 unmodified lines
11501150
11511151 #define DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1 0x2214 /* 2.0 E11 */
11521152 # define DP_ADAPTIVE_SYNC_SDP_SUPPORTED (1 << 0)
1153+# define DP_ADAPTIVE_SYNC_SDP_OPERATION_MODE GENMASK(1, 0)
1154+# define DP_ADAPTIVE_SYNC_SDP_LENGTH GENMASK(5, 0)
11531155 # define DP_AS_SDP_FIRST_HALF_LINE_OR_3840_PIXEL_CYCLE_WINDOW_NOT_SUPPORTED (1 << 1)
11541156 # define DP_VSC_EXT_SDP_FRAMEWORK_VERSION_1_SUPPORTED (1 << 4)
11551157
@@ -1639,10 +1641,12 @@ enum drm_dp_phy { · 483 unmodified lines
16391641 #define DP_SDP_AUDIO_COPYMANAGEMENT 0x05 /* DP 1.2 */
16401642 #define DP_SDP_ISRC 0x06 /* DP 1.2 */
16411643 #define DP_SDP_VSC 0x07 /* DP 1.2 */
1644+#define DP_SDP_ADAPTIVE_SYNC 0x22 /* DP 1.4 */
16421645 #define DP_SDP_CAMERA_GENERIC(i) (0x08 + (i)) /* 0-7, DP 1.3 */
16431646 #define DP_SDP_PPS 0x10 /* DP 1.4 */
16441647 #define DP_SDP_VSC_EXT_VESA 0x20 /* DP 1.4 */
16451648 #define DP_SDP_VSC_EXT_CEA 0x21 /* DP 1.4 */
1649+
16461650 /* 0x80+ CEA-861 infoframe types */
16471651
16481652 #define DP_SDP_AUDIO_INFOFRAME_HB2 0x1b
@@ -1798,4 +1802,11 @@ enum dp_content_type { · 149 unmodified lines
17981802 DP_CONTENT_TYPE_GAME = 0x04,
17991803 };
18001804
1805+enum operation_mode {
1806+ DP_AS_SDP_AVT_DYNAMIC_VTOTAL = 0x00,
1807+ DP_AS_SDP_AVT_FIXED_VTOTAL = 0x01,
1808+ DP_AS_SDP_FAVT_TRR_NOT_REACHED = 0x02,
1809+ DP_AS_SDP_FAVT_TRR_REACHED = 0x03
1810+};
1811+
18011812 #endif /* _DRM_DP_H_ */
include/drm/display/drm_dp_helper.h+30−0
@@ -98,9 +98,39 @@ struct drm_dp_vsc_sdp { · 97 unmodified lines
9898 enum dp_content_type content_type;
9999 };
100100
101+/**
102+ * struct drm_dp_as_sdp - drm DP Adaptive Sync SDP
103+ *
104+ * This structure represents a DP AS SDP of drm
105+ * It is based on DP 2.1 spec [Table 2-126: Adaptive-Sync SDP Header Bytes] and
106+ * [Table 2-127: Adaptive-Sync SDP Payload for DB0 through DB8]
107+ *
108+ * @sdp_type: Secondary-data packet type
109+ * @revision: Revision Number
110+ * @length: Number of valid data bytes
111+ * @vtotal: Minimum Vertical Vtotal
112+ * @target_rr: Target Refresh
113+ * @duration_incr_ms: Successive frame duration increase
114+ * @duration_decr_ms: Successive frame duration decrease
115+ * @operation_mode: Adaptive Sync Operation Mode
116+ */
117+struct drm_dp_as_sdp {
118+ unsigned char sdp_type;
119+ unsigned char revision;
120+ unsigned char length;
121+ int vtotal;
122+ int target_rr;
123+ int duration_incr_ms;
124+ int duration_decr_ms;
125+ enum operation_mode mode;
126+};
127+
128+void drm_dp_as_sdp_log(struct drm_printer *p,
129+ const struct drm_dp_as_sdp *as_sdp);
101130 void drm_dp_vsc_sdp_log(struct drm_printer *p, const struct drm_dp_vsc_sdp *vsc);
102131
103132 bool drm_dp_vsc_sdp_supported(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
133+bool drm_dp_as_sdp_supported(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
104134
105135 int drm_dp_psr_setup_time(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]);
106136
include/drm/display/drm_dp_mst_helper.h+22−1
@@ -817,7 +817,28 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, · 816 unmodified lines
817817
818818 void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr);
819819
820−bool drm_dp_read_mst_cap(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
820+/**
821+ * enum drm_dp_mst_mode - sink's MST mode capability
822+ */
823+enum drm_dp_mst_mode {
824+ /**
825+ * @DRM_DP_SST: The sink does not support MST nor single stream sideband
826+ * messaging.
827+ */
828+ DRM_DP_SST,
829+ /**
830+ * @DRM_DP_MST: Sink supports MST, more than one stream and single
831+ * stream sideband messaging.
832+ */
833+ DRM_DP_MST,
834+ /**
835+ * @DRM_DP_SST_SIDEBAND_MSG: Sink supports only one stream and single
836+ * stream sideband messaging.
837+ */
838+ DRM_DP_SST_SIDEBAND_MSG,
839+};
840+
841+enum drm_dp_mst_mode drm_dp_read_mst_cap(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
821842 int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool mst_state);
822843
823844 int drm_dp_mst_hpd_irq_handle_event(struct drm_dp_mst_topology_mgr *mgr,
include/drm/i915_pciids.h+3−1
@@ -711,7 +711,9 @@ · 710 unmodified lines
711711 INTEL_VGA_DEVICE(0x5692, info), \
712712 INTEL_VGA_DEVICE(0x56A0, info), \
713713 INTEL_VGA_DEVICE(0x56A1, info), \
714− INTEL_VGA_DEVICE(0x56A2, info)
714+ INTEL_VGA_DEVICE(0x56A2, info), \
715+ INTEL_VGA_DEVICE(0x56BE, info), \
716+ INTEL_VGA_DEVICE(0x56BF, info)
715717
716718 #define INTEL_DG2_G11_IDS(info) \
717719 INTEL_VGA_DEVICE(0x5693, info), \
include/uapi/drm/i915_drm.h+13−3
@@ -2623,19 +2623,29 @@ struct drm_i915_reg_read { · 2622 unmodified lines
26232623 *
26242624 */
26252625
2626+/*
2627+ * struct drm_i915_reset_stats - Return global reset and other context stats
2628+ *
2629+ * Driver keeps few stats for each contexts and also global reset count.
2630+ * This struct can be used to query those stats.
2631+ */
26262632 struct drm_i915_reset_stats {
2633+ /** @ctx_id: ID of the requested context */
26272634 __u32 ctx_id;
2635+
2636+ /** @flags: MBZ */
26282637 __u32 flags;
26292638
2630− /* All resets since boot/module reload, for all contexts */
2639+ /** @reset_count: All resets since boot/module reload, for all contexts */
26312640 __u32 reset_count;
26322641
2633− /* Number of batches lost when active in GPU, for this context */
2642+ /** @batch_active: Number of batches lost when active in GPU, for this context */
26342643 __u32 batch_active;
26352644
2636− /* Number of batches lost pending for execution, for this context */
2645+ /** @batch_pending: Number of batches lost pending for execution, for this context */
26372646 __u32 batch_pending;
26382647
2648+ /** @pad: MBZ */
26392649 __u32 pad;
26402650 };
26412651

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t