aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-06-28 06:31:34 -0400
committerDave Airlie <airlied@redhat.com>2013-06-28 06:31:34 -0400
commitd482e5fa299c2cfbb4700143dd766273730e2357 (patch)
tree817263cf3963a143ffa63396c4ac4ee32bed10a6
parent421cda3e324fce40e3f7abdf3d31cae1d0deddcd (diff)
Revert "drm: kms_helper: don't lose hotplug event"
This reverts commit 160954b7bca43da7cd3cfbce310e6df919a8216e. This was rearming the workqueue with a 0 timeout, causing a WARN_ON, and possible loop. Daniel writes: "I've looked a bit into this and I think we need to have a separate work struct for recovering these lost hotplug events since the continuous self-rearming case is a real risk (e.g. if a connector flip-flops all the time). At least I don't see a sane way to block out re-arming with the current code in a simple way. So reverting the offender seems like the right thing and I'll go back to the drawing board for 3.12." Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c32
-rw-r--r--include/drm/drm_crtc.h1
2 files changed, 1 insertions, 32 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index f6829ba58e86..738a4294d820 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -122,7 +122,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
122 int count = 0; 122 int count = 0;
123 int mode_flags = 0; 123 int mode_flags = 0;
124 bool verbose_prune = true; 124 bool verbose_prune = true;
125 enum drm_connector_status old_status;
126 125
127 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, 126 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
128 drm_get_connector_name(connector)); 127 drm_get_connector_name(connector));
@@ -138,32 +137,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
138 if (connector->funcs->force) 137 if (connector->funcs->force)
139 connector->funcs->force(connector); 138 connector->funcs->force(connector);
140 } else { 139 } else {
141 old_status = connector->status;
142
143 connector->status = connector->funcs->detect(connector, true); 140 connector->status = connector->funcs->detect(connector, true);
144
145 /*
146 * Normally either the driver's hpd code or the poll loop should
147 * pick up any changes and fire the hotplug event. But if
148 * userspace sneaks in a probe, we might miss a change. Hence
149 * check here, and if anything changed start the hotplug code.
150 */
151 if (old_status != connector->status) {
152 DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
153 connector->base.id,
154 drm_get_connector_name(connector),
155 old_status, connector->status);
156
157 /*
158 * The hotplug event code might call into the fb
159 * helpers, and so expects that we do not hold any
160 * locks. Fire up the poll struct instead, it will
161 * disable itself again.
162 */
163 dev->mode_config.delayed_event = true;
164 schedule_delayed_work(&dev->mode_config.output_poll_work,
165 0);
166 }
167 } 141 }
168 142
169 /* Re-enable polling in case the global poll config changed. */ 143 /* Re-enable polling in case the global poll config changed. */
@@ -1011,11 +985,7 @@ static void output_poll_execute(struct work_struct *work)
1011 struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work); 985 struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work);
1012 struct drm_connector *connector; 986 struct drm_connector *connector;
1013 enum drm_connector_status old_status; 987 enum drm_connector_status old_status;
1014 bool repoll = false, changed; 988 bool repoll = false, changed = false;
1015
1016 /* Pick up any changes detected by the probe functions. */
1017 changed = dev->mode_config.delayed_event;
1018 dev->mode_config.delayed_event = false;
1019 989
1020 if (!drm_kms_helper_poll) 990 if (!drm_kms_helper_poll)
1021 return; 991 return;
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 663c3ab47752..fa12a2fa4293 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -811,7 +811,6 @@ struct drm_mode_config {
811 /* output poll support */ 811 /* output poll support */
812 bool poll_enabled; 812 bool poll_enabled;
813 bool poll_running; 813 bool poll_running;
814 bool delayed_event;
815 struct delayed_work output_poll_work; 814 struct delayed_work output_poll_work;
816 815
817 /* pointers to standard properties */ 816 /* pointers to standard properties */