Commit Graph

404 Commits

Author SHA1 Message Date
Chris Michael 9b24d378a3 ecore-drm: Print error when taking control of a device fails
Summary: If we send a dbus blocking message, and it returns an error
then we should be printing out this error message

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-11 15:42:02 -05:00
Chris Michael ab2487037f ecore-drm: Disable/Enable inputs if we release/aquire VT through logind
Summary: Due to libinput processing events directly from evdev, we
need to disable/enable input events when we release/acquire the vt.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-11 14:51:44 -05: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
Mike Blumenkrantz c0683bc2dd ecore-drm should not use sscanf when getting logind vt
this should be more robust for when something like "/dev/tty4" is passed

@fix
2015-02-10 16:24:39 -05:00
Chris Michael 92954b707c ecore-drm: Remove unused variable
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-05 11:21:36 -05:00
Chris Michael 773897b09b ecore-drm: Fix issue with ecore_drm_output_crtc_Find sending back an
invalid id. Fix T2086

Summary: In order to avoid getting returned an invalid id, we should
not be checking the currently active encoder and crtc combination
because outputs may have changed, encoders/crtc combinations could
have changed, etc, etc.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-05 11:08:36 -05:00
Mike Blumenkrantz 11311bf01c ecore-drm should probably send the expected (reversed) scroll z value 2015-02-03 19:18:01 -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 559b7d7ee6 ecore-drm: Fix formatting
NB: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-02 11:46:50 -05:00
Chris Michael 8eb78df3bb ecore-drm: Remove session parameter for session take/release functions
The functions to take or release a session no longer accept session
name as a parameter, so fix calls to those functions

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:09 -05:00
Chris Michael 3b4a989892 ecore-drm: Remove unused function parameter
The session take/release functions no longer need the session name
paramater, so remove that.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:09 -05:00
Chris Michael c853181533 ecore-drm: Remove session parameter for internal function
The session take/release functions no longer require the name of the
session, so remove the function parameter

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:09 -05:00
Chris Michael bd41178fb0 ecore-drm: Remove logind header file
Summary: These functions have been moved to the private header file
now, and thus this file is no longer needed.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:09 -05:00
Chris Michael 3c62f4222c ecore-drm: Move session and vt fields to store inside the
Ecore_Drm_Device

Summary: This moves storing the session name and VT fields inside the
device structure. This also adds a field so we can store the keyboard
mode of the tty, and restore it on close.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -05:00
Chris Michael feff00178e ecore-drm: Cleanup private header file
Summary: This moves the logind function prototypes to the private
header and thus removes the need for a separate logind header file.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -05:00
Chris Michael 81a4731036 ecore-drm: Cleanup launcher code
Summary: This moves the VT switch handling code to the tty file, and
sets the proper flags on the VT when opened.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -05:00
Chris Michael c7d557cf4e ecore-drm: Fix various issues with logind code
Summary: This fixes a few issues with the logind code such as: Getting
the VT from systemd (if available), Properly setup the VT using proper
'open' flags, adding a 'restore' function to reset the tty properly,
and handle take/release session.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -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 bee13a55e1 ecore-drm: Default device->session to NULL
Summary: This sets the default session to NULL when a device is
created. Also a formatting fix

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -05:00
Chris Michael 5a62a760c0 ecore-drm: Store session name inside dev structure and don't
take/release session control inside dbus functions

Summary: These changes move the storage of session name to inside the
Ecore_Drm_Device structure and remove calls to take/release session
control to outside of the dbus code

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-26 08:37:08 -05:00
Chris Michael 205430ceb4 Revert "ecore-drm: Don't init tty unless we are Not using systemd"
This reverts commit 28e4901d04.

This broke vt switching in drm so revert (for now) until we get the
systemd vt and setup handlers
2015-01-19 12:55:50 -05:00
Chris Michael 28e4901d04 ecore-drm: Don't init tty unless we are Not using systemd
Summary: It turns out we don't need to handle open & setup of the tty
unless we are Not using systemd. This fixes an issue during
enlightenment restart where we are unable to reopen the tty.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-19 12:48:41 -05:00
Chris Michael 21b34d4d84 ecore-drm: Reset output cursor and crtc mode on shutdown
Summary: When we shutdown outputs, we should reset the hardware cursor
state and the saved crtc mode in order to reset things back to normal.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-19 12:48:41 -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
Chris Michael 90ffc57f0c ecore-drm: Limit mouse movement to within the output size
Summary: This patch adds support to limit the mouse from moving
outside the output dimensions, and fixes coordinate transformation
calls to use the Output from the Input device

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 10:35:52 -05:00
Chris Michael 30506f0d6d ecore-drm: Remove call to unused function
Summary: This just removes the call to the no longer used/needed
function to update the input device's view of the output.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 10:35:52 -05:00
Chris Michael 79a09007bc ecore-drm: Remove unused function
Summary: Since we now have a reference to the actual output inside the
input device, we no longer need this function to update the Input
device's view of the output size.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 10:35:52 -05:00
Chris Michael 2eb0be048b ecore-drm: Add actual Outut to the Input device structure
Summary: This adds an actual Ecore_Drm_Output pointer to the
Ecore_Drm_Evdev structure so we can check the output size to limit
mouse corrdinates.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 10:35:52 -05:00
Chris Michael e2a9988e5e ecore-drm: Fix issue with TakeControl and ReleaseControl functions
Summary: The dbus calls to TakeControl and ReleaseControl of a session
are actual Methods that need to be setup and called in order to
operate properly. As such, this commit fixes that issue by using the
proper eldbus method calls, and fixes an issue where shutting down
Enlightenment would lead to "cannot release control" error messages.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-06 13:01:31 -05:00
Chris Michael 32a7eecf50 ecore-drm: Fix incorrect launcher shutdown procedure
Summary: We need to clean tty handlers and close the tty Before we can
call logind_disconnect as that function ends up shuttting down our
dbus connection.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-06 11:12:54 -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
Chris Michael 0b77b7f59f ecore-drm: Free devices before we release the libinput reference
Summary: When destroying evdev devices, we make calls to
libinput_device_unref ... but we cannot Make that call if the libinput
context has been destroyed already (as happens when we free input). So
to fix, don't release the libinput context until all devices have been
released.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 14:26:52 -05:00
Chris Michael 6972d25dc9 ecore-drm: Don't declare sprite variable unless we need it, also fix
some formatting.

Summary: This commit saves from declaring variable for
Ecore_Drm_Sprite unless we are going inactive and need to iterate
sprites. (and also fixes some formatting)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:17:37 -05:00
Chris Michael d800e81d83 ecore-drm: Fix formatting
Summary: No functional changes, just formatting fixes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:14:25 -05:00
Chris Michael 7fbe17f5c4 ecore-drm: Fix formatting
Summary: No functional changes, just formatting fixes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:13:33 -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
Chris Michael 5d767aff32 ecore-drm: Finish implementing touch events
Summary: This fixes the touch events to actually send button down/up
when the proper touch event occurs

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:59 -05:00
Chris Michael 9980082c6a ecore-drm: Also update device calibration when output size changes
Summary: When the output size gets updated, it could end up changing
the device calibration (wrt input event transformation), so we should
update the device calibration also

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:59 -05:00
Chris Michael ea417ef9de ecore-drm: Comment out debug line for unhandled touch_frame event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael d3d5c80ad6 ecore-drm: Update pointer motion event coordinates
Summary: This fixes pointer motion events to be transformed based on
output coordinates

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael ed12acbfc6 ecore-drm: Transform touch events into output coordinates
Summary: This updates touch events to be transformed into output
coordinates

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael ce473d88a1 ecore-drm: Add internal function to set the output size in the input
device structure

Summary: This is used to update all input devices as to the new output
size so that input device events can get their coordinates transformed
into output coords

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael 64e005503b ecore-drm: Update input devices with new output size
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael ff13e2d88d ecore-drm: Add output size to device structure and add internal
function for setting size

Summary: This is needed so that events for mouse, touch, etc can get
transformed into output coordinates

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael 080ef1d984 ecore-drm: Fix formatting
Summary: No functional changes, just formatting fixes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael 7552bccc35 ecore-drm: Fix usage of EINA_LIST_FREE
Summary: When we exit the backlight_init function, we should
stringshare_del the returned device strings from eeze properly

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael e0864520d7 ecore-drm: Fix formatting
Summary: No functional changes, just fixing formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael 011b2a36af ecore-drm: Handle various touch events
Summary: This adds code to handle various touch events (up, down,
motion) so that touchscreen devices can work with ecore_drm.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael 893297e6f7 ecore-drm: Remove libinput log print callback
Summary: This was causing crashes in libinput when trying to print out
via eina_log. Disable/Remove it. Let libinput print it's own logs.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Seunghun Lee 2e977a1e50 ecore-drm: fix passing wrong argument to open().
Summary: remove unintended argument.

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1765
2014-12-10 08:04:38 -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
kabeer khan 8b573930c7 ecore_drm: Removed unused variables in ecore_drm_evdev
Summary: Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1762
2014-12-10 08:01:39 -05:00
Seunghun Lee 31ac7989d4 ecore-drm: Added cleanup data code as a error handling of connect logind.
Summary: need to clean also dbus, when failed open VT as a connection progress of logind.

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1756
2014-12-10 08:00:23 -05:00
Chris Michael a138716746 ecore-drm: Fix formatting.
Summary: No functional changes, just formatting fixes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 07:59:10 -05:00
Carsten Haitzler 407f7bbb0b ecoreodrm - fix build if systemd is not enabled 2014-12-10 08:54:02 +09:00
Chris Michael 33e3e9c8a2 ecore-drm: Port ecore_drm to use libinput
Summary: This ports the input code of ecore_drm to make use of
libinput for handling of devices, events, etc

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 15:13:49 -05:00
Chris Michael a5654dbb24 ecore-drm: Fix ecore_drm_launcher_device_close to not cause segfaults
Summary: We can only call _ecore_drm_logind_device_close if we have an
actual device string. It is possible that this Could get called with
NULL, and thus cause a crash.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 15:12:36 -05:00
Chris Michael 7da19b4c21 ecore-drm: Cleanup structures in private header
Summary: With the port to libinput, some fields in the input & evdev
structures are not needed anymore, so this commit cleans those up.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 15:11:46 -05:00
Chris Michael 6eb10cd701 ecore-drm: Include libinput header in drm private header
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 10:00:29 -05:00
Chris Michael 29856509bf ecore-drm: Fix formatting
Summary: No functional changes, just fixing formatting

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 09:52:24 -05:00
Chris Michael 9f0e5ae57c ecore-drm: Fix error message typo
Summary: This just fixes a typo in the error message string

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 09:50:59 -05:00
Seunghun Lee b10ab1a86f ecore-drm: added drm launcher that is allow to determine whether to launch with logind or root privilege.
Summary:
- allow to launch drm backend without systemd-logind with root privilege.
- allow to open drm device node via logind, not directly open it, in case exist systemd-logind.
- fixes issue that couldn't switch session, because ecore-drm couldn't drop master to drm device with no permission. (allow to switch session appropriate.)

Reviewers: gwanglim, devilhorns

Subscribers: torori, cedric

Differential Revision: https://phab.enlightenment.org/D1704
2014-12-09 09:36:42 -05:00
Chris Michael 574919ef31 ecore-drm: Remove erroneous debug messages
Summary: No real function changes, just some cleanup of old debug
messages

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-03 14:18:52 -05:00
Seunghun Lee 0482a0e686 ecore-drm: pass appropriate arguments to eldbus_message_arguments_get(), so that it can be return as success in _cb_device_resumed().
Summary: it seems eldbus_message_arguments_get() should be received all arguments to return success.

@fix

Reviewers: devilhorns, gwanglim

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1703
2014-11-26 10:31:52 -05:00
Chris Michael 5106ab900b ecore-drm: Fixup formatting from D1696 patch
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-11-26 09:08:55 -05:00
kabeer khan bacc082418 ecore-drm: Sending Active to login1.Session
Summary:
Resolved TODO to set Active and State property of login1.Session
Set Active = true and State = 'active' via eldbus_proxy_property_set

@fix

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1696
2014-11-26 09:08:00 -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
Seunghun Lee fe4bb3901c ecore-drm: remove unnecessary setting file's flag of O_RDWR that are ignored.
Summary: setting flag of O_RDWR by F_SETFL is no effect. it's ignored.

@fix

Reviewers: gwanglim, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1695
2014-11-26 08:59:41 -05:00
Carsten Haitzler e962827ef2 ecore drm - comment out unused code to reduce warnings
several brightness functions in ecore drm are unused - comment them
out until they are needed.
2014-11-25 17:01:36 +09:00
Seunghun Lee b2b81f2cd4 ecore-drm: fix error check of _device_flags_set function
Summary: the function return -1 if it's failed so checking for ! is
incorrect. We should check if the return is less than zero.

@fix

Reviewers: gwanglim, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1682
2014-11-21 09:18:36 -05:00
vivek 6e5a4a7156 ecore_drm: Added internal function for drm output updates when device is hotplug
Summary:
Added internal function _ecore_drm_update_outputs which will update the
outputs if the drm device is hotplug

@fix

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1565
2014-11-12 08:31:02 -05:00
Chris Michael f4ba6fdc2d ecore-drm: Remove dead functions
Summary: These functions were never exposed via API/Header, and never
used internally. Since drm gbm stuff is handled inside the gl_drm evas
engine now, we don't need this code here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-30 09:36:48 -04:00
Chris Michael 6140c99541 ecore-drm: Remove commented out dead functions
Summary: These functions were never exposed in the header, and were
also already commented out. This commit just removes the dead comments.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-30 09:36:48 -04:00
Srivardhan Hebbar 399c571ab6 ecoreidrm: Cleaned up unwanted code.
Summary: Cleaned up all unwanted code's in ecore_drm. This just
removes a bunch of already commented out code.

@fix

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

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1615
2014-10-30 09:36:21 -04:00
Stefan Schmidt cc6aebc916 ecore_drm: Silence warnings about unused parameters. 2014-10-29 16:00:28 +01:00
Chris Michael 3341692acf ecore-drm: Add error message for calling shutdown without calling init
first.

Summary: If someone calls ecore_drm_shutdown without first calling
ecore_drm_init, then the init count is wrong. Warn the caller.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-23 10:32:59 -04:00
Srivardhan Hebbar 7b1f4c09b9 ecore_drm: Making _ecore_drm_init_count not to go below zero in _ecore_drm_shutdown.
Summary:
If _ecore_drm_init_count goes below zero, then when next time ecore_drm_init is called, it won't do the initializations which it is supposed to do. So preventing this scenario by not making it go
below zero in _ecore_wl_shutdown function.

@fix

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

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1573
2014-10-23 09:04:55 -04:00
vivek cd1bc17c1b ecore-drm: Added documentation for various APIs in ecore_drm_output module
Summary:
Added documentation for ecore_drm_outputs_create, ecore_drm_output_free,
ecore_drm_output_cursor_size_set, ecore_drm_output_size_get functions

@fix

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1572
2014-10-23 08:52:43 -04:00
vivek 0446fd2d7f ecore-drm: Added documentation for various APIs in ecore_drm_device module
Summary:
Added documentation for ecore_drm_device_fd_get, ecore_drm_device_window_set
and ecore_drm_device_name_get APIs in ecore_drm_device module.

@fix

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1568
2014-10-23 08:31:47 -04:00
Chris Michael dae6bcb62d ecore-drm: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-23 08:28:56 -04:00
vivek 221c79dc87 ecore-drm: Cleanup backlight and drm device in output_free function code
Summary:
Added code to cleanup backlight structure and to close the drm device and
delete it.

@fix

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1566
2014-10-23 08:28:45 -04:00
Chris Michael bab8379248 ecore-drm: Check for valid crtc before calling free
Summary: We cannot call drmModeFreeCrtc with an invalid crtc, so check
that it is set inside the output structure before trying to make this
call

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-22 09:24:14 -04:00
Chris Michael 826d6f1bc2 ecore-drm: Cleanup/Unify output_free function code
Summary: There is no point in having different code in each output
free function (internal one and API exposed one), so let's unify the
code here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-22 09:24:14 -04:00
vivek 2a9272333f ecore_drm: Added internal function to check if drm device is hotplug device
Summary:
Added _ecore_drm_output_device_is_hotplug API to check if the
drm device is hotplug device. It returns EINA_TRUE if device is
hotplug else returns EINA_FALSE

@feature

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1559
2014-10-22 08:14:42 -04:00
Chris Michael 8549ee799a ecore-drm: Create udev watch for each output, and delete the watch
when we free the output.

Summary: This commit fixes an issue where a hotplug watch was Only
being added for One input, and also deletes any created watch during
output_free.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-21 08:26:25 -04:00
Chris Michael 6cf9246ad6 ecore-drm: Default output to NULL and add safety check for NULL output
after the device loop.

Summary: If there are no outputs created during the loop, we would end
up crashing here by checking output->watch. This fixes that situation
without leaking resources because we still end up doing our cleanup.

NB: Thanks Cedric for the report !! :)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-21 08:18:34 -04:00
Chris Michael 845dbaf7da ecore-drm: Remove useless return
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-20 10:17:08 -04:00
vivek 0fb11c15a1 ecore-drm: Added initial support to check if drm device is hotplug and update outputs
Summary:
Added watch to check if drm output device is hotplug and update the
outputs accordingly.

NB: This is only partially complete. The actual update of outputs
still needs to be implemented.

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1552
2014-10-20 10:16:32 -04:00
Chris Michael 7135d1967d ecore-drm: Fix drm cards on ARM platform not having boot_vga parameter
Summary:
On some ARM platforms, the drivers do not list boot_vga as an
attribute, so we cannot do checks for that. This patch fixes finding
drm cards on those platforms by skipping the boot_vga check if we had
to use "platform" to find it.

Thanks to shiin for the report :)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-08 10:06:45 -04:00
Chris Michael 1c77bdf2d1 ecore-drm: Fix failure of finding drm device on ARM platforms.
Summary:
On some ARM platforms we were failing to find the drm device card.
This was due to those ARM platforms using SUBSYSTEM="platform" as a
udev attribute instead of "pci". This fixes that issue so that those
devices are found again.

Thanks to shiin for the report :)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-08 09:31:37 -04: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
Srivardhan Hebbar dee101b08f ecore_drm: Removed unwanted FIXME line.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1520
2014-10-06 08:41:38 -04:00
Srivardhan Hebbar 56f3d4cadf ecore_drm: Removed hard coded seat value.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1519
2014-10-06 08:32:01 -04:00
vivek 4125f1cef9 ecore-drm: Added private function to cleanup backlight structure
Summary:
Added _ecore_drm_output_backlight_shutdown function to clean up
the resources related to backlight structure and initialized backlight structure
in _ecore_drm_output_create.

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1501
2014-09-29 09:28:58 -04:00
vivek 9b84f98e27 ecore-drm: Added internal function to set output brightness level
Summary:
Added _ecore_drm_output_brightness_set function to set brightness level

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1499
2014-09-29 08:52:39 -04:00
vivek 4d54525d47 ecore-drm: Fix _device_add function to check input
Summary:
Add condition to check if input is NULL in _device_add function

@fix

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1493
2014-09-26 09:04:53 -04:00
Chris Michael 2bc462f55b ecore-drm: Don't crash if we get no devpath from Eeze
Summary: During a device remove event, we should check that Eeze has
returned us a devpath to remove else we segfault when trying to strcmp
the device path later during actual remove.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-25 12:04:23 -04:00
Chris Michael 44e2cde623 ecore-drm: Add some more debug information if a device fails to open
Summary: This is mainly for debugging, but lets print out a bit more
information if a device fails to open.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-25 11:46:46 -04:00
Chris Michael b81cafcd7b ecore-drm: Fix adding an input device when we don't get the devpath
from Eeze.

Summary: If we fail to get a devpath from Eeze for an input device,
then we need to error out gracefully and not add a failed input device.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-25 11:36:24 -04:00
Chris Michael 157c0598ed ecore-drm: Add an extra blank line just to separate code
Summary: This commit has no functional changes, just
cosmetic/formatting to make the code easier to read.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-24 10:03:47 -04:00
vivek af6cb4e84a ecore-drm: Added private functions to get brightness levels in backlight
Summary:
 Added private internal functions to get various brightness levels
   1) Added _ecore_drm_actual_brightness_get to get Actual brightness
   2) Added _ecore_drm_max_brightness_get to get Max brightness
   3) Added _ecore_drm_brightness_get to get Brightness
 These functions will eventually be exposed with an API for ecore-drm
to get/set the backlight level for an output.

@feature

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1482
2014-09-24 10:02:37 -04:00
Chris Michael e3c3ba4811 ecore-drm: Remove need to use an extra variable for storing device.
Summary: This commit just modifies the internal code to remove the
need for an extra variable. There really is no need to store the
device twice. We already have it in the list of returned devices.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-24 09:06:47 -04:00
Chris Michael e19fbbcd45 ecore-drm: Port ecore_drm_output backlight init code to use Eeze
Summary: This ports the current backlight_init code to use Eeze
library instead of udev functions directly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:47:04 -04:00
Chris Michael a0395b07c5 ecore-drm: Port ecore_drm_inputs code to use Eeze instead of udev
Summary: This changes all of our internal ecore-drm input code to use
Eeze library instead of udev directly.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael 777e64fea5 ecore-drm: Remove udev from private header and add an Eeze_Udev_Watch
for Ecore_Drm_Input

Summary: This commit removes all references to 'udev' in the private
header, and replaces udev_monitor (in Ecore_Drm_Input structure) with
an Eeze_Udev_Watch.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael f16e061685 ecore-drm: Fix ecore_drm_device_find function to use Eeze
Summary: This converts the internal code of ecore_drm_device_find
function to use Eeze function calls instead of udev in order to locate
the drm card.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael 16d8352ebe ecore-drm: Remove references to udev functions and init Eeze during
startup

Summary: This removes the variable & function calls to udev and adds
code to initialize/shutdown Eeze.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael 9228a6ac6b ecore-drm: Fix comment to not mention udev
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael e35f3414d1 ecore-drm: Add Eeze as an internal dependency for ecore-drm
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael 368e9de044 ecore-drm: Remove internal dependency on libudev
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 15:31:12 -04:00
Chris Michael 0f24804c1a ecore-drm: Fix minor formatting issue
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-23 08:41:43 -04:00
vivek 05ea3edda5 Ecore_drm: Added initial support for backlight in ecore_drm module
Summary:
Added initial support for backlight in drm by adding various structures
and provided api for initializing the backlight struct.

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns, stefan_schmidt

Subscribers: stefan_schmidt, cedric

Differential Revision: https://phab.enlightenment.org/D1448
2014-09-23 08:41:43 -04:00
Chris Michael 8490f5d282 ecore-drm: Rework internal dbus code to use Eldbus
Summary: This changes all of our internal dbus code for ecore-drm to
work with async Eldbus calls. This adds a potential delay to startup
in that input devices may not be immediately available for use, but is
unavoidable due to Eldbus not having a dbus function call to block for
a reply.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 15:57:12 -04:00
Chris Michael 500491069f ecore-drm: Rework input code to function with Eldbus
Summary: Eldbus runs async so we needed to rework the internal input
code to function with it. This commit changes the iternal code to
issue a device open, and then wait for Eldbus to return us a callback
from the proxy that the device open is finished. This Does add a delay
during startup (which means devices will not always be immediately
ready for use) but thus is the nature of Eldbus.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 15:54:37 -04:00
Chris Michael 21fe5e6eab ecore-drm: Fix some error/warn message formatting
NB: Nothing functional here, just alignment of error messages in output.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 15:44:50 -04:00
Chris Michael c60b348803 ecore-drm: Fix private function prototypes for new dbus functions
Summary: In porting Ecore_Drm to use Eldbus, I had to change some
internal functions to work with the async nature of Eldbus. As a
result, I had to modify some private local functions.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 15:43:37 -04:00
Chris Michael 6e384f2a87 ecore-drm: Include config.h in private header
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 14:18:53 -04:00
Chris Michael 29a3482704 ecore-drm: Add Eldbus header to private header file
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 14:18:53 -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
Chris Michael d91e607dd6 ecore-drm: Fix missing close of fd on _device_add
If we failed to create an evdev device for an input, we should also be
closing the fd before we return

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-15 15:43:14 -04:00
Chris Michael cc23711651 ecore-drm: Close input device fd on error during open and fix some
todo messages

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-15 15:42:26 -04:00
Chris Michael 20e97d07a3 ecore-drm: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-15 14:32:49 -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
Chris Michael f76180a501 ecore-drm: Add API function to get screen geometry
This adds a function that we can call from ecore_evas to get the
screen_geometry

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-04 11:18:23 -04:00
Chris Michael b59b3016e8 ecore-drm: Add API function for getting screen geometry
This adds an API function that we can call to return the screen
geometry. This will be used from ecore_evas to get the screen_geometry.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-04 11:18:23 -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
Stefan Schmidt a941d9c2fd ecore/drm: Remove another leftover from dead spartacus 2014-09-02 11:45:02 +02:00
Stefan Schmidt a6178c13e9 ecore/drm: Fix typo in comment 2014-08-29 15:55:37 +02:00
Chris Michael 4fe1475b7f ecore-drm: Fix copy/paste build error
This line should not have been pasted (and it breaks build)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-28 15:55:05 -04:00
Chris Michael 41147645d7 ecore-drm: Add local function to free outputs and on any errors during
create, call it

Basically, this will fix a potential leak (and a potential case of a
false output getting added) IF during creation of outputs, something
fails.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-28 15:41:33 -04:00
Chris Michael 80c0a33267 ecore-drm: Print out failed device name during setup
If we fail to setup an input device, let's print an error With the
device name also

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-28 12:13:18 -04:00
Stefan Schmidt d8fb36e791 ecore/drm: Remove unused enums now that spartacus is gone 2014-08-28 17:56:04 +02:00
Stefan Schmidt 37d20553bd ecore_drm_dbus: Do not use the same name for global and local variables
We use conn here for a global Dbus connection variable as well as sometimes
in a local scope. Better rename the global one to avoid confusion and
potential failures when the code would fallback to the global one even if
the local scope should be used and the var was simply forgotten.
2014-08-13 14:06:18 +02:00
MinJeong Kim 0e4fd1b4d1 ecore-drm: implement function to disable ecore drm inputs on vt
switching

Summary:
When vt is released by SIGUSR1, drm_inputs have to be disabled.
For that this revision includes,
    1. Unrefer udev monitor
    2. Remove fd handler for udev monitor
    3. Release dbus device

Reviewers: stefan_schmidt, devilhorns, gwanglim

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1268
2014-08-04 08:50:40 -04:00
Chris Michael 0001b65783 ecore-drm: Fix improper shutdown for error cases in ecore_drm_init
If an error occurs during ecore_drm_init, we need to cleanup things in
the proper order. This fixes the case where ecore_event_shutdown and
ecore_shutdown May Not have been called (in previous revision) due to
the error conditions being out of order.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-24 11:33:21 -04: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 d1c583d30c ecore-drm: Reduce debug noise
As input is sorted out here (for now), we don't need to be so noisy
and printout extra debug stuff

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-17 12:56: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 c043021397 ecore-drm: Cleanup ecore_drm_input code to add/remove devices
This removes calls to the ecore_drm slave binary, and makes use of our
new dbus function calls to open an input device

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael 87049f9124 ecore-drm: When we destroy any evdev device, also close the associated
fd.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael 24ed704c8c ecore-drm: Fix ecore_drm_device calls to drop & set drm master
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael be325af372 ecore-drm: Add ecore_drm_dbus file for dbus functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael 61070f779f ecore-drm: Cleanup ecore_drm init/shutdown functions
As we don't need to spawn the suid binary anymore, we can remove all
the old code that was doing socketpair, passing messages, etc, etc.
Replace with proper ecore_drm_dbus function calls.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael e711a294b2 ecore-drm: Remove eldbus header and add dbus header
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael 121be16f3a ecore-drm: Cleanup ecore_drm private header
Remove support for logging to a file.
Fix ecore_drm_dbus function prototypes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:44:14 -04:00
Chris Michael 6935c4febd ecore-drm: Add necessary headers for dbus and systemd-login
This feature allows us to open input devices and receive events from
them as a normal user without the need for special input device
permissions, or the need for a slave suid binary.

NB: This will only wor with dbus & systemd support

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-15 09:43:12 -04:00
Chris Michael 5eef4351fd ecore-drm: Shutdown ecore_event on udev error.
Since we have already called ecore_event_init prior to using any udev
functions, if udev fails for some reason or another, we should also
shutdown ecore_event subsystem.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-06 12:58:57 -04:00
Chris Michael e1e8859aa0 ecore-drm: Fix formatting from a7428edeb4
Fix horrible formatting before it gets too far...
Bad Stefan, no cookie ;)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-07-01 10:59:31 -04:00
Stefan Schmidt a7428edeb4 ecore_drm: Check for currently used CRTC first before searching others
If we have a CRTC already configured save the work to search for a new
crtc and encoder combination that works with this connector. Just use what
we have.

Also always check if the CRTC is already allocated for a different connection
before using it.
2014-07-01 15:10:00 +02:00
Stefan Schmidt 5a9e47d0fd ecore_drm: Make struct Ecore_Drm_Device available
Allow the struct to be used by other parts and not only ecore_drm.
This is needed to use ecore_drm in the evas drm engine.
2014-06-30 10:13:43 +02:00
Stefan Schmidt d27996ef23 ecore_drm: Test drm device for DUMB BUFFER capability
Without this we can't do software rendering on the DRM device.
2014-06-30 10:13:43 +02:00
Stefan Schmidt 017f2d34b5 ecore_drm: Use CLOEXEC option when openning drm device 2014-06-30 10:13:42 +02:00
Stefan Schmidt 4c0f9da2b9 ecore_drm: Iterate over all available connectors not just the first
Maybe this was here for some debugging? It does not make any sense though
to loop over all connectors but break out of the loop after the first run.
2014-06-30 10:13:42 +02:00
Chris Michael 2ebafca848 ecore-drm: remove unnecessary extra variable.
We can assign the result of these calculations directly, so remove the
extra integer.

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2014-06-06 11:52:58 -04:00
Chris Michael 17ac41ad06 ecore-drm: don't declare w & h integers if we don't need them.
We only use w & h if one of the dev->abs.rel_* axis values are less
than zero, so let's not declare integers that we May not use until we
need them.

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2014-06-06 11:47:33 -04:00
Chris Michael e5656ce0e7 ecore-drm: Fix formatting issues from D933 patch
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2014-06-06 11:46:45 -04:00
Moritz Bitsch 78737a9696 ecore-drm: implement multitouch support
Summary: Support for type B touch devices, tested with egalax_ts compatible touchscreen.

Reviewers: devilhorns

Reviewed By: devilhorns

CC: cedric

Differential Revision: https://phab.enlightenment.org/D933
2014-06-06 11:40:33 -04:00
Moritz Bitsch 2d3ecfa20c ecore-drm: convert compose string into utf8
Summary:
	Key event string encoding was LATIN1 instead of UTF-8.
	This unifies the handling with the x backend.

Reviewers: raster

Reviewed By: raster

CC: cedric

Differential Revision: https://phab.enlightenment.org/D912
2014-05-29 11:33:20 +09:00
Chris Michael cd5f8d0d25 ecore-drm: Send proper keycode to ecore key event, and remove
erroneous variable.

@bugfix: Since later functions which process the ecore key event will
end up subtracting X's broken keycode values from This original
keycode value, we had better send the proper code with the offset
already added.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-05-12 13:55:02 +01:00
Jérémy Zurcher 9a79d1e864 silence a few warnings 2014-05-08 00:15:53 +02:00
Gwanglim Lee ca443ac152 Fixed a problem with e wl server that sent invalid key value to wl client.
Summary:
This problem occurred due to xkb_keysym_t value of libxkbcommon by e wl server.
e wl server should pass keycode from evdev input device on to wl client.
In order that e wl server receives valid keycode Ecore_Event_Key should have
an extended data member. This patch should be applied with server side patch.

@fix

Test Plan: run e wl server -> create wl client -> type keys

Reviewers: raster, devilhorns, zmike

CC: cedric

Differential Revision: https://phab.enlightenment.org/D712
2014-04-14 09:41:43 -04:00
Chris Michael a93cd29847 ecore-drm: Fix mouse wheel to not be inverted
@bugfix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-04-01 07:09:49 +01:00
Chris Michael bba98a515c ecore-drm: Add API function for getting size of an output.
@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-04-01 07:09:49 +01:00
Carsten Haitzler 4da1081c4d drm - shut up warnings (not actual bugs) 2014-03-22 19:12:07 +09:00
Chris Michael b87cbf8fe4 ecore-drm: Fix absolute motion coordinate calculation
@bugfix: When calculating center point for absolute motion, use the
proper min_y value for calculating Y axis

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-20 07:15:23 +00:00
Stefan Schmidt 897b70437f evas/engine/drm: Avoid shadow of a function parameter
Having the same name for a parameter as well as a local var name could
cause quite some problems. Better avoid it.
2014-03-19 16:16:55 +01:00
zmike beff8db14e ecore drm now semi-supports absolute motion (touchpads!)
this is a little bit sensitive. you have been warned
2014-03-18 17:53:32 -04:00
Mike Blumenkrantz 2aabdb8f48 ecore drm evdev probably shouldn't treat my touchpad as a keyboard (BTN_TOOL_FINGER)
this is pretty insane and likely needs more competent/reliable handling
2014-03-18 16:12:58 -04:00
Mike Blumenkrantz 34acd14563 ecore-drm fails with appropriate error message on failing to open input 2014-03-18 14:24:06 -04:00
Chris Michael 0368c4e194 ecore-drm: Fix ecore_drm_device_window_set to use an unsigned int
@fix: The majority of ecore_evas code expects that the 'window' returned
from ecore_evas_window_get be an Ecore_Window. Previously, this was
not possible as this function was using a void pointer. This change
fixes that issue.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-18 09:12:57 +00:00
Jeff Grimshaw 9ff9faae70 ecore_drm: fix Doxygen markup to prevent warnings.
Summary:
These files are missing group titles on the @defgroup line.  Added the titles so Doxygen does not
complain.

Test Plan: make doc 2> doc/doxyerr.log

CC: cedric

Differential Revision: https://phab.enlightenment.org/D612

Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2014-03-15 20:04:24 +09:00
Chris Michael 05e4ba0027 ecore-drm: Set sprite output to NULL by default
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-13 08:15:13 +00:00
Chris Michael 5e7d52dfad ecore-drm: Remove dead commented line
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-13 08:15:13 +00:00
Chris Michael 722704c32c ecore-drm: Remove debug message for key repeat events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-13 08:15:13 +00:00
Chris Michael 2f3082df66 ecore-drm: Quiet down ecore_drm_output rendering messages
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-12 10:41:57 +00:00
Chris Michael c48fc5155a ecore-drm: Fix doxygen group for sprites
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-12 10:30:33 +00:00
Chris Michael bdf00c28b7 ecore-drm: Add API function to return the drm device name
@feature: Add new API function to return the drm device name

NB: This will be used in the ecore_evas_drm code to set the
ecore_evas->name.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-12 09:27:44 +00:00
Chris Michael 7d8059e4c5 ecore-drm: Add code to handle mouse input
@feature: Add support in ecore-drm for handling mouse movement, wheel,
and buttons.

This adds code to pass mouse events from linux input to ecore by
raising ecore_events (ecore_event_add).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-11 08:44:46 +00:00
Chris Michael 8fe9adead1 ecore-drm: Add private structure to store mouse information in evdev
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-11 08:44:46 +00:00
Chris Michael ee5caf9016 ecore-drm: Reset modifiers to zero before updating them on keypress
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 13:44:29 +00:00
Chris Michael c0894f4810 ecore-drm: Remove FIXME comment
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 13:38:01 +00:00
Chris Michael f667f70db9 ecore-drm: Add code to handle modifiers in a key event
@feature: Add handling of modifiers in a drm key event

This adds code to deal with modifiers being pressed/released during a
key event and pass those along to the ecore_event structure

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 13:33:23 +00:00
Chris Michael 71e3e63dfd ecore-drm: Add private xkb fields for depressed, latched, locked, and
group

This adds fields to the xkb structure for storing when modifiers are
pressed, released, etc so we can handle those in key events.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 13:33:22 +00:00
Chris Michael 2a36446402 ecore-drm: Set the window of the Ecore_Event_Key structure
@feature: Add keyboard event processing for ecore-drm

When we get a key event from evdev and create an Ecore_Event_Key to
pass along, we need to set the window where this event occured.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:31 +00:00
Chris Michael 42ed617302 ecore-drm: Add API function to set the window we should send events
too.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:31 +00:00
Chris Michael 5ffa7cd23f ecore-drm: Add private window field to drm device structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:31 +00:00
Chris Michael 90551ff49c ecore-drm: Add code pass along key events to ecore_event
@feature: Add keyboard input handling to ecore-drm library

This adds code to ecore_drm library to process keyboard events and
pass them to ecore_event so that ecore_evas can receive keyboard input

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:31 +00:00
Chris Michael 739da9956e ecore-drm: Create xkb context on device open
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:31 +00:00
Chris Michael 0b1cc3a17c ecore-drm: Add xkb fields to Evdev structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:31 +00:00
Chris Michael 2aa64616cb ecore-drm: Add xkbcontext to device structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:30 +00:00
Chris Michael 3b5b60be45 ecore-drm: Add xkbcommon header
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:30 +00:00
Chris Michael 337a18a5dd ecore-drm: Initialize ecore_event on ecore_drm_init
@bugfix: Initialize ecore_event on ecore_drm_init

We need to make sure ecore_event_init has been called so we can
process events for ecore_evas.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-10 12:40:30 +00: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 8e30a4eeab ecore-drm: Add missing EINA_UNUSED for unused function paramaters.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-06 11:12:23 +00:00
Chris Michael d7f69ba826 ecore-drm: Comment out Gbm Format
@bugfix: This fixes ecore-drm building since we commented out all the
hardware accel support (for now).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-06 11:10:26 +00:00
Chris Michael ea8ce66709 ecore-drm: Add missing define
@bugfix: Add missing define for number of framebuffers

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-06 11:08:55 +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