From 69787f7da6b2adc4054357a661aaa1701a9ca76f Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Tue, 23 Oct 2012 18:23:34 +0000
Subject: drm: run the hpd irq event code directly
Git-commit: 69787f7da6b2adc4054357a661aaa1701a9ca76f
Patch-mainline: v3.8-rc1

All drivers already have a work item to run the hpd code, so we don't
need to launch a new one in the helper code. Dave Airlie mentioned
that the cancel+re-queue might paper over DP related hpd ping-pongs,
hence why this is split out.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Michal Srb <msrb@suse.com>
---
 drivers/gpu/drm/drm_crtc_helper.c |   14 +-------------
 include/drm/drm_crtc.h            |    1 -
 2 files changed, 1 insertions(+), 14 deletions(-)

Index: linux-3.0-SLE11-SP3/drivers/gpu/drm/drm_crtc_helper.c
===================================================================
--- linux-3.0-SLE11-SP3.orig/drivers/gpu/drm/drm_crtc_helper.c
+++ linux-3.0-SLE11-SP3/drivers/gpu/drm/drm_crtc_helper.c
@@ -1037,15 +1037,12 @@ static const struct dmi_system_id drm_no
 	{ }	/* terminating entry */
 };
 
-static void hpd_irq_event_execute(struct work_struct *work);
-
 void drm_kms_helper_poll_init(struct drm_device *dev)
 {
 	if (dmi_check_system(drm_no_poll_list))
 		drm_kms_helper_poll = false;
 
 	INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
-	INIT_DELAYED_WORK(&dev->mode_config.hpd_irq_work, hpd_irq_event_execute);
 	dev->mode_config.poll_enabled = true;
 
 	drm_kms_helper_poll_enable(dev);
@@ -1058,10 +1055,8 @@ void drm_kms_helper_poll_fini(struct drm
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);
 
-static void hpd_irq_event_execute(struct work_struct *work)
+void drm_helper_hpd_irq_event(struct drm_device *dev)
 {
-	struct delayed_work *delayed_work = to_delayed_work(work);
-	struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.hpd_irq_work);
 	struct drm_connector *connector;
 	enum drm_connector_status old_status;
 	bool changed = false;
@@ -1092,11 +1087,4 @@ static void hpd_irq_event_execute(struct
 	if (changed)
 		drm_kms_helper_hotplug_event(dev);
 }
-
-void drm_helper_hpd_irq_event(struct drm_device *dev)
-{
-	cancel_delayed_work(&dev->mode_config.hpd_irq_work);
-	if (drm_kms_helper_poll)
-		schedule_delayed_work(&dev->mode_config.hpd_irq_work, 0);
-}
 EXPORT_SYMBOL(drm_helper_hpd_irq_event);
Index: linux-3.0-SLE11-SP3/include/drm/drm_crtc.h
===================================================================
--- linux-3.0-SLE11-SP3.orig/include/drm/drm_crtc.h
+++ linux-3.0-SLE11-SP3/include/drm/drm_crtc.h
@@ -793,7 +793,6 @@ struct drm_mode_config {
 	/* output poll support */
 	bool poll_enabled;
 	struct delayed_work output_poll_work;
-	struct delayed_work hpd_irq_work;
 
 	/* pointers to standard properties */
 	struct list_head property_blob_list;
