[Intel-gfx] [PATCH 08/17] drm/i915: add per-output hotplug callback

Keith Packard keithp at keithp.com
Sun May 31 05:42:32 CEST 2009


This allows each output to deal with plug/unplug events as needed
(cherry picked from commit 08d57f21d1042153ebc26465be85d7e166008a14)
---
 drivers/gpu/drm/i915/i915_irq.c  |    8 ++++++++
 drivers/gpu/drm/i915/intel_drv.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 98bb4c8..43745ff 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -191,7 +191,15 @@ static void i915_hotplug_work_func(struct work_struct *work)
 	drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
 						    hotplug_work);
 	struct drm_device *dev = dev_priv->dev;
+	struct drm_mode_config *mode_config = &dev->mode_config;
+	struct drm_connector *connector;
 
+	list_for_each_entry(connector, &mode_config->connector_list, head) {
+		struct intel_output *intel_output = to_intel_output(connector);
+
+		if (intel_output->hot_plug)
+			(*intel_output->hot_plug) (intel_output);
+	}
 	/* Just fire off a uevent and let userspace tell us what to do */
 	drm_sysfs_hotplug_event(dev);
 }
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d89a2fe..c585879 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -83,6 +83,7 @@ struct intel_output {
 	bool load_detect_temp;
 	bool needs_tv_clock;
 	void *dev_priv;
+	void (*hot_plug)(struct intel_output *);
 };
 
 struct intel_crtc {
-- 
1.6.3.1




More information about the Intel-gfx mailing list