<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 6, 2015 at 12:45 AM Xiong Zhang <<a href="mailto:xiong.y.zhang@intel.com">xiong.y.zhang@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">DDI-E doesn't have the correspondent GMBUS pin.<br>
<br>
We rely on VBT to tell us which one it being used instead.<br>
<br>
The DVI/HDMI on shared port couldn't exist.<br>
<br>
This patch isn't tested without hardware wchich has HDMI<br>
on DDI-E.<br>
<br>
Signed-off-by: Xiong Zhang <<a href="mailto:xiong.y.zhang@intel.com" target="_blank">xiong.y.zhang@intel.com</a>><br>
---<br>
drivers/gpu/drm/i915/i915_drv.h | 5 +++++<br>
drivers/gpu/drm/i915/intel_bios.c | 28 ++++++++++++++++++++++++----<br>
drivers/gpu/drm/i915/intel_hdmi.c | 18 ++++++++++++++++++<br>
3 files changed, 47 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h<br>
index 6d93334..5d8e7fe 100644<br>
--- a/drivers/gpu/drm/i915/i915_drv.h<br>
+++ b/drivers/gpu/drm/i915/i915_drv.h<br>
@@ -1414,6 +1414,10 @@ enum modeset_restore {<br>
#define DP_AUX_C 0x20<br>
#define DP_AUX_D 0x30<br>
<br>
+#define DDC_PIN_B 0x05<br>
+#define DDC_PIN_C 0x04<br>
+#define DDC_PIN_D 0x06<br>
+<br>
struct ddi_vbt_port_info {<br>
/*<br>
* This is an index in the HDMI/DVI DDI buffer translation table.<br>
@@ -1428,6 +1432,7 @@ struct ddi_vbt_port_info {<br>
uint8_t supports_dp:1;<br>
<br>
uint8_t alternate_aux_channel;<br>
+ uint8_t alternate_ddc_pin;<br>
};<br>
<br>
enum psr_lines_to_wait {<br>
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c<br>
index 16cdf17..265227f 100644<br>
--- a/drivers/gpu/drm/i915/intel_bios.c<br>
+++ b/drivers/gpu/drm/i915/intel_bios.c<br>
@@ -894,7 +894,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,<br>
uint8_t hdmi_level_shift;<br>
int i, j;<br>
bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;<br>
- uint8_t aux_channel;<br>
+ uint8_t aux_channel, ddc_pin;<br>
/* Each DDI port can have more than one value on the "DVO Port" field,<br>
* so look for all the possible values for each port and abort if more<br>
* than one is found. */<br>
@@ -928,6 +928,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,<br>
return;<br>
<br>
aux_channel = child->raw[25];<br>
+ ddc_pin = child->common.ddc_pin;<br>
<br>
is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;<br>
is_dp = child->common.device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;<br>
@@ -959,11 +960,30 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,<br>
DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port));<br>
<br>
if (is_dvi) {<br>
- if (child->common.ddc_pin == 0x05 && port != PORT_B)<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></blockquote><div> </div><div>I see a trailing space here </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ * 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[PORT_B].supports_dvi = 0;<br>
+ dev_priv->vbt.ddi_port_info[PORT_B].supports_hdmi = 0;<br>
+ }<br>
+ else if (ddc_pin == DDC_PIN_C) {<br>
+ dev_priv->vbt.ddi_port_info[PORT_C].supports_dvi = 0;<br>
+ dev_priv->vbt.ddi_port_info[PORT_C].supports_hdmi = 0;<br>
+ }<br></blockquote><div><br></div><div>and here</div><div><br></div><div>But the concept and patch is totally right so with trailing whitespaces fixed</div><div>Reviewed-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@intel.com">rodrigo.vivi@intel.com</a>></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ else if (ddc_pin == DDC_PIN_D) {<br>
+ dev_priv->vbt.ddi_port_info[PORT_D].supports_dvi = 0;<br>
+ dev_priv->vbt.ddi_port_info[PORT_D].supports_hdmi = 0;<br>
+ }<br>
+ }<br>
+ else if (ddc_pin == DDC_PIN_B && port != PORT_B)<br>
DRM_DEBUG_KMS("Unexpected DDC pin for port B\n");<br>
- if (child->common.ddc_pin == 0x04 && port != PORT_C)<br>
+ else if (ddc_pin == DDC_PIN_C && port != PORT_C)<br>
DRM_DEBUG_KMS("Unexpected DDC pin for port C\n");<br>
- if (child->common.ddc_pin == 0x06 && port != PORT_D)<br>
+ else if (ddc_pin == DDC_PIN_D && port != PORT_D)<br>
DRM_DEBUG_KMS("Unexpected DDC pin for port D\n");<br>
} </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c<br>
index 70bad5b..e1f6e81 100644<br>
--- a/drivers/gpu/drm/i915/intel_hdmi.c<br>
+++ b/drivers/gpu/drm/i915/intel_hdmi.c<br>
@@ -1991,6 +1991,24 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,<br>
intel_hdmi->ddc_bus = GMBUS_PIN_DPD;<br>
intel_encoder->hpd_pin = HPD_PORT_D;<br>
break;<br>
+ case PORT_E:<br>
+ /* On SKL PORT E doesn't have seperate GMBUS pin<br>
+ * We rely on VBT to set a proper alternate GMBUS pin. */<br>
+ switch (dev_priv->vbt.ddi_port_info[PORT_E].alternate_ddc_pin) {<br>
+ case DDC_PIN_B:<br>
+ intel_hdmi->ddc_bus = GMBUS_PIN_DPB;<br>
+ break;<br>
+ case DDC_PIN_C:<br>
+ intel_hdmi->ddc_bus = GMBUS_PIN_DPC;<br>
+ break;<br>
+ case DDC_PIN_D:<br>
+ intel_hdmi->ddc_bus = GMBUS_PIN_DPD;<br>
+ break;<br>
+ default:<br>
+ BUG();<br>
+ }<br>
+ intel_encoder->hpd_pin = HPD_PORT_E;<br>
+ break;<br>
case PORT_A:<br>
intel_encoder->hpd_pin = HPD_PORT_A;<br>
/* Internal port only for eDP. */<br>
--<br>
2.1.4<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org" target="_blank">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</blockquote></div></div>