Commit Graph

46 Commits

Author SHA1 Message Date
Derek Foreman 8ff59b2c55 ecore_drm2: Pass Ecore_Drm2_Device instead of fd to most functions
Intended to simplify the upcoming commit that merges device find and
device open into a single function that returns a device.

The fd is something callers shouldn't really need to get their hands on,
right now there are still a few places where it's needed, but those will
be gone soon too.
2017-08-09 14:56:58 -05:00
Derek Foreman bc5ebd0a20 ecore_drm2: Fix linker problems
Accidentally used functions in the library directly instead of through
the sym_* dlsym looked-up variants.

Why this only caused problems in some installations may still be worth
investigating - we may be pulling in libdrm at link time from some
other library?
2017-08-04 12:13:40 -05:00
Derek Foreman 414d406b3b ecore_drm2: Ensure device we find can mode set
Some systems have dri devices that can't mode set, and if they're first in
the directory they'll get picked by our code and things fall apart later.

So, open the potential device and ensure it has basic functionality before
selecting it.

This is a little inefficient as it gets the device via elput twice before
it can be used - this will be addressed later as the changes are a little
more invasive to optimize.
2017-07-21 16:46:00 -05:00
Derek Foreman 57e826db69 ecore_drm2: Open elput manager before drm device
We're going to need to access the device as part of the find process,
so we need a manager.
2017-07-21 16:46:00 -05:00
Chris Michael bbd18510d6 ecore-drm2: Remove #ifdef HAVE_ATOMIC_DRM
As we now use static_libs/libdrm for compiling ecore-drm2, we can
remove the atomic #ifdefs as we can run-time check this now.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-09 14:20:05 -04:00
Chris Michael b7c7ce4ce0 ecore-drm2: Add API function to set pointer rotation
This patch adds a new API function which can be used to swap x & y
pointer axis and invert them according to rotation angle. Mouse input
events occur according to canvas coordinates so this can be used when
a canvas is rotated.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:03:36 -04:00
Derek Foreman 280c82fdd4 ecore_drm2: Don't try to disable all devices when session deactivates
We get this callback after we've lost the drm device to logind, so
deactivating stuff here will just generate a lot of ERR messages
and break our internal book-keeping.

Instead, we just turn on DPMS on session activation instead of trying
to go through the output enable path (that will bail if it's already
enabled)

This could potentially result in a display that's enabled and DPMS
off being switched back on during session activation - if that's a real
problem we can restore the previous dpms state instead...

@fix T5483
2017-06-02 15:50:09 -05:00
Chris Michael bd189f69f2 ecore-drm2: Don't fill device atomic state if atomic is disabled
If atomic support is disabled (via kernel or env var), then we do not
need to fill device atomic state as it will not be used anyway.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-30 11:01:22 -04:00
Mike Blumenkrantz 737f64b822 ecore-drm2: simplify output name checking on device change
eina_streq handles null and stringshare params
2017-05-26 16:27:43 -04:00
Mike Blumenkrantz b09c6f1f3e elput: start elput_device_ and elput_seat_ namespaces, rename some functions 2017-05-26 16:27:43 -04:00
Mike Blumenkrantz e8fe0bcc47 elput/drm: redo xkb context/keymap setting
context and keymap need to be set at the same time in order to effectively
update keyboard state, and active group should be accessible through api
as well

preserve old function ABI to ensure old binaries don't crash
2017-05-26 16:27:42 -04:00
Derek Foreman 950df19c67 ecore_drm2: Add an env var to disable atomic pageflips
Allows testing non-atomic paths without a reboot or a rebuild.
2017-05-05 12:53:21 -05:00
Chris Michael 03cb02fa74 ecore-drm2: Remove newly added atomic API functions
As we need to do atomic commits on a per-output basis, these 2 newly
added API functions can go because these functions did one atomic
commit for all outputs

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael f07f2e6e4e ecore-drm2: Enable filling state structures without atomic support
This commit enables the ability to fill our state structures even if
atomic support is not enabled. This will allow us to reuse those state
structures for dealing with pageflip in both the atomic & non-atomic
use cases.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael c4b22eb59c ecore-drm2: Iterate plane formats properly
This patch addresses an issue where plane formats were not being
properly copied into our Plane State structure and causing any usage
of our atomic code paths to crash and burn

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-19 14:58:11 -04:00
Chris Michael d3d9ab2296 ecore-drm2: Free any previous atomic request
If we fail the atomic request merge, cleanup any previous request and
just use the new one.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 345fefd3ef ecore-drm2: Add API functions for atomic commit test and commit
This patch adds 2 new API functions, one which we can use to test atomic
commits before actually applying them, and another which does the
actual Atomic commit.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 9dbf54e2f6 ecore-drm2: Move defines for CAP_CURSOR sizes to private header
As we may need these defines in other files, move them to the private
header so there is access to them.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 205c829a11 ecore-drm2: Store cursor size on device
As we will need these values later to determine if an FBO can go onto
the cursor plane, we should store this in the device structure to
avoid having to refetch them later.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 4f8f41299f ecore-drm2: Add support for plane formats
Small patch to store supported formats on a given plane state. This
will be used for assigning dmabuf clients to a hardware plane based on
size and supported format.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 554883c048 ecore-drm2: Disable driver whitelist tests
While having the ability to test for specific driver and kernel
versions is nice to ensure that Atomic is supported, it quickly can
get out of hand trying to maintain this whitelist so (for now) disable
it and rely on the kernel results from drmSetCap.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael ca194584d5 ecore-drm2: Add API function to return supported rotations of an output
Small patch to add an API function which can be used to return the
supported rotations of a given output. This is used inside the
Enlightenment wl_drm module to determine if rotations is supported on
an output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-18 10:38:01 -05:00
Chris Michael 639ad420aa ecore-drm2: Add API to determine if a device prefers shadow buffers
Small patch to add a new API function that can be called to determine
if a given drm device prefers the use of shadow buffers. This API
will be used later to provide some optimizations on various platforms.

NB: Requested by Derek

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-18 09:48:01 -05:00
Chris Michael 8421a37313 ecore-drm2: Make calls to symlink'd libdrm functions
Instead of linking to libdrm and calling drmMode functions, we will
instead symlink the functions we need during runtime and call those
symlinks.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-15 08:42:07 -05:00
Chris Michael ecc000d84c ecore-drm2: Add code to free Atomic state on shutdown
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael f8e28f37dc ecore-drm2: Add code to fill Plane Atomic state
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael 91739d10b0 ecore-drm2: Add code to fill Connector Atomic state
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael 7041202a0a ecore-drm2: Add code to fill Atomic Crtc State
This patch adds code to enable Atomic Modesetting support (via ioctl)
and to fill in Atomic Crtc state during startup.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael 541be05bf2 ecore-drm2: Add code to check if Atomic Modesettting is usable
This code will detect the drm driver name and check that the kernel
itself is new enough to use Atomic Modesetting. This is needed as some
drivers (i915) do not handle Atomic Modesetting propertly without a
new enough kernel.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael 1bbc23b086 ecore-drm2: Add API for vt-switching
This commit adds a function we can call from inside Enlightenment in
order to fix an issue with VT-Switching. The problem was when a client
application is open, the compositor does not pass along the key-combo
for vt-switch but rather sends it to an application. This patch (along
with upcoming Enlightenment one) fixes the issue.

NB: This late API add approved by Stefan ;)

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-27 13:28:10 -04:00
Chris Michael 5a482e9af4 ecore-drm2: Perform input device calibration based on output name
When a new input device gets added, device calibration may need to be
performed. In order for that to be done properly, we need to know
which output this input device is associated with. This patch makes a
function call to Elput in order to retrieve that output name and
perform the proper calibration.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-08 08:05:20 -04:00
Jean-Philippe Andre 570a398e29 ecore_drm2: Fix mouse pointer when using absolute coords
Running E wl2 in KVM led to the following issue: integrated mouse
pointer would always be stuck at (0,0).

The reason was that calibration would never happen, and it's
required* for absolute pointing devices, such as the qemu mouse
integration.

Fix: Listen to device add and calibrate based on the first
output. No idea if we could calibrate on any other output,
or how this should be done in case of multiple screens.

[*] I believe calibration might actually not be required, as
    the absolute position is already the correct one when
    received from libinput.
2016-07-07 16:15:59 +09:00
Chris Michael 51b589da6a ecore-drm2: Fix redrawing screen when we vt-switch back to a session
When we vt-switch away from a running session, we need to disable
rendering to an output and re-enable when we switch back. This patch
set essentially makes vt-switching work again in Enlightenment Wayland.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-21 12:55:17 -04:00
Chris Michael 09805d2b15 ecore-drm2: Add API functions to support cacheing of context & keymap
@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 0416aa6bf3 ecore-drm2: Add API function to calibrate input devices
This adds a new API function that Ecore_Evas can call to calibrate
input devices given size of the output

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Mike Blumenkrantz da8bcbc7c6 ecore-drm2: update to latest elput 2016-05-27 11:57:53 -04:00
Mike Blumenkrantz c1253164b2 ecore-drm2: perform logind connection after finding device path in ecore_drm2_device_find 2016-05-27 11:57:53 -04:00
Chris Michael 7b5af2f0df ecore-drm2: Add API function to set left-handed mouse mode
This commit adds an API function used to set a mouse to be left-handed

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 8b3e05a7f1 ecore-drm2: Check return of elput_manager_open
We should check to make sure that opening the device has succeeded
before trying to continue

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 92553e167e ecore-drm2: Initialize elput input when device gets opened
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael e934f546ad ecore-drm2: Add API function to get screen size range
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael f3b7672551 ecore-drm2: Add API function to return available crtcs
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 13337c2583 ecore-drm2: Add API functions needed to port Ecore_Evas drm
This patch adds 2 new API functions which are required by Ecore_Evas
in order for it to function with drm. These API functions allow for
restricting pointer movement, and for setting the window id which will
be used when sending input events

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 3c332e1f88 ecore-drm2: Add drm2 event for session activation
This patch adds a new Ecore_Drm2_Event_Activate that can be raised to
inform Enlightenment that a session has been activated or suspended so
that rendering can be paused/resumed

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 296d233f64 ecore-drm2: Add API functions to get and set pointer position
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael 9c7b657287 ecore-drm2: Add API functions to work with a drm device
This commit adds new API functions to find, open, and close a drm
device, along with API functions to retrieve clock_id and cursor size.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00