uterm: fbdev: fix wakeing up displays
authorDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 24 Jan 2013 09:24:18 +0000 (10:24 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 24 Jan 2013 09:24:18 +0000 (10:24 +0100)
The dfb->disp pointer is not used so the current fbdev backend doesn't
wake up displays on video-wakeup. Fix this by traversing the new display
list (even though we currently have only one display at most).

Also remove th dfb->disp pointer as it is unused now.

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

index 722d1f5..f89a199 100644 (file)
@@ -71,7 +71,6 @@ struct fbdev_display {
 struct fbdev_video {
        char *node;
        bool pending_intro;
-       struct uterm_display *disp;
 };
 
 int uterm_fbdev_display_blit(struct uterm_display *disp,
index 2ca53fd..7ee96ab 100644 (file)
@@ -601,22 +601,38 @@ static void video_destroy(struct uterm_video *video)
 
 static void video_sleep(struct uterm_video *video)
 {
-       struct fbdev_video *vfb = video->data;
+       struct uterm_display *iter;
+       struct shl_dlist *i;
+
+       shl_dlist_for_each(i, &video->displays) {
+               iter = shl_dlist_entry(i, struct uterm_display, list);
 
-       if (vfb->disp && display_is_online(vfb->disp))
-               display_deactivate_force(vfb->disp, true);
+               if (!display_is_online(iter))
+                       continue;
+
+               display_deactivate_force(iter, true);
+       }
 }
 
 static int video_wake_up(struct uterm_video *video)
 {
-       struct fbdev_video *vfb = video->data;
+       struct uterm_display *iter;
+       struct shl_dlist *i;
        int ret;
 
-       if (vfb->disp && display_is_online(vfb->disp)) {
-               video->flags |= VIDEO_AWAKE;
-               ret = display_activate_force(vfb->disp, NULL, true);
+       video->flags |= VIDEO_AWAKE;
+       shl_dlist_for_each(i, &video->displays) {
+               iter = shl_dlist_entry(i, struct uterm_display, list);
+
+               if (!display_is_online(iter))
+                       continue;
+
+               ret = display_activate_force(iter, NULL, true);
                if (ret)
                        return ret;
+
+               if (iter->dpms != UTERM_DPMS_UNKNOWN)
+                       display_set_dpms(iter, iter->dpms);
        }
 
        return 0;