@@ -1207,6 +1207,9 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)
i915_ggtt_cleanup_hw(dev_priv);
}
+DEFINE_MUTEX(i915_driver_list_lock);
+LIST_HEAD(i915_driver_list);
+
/**
* i915_driver_register - register the driver with the rest of the system
* @dev_priv: device private
@@ -1264,6 +1267,11 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
*/
if (INTEL_INFO(dev_priv)->num_pipes)
drm_kms_helper_poll_init(dev);
+
+ INIT_LIST_HEAD(&dev_priv->driver_list_link);
+ mutex_lock(&i915_driver_list_lock);
+ list_add_tail(&dev_priv->driver_list_link, &i915_driver_list);
+ mutex_unlock(&i915_driver_list_lock);
}
/**
@@ -1275,6 +1283,10 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
intel_fbdev_unregister(dev_priv);
intel_audio_deinit(dev_priv);
+ mutex_lock(&i915_driver_list_lock);
+ list_del(&dev_priv->driver_list_link);
+ mutex_unlock(&i915_driver_list_lock);
+
/*
* After flushing the fbdev (incl. a late async config which will
* have delayed queuing of a hotplug event), then flush the hotplug
@@ -2142,12 +2142,17 @@ struct drm_i915_private {
struct i915_pmu pmu;
+ struct list_head driver_list_link;
+
/*
* NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
* will be rejected. Instead look for a better place.
*/
};
+extern struct mutex i915_driver_list_lock;
+extern struct list_head i915_driver_list;
+
static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
{
return container_of(dev, struct drm_i915_private, drm);