Commit Graph

32 Commits

Author SHA1 Message Date
Chris Michael 2dbe2732a2 ecore-drm: Update copyright notice
As portions of this code have been derived from existing code in
Weston, we should also be including their copyright/licence text to
give credit.

NB: Fixes T3286

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:22:22 -05:00
Chris Michael cb983f747b ecore-drm: Unify and cleanup tty code
This patch brings the tty code more inline with what the logind code
Was doing. It also fixes the return value from the vt_signal handler,
and opens the tty in non-blocking mode now.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-21 11:38:07 -05:00
Derek Foreman 943f2df006 ecore_drm/ecore_wl2: logging: remove errant usage of %m
Summary:
printf %m stringifies and prints errno.  I've tried to remove its use
anywhere that the immediately preceding function might not set errno
or is a complicated function for which knowing errno doesn't really
give any useful information.

I've left a few of the drmMode calls because they're just wrappers
around ioctl, which legitimately sets errno.

@fix

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3572
2016-01-14 13:06:02 -05:00
Chris Michael f836aba678 ecore-drm: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-07 09:00:32 -05:00
Chris Michael 4ef8750733 ecore-drm: Don't exit tty setup if tty is already in graphics mode
Summary: If we go to setup a tty and it is already in graphics mode,
then there is no need to exit with a failed setup here. Instead, we
can actually continue to setup the tty.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-30 09:28:10 -04:00
Chris Michael a2c1faef70 ecore-drm: Add missing field initializers for vt_mode
Summary: clang reports missing field initializers for usage of vt_mode
structure, so add the missing initializers

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-14 09:37:20 -04:00
Mike Blumenkrantz 3a3552ec66 ecore-drm: fix improper conditional syntax in _ecore_drm_tty_switch() 2015-04-24 12:53:01 -04:00
Mike Blumenkrantz 3d71a10891 ecore-drm: add safety checks to all EAPI functions 2015-04-24 12:53:01 -04:00
Chris Michael 70e8a00271 ecore-drm: Move doxygen documentation to main Ecore_Drm header
Summary: This moves all doxygen to the main Ecore_Drm header to match
rest of efl.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael 4f320a80df ecore-drm: Disable/Enable inputs if we release/acquire the VT
Summary: Due to libinput process events directly from evdev, when we
VT switch we should disable/enable inputs accordingly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-11 14:14:52 -05:00
Chris Michael 37d21a4729 ecore-drm: Trap for failure to dup stdin
Summary: If we fail to duplicate stdin, we should write out an error
and exit appropriately.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-02 11:59:27 -05:00
Chris Michael e6970f4f8b ecore-drm: Cleanup tty code and handle vt signal trapping
Summary: This cleans up the tty code a bit, and makes it the
responsibility of the tty code to handle VT switching signals

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -05:00
Chris Michael d38462f2eb ecore-drm: Restore tty keyboard mode on restore of tty
Summary: When we are shutting down a tty, restore the old keyboard
mode that we retain from tty_setup.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-19 12:48:41 -05:00
Chris Michael 0c105e4f68 ecore-drm: Re-enable setting K_OFF keyboard mode
Summary: Now that things are shaping up, we can re-enable the K_OFF
tty mode which will help with buffering input, etc.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 15:35:55 -05:00
Seunghun Lee 2db6ed0945 ecore-drm: remove duplicated code from logind and tty.
Summary: integrates the code used in common.

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1796
2015-01-05 09:08:27 -05:00
Seunghun Lee c280e2f711 ecore-drm: add error handling, when fail to setup tty.
Summary: need to restore vt to text mode, when failed to setup.

@fix

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1777
2014-12-16 09:20:42 -05:00
Seunghun Lee 5720a350f9 ecore-drm: Add event to notify session activation state.
Summary:
this event is to notify session activation state to compositor.
thus compositor can change composite state by this event.

Reviewers: devilhorns

Subscribers: torori, cedric

Differential Revision: https://phab.enlightenment.org/D1767
2014-12-10 12:12:21 -05:00
Seunghun Lee fed49b9709 ecore-drm: restore VT to text mode when close tty.
Summary: if ecore-drm failed to be run after changing tty mode, need to restore VT to text mode.

Test Plan:
- run enlightenment(drm backend) without systemd.
after changing tty graphics mode, if it's failed to be run by any reason,
you'll see black screen and coulnd't control session.

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1764
2014-12-10 08:03:50 -05:00
Seunghun Lee 7ac4020874 ecore-drm: cleanup data when failed to setup tty.
Summary: added code to free string of tty's name when failed to setup tty.

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1763
2014-12-10 08:02:52 -05:00
Seunghun Lee 2f47d48d76 ecore-drm: close fd handle if _ecore_drm_tty_setup() is failed in ecore_drm_tty_open().
Summary: added code to close fd handle and clear data.

@fix

Test Plan: N/A

Reviewers: gwanglim, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1701
2014-11-26 09:02:02 -05:00
Chris Michael 61a6f5b8ae ecore-drm: Remove the FIXME note
Summary: Apparently, it's better if we just let this fail rather than
trying to be proactive for the API user.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-06 10:08:19 -04:00
Chris Michael cfea1e9322 Revert verifying anything passed in to the API.
Revert "ecore_drm: Verifying if name format is /dev/xyz before assigning to tty."

This reverts commit 5ebc31908e.
2014-10-06 10:07:22 -04:00
Chris Michael c644155ac6 Revert "ecore-drm: Fix formatting"
This reverts commit d4e4038e52.
2014-10-06 10:07:07 -04:00
Chris Michael d4e4038e52 ecore-drm: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-06 09:16:11 -04:00
Srivardhan Hebbar 5ebc31908e ecore_drm: Verifying if name format is /dev/xyz before assigning to tty.
Summary: Because this is an exposed API function, we should be
checking that the name parameter is valid, and also verify it's
formatting before we use it. This patch fixes that by comparing the
passed in name and assembling a valid tty name to open

@fix

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1521
2014-10-06 09:14:30 -04:00
Chris Michael 42a97a98c2 ecore-drm: Fix drm VT switching to work again
This commit fixes VT switching in the ecore_drm library code to work
again. Previously we were not dup'ing the stdin fd which lead to
inappropriate ioctls for that fd. Fix that by adding the missing dup
call. This also adds more error messages during ioctl function calls,
and cleans up the switching handler code (for keyboard events).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-15 15:45:31 -04:00
MinJeong Kim 96a83aecfa 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
2014-09-15 12:03:52 -04:00
Gwanglim Lee fb861fc236 ecore-drm: Remove duplicated tty fd check
Summary:
No need to check tty fd again as we just did that.
Remove this and adjust indent.

Test Plan: N/A

Reviewers: devilhorns, stefan_schmidt, raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1407
2014-09-04 09:43:53 +02:00
Chris Michael ff5bac5e6e ecore-drm: Fix trapping of SIGUSR1 for VT switching signals
SIGUSR1 is used here to catch VT switching and either acquire or
release the VT. The problem is that XWayland Also sends SIGUSR1 when
it has finished initializing. In order to not get confused about where
the SIGUSR1 came from we can check the pid inside the siginfo
structure and see if it matches.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-17 14:47:02 -04:00
Chris Michael 9c20a1b979 ecore-drm: Reenable setting the VT to graphics mode
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael fe7206d334 ecore-drm: Add API function to return the vt fd
@feature: Added API function to return the file descriptor from the
opened virtual terminal.

This is needed for use in ecore_evas. When it sets up the canvas, we
pass this fd to the canvas for use in setting up the vt framebuffers

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:30 +00:00
Chris Michael 3762e85c39 ecore-drm: Add Ecore_Drm code
@feature: Add Ecore_Drm library code for setting up drm card, outputs,
virtual terminals, framebuffers, and input for use with ecore_evas drm
code.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-06 10:57:26 +00:00