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

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/ltphy: Provide protection against unsupported modes

We need to make sure we return some port clock in case we have
unsupported LT PHY modes or if we were not able to read the LT PHY state
for whatever reason and the mode ends up being 0.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260105055937.136522-3-suraj.kandpal@intel.com

+6 -1
+6 -1
drivers/gpu/drm/i915/display/intel_lt_phy.c
··· 31 31 #define INTEL_LT_PHY_BOTH_LANES (INTEL_LT_PHY_LANE1 |\ 32 32 INTEL_LT_PHY_LANE0) 33 33 #define MODE_DP 3 34 + #define MODE_HDMI_20 4 34 35 #define Q32_TO_INT(x) ((x) >> 32) 35 36 #define Q32_TO_FRAC(x) ((x) & 0xFFFFFFFF) 36 37 #define DCO_MIN_FREQ_MHZ 11850 ··· 1752 1751 intel_lt_phy_calc_port_clock(struct intel_encoder *encoder, 1753 1752 const struct intel_crtc_state *crtc_state) 1754 1753 { 1754 + struct intel_display *display = to_intel_display(encoder); 1755 1755 int clk; 1756 1756 const struct intel_lt_phy_pll_state *lt_state = 1757 1757 &crtc_state->dpll_hw_state.ltpll; ··· 1770 1768 rate = REG_FIELD_GET8(LT_PHY_VDR_RATE_ENCODING_MASK, 1771 1769 lt_state->config[0]); 1772 1770 clk = intel_lt_phy_get_dp_clock(rate); 1773 - } else { 1771 + } else if (mode == MODE_HDMI_20) { 1774 1772 clk = intel_lt_phy_calc_hdmi_port_clock(crtc_state); 1773 + } else { 1774 + drm_WARN_ON(display->drm, "Unsupported LT PHY Mode!\n"); 1775 + clk = xe3plpd_lt_hdmi_252.clock; 1775 1776 } 1776 1777 1777 1778 return clk;