Commit f68d697e authored by Chris Wilson's avatar Chris Wilson Committed by Dave Airlie

drm/i915: only hook up hpd pulse for DP outputs

On HSW+, the digital encoders are shared between HDMI and DP outputs,
with one encoder masquerading as both. The VBT should tell us if we need
to have DP or HDMI support on a particular port, but if we don't have DP
support and we enable the DP hpd pulse handler then we cause an oops.

Don't hook up the DP hpd handling if we don't have a DP port.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81856
Reported-by: Intel QA Team.
Signed-off-by: Dave Airlie <airlied@redhat.com> # v1
[ickle: Fix the error handling after a malloc failure]
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 1fae6dfe
...@@ -1515,15 +1515,13 @@ void intel_ddi_init(struct drm_device *dev, enum port port) ...@@ -1515,15 +1515,13 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
struct intel_digital_port *intel_dig_port; struct intel_digital_port *intel_dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct intel_connector *hdmi_connector = NULL;
struct intel_connector *dp_connector = NULL;
bool init_hdmi, init_dp; bool init_hdmi, init_dp;
init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi || init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
dev_priv->vbt.ddi_port_info[port].supports_hdmi); dev_priv->vbt.ddi_port_info[port].supports_hdmi);
init_dp = dev_priv->vbt.ddi_port_info[port].supports_dp; init_dp = dev_priv->vbt.ddi_port_info[port].supports_dp;
if (!init_dp && !init_hdmi) { if (!init_dp && !init_hdmi) {
DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible\n", DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible, assuming it is\n",
port_name(port)); port_name(port));
init_hdmi = true; init_hdmi = true;
init_dp = true; init_dp = true;
...@@ -1553,23 +1551,28 @@ void intel_ddi_init(struct drm_device *dev, enum port port) ...@@ -1553,23 +1551,28 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
DDI_A_4_LANES); DDI_A_4_LANES);
intel_encoder->type = INTEL_OUTPUT_UNKNOWN; intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
intel_encoder->cloneable = 0; intel_encoder->cloneable = 0;
intel_encoder->hot_plug = intel_ddi_hot_plug; intel_encoder->hot_plug = intel_ddi_hot_plug;
intel_dig_port->hpd_pulse = intel_dp_hpd_pulse; if (init_dp) {
dev_priv->hpd_irq_port[port] = intel_dig_port; if (!intel_ddi_init_dp_connector(intel_dig_port))
goto err;
if (init_dp) intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
dp_connector = intel_ddi_init_dp_connector(intel_dig_port); dev_priv->hpd_irq_port[port] = intel_dig_port;
}
/* In theory we don't need the encoder->type check, but leave it just in /* In theory we don't need the encoder->type check, but leave it just in
* case we have some really bad VBTs... */ * case we have some really bad VBTs... */
if (intel_encoder->type != INTEL_OUTPUT_EDP && init_hdmi) if (intel_encoder->type != INTEL_OUTPUT_EDP && init_hdmi) {
hdmi_connector = intel_ddi_init_hdmi_connector(intel_dig_port); if (!intel_ddi_init_hdmi_connector(intel_dig_port))
goto err;
if (!dp_connector && !hdmi_connector) {
drm_encoder_cleanup(encoder);
kfree(intel_dig_port);
} }
return;
err:
drm_encoder_cleanup(encoder);
kfree(intel_dig_port);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment