<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
to fix the FIXME in i<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;" class="ContentPasted2">ntel_cx0_phy_set_signal_levels() </span>we need the following patch snipet to be incorporated into this patch.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
@@ -331,18 +331,14 @@ void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder,
<div class="ContentPasted0"> }</div>
<div class="ContentPasted0"> }</div>
<div class="ContentPasted0"> </div>
<div class="ContentPasted0">- intel_cx0_write(i915, encoder->port, master_lane, PHY_C10_VDR_CONTROL(1),</div>
<div class="ContentPasted0">- C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG,</div>
<div class="ContentPasted0">+ intel_cx0_write(i915, encoder->port, !master_lane, PHY_C10_VDR_CONTROL(1),</div>
<div class="ContentPasted0">+ C10_VDR_CTRL_MSGBUS_ACCESS | C10_VDR_CTRL_UPDATE_CFG,</div>
<div class="ContentPasted0"> MB_WRITE_COMMITTED);</div>
<div class="ContentPasted0">-#if 0</div>
<div class="ContentPasted0">- /*</div>
<div class="ContentPasted0">- * FIXME: Revisit this code to see why we can't update</div>
<div class="ContentPasted0">- * config on Lane 1</div>
<div class="ContentPasted0">- */</div>
<div class="ContentPasted0">- intel_cx0_rmw(i915, encoder->port, !master_lane, PHY_C10_VDR_CONTROL(1),</div>
<div class="ContentPasted0">- C10_VDR_CTRL_MSGBUS_ACCESS | C10_VDR_CTRL_UPDATE_CFG, C10_VDR_CTRL_UPDATE_CFG,</div>
<div class="ContentPasted0">+</div>
<div class="ContentPasted0">+ intel_cx0_write(i915, encoder->port, master_lane, PHY_C10_VDR_CONTROL(1),</div>
<div class="ContentPasted0">+ C10_VDR_CTRL_MSGBUS_ACCESS | C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG,</div>
<div class="ContentPasted0"> MB_WRITE_COMMITTED);</div>
<div class="ContentPasted0">-#endif</div>
<div class="ContentPasted0">+</div>
<div class="ContentPasted0"> intel_cx0_phy_transaction_end(encoder, wakeref);</div>
}<br>
</div>
<div id="signature_bookmark"></div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;" class="ContentPasted1">Sorry for the top post - webmail </span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;" class="ContentPasted1">-Clint</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;" class="ContentPasted1"><br>
</span></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size: 11pt;"><b>From:</b> Kahola, Mika <mika.kahola@intel.com><br>
<b>Sent:</b> Friday, October 14, 2022 5:47 AM<br>
<b>To:</b> intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Kahola, Mika <mika.kahola@intel.com>; Sripada, Radhakrishna <radhakrishna.sripada@intel.com>; Deak, Imre <imre.deak@intel.com>; Shankar, Uma <uma.shankar@intel.com>; Taylor, Clinton A <clinton.a.taylor@intel.com><br>
<b>Subject:</b> [PATCH 06/20] drm/i915/mtl: Add vswing programming for C10 phys</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">From: Radhakrishna Sripada <radhakrishna.sripada@intel.com><br>
<br>
C10 phys uses direct mapping internally for voltage and pre-emphasis levels.<br>
Program the levels directly to the fields in the VDR Registers.<br>
<br>
Bspec: 65449<br>
<br>
Cc: Imre Deak <imre.deak@intel.com><br>
Cc: Uma Shankar <uma.shankar@intel.com><br>
Signed-off-by: Clint Taylor <Clinton.A.Taylor@intel.com><br>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com><br>
Signed-off-by: Mika Kahola <mika.kahola@intel.com><br>
---<br>
drivers/gpu/drm/i915/display/intel_cx0_phy.c | 143 ++++++++++++++++--<br>
drivers/gpu/drm/i915/display/intel_cx0_phy.h | 2 +<br>
.../gpu/drm/i915/display/intel_cx0_reg_defs.h | 6 +<br>
drivers/gpu/drm/i915/display/intel_ddi.c | 4 +-<br>
.../drm/i915/display/intel_ddi_buf_trans.c | 36 ++++-<br>
.../drm/i915/display/intel_ddi_buf_trans.h | 6 +<br>
.../i915/display/intel_display_power_map.c | 1 +<br>
7 files changed, 185 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c<br>
index dc033174c9c0..ef874986940d 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c<br>
@@ -6,10 +6,14 @@<br>
#include "i915_reg_defs.h"<br>
#include "intel_cx0_phy.h"<br>
#include "intel_cx0_reg_defs.h"<br>
+#include "intel_ddi.h"<br>
+#include "intel_ddi_buf_trans.h"<br>
#include "intel_de.h"<br>
#include "intel_display_types.h"<br>
#include "intel_dp.h"<br>
#include "intel_panel.h"<br>
+#include "intel_psr.h"<br>
+#include "intel_uncore.h"<br>
<br>
bool intel_is_c10phy(struct drm_i915_private *dev_priv, enum phy phy)<br>
{<br>
@@ -19,6 +23,15 @@ bool intel_is_c10phy(struct drm_i915_private *dev_priv, enum phy phy)<br>
return false;<br>
}<br>
<br>
+static void<br>
+assert_dc_off(struct drm_i915_private *i915)<br>
+{<br>
+ bool enabled;<br>
+<br>
+ enabled = intel_display_power_is_enabled(i915, POWER_DOMAIN_DC_OFF);<br>
+ drm_WARN_ON(&i915->drm, !enabled);<br>
+}<br>
+<br>
static void intel_cx0_bus_reset(struct drm_i915_private *i915, enum port port, int lane)<br>
{<br>
enum phy phy = intel_port_to_phy(i915, port);<br>
@@ -108,6 +121,8 @@ static u8 intel_cx0_read(struct drm_i915_private *i915, enum port port,<br>
int i, status;<br>
u32 val;<br>
<br>
+ assert_dc_off(i915);<br>
+<br>
for (i = 0; i < 3; i++) {<br>
status = __intel_cx0_read(i915, port, lane, addr, &val);<br>
<br>
@@ -191,6 +206,8 @@ static void __intel_cx0_write(struct drm_i915_private *i915, enum port port,<br>
enum phy phy = intel_port_to_phy(i915, port);<br>
int i, status;<br>
<br>
+ assert_dc_off(i915);<br>
+<br>
for (i = 0; i < 3; i++) {<br>
status = __intel_cx0_write_once(i915, port, lane, addr, data, committed);<br>
<br>
@@ -240,6 +257,84 @@ static void intel_cx0_rmw(struct drm_i915_private *i915, enum port port,<br>
}<br>
}<br>
<br>
+/*<br>
+ * Prepare HW for CX0 phy transactions.<br>
+ *<br>
+ * It is required that PSR and DC5/6 are disabled before any CX0 message<br>
+ * bus transaction is executed.<br>
+ */<br>
+static intel_wakeref_t intel_cx0_phy_transaction_begin(struct intel_encoder *encoder)<br>
+{<br>
+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);<br>
+<br>
+ intel_psr_pause(intel_dp);<br>
+ return intel_display_power_get(i915, POWER_DOMAIN_DC_OFF);<br>
+}<br>
+<br>
+static void intel_cx0_phy_transaction_end(struct intel_encoder *encoder, intel_wakeref_t wakeref)<br>
+{<br>
+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);<br>
+<br>
+ intel_psr_resume(intel_dp);<br>
+ intel_display_power_put(i915, POWER_DOMAIN_DC_OFF, wakeref);<br>
+}<br>
+<br>
+void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder,<br>
+ const struct intel_crtc_state *crtc_state)<br>
+{<br>
+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
+ struct intel_digital_port *dig_port = enc_to_dig_port(encoder);<br>
+ bool lane_reversal = dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;<br>
+ u8 master_lane = lane_reversal ? INTEL_CX0_LANE1 :<br>
+ INTEL_CX0_LANE0;<br>
+ const struct intel_ddi_buf_trans *trans;<br>
+ intel_wakeref_t wakeref;<br>
+ int n_entries, ln;<br>
+<br>
+ wakeref = intel_cx0_phy_transaction_begin(encoder);<br>
+<br>
+ trans = encoder->get_buf_trans(encoder, crtc_state, &n_entries);<br>
+ if (drm_WARN_ON_ONCE(&i915->drm, !trans))<br>
+ return;<br>
+<br>
+ intel_cx0_rmw(i915, encoder->port, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),<br>
+ 0, C10_VDR_CTRL_MSGBUS_ACCESS, MB_WRITE_COMMITTED);<br>
+<br>
+ for (ln = 0; ln < 4; ln++) {<br>
+ int level = intel_ddi_level(encoder, crtc_state, ln);<br>
+ int lane, tx;<br>
+<br>
+ lane = ln / 2;<br>
+ tx = ln % 2 + 1;<br>
+<br>
+ intel_cx0_rmw(i915, encoder->port, lane, PHY_CX0_TX_CONTROL(tx, 2),<br>
+ C10_PHY_VSWING_PREEMPH_MASK,<br>
+ C10_PHY_VSWING_PREEMPH(trans->entries[level].direct.preemph),<br>
+ MB_WRITE_COMMITTED);<br>
+ intel_cx0_rmw(i915, encoder->port, lane, PHY_CX0_TX_CONTROL(tx, 8),<br>
+ C10_PHY_VSWING_LEVEL_MASK,<br>
+ C10_PHY_VSWING_LEVEL(trans->entries[level].direct.level),<br>
+ MB_WRITE_COMMITTED);<br>
+ }<br>
+<br>
+ intel_cx0_write(i915, encoder->port, master_lane, PHY_C10_VDR_CONTROL(1),<br>
+ C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG,<br>
+ MB_WRITE_COMMITTED);<br>
+#if 0<br>
+ /*<br>
+ * FIXME: Revisit this code to see why we can't update<br>
+ * config on Lane 1<br>
+ */<br>
+ intel_cx0_rmw(i915, encoder->port, !master_lane, PHY_C10_VDR_CONTROL(1),<br>
+ C10_VDR_CTRL_MSGBUS_ACCESS | C10_VDR_CTRL_UPDATE_CFG, C10_VDR_CTRL_UPDATE_CFG,<br>
+ MB_WRITE_COMMITTED);<br>
+#endif<br>
+<br>
+ intel_cx0_phy_transaction_end(encoder, wakeref);<br>
+}<br>
+<br>
/*<br>
* Basic DP link rates with 38.4 MHz reference clock.<br>
* Note: The tables below are with SSC. In non-ssc<br>
@@ -698,9 +793,12 @@ void intel_c10mpllb_readout_hw_state(struct intel_encoder *encoder,<br>
u8 lane = lane_reversal ? INTEL_CX0_LANE1 :<br>
INTEL_CX0_LANE0;<br>
enum phy phy = intel_port_to_phy(i915, encoder->port);<br>
+ intel_wakeref_t wakeref;<br>
int i;<br>
u8 cmn, tx0;<br>
<br>
+ wakeref = intel_cx0_phy_transaction_begin(encoder);<br>
+<br>
/*<br>
* According to C10 VDR Register programming Sequence we need<br>
* to do this to read PHY internal registers from MsgBus.<br>
@@ -719,6 +817,8 @@ void intel_c10mpllb_readout_hw_state(struct intel_encoder *encoder,<br>
C10_CMN0_DP_VAL : C10_CMN0_HDMI_VAL))<br>
drm_warn(&i915->drm, "Unexpected tx: %x or cmn: %x for phy: %c.\n",<br>
tx0, cmn, phy_name(phy));<br>
+<br>
+ intel_cx0_phy_transaction_end(encoder, wakeref);<br>
}<br>
<br>
static void intel_c10_pll_program(struct drm_i915_private *i915,<br>
@@ -849,17 +949,20 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,<br>
<br>
if (intel_crtc_has_dp_encoder(crtc_state)) {<br>
intel_dp = enc_to_intel_dp(encoder);<br>
- ssc_enabled = intel_dp->dpcd[DP_MAX_DOWNSPREAD] &<br>
- DP_MAX_DOWNSPREAD_0_5;<br>
+ ssc_enabled = (intel_dp->dpcd[DP_MAX_DOWNSPREAD] &<br>
+ DP_MAX_DOWNSPREAD_0_5);<br>
+<br>
+ if (intel_dp_is_edp(intel_dp) && !intel_panel_use_ssc(i915))<br>
+ ssc_enabled = false;<br>
<br>
/* TODO: DP2.0 10G and 20G rates enable MPLLA*/<br>
val |= ssc_enabled ? XELPDP_SSC_ENABLE_PLLB : 0;<br>
}<br>
+<br>
intel_de_rmw(i915, XELPDP_PORT_CLOCK_CTL(encoder->port),<br>
- XELPDP_LANE1_PHY_CLOCK_SELECT |<br>
- XELPDP_FORWARD_CLOCK_UNGATE |<br>
+ XELPDP_LANE1_PHY_CLOCK_SELECT | XELPDP_FORWARD_CLOCK_UNGATE |<br>
XELPDP_DDI_CLOCK_SELECT_MASK |<br>
- XELPDP_SSC_ENABLE_PLLB, val);<br>
+ XELPDP_SSC_ENABLE_PLLA | XELPDP_SSC_ENABLE_PLLB, val);<br>
}<br>
<br>
static u32 intel_cx0_get_powerdown_update(u8 lane)<br>
@@ -986,9 +1089,12 @@ static void intel_c10_program_phy_lane(struct drm_i915_private *i915,<br>
{<br>
u8 l0t1, l0t2, l1t1, l1t2;<br>
<br>
- intel_cx0_rmw(i915, port, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),<br>
- C10_VDR_CTRL_MSGBUS_ACCESS, C10_VDR_CTRL_MSGBUS_ACCESS,<br>
- MB_WRITE_COMMITTED);<br>
+ intel_cx0_rmw(i915, port, 1, PHY_C10_VDR_CONTROL(1),<br>
+ C10_VDR_CTRL_MSGBUS_ACCESS | C10_VDR_CTRL_UPDATE_CFG,<br>
+ C10_VDR_CTRL_MSGBUS_ACCESS, MB_WRITE_COMMITTED);<br>
+ intel_cx0_rmw(i915, port, 0, PHY_C10_VDR_CONTROL(1),<br>
+ C10_VDR_CTRL_MSGBUS_ACCESS | C10_VDR_CTRL_UPDATE_CFG,<br>
+ C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_MSGBUS_ACCESS, MB_WRITE_COMMITTED);<br>
<br>
l0t1 = intel_cx0_read(i915, port, 0, PHY_CX0_TX_CONTROL(1, 2));<br>
l0t2 = intel_cx0_read(i915, port, 0, PHY_CX0_TX_CONTROL(2, 2));<br>
@@ -1039,8 +1145,12 @@ static void intel_c10_program_phy_lane(struct drm_i915_private *i915,<br>
}<br>
}<br>
<br>
- intel_cx0_rmw(i915, port, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),<br>
- C10_VDR_CTRL_UPDATE_CFG, C10_VDR_CTRL_UPDATE_CFG, MB_WRITE_COMMITTED);<br>
+ intel_cx0_rmw(i915, port, 1, PHY_C10_VDR_CONTROL(1),<br>
+ C10_VDR_CTRL_UPDATE_CFG | C10_VDR_CTRL_MSGBUS_ACCESS,<br>
+ C10_VDR_CTRL_UPDATE_CFG, MB_WRITE_COMMITTED);<br>
+ intel_cx0_rmw(i915, port, 0, PHY_C10_VDR_CONTROL(1),<br>
+ C10_VDR_CTRL_UPDATE_CFG | C10_VDR_CTRL_MSGBUS_ACCESS,<br>
+ C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG, MB_WRITE_COMMITTED);<br>
}<br>
<br>
static u32 intel_cx0_get_pclk_pll_request(u8 lane)<br>
@@ -1138,9 +1248,14 @@ void intel_cx0pll_enable(struct intel_encoder *encoder,<br>
{<br>
struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
enum phy phy = intel_port_to_phy(i915, encoder->port);<br>
+ intel_wakeref_t wakeref;<br>
+<br>
+ wakeref = intel_cx0_phy_transaction_begin(encoder);<br>
<br>
drm_WARN_ON(&i915->drm, !intel_is_c10phy(i915, phy));<br>
intel_c10pll_enable(encoder, crtc_state);<br>
+<br>
+ intel_cx0_phy_transaction_end(encoder, wakeref);<br>
}<br>
<br>
static void intel_c10pll_disable(struct intel_encoder *encoder)<br>
@@ -1185,7 +1300,8 @@ static void intel_c10pll_disable(struct intel_encoder *encoder)<br>
<br>
/* 7. Program PORT_CLOCK_CTL register to disable and gate clocks. */<br>
intel_de_rmw(i915, XELPDP_PORT_CLOCK_CTL(encoder->port),<br>
- XELPDP_DDI_CLOCK_SELECT_MASK |<br>
+ XELPDP_DDI_CLOCK_SELECT_MASK, 0);<br>
+ intel_de_rmw(i915, XELPDP_PORT_CLOCK_CTL(encoder->port),<br>
XELPDP_FORWARD_CLOCK_UNGATE, 0);<br>
}<br>
<br>
@@ -1193,9 +1309,14 @@ void intel_cx0pll_disable(struct intel_encoder *encoder)<br>
{<br>
struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
enum phy phy = intel_port_to_phy(i915, encoder->port);<br>
+ intel_wakeref_t wakeref;<br>
+<br>
+ wakeref = intel_cx0_phy_transaction_begin(encoder);<br>
<br>
drm_WARN_ON(&i915->drm, !intel_is_c10phy(i915, phy));<br>
intel_c10pll_disable(encoder);<br>
+<br>
+ intel_cx0_phy_transaction_end(encoder, wakeref);<br>
}<br>
<br>
void intel_c10mpllb_state_verify(struct intel_atomic_state *state,<br>
diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.h b/drivers/gpu/drm/i915/display/intel_cx0_phy.h<br>
index f8023f240727..952c7deeffaa 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.h<br>
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.h<br>
@@ -40,5 +40,7 @@ int intel_c10mpllb_calc_port_clock(struct intel_encoder *encoder,<br>
void intel_c10mpllb_state_verify(struct intel_atomic_state *state,<br>
struct intel_crtc_state *new_crtc_state);<br>
int intel_c10_phy_check_hdmi_link_rate(int clock);<br>
+void intel_cx0_phy_set_signal_levels(struct intel_encoder *encoder,<br>
+ const struct intel_crtc_state *crtc_state);<br>
<br>
#endif /* __INTEL_CX0_PHY_H__ */<br>
diff --git a/drivers/gpu/drm/i915/display/intel_cx0_reg_defs.h b/drivers/gpu/drm/i915/display/intel_cx0_reg_defs.h<br>
index b394f5c23acb..fad6308bbf77 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_cx0_reg_defs.h<br>
+++ b/drivers/gpu/drm/i915/display/intel_cx0_reg_defs.h<br>
@@ -164,4 +164,10 @@<br>
#define PHY_CX0_TX_CONTROL(tx, control) (0x400 + ((tx) - 1) * 0x200 + (control))<br>
#define CONTROL2_DISABLE_SINGLE_TX REG_BIT(6)<br>
<br>
+/* C10 Phy VSWING Masks */<br>
+#define C10_PHY_VSWING_LEVEL_MASK REG_GENMASK8(2, 0)<br>
+#define C10_PHY_VSWING_LEVEL(val) REG_FIELD_PREP8(C10_PHY_VSWING_LEVEL_MASK, val)<br>
+#define C10_PHY_VSWING_PREEMPH_MASK REG_GENMASK8(1, 0)<br>
+#define C10_PHY_VSWING_PREEMPH(val) REG_FIELD_PREP8(C10_PHY_VSWING_PREEMPH_MASK, val)<br>
+<br>
#endif /* __INTEL_CX0_REG_DEFS_H__ */<br>
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c<br>
index 639ec604babf..1380ed2221ad 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_ddi.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c<br>
@@ -4445,7 +4445,9 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)<br>
encoder->get_config = hsw_ddi_get_config;<br>
}<br>
<br>
- if (IS_DG2(dev_priv)) {<br>
+ if (DISPLAY_VER(dev_priv) >= 14) {<br>
+ encoder->set_signal_levels = intel_cx0_phy_set_signal_levels;<br>
+ } else if (IS_DG2(dev_priv)) {<br>
encoder->set_signal_levels = intel_snps_phy_set_signal_levels;<br>
} else if (DISPLAY_VER(dev_priv) >= 12) {<br>
if (intel_phy_is_combo(dev_priv, phy))<br>
diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c<br>
index 006a2e979000..49f8a0a6593b 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c<br>
@@ -1035,6 +1035,30 @@ static const struct intel_ddi_buf_trans dg2_snps_trans_uhbr = {<br>
.num_entries = ARRAY_SIZE(_dg2_snps_trans_uhbr),<br>
};<br>
<br>
+/*<br>
+ * Some platforms don't need a mapping table and only expect us to<br>
+ * to program the vswing + preemphasis levels directly since the<br>
+ * hardware will do its own mapping to tuning values internally.<br>
+ */<br>
+static const union intel_ddi_buf_trans_entry direct_map_trans[] = {<br>
+ { .direct = { .level = 0, .preemph = 0 } },<br>
+ { .direct = { .level = 0, .preemph = 1 } },<br>
+ { .direct = { .level = 0, .preemph = 2 } },<br>
+ { .direct = { .level = 0, .preemph = 3 } },<br>
+ { .direct = { .level = 1, .preemph = 0 } },<br>
+ { .direct = { .level = 1, .preemph = 0 } },<br>
+ { .direct = { .level = 1, .preemph = 2 } },<br>
+ { .direct = { .level = 2, .preemph = 0 } },<br>
+ { .direct = { .level = 2, .preemph = 1 } },<br>
+ { .direct = { .level = 3, .preemph = 0 } },<br>
+};<br>
+<br>
+static const struct intel_ddi_buf_trans mtl_cx0c10_trans = {<br>
+ .entries = direct_map_trans,<br>
+ .num_entries = ARRAY_SIZE(direct_map_trans),<br>
+ .hdmi_default_entry = ARRAY_SIZE(direct_map_trans) - 1,<br>
+};<br>
+<br>
bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table)<br>
{<br>
return table == &tgl_combo_phy_trans_edp_hbr2_hobl;<br>
@@ -1606,12 +1630,22 @@ dg2_get_snps_buf_trans(struct intel_encoder *encoder,<br>
return intel_get_buf_trans(&dg2_snps_trans, n_entries);<br>
}<br>
<br>
+static const struct intel_ddi_buf_trans *<br>
+mtl_get_cx0_buf_trans(struct intel_encoder *encoder,<br>
+ const struct intel_crtc_state *crtc_state,<br>
+ int *n_entries)<br>
+{<br>
+ return intel_get_buf_trans(&mtl_cx0c10_trans, n_entries);<br>
+}<br>
+<br>
void intel_ddi_buf_trans_init(struct intel_encoder *encoder)<br>
{<br>
struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
enum phy phy = intel_port_to_phy(i915, encoder->port);<br>
<br>
- if (IS_DG2(i915)) {<br>
+ if (DISPLAY_VER(i915) >= 14) {<br>
+ encoder->get_buf_trans = mtl_get_cx0_buf_trans;<br>
+ } else if (IS_DG2(i915)) {<br>
encoder->get_buf_trans = dg2_get_snps_buf_trans;<br>
} else if (IS_ALDERLAKE_P(i915)) {<br>
if (intel_phy_is_combo(i915, phy))<br>
diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h<br>
index 2133984a572b..e4a857b9829d 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h<br>
+++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h<br>
@@ -51,6 +51,11 @@ struct dg2_snps_phy_buf_trans {<br>
u8 post_cursor;<br>
};<br>
<br>
+struct direct_phy_buf_trans {<br>
+ u8 level;<br>
+ u8 preemph;<br>
+};<br>
+<br>
union intel_ddi_buf_trans_entry {<br>
struct hsw_ddi_buf_trans hsw;<br>
struct bxt_ddi_buf_trans bxt;<br>
@@ -58,6 +63,7 @@ union intel_ddi_buf_trans_entry {<br>
struct icl_mg_phy_ddi_buf_trans mg;<br>
struct tgl_dkl_phy_ddi_buf_trans dkl;<br>
struct dg2_snps_phy_buf_trans snps;<br>
+ struct direct_phy_buf_trans direct;<br>
};<br>
<br>
struct intel_ddi_buf_trans {<br>
diff --git a/drivers/gpu/drm/i915/display/intel_display_power_map.c b/drivers/gpu/drm/i915/display/intel_display_power_map.c<br>
index dc04afc6cc8f..45c3ab4e2f28 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_display_power_map.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_display_power_map.c<br>
@@ -1374,6 +1374,7 @@ I915_DECL_PW_DOMAINS(xelpdp_pwdoms_dc_off,<br>
XELPDP_PW_2_POWER_DOMAINS,<br>
POWER_DOMAIN_AUDIO_MMIO,<br>
POWER_DOMAIN_MODESET,<br>
+ POWER_DOMAIN_DC_OFF,<br>
POWER_DOMAIN_AUX_A,<br>
POWER_DOMAIN_AUX_B,<br>
POWER_DOMAIN_INIT);<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</body>
</html>