diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index b06a4a3ff08d..d0983bb93a18 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -38,7 +38,7 @@ | |||
38 | struct intel_hdmi_priv { | 38 | struct intel_hdmi_priv { |
39 | u32 sdvox_reg; | 39 | u32 sdvox_reg; |
40 | u32 save_SDVOX; | 40 | u32 save_SDVOX; |
41 | int has_hdmi_sink; | 41 | bool has_hdmi_sink; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static void intel_hdmi_mode_set(struct drm_encoder *encoder, | 44 | static void intel_hdmi_mode_set(struct drm_encoder *encoder, |
@@ -128,6 +128,22 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, | |||
128 | return true; | 128 | return true; |
129 | } | 129 | } |
130 | 130 | ||
131 | static void | ||
132 | intel_hdmi_sink_detect(struct drm_connector *connector) | ||
133 | { | ||
134 | struct intel_output *intel_output = to_intel_output(connector); | ||
135 | struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; | ||
136 | struct edid *edid = NULL; | ||
137 | |||
138 | edid = drm_get_edid(&intel_output->base, | ||
139 | &intel_output->ddc_bus->adapter); | ||
140 | if (edid != NULL) { | ||
141 | hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid); | ||
142 | kfree(edid); | ||
143 | intel_output->base.display_info.raw_edid = NULL; | ||
144 | } | ||
145 | } | ||
146 | |||
131 | static enum drm_connector_status | 147 | static enum drm_connector_status |
132 | intel_hdmi_detect(struct drm_connector *connector) | 148 | intel_hdmi_detect(struct drm_connector *connector) |
133 | { | 149 | { |
@@ -139,11 +155,18 @@ intel_hdmi_detect(struct drm_connector *connector) | |||
139 | 155 | ||
140 | temp = I915_READ(PORT_HOTPLUG_EN); | 156 | temp = I915_READ(PORT_HOTPLUG_EN); |
141 | 157 | ||
142 | I915_WRITE(PORT_HOTPLUG_EN, | 158 | switch (hdmi_priv->sdvox_reg) { |
143 | temp | | 159 | case SDVOB: |
144 | HDMIB_HOTPLUG_INT_EN | | 160 | temp |= HDMIB_HOTPLUG_INT_EN; |
145 | HDMIC_HOTPLUG_INT_EN | | 161 | break; |
146 | HDMID_HOTPLUG_INT_EN); | 162 | case SDVOC: |
163 | temp |= HDMIC_HOTPLUG_INT_EN; | ||
164 | break; | ||
165 | default: | ||
166 | return connector_status_unknown; | ||
167 | } | ||
168 | |||
169 | I915_WRITE(PORT_HOTPLUG_EN, temp); | ||
147 | 170 | ||
148 | POSTING_READ(PORT_HOTPLUG_EN); | 171 | POSTING_READ(PORT_HOTPLUG_EN); |
149 | 172 | ||
@@ -158,9 +181,10 @@ intel_hdmi_detect(struct drm_connector *connector) | |||
158 | return connector_status_unknown; | 181 | return connector_status_unknown; |
159 | } | 182 | } |
160 | 183 | ||
161 | if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0) | 184 | if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0) { |
185 | intel_hdmi_sink_detect(connector); | ||
162 | return connector_status_connected; | 186 | return connector_status_connected; |
163 | else | 187 | } else |
164 | return connector_status_disconnected; | 188 | return connector_status_disconnected; |
165 | } | 189 | } |
166 | 190 | ||