From: Jani Nikula <jani.nikula@intel.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/ddi: Rely on VBT DDI port info for eDP detection
Date: Wed, 21 Dec 2016 13:21:44 +0200 [thread overview]
Message-ID: <87shphmss7.fsf@intel.com> (raw)
In-Reply-To: <1482315444-24750-1-git-send-email-imre.deak@intel.com>
On Wed, 21 Dec 2016, Imre Deak <imre.deak@intel.com> wrote:
> There is at least one APL based system using port A in DP mode
> (connecting to an on-board DP->VGA adaptor). Atm we'll configure port A
> unconditionally as eDP which is incorrect in this case. Fix this by
> relying on the VBT DDI port 'internal port' flag instead on all ports on
> DDI platforms. For now chicken out from using VBT for port A before
> GEN9.
>
> v2:
> - Move the DDI port info lookup to intel_bios_is_port_edp() (David, Jani)
> - Use the DDI port info on all DDI platforms starting for port B.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1)
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> drivers/gpu/drm/i915/intel_bios.c | 4 ++++
> drivers/gpu/drm/i915/intel_dp.c | 2 +-
> 3 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 77d7a07..1a91409 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1669,6 +1669,7 @@ struct ddi_vbt_port_info {
> uint8_t supports_dvi:1;
> uint8_t supports_hdmi:1;
> uint8_t supports_dp:1;
> + uint8_t supports_edp:1;
>
> uint8_t alternate_aux_channel;
> uint8_t alternate_ddc_pin;
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 1cf2fa6..a359def 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -1161,6 +1161,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
> info->supports_dvi = is_dvi;
> info->supports_hdmi = is_hdmi;
> info->supports_dp = is_dp;
> + info->supports_edp = is_edp;
>
> DRM_DEBUG_KMS("Port %c VBT info: DP:%d HDMI:%d DVI:%d EDP:%d CRT:%d\n",
> port_name(port), is_dp, is_hdmi, is_dvi, is_edp, is_crt);
> @@ -1664,6 +1665,9 @@ bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
> };
> int i;
>
> + if (HAS_DDI(dev_priv))
> + return dev_priv->vbt.ddi_port_info[port].supports_edp;
> +
> if (!dev_priv->vbt.child_dev_num)
> return false;
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 66b5bc8..746c237 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4975,7 +4975,7 @@ bool intel_dp_is_edp(struct drm_i915_private *dev_priv, enum port port)
> if (INTEL_GEN(dev_priv) < 5)
> return false;
>
> - if (port == PORT_A)
> + if (INTEL_GEN(dev_priv) < 9 && port == PORT_A)
> return true;
I like the split between intel_bios.c and intel_dp.c like this.
If we wanted to be extra careful with this, we might even consider
splitting the patch in two, one changing intel_dp_is_edp and the other
intel_bios_is_port_edp... They *are* distinct changes, after all.
BR,
Jani.
>
> return intel_bios_is_port_edp(dev_priv, port);
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-12-21 11:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 15:12 [PATCH] drm/i915/gen9+: Rely on VBT DDI port info for eDP detection Imre Deak
2016-12-20 15:31 ` Ville Syrjälä
2016-12-20 16:02 ` David Weinehall
2016-12-20 16:34 ` Imre Deak
2016-12-21 8:34 ` Jani Nikula
2016-12-21 10:03 ` Imre Deak
2016-12-20 17:45 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-12-21 10:17 ` [PATCH v2] drm/i915/ddi: " Imre Deak
2016-12-21 11:21 ` Jani Nikula [this message]
2016-12-21 11:50 ` Imre Deak
2016-12-21 11:56 ` Jani Nikula
2016-12-22 9:12 ` David Weinehall
2016-12-22 12:28 ` Imre Deak
2016-12-21 10:56 ` ✗ Fi.CI.BAT: failure for drm/i915/gen9+: Rely on VBT DDI port info for eDP detection (rev2) Patchwork
2016-12-21 12:15 ` Imre Deak
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=87shphmss7.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).