<div dir="ltr">I meant DON't suspect</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 11:53 PM, Maarten Maathuis <span dir="ltr"><<a href="mailto:madman2003@gmail.com" target="_blank">madman2003@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Also tested v3 on top of 4.8.3 (mainline git is a mess right now for booting).<div><br></div><div>I did encounter a seemingly unrelated message during boot (including a WARN_ON):</div><div>[drm:skylake_pfit_enable [i915]] *ERROR* Requesting pfit without getting a scaler first<br></div><div><br></div><div>I suspect any causal relation with these patches.</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Mon, Oct 17, 2016 at 8:07 PM, <span dir="ltr"><<a href="mailto:ville.syrjala@linux.intel.com" target="_blank">ville.syrjala@linux.intel.com</a><wbr>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>From: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com" target="_blank">ville.syrjala@linux.intel.com</a><wbr>><br>
<br>
Now that we use the AUX and GMBUS assignment from VBT for all ports,<br>
let's clean up the sanitization of the port information a bit.<br>
Previosuly we only did this for port E, and only complained about a<br>
non-standard assignment for the other ports. But as we know that<br>
non-standard assignments are a fact of life, let's expand the<br>
sanitization to all the ports.<br>
<br>
v2: Include a commit message, fix up the comments a bit<br>
</span>v3: Don't clobber other ports if the current port has no alternate aux ch/ddc pin<br>
<span><br>
Cc: <a href="mailto:stable@vger.kernel.org" target="_blank">stable@vger.kernel.org</a><br>
Cc: Maarten Maathuis <<a href="mailto:madman2003@gmail.com" target="_blank">madman2003@gmail.com</a>><br>
Tested-by: Maarten Maathuis <<a href="mailto:madman2003@gmail.com" target="_blank">madman2003@gmail.com</a>><br>
References: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=97877" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/s<wbr>how_bug.cgi?id=97877</a><br>
Signed-off-by: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com" target="_blank">ville.syrjala@linux.intel.com</a><wbr>><br>
</span>Link: <a href="http://patchwork.freedesktop.org/patch/msgid/1476208368-5710-4-git-send-email-ville.syrjala@linux.intel.com" rel="noreferrer" target="_blank">http://patchwork.freedesktop.o<wbr>rg/patch/msgid/1476208368-5710<wbr>-4-git-send-email-ville.syrjal<wbr>a@linux.intel.com</a><br>
Reviewed-by: Jim Bride <<a href="mailto:jim.bride@linux.intel.com" target="_blank">jim.bride@linux.intel.com</a>> (v2)<br>
---<br>
drivers/gpu/drm/i915/intel_bi<wbr>os.c | 122 ++++++++++++++++++++++++------<wbr>--------<br>
1 file changed, 77 insertions(+), 45 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_b<wbr>ios.c b/drivers/gpu/drm/i915/intel_b<wbr>ios.c<br>
index 83667e8cdd6b..a8ff8c099685 100644<br>
--- a/drivers/gpu/drm/i915/intel_b<wbr>ios.c<br>
+++ b/drivers/gpu/drm/i915/intel_b<wbr>ios.c<br>
@@ -1035,6 +1035,77 @@ static u8 translate_iboost(u8 val)<br>
<span> return mapping[val];<br>
}<br>
<br>
+static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,<br>
+ enum port port)<br>
+{<br>
+ const struct ddi_vbt_port_info *info =<br>
+ &dev_priv->vbt.ddi_port_info[<wbr>port];<br>
+ enum port p;<br>
+<br>
</span>+ if (!info->alternate_ddc_pin)<br>
+ return;<br>
<div><div class="m_-1489740164944007733h5">+<br>
+ for_each_port_masked(p, (1 << port) - 1) {<br>
+ struct ddi_vbt_port_info *i = &dev_priv->vbt.ddi_port_info[p<wbr>];<br>
+<br>
+ if (info->alternate_ddc_pin != i->alternate_ddc_pin)<br>
+ continue;<br>
+<br>
+ DRM_DEBUG_KMS("port %c trying to use the same DDC pin (0x%x) as port %c, "<br>
+ "disabling port %c DVI/HDMI support\n",<br>
+ port_name(p), i->alternate_ddc_pin,<br>
+ port_name(port), port_name(p));<br>
+<br>
+ /*<br>
+ * If we have multiple ports supposedly sharing the<br>
+ * pin, then dvi/hdmi couldn't exist on the shared<br>
+ * port. Otherwise they share the same ddc bin and<br>
+ * system couldn't communicate with them separately.<br>
+ *<br>
+ * Due to parsing the ports in alphabetical order,<br>
+ * a higher port will always clobber a lower one.<br>
+ */<br>
+ i->supports_dvi = false;<br>
+ i->supports_hdmi = false;<br>
+ i->alternate_ddc_pin = 0;<br>
+ }<br>
+}<br>
+<br>
+static void sanitize_aux_ch(struct drm_i915_private *dev_priv,<br>
+ enum port port)<br>
+{<br>
+ const struct ddi_vbt_port_info *info =<br>
+ &dev_priv->vbt.ddi_port_info[<wbr>port];<br>
+ enum port p;<br>
+<br>
</div></div>+ if (!info->alternate_aux_channel)<br>
+ return;<br>
<div><div class="m_-1489740164944007733h5">+<br>
+ for_each_port_masked(p, (1 << port) - 1) {<br>
+ struct ddi_vbt_port_info *i = &dev_priv->vbt.ddi_port_info[p<wbr>];<br>
+<br>
+ if (info->alternate_aux_channel != i->alternate_aux_channel)<br>
+ continue;<br>
+<br>
+ DRM_DEBUG_KMS("port %c trying to use the same AUX CH (0x%x) as port %c, "<br>
+ "disabling port %c DP support\n",<br>
+ port_name(p), i->alternate_aux_channel,<br>
+ port_name(port), port_name(p));<br>
+<br>
+ /*<br>
+ * If we have multiple ports supposedlt sharing the<br>
+ * aux channel, then DP couldn't exist on the shared<br>
+ * port. Otherwise they share the same aux channel<br>
+ * and system couldn't communicate with them separately.<br>
+ *<br>
+ * Due to parsing the ports in alphabetical order,<br>
+ * a higher port will always clobber a lower one.<br>
+ */<br>
+ i->supports_dp = false;<br>
+ i->alternate_aux_channel = 0;<br>
+ }<br>
+}<br>
+<br>
static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,<br>
const struct bdb_header *bdb)<br>
{<br>
</div></div>@@ -1109,54 +1180,15 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,<br>
<div class="m_-1489740164944007733HOEnZb"><div class="m_-1489740164944007733h5"> DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port));<br>
<br>
if (is_dvi) {<br>
- if (port == PORT_E) {<br>
- info->alternate_ddc_pin = ddc_pin;<br>
- /* if DDIE share ddc pin with other port, then<br>
- * dvi/hdmi couldn't exist on the shared port.<br>
- * Otherwise they share the same ddc bin and system<br>
- * couldn't communicate with them seperately. */<br>
- if (ddc_pin == DDC_PIN_B) {<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_B].supports_dvi = 0;<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_B].supports_hdmi = 0;<br>
- } else if (ddc_pin == DDC_PIN_C) {<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_C].supports_dvi = 0;<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_C].supports_hdmi = 0;<br>
- } else if (ddc_pin == DDC_PIN_D) {<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_D].supports_dvi = 0;<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_D].supports_hdmi = 0;<br>
- }<br>
- } else if (ddc_pin == DDC_PIN_B && port != PORT_B)<br>
- DRM_DEBUG_KMS("Unexpected DDC pin for port B\n");<br>
- else if (ddc_pin == DDC_PIN_C && port != PORT_C)<br>
- DRM_DEBUG_KMS("Unexpected DDC pin for port C\n");<br>
- else if (ddc_pin == DDC_PIN_D && port != PORT_D)<br>
- DRM_DEBUG_KMS("Unexpected DDC pin for port D\n");<br>
+ info->alternate_ddc_pin = ddc_pin;<br>
+<br>
+ sanitize_ddc_pin(dev_priv, port);<br>
}<br>
<br>
if (is_dp) {<br>
- if (port == PORT_E) {<br>
- info->alternate_aux_channel = aux_channel;<br>
- /* if DDIE share aux channel with other port, then<br>
- * DP couldn't exist on the shared port. Otherwise<br>
- * they share the same aux channel and system<br>
- * couldn't communicate with them seperately. */<br>
- if (aux_channel == DP_AUX_A)<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_A].supports_dp = 0;<br>
- else if (aux_channel == DP_AUX_B)<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_B].supports_dp = 0;<br>
- else if (aux_channel == DP_AUX_C)<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_C].supports_dp = 0;<br>
- else if (aux_channel == DP_AUX_D)<br>
- dev_priv->vbt.ddi_port_info[P<wbr>ORT_D].supports_dp = 0;<br>
- }<br>
- else if (aux_channel == DP_AUX_A && port != PORT_A)<br>
- DRM_DEBUG_KMS("Unexpected AUX channel for port A\n");<br>
- else if (aux_channel == DP_AUX_B && port != PORT_B)<br>
- DRM_DEBUG_KMS("Unexpected AUX channel for port B\n");<br>
- else if (aux_channel == DP_AUX_C && port != PORT_C)<br>
- DRM_DEBUG_KMS("Unexpected AUX channel for port C\n");<br>
- else if (aux_channel == DP_AUX_D && port != PORT_D)<br>
- DRM_DEBUG_KMS("Unexpected AUX channel for port D\n");<br>
+ info->alternate_aux_channel = aux_channel;<br>
+<br>
+ sanitize_aux_ch(dev_priv, port);<br>
}<br>
<br>
if (bdb->version >= 158) {<br>
--<br>
2.7.4<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-1489740164944007733gmail_signature" data-smartmail="gmail_signature">Far away from the primal instinct, the song seems to fade away, the river get wider between your thoughts and the things we do and say.</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Far away from the primal instinct, the song seems to fade away, the river get wider between your thoughts and the things we do and say.</div>
</div>