diff mbox

[4/4] drm/i915: emit a hotplug event on resume

Message ID 1364315146-20542-4-git-send-email-jbarnes@virtuousgeek.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jesse Barnes March 26, 2013, 4:25 p.m. UTC
This will poke userspace into probing for configuration changes that may
have occurred across suspend/resume.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_drv.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Rodrigo Vivi March 26, 2013, 4:43 p.m. UTC | #1
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>


On Tue, Mar 26, 2013 at 1:25 PM, Jesse Barnes <jbarnes@virtuousgeek.org>wrote:

> This will poke userspace into probing for configuration changes that may
> have occurred across suspend/resume.
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c |   20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c
> b/drivers/gpu/drm/i915/i915_drv.c
> index bf57e1c..0cfc778 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -545,6 +545,24 @@ void intel_console_resume(struct work_struct *work)
>         console_unlock();
>  }
>
> +static void intel_resume_hotplug(struct drm_device *dev)
> +{
> +       struct drm_mode_config *mode_config = &dev->mode_config;
> +       struct intel_encoder *encoder;
> +
> +       mutex_lock(&mode_config->mutex);
> +       DRM_DEBUG_KMS("running encoder hotplug functions\n");
> +
> +       list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
> +               if (encoder->hot_plug)
> +                       encoder->hot_plug(encoder);
> +
> +       mutex_unlock(&mode_config->mutex);
> +
> +       /* Just fire off a uevent and let userspace tell us what to do */
> +       drm_helper_hpd_irq_event(dev);
> +}
> +
>  static int __i915_drm_thaw(struct drm_device *dev)
>  {
>         struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -580,6 +598,8 @@ static int __i915_drm_thaw(struct drm_device *dev)
>                  * */
>                 intel_hpd_init(dev);
>                 dev_priv->enable_hotplug_processing = true;
> +               /* Config may have changed between suspend and resume */
> +               intel_resume_hotplug(dev);
>         }
>
>         intel_opregion_init(dev);
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index bf57e1c..0cfc778 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -545,6 +545,24 @@  void intel_console_resume(struct work_struct *work)
 	console_unlock();
 }
 
+static void intel_resume_hotplug(struct drm_device *dev)
+{
+	struct drm_mode_config *mode_config = &dev->mode_config;
+	struct intel_encoder *encoder;
+
+	mutex_lock(&mode_config->mutex);
+	DRM_DEBUG_KMS("running encoder hotplug functions\n");
+
+	list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
+		if (encoder->hot_plug)
+			encoder->hot_plug(encoder);
+
+	mutex_unlock(&mode_config->mutex);
+
+	/* Just fire off a uevent and let userspace tell us what to do */
+	drm_helper_hpd_irq_event(dev);
+}
+
 static int __i915_drm_thaw(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -580,6 +598,8 @@  static int __i915_drm_thaw(struct drm_device *dev)
 		 * */
 		intel_hpd_init(dev);
 		dev_priv->enable_hotplug_processing = true;
+		/* Config may have changed between suspend and resume */
+		intel_resume_hotplug(dev);
 	}
 
 	intel_opregion_init(dev);