From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 3/5] drm/i915: check the DDC and AUX bits of the VBT on DDI machines
Date: Thu, 12 Sep 2013 17:07:55 -0300 [thread overview]
Message-ID: <1379016475-1635-1-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <20130911212212.GC9220@nuc-i3427.alporthouse.com>
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
Our code currently assumes that port X will use the DP AUX channel X
and the DDC pin X. The VBT should tell us how things are mapped, so
add some WARNs in case we discover our assumptions are wrong (or in
case the VBT is just wrong, which is also perfectly possible).
Why would someone wire port B to AUX C and DDC D?
v2: Rebase
v3: Convert WARNs to DRM_DEBUG_KMS
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1)
---
drivers/gpu/drm/i915/intel_bios.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 2f43429..12e4fd1 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -590,6 +590,8 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
uint8_t hdmi_level_shift;
int i, j;
+ bool is_dvi, is_dp;
+ uint8_t aux_channel;
/* Each DDI port can have more than one value on the "DVO Port" field,
* so look for all the possible values for each port and abort if more
* than one is found. */
@@ -622,6 +624,31 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
if (!child)
return;
+ aux_channel = child->raw[25];
+
+ is_dvi = child->common.device_type & (1 << 4);
+ is_dp = child->common.device_type & (1 << 2);
+
+ if (is_dvi) {
+ if (child->common.ddc_pin == 0x05 && port != PORT_B)
+ DRM_DEBUG_KMS("Unexpected DDC pin for port B\n");
+ if (child->common.ddc_pin == 0x04 && port != PORT_C)
+ DRM_DEBUG_KMS("Unexpected DDC pin for port C\n");
+ if (child->common.ddc_pin == 0x06 && port != PORT_D)
+ DRM_DEBUG_KMS("Unexpected DDC pin for port D\n");
+ }
+
+ if (is_dp) {
+ if (aux_channel == 0x40 && port != PORT_A)
+ DRM_DEBUG_KMS("Unexpected AUX channel for port A\n");
+ if (aux_channel == 0x10 && port != PORT_B)
+ DRM_DEBUG_KMS("Unexpected AUX channel for port B\n");
+ if (aux_channel == 0x20 && port != PORT_C)
+ DRM_DEBUG_KMS("Unexpected AUX channel for port C\n");
+ if (aux_channel == 0x30 && port != PORT_D)
+ DRM_DEBUG_KMS("Unexpected AUX channel for port D\n");
+ }
+
if (bdb->version >= 158) {
/* The VBT HDMI level shift values match the table we have. */
hdmi_level_shift = child->raw[7] & 0xF;
--
1.8.3.1
next prev parent reply other threads:[~2013-09-12 20:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-11 21:02 [PATCH 1/5] drm/i915: VBT's child_device_config changes over time Paulo Zanoni
2013-09-11 21:02 ` [PATCH 2/5] drm/i915: use the HDMI DDI buffer translations from VBT Paulo Zanoni
2013-09-11 21:33 ` Chris Wilson
2013-09-12 17:14 ` Paulo Zanoni
2013-09-12 20:06 ` Paulo Zanoni
2013-09-11 21:02 ` [PATCH 3/5] drm/i915: check the DDC and AUX bits of the VBT on DDI machines Paulo Zanoni
2013-09-11 21:22 ` Chris Wilson
2013-09-12 20:07 ` Paulo Zanoni [this message]
2013-09-11 21:02 ` [PATCH 4/5] drm/i915: add some assertions about VBT DDI port types Paulo Zanoni
2013-09-11 21:23 ` Chris Wilson
2013-09-12 20:10 ` Paulo Zanoni
2013-09-11 21:02 ` [PATCH 5/5] drm/i915: don't init DP or HDMI when not supported by DDI port Paulo Zanoni
2013-09-11 21:19 ` Chris Wilson
2013-09-12 20:12 ` Paulo Zanoni
2013-09-20 22:45 ` Daniel Vetter
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=1379016475-1635-1-git-send-email-przanoni@gmail.com \
--to=przanoni@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@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