Commit Graph

64 Commits

Author SHA1 Message Date
Christopher Michael f3c4692221 ecore-drm2: Add API function to return default depth
Rather than hard-coding depth & bpp in the evas drm engines, we can
use this function to return the default depth & bpp.

@feature
2020-05-15 10:45:56 -04:00
Chris Michael 2288c92bc5 ecore-drm2: Fix issue of shifting 1 by more than 32bits
Based on 9ca573f40f, this patch fixes
potential undefined behaviour on 64 bit systems.

@fix
2019-11-14 12:21:40 -05:00
Christopher Michael ead88ff2ad ecore-drm2: Add API to check if vblank is supported
This patch adds a small API that we can use to check if the current
video driver supports the usage of drmWaitVBlank. This check is
required for certain drivers (like vbox) which do not support
drmWaitVBlank and thus are causing our animators in ecore_evas to
freeze. We can now use this API from within Ecore_Evas to disable
vsync'd animators and fall back to timer based ones.

@feature
2019-05-22 07:44:00 -04:00
Carsten Haitzler 96c3edd701 ecore drm2 - fix warnigns in DBG eina logs for long types
on 32bit longs are 32bit so cast appropriately to not have warnings.
2019-05-13 14:27:00 +01:00
Christopher Michael 5fe11b2dbf ecore-drm2: Update printf format to match changed value type
Commit 8e0c4d83ed changed the atomic property value type to be
uint64_t so we need to update the printf's to reflect that
2019-04-18 09:07:17 -04:00
Christopher Michael d09664e20e ecore-drm2: Add background_color to crtc atomic properties
This patch adds a new field to the crtc atomic state which will be
used to support crtc background_color property, and also fills in that
state during crtc atomic state fill.

@feature
2019-04-18 07:21:39 -04:00
Michaël Bouchaud (yoz) 72f9a94188 ecore_drm2: Add API to allow settings tap-to-click on pointer device
Summary:
Add a way to configure pointer device with tap-to-click features.

@feature
Depends on D7843

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7847
2019-01-31 08:41:04 -05:00
Christopher Michael 6fcffef3ff ecore-drm2: Add support for specifying a particular drm card
Summary:
There are cases where the drm card that we wish to run on is not
always the first card (ie: card1, card2, etc). In our previous code,
we would always start searching at card0 and if found we would always
use that card. This patch allows a card to be specified in the
environment that can be searched for and used. For example, if we
specify ECORE_DRM2_CARD=card1 than that card will be searched and used
if found. This also allows wildcard searches such as
ECORE_DRM2_CARD=card[1-9]* which can be used to skip the first card
(card0).

Reviewers: ManMower

Reviewed By: ManMower

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7530
2019-01-02 10:33:42 -05:00
Chris Michael d1a7dd5e42 ecore_drm2: fix seat matching when checking for a device with a null seat
Summary: Check to make sure that the seat from the matching device is still null.

Test Plan: Make sure that devices are not being rejected while on seat1. This depends on another patch

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: ManMower, devilhorns, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5711
2018-01-22 11:26:13 -05:00
Derek Foreman 54fede47a9 ecore_drm2: simplify device selection code
The platform check was added for systems (like ARM) that don't generally
have PCI graphics devices.  However, now we pick a fallback device that
doesn't have a PCI constraint, so the platform check should no longer be
necessary.
2018-01-10 12:54:42 -06:00
Derek Foreman 324c917a20 ecore_drm2: Allow non-pci DRM devices to be selected
Summary: This is a tweak to c264ef264f for D5712 . chosen_dev in the loop was only being set for DRM devices attached to PCI devices. While this is useful for determining if the device is the preferred boot_vga device, There is no apparent requirement (comparing to Weston) for all DRM devices to be attached to a PCI device. (This is considering USB DisplayLink devices. I am not sure how the parent device tree is with these...)

Reviewers: devilhorns, ManMower

Reviewed By: devilhorns, ManMower

Subscribers: cedric, jpeg, #efl

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5727
2018-01-10 12:23:34 -06:00
Derek Foreman 0d845ce3aa ecore_drm2: Remove pointless goto
This "out" label probably used to be the target of multiple gotos,
but now it's just being used to jump over a single line of code.
2018-01-05 12:28:36 -06:00
Derek Foreman c264ef264f ecore_drm2: Don't fail if there's no boot_vga device
In a multi-seat configuration it's quite likely that only one
seat will have a boot_vga device.

While we should use the boot_vga device if possible, we shouldn't
fail just because a seat's gpu isn't the boot_vga device.  Fallback
to the last viable drm device we saw.

Reported-by: n3rdopolis
ref D5712
ref T6455
2018-01-05 11:51:22 -06:00
Chris Michael 474da25165 ecore-drm2: Add API to allow setting pointer acceleration profile
Small patch to allow setting pointer acceleration profile (for
wayland) from within Enlightenment.

ref T4736

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-24 11:42:57 -04:00
Chris Michael b43f6c14dd ecore-drm2: Add API function to allow setting pointer acceleration speed
Small patch to add a new API function which can be called from
Enlightenment in order to allow setting pointer acceleration speed.

ref T4736

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-24 11:32:51 -04:00
Derek Foreman 70c1ce3be3 ecore_drm2: Remove useless safety checks
Now that the device is opened and found in one operation it's impossible
to have fd == -1, so we can stop testing for it.
2017-08-09 14:56:59 -05:00
Derek Foreman afd65a8a99 ecore_drm2: Merge ecore_drm2_device_free and _close
There's no reason to have them be separate, all callers must do them
back to back, so let's just combine them.
2017-08-09 14:56:58 -05:00
Derek Foreman d8a9b895bb ecore_drm2: Merge ecore_drm2_device_find and ecore_drm2_device_open
There's never a reason to find a device and not open it, so all callers
end up calling these two functions back to back.
2017-08-09 14:56:58 -05:00
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