seat: set DPMS to ON before broadcasting the device
authorDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 28 Nov 2012 21:21:33 +0000 (22:21 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 28 Nov 2012 21:21:33 +0000 (22:21 +0100)
We cannot modeset a device while DPMS is set to OFF so we should do this
before broadcasting the device. Otherwise, the callback might not be able
to use the display.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/kmscon_seat.c

index 11328a7..04cc8c3 100644 (file)
@@ -151,15 +151,15 @@ static void activate_display(struct kmscon_display *d)
 
                d->activated = true;
 
-               shl_dlist_for_each_safe(iter, tmp, &seat->sessions) {
-                       s = shl_dlist_entry(iter, struct kmscon_session, list);
-                       session_call_display_new(s, d->disp);
-               }
-
                ret = uterm_display_set_dpms(d->disp, UTERM_DPMS_ON);
                if (ret)
                        log_warning("cannot set DPMS state to on for display: %d",
                                    ret);
+
+               shl_dlist_for_each_safe(iter, tmp, &seat->sessions) {
+                       s = shl_dlist_entry(iter, struct kmscon_session, list);
+                       session_call_display_new(s, d->disp);
+               }
        }
 }