ecore-drm: added vt switch key event handler
authorMinJeong Kim <minjjj.kim@samsung.com>
Mon, 15 Sep 2014 16:03:52 +0000 (12:03 -0400)
committerChris Michael <cp.michael@samsung.com>
Mon, 15 Sep 2014 16:03:52 +0000 (12:03 -0400)
commit96a83aecfa59528e4e200ef7dcc3740b82625705
tree32a6a753d7cce23a0cbe2fa8bc683512a3927cd4
parent11237fd8584b0aa1706bfa1d37ec8b78727736c0
ecore-drm: added vt switch key event handler

Summary:
Because vt mode of tty is set to VT_PROCESS,
ecore-drm is responsible for managing switch-to or switch-from other vt.
For that, ecore-drm has to handshake with kernel(tty driver).

 On switch-from side(A):
  1. Listen key event to satisfy vt switch key binding.
  2. ioctl(fd, VT_ACTIVE, switch-to-vt) for activating switch-to vt.
  3. Receive SIGUSR1(relsig) from kernel.
  4. Prepare releasing vt, and ioctl(fd, VT_RELDISP, 1).

 On switch-to side(B):
  0. Kernel receive VT_RELDISP with value 1(ok) from switch-from vt.
  1. Receive SIGUSR2(acqsig) from kernel.
  2. ioctl(fd, VT_RELDISP, VT_ACKACQ), and start to setup vt.

 This revision added A-1 step on above.

Test Plan:
 On booted PC with systemd.
 1. launch enlightenment_start with drm and wayland
 ex) ECORE_DRM_TTY=/dev/tty1 \
     E_WL_FORCE=drm \
     ELM_ENGINE=wayland_shm enlightenment_start
 2. try to switch vt by pressing "Ctrl + Alt + (F1 ~ F8)"

Reviewers: gwanglim, stefan_schmidt, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1280
src/lib/ecore_drm/Ecore_Drm.h
src/lib/ecore_drm/ecore_drm_tty.c