aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_probe_helper.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-21 02:45:22 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-22 00:11:39 -0500
commitb7703726251191cd9f3ef3a80b2d9667901eec95 (patch)
treee2398efa8afa5d991cc1d19d664c8065098d81ea /drivers/gpu/drm/drm_probe_helper.c
parent162b6a57ac50eec236530a16c071ffa50e87362a (diff)
drm/probe-helper: clamp unknown connector status in the poll work
On some chipset we try to avoid possibly invasive output detection methods (like load detect which can cause flickering elsewhere) in the output poll work. Drivers could hence return unknown when a previous full ->detect call returned a different state. This change will generate a hotplug event, forcing userspace to do a full scan. This in turn updates the connector->status field so that we will _again_ get a state change when the hotplug work re-runs in 10 seconds. To avoid this ping-pong loop detect this situation and clamp the connector state to the old value. Patch is inspired by a patch from Knut Peterson. Knut's patch completely ignored connector state changes if either the old or new status was unknown, which seemed to be a bit too agressive to me. v2: Rebased onto the drm_probe_helper.c extraction. References: http://lists.freedesktop.org/archives/dri-devel/2012-August/025975.html Cc: Knut Petersen <Knut_Petersen@t-online.de> Cc: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Alex Deucher <alexander.deucher@amd.com> Cc: Rob Clark <robdclark@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_probe_helper.c')
-rw-r--r--drivers/gpu/drm/drm_probe_helper.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 33bf550a1d3f..6591d48c1b9d 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -335,6 +335,24 @@ static void output_poll_execute(struct work_struct *work)
335 if (old_status != connector->status) { 335 if (old_status != connector->status) {
336 const char *old, *new; 336 const char *old, *new;
337 337
338 /*
339 * The poll work sets force=false when calling detect so
340 * that drivers can avoid to do disruptive tests (e.g.
341 * when load detect cycles could cause flickering on
342 * other, running displays). This bears the risk that we
343 * flip-flop between unknown here in the poll work and
344 * the real state when userspace forces a full detect
345 * call after receiving a hotplug event due to this
346 * change.
347 *
348 * Hence clamp an unknown detect status to the old
349 * value.
350 */
351 if (connector->status == connector_status_unknown) {
352 connector->status = old_status;
353 continue;
354 }
355
338 old = drm_get_connector_status_name(old_status); 356 old = drm_get_connector_status_name(old_status);
339 new = drm_get_connector_status_name(connector->status); 357 new = drm_get_connector_status_name(connector->status);
340 358