diff options
authorRobert Beckett <>2019-07-02 16:31:22 +0100
committerDaniel Stone <>2019-07-18 06:35:41 +0000
commit49dc32013eb7d65a3aa154dc3f821ae31a8696bd (patch)
parentc569bdc23612eab518b6f60cf60fb3ab775cf5e4 (diff)
backend-drm: dont emit sesion signal if already at same state
logind will send a device changed at start of day, prompting a session active change, but the session will already be active from compositor creation. Avoid unnecessary signal emition and drm state invalidation. The logind launcher sets the session active when the graphics device is assigned to weston from systemd. Unfortunately 8d23ab78 didnt check whether the session was already active before setting it active and emitting the session active signal. The handler for that signal then proceeds to invalidate the entire graphics state, causing the next redraw to reconfigure all outputs (to the same routing as they were already). This then massively increases the likelihood of trying to configure a crtc that has a commit already in flight. Add the old behaviour of only emitting a signal on a changed state. This avoids the issue for now by reducing the chances of a clash. Future work will need to fix the issue properly (better handling of state_invalid e.g. wait for quiescence, better monitoring for crtc usage clashes etc). Signed-off-by: Robert Beckett <>
1 files changed, 2 insertions, 1 deletions
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
index d513010c..5fb20355 100644
--- a/libweston/backend-drm/drm.c
+++ b/libweston/backend-drm/drm.c
@@ -2564,7 +2564,8 @@ drm_device_changed(struct weston_compositor *compositor,
struct drm_backend *b = to_drm_backend(compositor);
- if (b->drm.fd < 0 || b->drm.devnum != device)
+ if (b->drm.fd < 0 || b->drm.devnum != device ||
+ compositor->session_active == added)
compositor->session_active = added;