From: "Souza, Jose" <jose.souza@intel.com>
To: "Roper, Matthew D" <matthew.d.roper@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 3/5] drm/i915/ehl: Don't program PHY_MISC on EHL PHY C
Date: Fri, 21 Jun 2019 20:34:12 +0000 [thread overview]
Message-ID: <bf03405821d56a0f8a05355afe4583c45cf7bd59.camel@intel.com> (raw)
In-Reply-To: <20190621020132.1164-4-matthew.d.roper@intel.com>
On Thu, 2019-06-20 at 19:01 -0700, Matt Roper wrote:
> Although EHL added a third combo PHY, no PHY_MISC register was added
> for
> PHY C. The bspec indicates that there's no need to program the "DE
> to
> IO Comp Pwr Down" setting for this PHY that we usually need to set in
> PHY_MISC.
>
> Bspec: 33148
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
> .../gpu/drm/i915/display/intel_combo_phy.c | 53 +++++++++++++--
> ----
> 1 file changed, 36 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_combo_phy.c
> b/drivers/gpu/drm/i915/display/intel_combo_phy.c
> index 075bab2500eb..da590f1a998b 100644
> --- a/drivers/gpu/drm/i915/display/intel_combo_phy.c
> +++ b/drivers/gpu/drm/i915/display/intel_combo_phy.c
> @@ -183,9 +183,13 @@ static void cnl_combo_phys_uninit(struct
> drm_i915_private *dev_priv)
> static bool icl_combo_phy_enabled(struct drm_i915_private *dev_priv,
> enum port port)
> {
> - return !(I915_READ(ICL_PHY_MISC(port)) &
> - ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN) &&
> - (I915_READ(ICL_PORT_COMP_DW0(port)) & COMP_INIT);
> + /* The PHY C added by EHL has no PHY_MISC register */
> + if (port == PORT_C)
> + return I915_READ(ICL_PORT_COMP_DW0(port)) & COMP_INIT;
Please add IS_ELKHARTLAKE() to the if, this is a particularity of EHL,
future platforms will reuse this function and they have PHY_MISC.
> + else
> + return !(I915_READ(ICL_PHY_MISC(port)) &
> + ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN) &&
> + (I915_READ(ICL_PORT_COMP_DW0(port)) &
> COMP_INIT);
> }
>
> static bool icl_combo_phy_verify_state(struct drm_i915_private
> *dev_priv,
> @@ -300,18 +304,26 @@ static void icl_combo_phys_init(struct
> drm_i915_private *dev_priv)
> }
>
> /*
> - * EHL's combo PHY A can be hooked up to either an
> external
> - * display (via DDI-D) or an internal display (via DDI-
> A or
> - * the DSI DPHY). This is a motherboard design
> decision that
> - * can't be changed on the fly, so initialize the PHY's
> mux
> - * based on whether our VBT indicates the presence of
> any
> - * "internal" child devices.
> + * Although EHL adds a combo PHY C, there's no PHY_MISC
> + * register for it and no need to program the
> + * DE_IO_COMP_PWR_DOWN setting on PHY C.
> */
> - val = I915_READ(ICL_PHY_MISC(port));
> - if (IS_ELKHARTLAKE(dev_priv) && port == PORT_A)
> - val = ehl_combo_phy_a_mux(dev_priv, val);
> - val &= ~ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN;
> - I915_WRITE(ICL_PHY_MISC(port), val);
> + if (port != PORT_C) {
Something as above here too.
Maybe something with less changes like:
if (IS_ELKHARTLAKE(dev_priv) && port == PORT_C)
goto skip_phy_misc;
> + /*
> + * EHL's combo PHY A can be hooked up to either
> an
> + * external display (via DDI-D) or an internal
> display
> + * (via DDI-A or the DSI DPHY). This is a
> motherboard
> + * design decision that can't be changed on the
> fly, so
> + * initialize the PHY's mux based on whether
> our VBT
> + * indicates the presence of any "internal"
> child
> + * devices.
> + */
> + val = I915_READ(ICL_PHY_MISC(port));
> + if (IS_ELKHARTLAKE(dev_priv) && port == PORT_A)
> + val = ehl_combo_phy_a_mux(dev_priv,
> val);
> + val &= ~ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN;
> + I915_WRITE(ICL_PHY_MISC(port), val);
> + }
>
> cnl_set_procmon_ref_values(dev_priv, port);
>
> @@ -343,9 +355,16 @@ static void icl_combo_phys_uninit(struct
> drm_i915_private *dev_priv)
> DRM_WARN("Port %c combo PHY HW state changed
> unexpectedly\n",
> port_name(port));
>
> - val = I915_READ(ICL_PHY_MISC(port));
> - val |= ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN;
> - I915_WRITE(ICL_PHY_MISC(port), val);
> + /*
> + * Although EHL adds a combo PHY C, there's no PHY_MISC
> + * register for it and no need to program the
> + * DE_IO_COMP_PWR_DOWN setting on PHY C.
> + */
> + if (port != PORT_C) {
> + val = I915_READ(ICL_PHY_MISC(port));
> + val |= ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN;
> + I915_WRITE(ICL_PHY_MISC(port), val);
> + }
Same as above.
>
> val = I915_READ(ICL_PORT_COMP_DW0(port));
> val &= ~COMP_INIT;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-21 20:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 2:01 [PATCH 0/5] EHL port programming Matt Roper
2019-06-21 2:01 ` [PATCH 1/5] drm/i915/icl: Drop port parameter to icl_get_combo_buf_trans() Matt Roper
2019-06-21 22:23 ` Clinton Taylor
2019-06-21 2:01 ` [PATCH 2/5] drm/i915/ehl: Add third combo PHY offset Matt Roper
2019-06-21 20:19 ` Souza, Jose
2019-06-21 2:01 ` [PATCH 3/5] drm/i915/ehl: Don't program PHY_MISC on EHL PHY C Matt Roper
2019-06-21 20:34 ` Souza, Jose [this message]
2019-06-21 2:01 ` [PATCH 4/5] drm/i915/gen11: Start distinguishing 'phy' from 'port' Matt Roper
2019-06-21 14:08 ` Matt Roper
2019-06-22 0:24 ` Souza, Jose
2019-06-25 12:46 ` Ville Syrjälä
2019-06-25 20:54 ` Matt Roper
2019-06-21 2:01 ` [PATCH 5/5] drm/i915/ehl: Enable DDI-D Matt Roper
2019-06-21 20:52 ` Souza, Jose
2019-06-25 22:19 ` Matt Roper
2019-06-26 21:11 ` Souza, Jose
2019-06-21 2:27 ` ✗ Fi.CI.CHECKPATCH: warning for EHL port programming Patchwork
2019-06-21 2:30 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-06-21 3:04 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-21 9:09 ` ✓ Fi.CI.IGT: " Patchwork
2019-06-21 14:36 ` ✗ Fi.CI.CHECKPATCH: warning for EHL port programming (rev2) Patchwork
2019-06-21 14:59 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-21 21:21 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bf03405821d56a0f8a05355afe4583c45cf7bd59.camel@intel.com \
--to=jose.souza@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox