From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Anusha Srivatsa <anusha.srivatsa@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915: Split pin mapping into per platform functions
Date: Thu, 17 Aug 2017 17:23:41 -0300 [thread overview]
Message-ID: <1503001421.22770.20.camel@intel.com> (raw)
In-Reply-To: <1502927114-24012-1-git-send-email-anusha.srivatsa@intel.com>
Em Qua, 2017-08-16 às 16:45 -0700, Anusha Srivatsa escreveu:
> Cleanup the code. Map the pins in accordance to
> individual platforms rather than according to ports.
> Create separate functions for platforms.
>
> v2:
> - Add missing condition for CoffeeLake. Make platform
> specific functions static. Add function
> i915_ddc_pin_mapping().
>
> v3:
> - Rename functions to x_port_to_ddc_pin() which directly
> indicates the purpose. Correct default return values on CNP
> and BXT. Rename i915_port_to_ to g4x_port_to since that was
> the first platform to run this. Correct code style. (Paulo)
>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Sugested-by Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Clinton Tayloe <clinton.a.taylor@intel.com>
> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
> ---
> drivers/gpu/drm/i915/intel_hdmi.c | 113
> ++++++++++++++++++++++++++++++--------
> 1 file changed, 91 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
> b/drivers/gpu/drm/i915/intel_hdmi.c
> index e30c27a..e8abea7 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1843,45 +1843,114 @@ void
> intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
> DRM_DEBUG_KMS("sink scrambling handled\n");
> }
>
> -static u8 intel_hdmi_ddc_pin(struct drm_i915_private *dev_priv,
> - enum port port)
> +static u8 chv_port_to_ddc_pin(struct drm_i915_private *dev_priv,
> enum port port)
> {
> - const struct ddi_vbt_port_info *info =
> - &dev_priv->vbt.ddi_port_info[port];
> u8 ddc_pin;
>
> - if (info->alternate_ddc_pin) {
> - DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c
> (VBT)\n",
> - info->alternate_ddc_pin,
> port_name(port));
> - return info->alternate_ddc_pin;
> + switch (port) {
> + case PORT_B:
> + ddc_pin = GMBUS_PIN_DPB;
> + break;
> + case PORT_C:
> + ddc_pin = GMBUS_PIN_DPC;
> + break;
> + case PORT_D:
> + ddc_pin = GMBUS_PIN_DPD_CHV;
> + break;
> + default:
> + MISSING_CASE(port);
> + ddc_pin = GMBUS_PIN_DPB;
> + break;
> }
> + return ddc_pin;
> +}
> +
> +static u8 bxt_port_to_ddc_pin(struct drm_i915_private *dev_priv,
> enum port port)
> +{
> + u8 ddc_pin;
>
> switch (port) {
> case PORT_B:
> - if (IS_GEN9_LP(dev_priv) || HAS_PCH_CNP(dev_priv))
> - ddc_pin = GMBUS_PIN_1_BXT;
> - else
> - ddc_pin = GMBUS_PIN_DPB;
> + ddc_pin = GMBUS_PIN_1_BXT;
> break;
> case PORT_C:
> - if (IS_GEN9_LP(dev_priv) || HAS_PCH_CNP(dev_priv))
> - ddc_pin = GMBUS_PIN_2_BXT;
> - else
> - ddc_pin = GMBUS_PIN_DPC;
> + ddc_pin = GMBUS_PIN_2_BXT;
> + break;
> + default:
> + MISSING_CASE(port);
> + ddc_pin = GMBUS_PIN_1_BXT;
> + break;
> + }
> + return ddc_pin;
> +}
> +
> +static u8 cnp_port_to_ddc_pin(struct drm_i915_private *dev_priv,
> + enum port port)
> +{
> + u8 ddc_pin;
> +
> + switch (port) {
> + case PORT_B:
> + ddc_pin = GMBUS_PIN_1_BXT;
> + break;
> + case PORT_C:
> + ddc_pin = GMBUS_PIN_2_BXT;
> break;
> case PORT_D:
> - if (HAS_PCH_CNP(dev_priv))
> - ddc_pin = GMBUS_PIN_4_CNP;
> - else if (IS_CHERRYVIEW(dev_priv))
> - ddc_pin = GMBUS_PIN_DPD_CHV;
> - else
> - ddc_pin = GMBUS_PIN_DPD;
> + ddc_pin = GMBUS_PIN_4_CNP;
> + break;
> + default:
> + MISSING_CASE(port);
> + ddc_pin = GMBUS_PIN_1_BXT;
> + break;
> + }
> + return ddc_pin;
> +}
> +
> +static u8 g4x_port_to_ddc_pin(struct drm_i915_private *dev_priv,
> + enum port port)
> +{
> + u8 ddc_pin;
> +
> + switch (port) {
> + case PORT_B:
> + ddc_pin = GMBUS_PIN_DPB;
> + break;
> + case PORT_C:
> + ddc_pin = GMBUS_PIN_DPC;
> + break;
> + case PORT_D:
> + ddc_pin = GMBUS_PIN_DPD;
> break;
> default:
> MISSING_CASE(port);
> ddc_pin = GMBUS_PIN_DPB;
> break;
> }
> + return ddc_pin;
> +}
> +
> +static u8 intel_hdmi_ddc_pin(struct drm_i915_private *dev_priv,
> + enum port port)
> +{
> + const struct ddi_vbt_port_info *info =
> + &dev_priv->vbt.ddi_port_info[port];
> + u8 ddc_pin;
> +
> + if (info->alternate_ddc_pin) {
> + DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c
> (VBT)\n",
> + info->alternate_ddc_pin,
> port_name(port));
> + return info->alternate_ddc_pin;
> + }
> +
> + if (IS_CHERRYVIEW(dev_priv))
> + ddc_pin = chv_port_to_ddc_pin(dev_priv, port);
> + else if (IS_GEN9_LP(dev_priv))
> + ddc_pin = bxt_port_to_ddc_pin(dev_priv, port);
> + else if (HAS_PCH_CNP(dev_priv))
> + ddc_pin = cnp_port_to_ddc_pin(dev_priv, port);
> + else
> + ddc_pin = g4x_port_to_ddc_pin(dev_priv, port);
>
> DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (platform
> default)\n",
> ddc_pin, port_name(port));
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-17 20:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 23:45 [PATCH] drm/i915: Split pin mapping into per platform functions Anusha Srivatsa
2017-08-17 0:06 ` ✓ Fi.CI.BAT: success for drm/i915: Split pin mapping into per platform functions (rev3) Patchwork
2017-08-17 20:23 ` Paulo Zanoni [this message]
2017-08-17 21:29 ` [PATCH] drm/i915: Split pin mapping into per platform functions Srivatsa, Anusha
-- strict thread matches above, loose matches on Subject: below --
2017-08-10 18:42 Anusha Srivatsa
2017-08-14 21:14 ` Paulo Zanoni
2017-08-14 21:23 ` Srivatsa, Anusha
2017-07-27 1:44 Anusha Srivatsa
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=1503001421.22770.20.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=anusha.srivatsa@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.