intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Synchronize connectors states when switching from poll to irq
@ 2017-06-26 12:32 Paul Kocialkowski
  2017-06-26 12:51 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Kocialkowski @ 2017-06-26 12:32 UTC (permalink / raw)
  To: intel-gfx; +Cc: David Airlie, linux-kernel, dri-devel, Daniel Vetter

After detecting an IRQ storm, hotplug detection will switch from
irq-based detection to poll-based detection. After a short delay or
when resetting storm detection from debugfs, detection will switch
back to being irq-based.

However, it may occur that polling does not have enough time to detect
the current connector state when that second switch takes place. Thus,
this sets the appropriate hotplug event bits for the concerned
connectors and schedules the hotplug work, that will ensure the
connectors states are in sync when switching back to irq.

Without this, no irq will be triggered and the hpd change will be lost.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_hotplug.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index f1200272a699..29f55480b0bb 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -218,9 +218,13 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
 			struct intel_connector *intel_connector = to_intel_connector(connector);
 
 			if (intel_connector->encoder->hpd_pin == i) {
-				if (connector->polled != intel_connector->polled)
+				if (connector->polled != intel_connector->polled) {
 					DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
 							 connector->name);
+
+					dev_priv->hotplug.event_bits |= (1 << i);
+				}
+
 				connector->polled = intel_connector->polled;
 				if (!connector->polled)
 					connector->polled = DRM_CONNECTOR_POLL_HPD;
@@ -232,6 +236,8 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
 		dev_priv->display.hpd_irq_setup(dev_priv);
 	spin_unlock_irq(&dev_priv->irq_lock);
 
+	schedule_work(&dev_priv->hotplug.hotplug_work);
+
 	intel_runtime_pm_put(dev_priv);
 }
 
-- 
2.13.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-20 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26 12:32 [PATCH] drm/i915: Synchronize connectors states when switching from poll to irq Paul Kocialkowski
2017-06-26 12:51 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-07-18 12:11 ` [PATCH] " Paul Kocialkowski
2017-07-20  6:11   ` Manasi Navare
2017-07-20 14:41     ` Paul Kocialkowski
2017-07-20  1:04 ` [Intel-gfx] " Pandiyan, Dhinakaran
2017-07-20 14:35   ` Paul Kocialkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).