]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/lt_phy: Add xe3plpd Thunderbolt PLL hooks
authorMika Kahola <mika.kahola@intel.com>
Thu, 12 Mar 2026 08:06:54 +0000 (08:06 +0000)
committerMika Kahola <mika.kahola@intel.com>
Tue, 24 Mar 2026 07:46:01 +0000 (09:46 +0200)
Add the PLL hooks for the TBT PLL on xe3plpd. These are simple stubs
similar to the TBT PLL on earlier platforms, since this PLL is always
on from the display POV - so no PLL enable/disable programming is
required as opposed to the non-TBT PLLs - and the clocks for different
link rates are enabled/disabled at a different level, via the
intel_encoder::enable_clock()/disable_clock() interface.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260312080657.2648265-22-mika.kahola@intel.com
drivers/gpu/drm/i915/display/intel_dpll_mgr.c
drivers/gpu/drm/i915/display/intel_lt_phy.c
drivers/gpu/drm/i915/display/intel_lt_phy.h

index 28c560417409fe03987149c3a26b74508d9a9601..534cc691979fdacd532f9ba89532600fbe93bf35 100644 (file)
@@ -4618,6 +4618,13 @@ static void xe3plpd_pll_disable(struct intel_display *display,
        intel_xe3plpd_pll_disable(encoder);
 }
 
+static const struct intel_dpll_funcs xe3plpd_tbt_pll_funcs = {
+       .enable = mtl_tbt_pll_enable,
+       .disable = mtl_tbt_pll_disable,
+       .get_hw_state = intel_lt_phy_tbt_pll_readout_hw_state,
+       .get_freq = mtl_tbt_pll_get_freq,
+};
+
 static const struct intel_dpll_funcs xe3plpd_pll_funcs = {
        .enable = xe3plpd_pll_enable,
        .disable = xe3plpd_pll_disable,
@@ -4628,7 +4635,8 @@ static const struct intel_dpll_funcs xe3plpd_pll_funcs = {
 static const struct dpll_info xe3plpd_plls[] = {
        { .name = "DPLL 0", .funcs = &xe3plpd_pll_funcs, .id = DPLL_ID_ICL_DPLL0, },
        { .name = "DPLL 1", .funcs = &xe3plpd_pll_funcs, .id = DPLL_ID_ICL_DPLL1, },
-       /* TODO: Add TBT */
+       { .name = "TBT PLL", .funcs = &xe3plpd_tbt_pll_funcs, .id = DPLL_ID_ICL_TBTPLL,
+         .is_alt_port_dpll = true, .always_on = true },
        { .name = "TC PLL 1", .funcs = &xe3plpd_pll_funcs, .id = DPLL_ID_ICL_MGPLL1, },
        { .name = "TC PLL 2", .funcs = &xe3plpd_pll_funcs, .id = DPLL_ID_ICL_MGPLL2, },
        { .name = "TC PLL 3", .funcs = &xe3plpd_pll_funcs, .id = DPLL_ID_ICL_MGPLL3, },
@@ -4671,7 +4679,8 @@ static int xe3plpd_compute_tc_phy_dplls(struct intel_atomic_state *state,
        struct icl_port_dpll *port_dpll;
        int ret;
 
-       /* TODO: Add state calculation for TBT PLL */
+       port_dpll = &crtc_state->icl_port_dplls[ICL_PORT_DPLL_DEFAULT];
+       intel_lt_phy_tbt_pll_calc_state(&port_dpll->hw_state);
 
        port_dpll = &crtc_state->icl_port_dplls[ICL_PORT_DPLL_MG_PHY];
        ret = intel_lt_phy_pll_calc_state(crtc_state, encoder, &port_dpll->hw_state);
index e9fce044b99dafb28ddfc63e36d65ed2066ec9cd..dd8b99f8821ef35023e0e84adaa552fcc5598666 100644 (file)
@@ -1784,6 +1784,13 @@ intel_lt_phy_pll_calc_state(struct intel_crtc_state *crtc_state,
        return -EINVAL;
 }
 
+void intel_lt_phy_tbt_pll_calc_state(struct intel_dpll_hw_state *hw_state)
+{
+       memset(hw_state, 0, sizeof(*hw_state));
+
+       hw_state->ltpll.tbt_mode = true;
+}
+
 static void
 intel_lt_phy_program_pll(struct intel_encoder *encoder,
                         const struct intel_lt_phy_pll_state *ltpll)
@@ -2213,6 +2220,17 @@ static bool intel_lt_phy_pll_is_enabled(struct intel_encoder *encoder)
                             XELPDP_LANE_PCLK_PLL_ACK(0);
 }
 
+bool intel_lt_phy_tbt_pll_readout_hw_state(struct intel_display *display,
+                                          struct intel_dpll *pll,
+                                          struct intel_dpll_hw_state *hw_state)
+{
+       memset(hw_state, 0, sizeof(*hw_state));
+
+       hw_state->ltpll.tbt_mode = true;
+
+       return true;
+}
+
 bool intel_lt_phy_pll_readout_hw_state(struct intel_encoder *encoder,
                                       struct intel_lt_phy_pll_state *pll_state)
 {
index d8d5c2064b6b869bdf1638ed9435d0ee90d78bd1..147ae431713d66dd75de6fc53f1cd34f7cdcefaa 100644 (file)
@@ -26,6 +26,7 @@ int
 intel_lt_phy_pll_calc_state(struct intel_crtc_state *crtc_state,
                            struct intel_encoder *encoder,
                            struct intel_dpll_hw_state *hw_state);
+void intel_lt_phy_tbt_pll_calc_state(struct intel_dpll_hw_state *hw_state);
 int intel_lt_phy_calc_port_clock(struct intel_display *display,
                                 const struct intel_lt_phy_pll_state *lt_state);
 void intel_lt_phy_set_signal_levels(struct intel_encoder *encoder,
@@ -35,6 +36,9 @@ void intel_lt_phy_dump_hw_state(struct drm_printer *p,
 bool
 intel_lt_phy_pll_compare_hw_state(const struct intel_lt_phy_pll_state *a,
                                  const struct intel_lt_phy_pll_state *b);
+bool intel_lt_phy_tbt_pll_readout_hw_state(struct intel_display *display,
+                                          struct intel_dpll *pll,
+                                          struct intel_dpll_hw_state *hw_state);
 bool intel_lt_phy_pll_readout_hw_state(struct intel_encoder *encoder,
                                       struct intel_lt_phy_pll_state *pll_state);
 void intel_lt_phy_pll_state_verify(struct intel_atomic_state *state,