[Intel-gfx] [PATCH 3/8] drm/i915: Add hpd status bit to struct intel_connector.

Egbert Eich eich at suse.de
Thu Jan 10 16:02:41 CET 2013


To be able to map an HPD interrupt to a connector add the
hpd status bit to the intel_connector structure.

Signed-off-by: Egbert Eich <eich at suse.de>
---
 drivers/gpu/drm/i915/intel_crt.c  |    3 ++-
 drivers/gpu/drm/i915/intel_dp.c   |    3 ++-
 drivers/gpu/drm/i915/intel_drv.h  |    3 +++
 drivers/gpu/drm/i915/intel_hdmi.c |    3 ++-
 drivers/gpu/drm/i915/intel_sdvo.c |   11 ++++++++++-
 5 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 0cd9ff0..75298ce 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -797,7 +797,8 @@ void intel_crt_init(struct drm_device *dev)
 	 */
 	crt->force_hotplug_required = 0;
 
-	dev_priv->hotplug_supported_mask |= intel_crt_hotplug_int_status(dev);
+	intel_connector->hpd_status_bit = intel_crt_hotplug_int_status(dev);
+	dev_priv->hotplug_supported_mask |= intel_connector->hpd_status_bit;
 
 	/*
 	 * TODO: find a proper way to discover whether we need to set the
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1946b5b..b97eb76 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2766,7 +2766,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 		WARN(1, "Invalid port %c\n", port_name(port));
 		break;
 	}
-	dev_priv->hotplug_supported_mask |= intel_hotplug_int_status(dev, port);
+	intel_connector->hpd_status_bit = intel_hotplug_int_status(dev, port);
+	dev_priv->hotplug_supported_mask |= intel_connector->hpd_status_bit;
 
 	if (is_edp(intel_dp))
 		intel_dp_init_panel_power_sequencer(dev, intel_dp);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 8a1bd4a..a251036 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -191,6 +191,9 @@ struct intel_connector {
 
 	/* Cached EDID for eDP and LVDS. May hold ERR_PTR for invalid EDID. */
 	struct edid *edid;
+
+	/* hpd status bit for this connector */
+	u32 hpd_status_bit;
 };
 
 struct intel_crtc {
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index d20f9ff..9099b6dc 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -992,7 +992,8 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	default:
 		BUG();
 	}
-	dev_priv->hotplug_supported_mask |= intel_hotplug_int_status(dev, port);
+	intel_connector->hpd_status_bit = intel_hotplug_int_status(dev, port);
+	dev_priv->hotplug_supported_mask |= intel_connector->hpd_status_bit;
 
 	if (!HAS_PCH_SPLIT(dev)) {
 		intel_hdmi->write_infoframe = g4x_write_infoframe;
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 567846e..c99bb9d 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -2697,6 +2697,7 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_encoder *intel_encoder;
 	struct intel_sdvo *intel_sdvo;
+	struct drm_connector *connector;
 	u32 hotplug_mask;
 	int i;
 
@@ -2749,8 +2750,16 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
 	/* Only enable the hotplug irq if we need it, to work around noisy
 	 * hotplug lines.
 	 */
-	if (intel_sdvo->hotplug_active)
+	if (intel_sdvo->hotplug_active) {
 		dev_priv->hotplug_supported_mask |= hotplug_mask;
+		list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+			struct intel_connector *intel_connector = to_intel_connector(connector);
+			if (intel_connector->encoder == intel_encoder) {
+				intel_connector->hpd_status_bit = hotplug_mask;
+				break;
+			}
+		}
+	}
 
 	intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo, sdvo_reg);
 
-- 
1.7.7




More information about the Intel-gfx mailing list