From: Kristian Høgsberg Date: Thu, 1 Oct 2009 20:43:54 +0000 (-0400) Subject: Set an drop drm master on enter and leave vt X-Git-Tag: 0.85.0~967 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2311cfba73ea92f91de1e709359ac85d564e9c7;p=platform%2Fupstream%2Fweston.git Set an drop drm master on enter and leave vt This way we can vt switch between wayland and X. --- diff --git a/wayland-system-compositor.c b/wayland-system-compositor.c index 9e8b50b..ee3c6d0 100644 --- a/wayland-system-compositor.c +++ b/wayland-system-compositor.c @@ -1355,10 +1355,16 @@ static void on_enter_vt(int signal_number, void *data) struct wlsc_output *output; int ret, fd; + fd = eglGetDisplayFD(ec->display); + ret = drmSetMaster(fd); + if (ret) { + fprintf(stderr, "failed to set drm master\n"); + return; + } + ioctl(ec->tty_fd, VT_RELDISP, VT_ACKACQ); ec->vt_active = TRUE; - fd = eglGetDisplayFD(ec->display); output = container_of(ec->output_list.next, struct wlsc_output, link); while (&output->link != &ec->output_list) { ret = drmModeSetCrtc(fd, output->crtc_id, @@ -1376,6 +1382,14 @@ static void on_enter_vt(int signal_number, void *data) static void on_leave_vt(int signal_number, void *data) { struct wlsc_compositor *ec = data; + int ret, fd; + + fd = eglGetDisplayFD(ec->display); + ret = drmDropMaster(fd); + if (ret) { + fprintf(stderr, "failed to drop drm master\n"); + return; + } ioctl (ec->tty_fd, VT_RELDISP, 1); ec->vt_active = FALSE;