[Intel-gfx] [PATCH v6 2/5] drm/i915/rkl: Add DPLL4 support
Lucas De Marchi
lucas.demarchi at intel.com
Wed Jun 17 01:11:13 UTC 2020
On Tue, Jun 16, 2020 at 04:58:07PM -0700, Matt Roper wrote:
>Rocket Lake has a third DPLL (called 'DPLL4') that must be used to
>enable a third display. Unlike EHL's variant of DPLL4, the RKL variant
>behaves the same as DPLL0/1. And despite its name, the DPLL4 registers
>are offset as if it were DPLL2, so no extra offset handling is needed
>either.
>
>v2:
> - Add new .update_ref_clks() hook.
>
>Bspec: 49202
>Bspec: 49443
>Bspec: 50288
>Bspec: 50289
>Cc: Lucas De Marchi <lucas.demarchi at intel.com>
>Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
>---
> drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 29 +++++++++++++++++--
> 1 file changed, 26 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>index b45185b80bec..b5f4d4cef682 100644
>--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>@@ -3506,13 +3506,19 @@ static bool icl_get_combo_phy_dpll(struct intel_atomic_state *state,
> return false;
> }
>
>- if (IS_ELKHARTLAKE(dev_priv) && port != PORT_A)
>+ if (IS_ROCKETLAKE(dev_priv)) {
> dpll_mask =
> BIT(DPLL_ID_EHL_DPLL4) |
> BIT(DPLL_ID_ICL_DPLL1) |
> BIT(DPLL_ID_ICL_DPLL0);
I don't think that is sufficient. As you said in the commit message,
here DPLL4 are much like DPLL0, DPLL1 rather than the special treatment
it has in EHL.
That means we need to update the places making use of it. Example:
TGL_DPLL_CFGCR0()
TGL_DPLL_CFGCR1()
The way it is now, it would basically be using the address
0x16429C / 0x1642A0 that are actually for TBT
Looking at bspec 50288, it seems we should reorder the IDs to be
DPLL0, DPLL1, DPLL4, TBTPLL. Then we can go back and use _MMIO_PLL()
rather than _MMIO_PLL3(). There is even a "TODO" in the right place in
the source code for that, although I don't remember if in TGL it has any
special. I think we never added it for TGL just because with 2 combo
ports you will never need 3 PLLs.
Lucas De Marchi
>- else
>+ } else if (IS_ELKHARTLAKE(dev_priv) && port != PORT_A) {
>+ dpll_mask =
>+ BIT(DPLL_ID_EHL_DPLL4) |
>+ BIT(DPLL_ID_ICL_DPLL1) |
>+ BIT(DPLL_ID_ICL_DPLL0);
>+ } else {
> dpll_mask = BIT(DPLL_ID_ICL_DPLL1) | BIT(DPLL_ID_ICL_DPLL0);
>+ }
>
> port_dpll->pll = intel_find_shared_dpll(state, crtc,
> &port_dpll->hw_state,
>@@ -4275,6 +4281,21 @@ static const struct intel_dpll_mgr tgl_pll_mgr = {
> .dump_hw_state = icl_dump_hw_state,
> };
>
>+static const struct dpll_info rkl_plls[] = {
>+ { "DPLL 0", &combo_pll_funcs, DPLL_ID_ICL_DPLL0, 0 },
>+ { "DPLL 1", &combo_pll_funcs, DPLL_ID_ICL_DPLL1, 0 },
>+ { "DPLL 4", &combo_pll_funcs, DPLL_ID_EHL_DPLL4, 0 },
>+ { },
>+};
>+
>+static const struct intel_dpll_mgr rkl_pll_mgr = {
>+ .dpll_info = rkl_plls,
>+ .get_dplls = icl_get_dplls,
>+ .put_dplls = icl_put_dplls,
>+ .update_ref_clks = icl_update_dpll_ref_clks,
>+ .dump_hw_state = icl_dump_hw_state,
>+};
>+
> /**
> * intel_shared_dpll_init - Initialize shared DPLLs
> * @dev: drm device
>@@ -4288,7 +4309,9 @@ void intel_shared_dpll_init(struct drm_device *dev)
> const struct dpll_info *dpll_info;
> int i;
>
>- if (INTEL_GEN(dev_priv) >= 12)
>+ if (IS_ROCKETLAKE(dev_priv))
>+ dpll_mgr = &rkl_pll_mgr;
>+ else if (INTEL_GEN(dev_priv) >= 12)
> dpll_mgr = &tgl_pll_mgr;
> else if (IS_ELKHARTLAKE(dev_priv))
> dpll_mgr = &ehl_pll_mgr;
>--
>2.24.1
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
More information about the Intel-gfx
mailing list