uterm: drm: set VIDEO_HOTPLUG on wakeup
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 4 Nov 2013 07:05:28 +0000 (08:05 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Mon, 4 Nov 2013 07:05:28 +0000 (08:05 +0100)
Be more verbose during wake-up and set VIDEO_HOTPLUG so we force the
hotplug-check. I don't know why it worked until now, but we definitely
need to force it as we have no idea what display-status changed.

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

index 75830f3..e3b7d8d 100644 (file)
@@ -658,6 +658,8 @@ int uterm_drm_video_hotplug(struct uterm_video *video,
        if (!video_is_awake(video) || !video_need_hotplug(video))
                return 0;
 
+       log_debug("testing DRM hotplug status");
+
        res = drmModeGetResources(vdrm->fd);
        if (!res) {
                log_err("cannot retrieve drm resources");
@@ -728,7 +730,7 @@ int uterm_drm_video_wake_up(struct uterm_video *video)
                return -EACCES;
        }
 
-       video->flags |= VIDEO_AWAKE;
+       video->flags |= VIDEO_AWAKE | VIDEO_HOTPLUG;
        ret = uterm_drm_video_hotplug(video, true);
        if (ret) {
                drmDropMaster(vdrm->fd);