+/*
+ * intel_hdmi_hpd- is the specified port connected?
+ * @dev_priv: i915 private structure
+ * @intel_hdmi: the HDMI port to test
+ *
+ * Returns true if @intel_hdmi is connected, false otherwise.
+ */
+static bool intel_hdmi_hpd(struct drm_i915_private *dev_priv,
+ struct intel_hdmi *intel_hdmi)
+{
+ u32 bit;
+
+ /* XXX: IBX has different SDEISR bits */
+ if (HAS_PCH_IBX(dev_priv->dev))
+ return true;
+
+ switch (intel_hdmi->sdvox_reg) {
+ case HDMIB:
+ case SDVOB:
+ bit = SDE_PORTB_HOTPLUG_CPT;
+ break;
+ case HDMIC:
+ case SDVOC:
+ bit = SDE_PORTC_HOTPLUG_CPT;
+ break;
+ case HDMID:
+ bit = SDE_PORTD_HOTPLUG_CPT;
+ break;
+ default:
+ return true;
+ }
+
+ return I915_READ(SDEISR) & bit;
+}
+