Commit 905bc9ff authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm: don't start the poll engine in probe_single_connector

Actually there's a reason this stuff is there, and it's called

commit e58f637b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 20 09:13:36 2010 +0100

    drm/kms: Add a module parameter to disable polling

The idea has been that users can enable/disable polling at runtime. So
the quick hack has been to just re-enable the output polling if xrandr
asks for the latest state of the connectors.

The problem with that hack is that when we force connectors to another
state than what would be detected, we nicely ping-pong:
- Userspace calls probe, gets the forced state, but polling starts
  again.
- Polling notices that the state is actually different, wakes up
  userspace.
- Repeat.

As that commit already explains, the right fix would be to make the
locking more fine-grained, so that hotplug detection on one output
does not interfere with cursor updates on another crtc.

But that is way too much work. So let's just safe this gross hack by
caching the last-seen state of drm_kms_helper_poll for that driver,
and only fire up the poll engine again if it changed from off to on.

v2: Fixup the edge detection of drm_kms_helper_poll.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49907Tested-by: default avatarTvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5e2cb2f6
...@@ -127,9 +127,14 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, ...@@ -127,9 +127,14 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
connector->funcs->force(connector); connector->funcs->force(connector);
} else { } else {
connector->status = connector->funcs->detect(connector, true); connector->status = connector->funcs->detect(connector, true);
drm_kms_helper_poll_enable(dev);
} }
/* Re-enable polling in case the global poll config changed. */
if (drm_kms_helper_poll != dev->mode_config.poll_running)
drm_kms_helper_poll_enable(dev);
dev->mode_config.poll_running = drm_kms_helper_poll;
if (connector->status == connector_status_disconnected) { if (connector->status == connector_status_disconnected) {
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
connector->base.id, drm_get_connector_name(connector)); connector->base.id, drm_get_connector_name(connector));
......
...@@ -792,6 +792,7 @@ struct drm_mode_config { ...@@ -792,6 +792,7 @@ struct drm_mode_config {
/* output poll support */ /* output poll support */
bool poll_enabled; bool poll_enabled;
bool poll_running;
struct delayed_work output_poll_work; struct delayed_work output_poll_work;
/* pointers to standard properties */ /* pointers to standard properties */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment