Commit Graph

264 Commits

Author SHA1 Message Date
Carsten Haitzler 39f224b3a6 ecore drm2 - work around kms/drm bug seemingly when no flip event comes
so we request a flip so we can do vsync events. the flip event never
comes. i am not sure why it never comes, but we ask and nothing
arrives, and this basically halts all rendering in wayland compositor
mode as we are syncing rendering to vsync (of course). put in a
timeout of 0.05s (50ms) to try ask again if the event never comes and
log the error. this is a pretty useful workaround becauswe having your
entire display freeze is a ... bad thing.

@fix
2019-02-21 09:52:31 +00:00
Christopher Michael c62bac00cb ecore-drm2: Minor formatting fixes.
NB: No functional changes
2019-02-06 10:07:20 -05:00
Christopher Michael 3999a97579 ecore-drm2: Reduce duplicated code
No need for this line to be there twice as it is going to be called in
either case.

NB: No functional changes
2019-02-06 10:03:02 -05:00
Christopher Michael 65bf9c6e0f ecore-drm2: Remove useless if check
_ecore_drm2_use_atomic is already checked just above this, so there is
no need for this if statement
2019-02-06 10:00:51 -05: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 9dedaddf2d ecore-drm2: Support multiple gpus during vblank
Summary:
When we try to calculate a drm vblank type, we should take into
account the output's pipe value which is used to determine if we are
using multiple gpus (if so, we need to use the high_crtc_mask.

Reviewers: ManMower

Reviewed By: ManMower

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7803
2019-01-28 14:45:23 -05:00
Christopher Michael c6ebe8241e ecore-drm2: Fix formatting
NB: No functional changes
2019-01-17 10:58:43 -05:00
Christopher Michael 8079d6d38a ecore-drm2: Pass output as data to drmModePageFlip and drmModeAtomicCommit
In order to support per-output ticking, the drmModePageFlip and
drmModeAtomicCommit functions need to pass the actual Output as data
to the pageflip callback so that the pageflip callback function can
pass the proper rectangle to ecore_evas_animator_tick

Differential Revision: https://phab.enlightenment.org/D7678
2019-01-17 09:37:33 -06: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
Christopher Michael bd6d83bee7 ecore-drm2: Fix drmModeSetCrtc call during fb flip
drmModeSetCrtc x & y values are actually offsets into the framebuffer
memory. As such, we should not be sending output position here.

@fix
2019-01-02 10:03:06 -05:00
Christopher Michael cbac8eddb0 ecore-drm2: Minor formatting fixes
NB: No functional changes
2019-01-02 10:01:55 -05:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Derek Foreman 7d54989f9b ecore_drm2: Fix failure to properly set up new plane
Summary:
When we add a plane we need to add it to the list before doing the atomic
test to ensure we're testing new state that includes the plane, and to
ensure the next screen update includes the plane we just added.

Fix T7066

Reviewers: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7066

Differential Revision: https://phab.enlightenment.org/D6432
2018-06-26 15:28:07 -04:00
Chris Michael ccf064f5ae ecore-drm2: Add API function to retrieve output user data
With the rework of Ecore_Evas drm engine, we need to get the
ecore_evas itself in the pageflip callback so we have to reassign
output->user_data to the ecore_evas which we can then use to retrieve
via this function

This is needed as the pageflip callback will pass us the output on
which the pageflip completed.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-27 09:31:33 -05:00
Chris Michael 72b192c012 ecore-drm2: Free stringshare for relative output during output_free
When we destroy a given output, we should be freeing the
eina_stringshare for relative.to

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-27 09:22:04 -05:00
Chris Michael fc4f66c6c2 ecore-drm2: Add API to get/set which output is relative to another
In order to know which output we should clone, we need a way to
store/retrieve the output which should be cloned. This patch adds a
small api we can use in randr config dialog to get/set that value.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-27 09:16:00 -05:00
Chris Michael 124c7535bb ecore-drm2: Fix typo when comparing output relative mode
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-20 09:40:14 -05:00
Chris Michael f877f6c09f ecore-drm2: Account for output relative mode when getting cloned value
As an output may have it's relative mode set to clone from the E randr
dialog, we should account for that also when returning output cloned
mode.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-20 08:53:59 -05:00
Chris Michael a78dc2d816 ecore-drm2: Add API functions to get/set output relative mode
These API functions will be used inside Enlightenment in order to
determine the proper extended screen size based on outputs relative
position.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-13 11:44:11 -05:00
Chris Michael e93f7bce30 ecore-drm2: Ensure output changed event is sent for removed outputs
If an output gets disconnected, we would still like to be notified of
that. In the _outputs_update function, we mark an output as
disconnected by setting output->connected and output->enabled to
FALSE. With this line in place (in the output_event_send function) we
would never get notified if an output was disconnected.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-06 13:01:25 -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
Chris Michael 2ac8458238 ecore-drm2: return supported rotations if not using hardware
If we are Not using Atomic/Hardware support for output rotations, we
should return all available rotations as these will still work in
software mode.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-01-09 12:48:25 -05:00
Chris Michael 4aeca75cff ecore-drm2: Fix enabling outputs
Commit 9d583b3fdb broke
ecore_drm2_output_enabled_set function due changing order of setting
output->enabled value. This patch fixes both issues by checking the
'enabled' variable being passed in.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-01-09 12:48:07 -05: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
Vincent Torri 4ae6eeb2cf efl: remove _MSC_VER (Visual Studio macro) usage in source code 2018-01-04 12:59:47 -08:00
Chris Michael 9021c752cb ecore-drm2: Fix issue of not being able to set output mode
If we pass in screen geometry here when trying to set an output mode,
we can encounter "out of memory" errors from libdrm with outputs
that have a high resolution. As it turns out, we should be passing 0, 0 for
the x/y values when trying to set an output mode.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-01 08:52:03 -04:00
Chris Michael bd2588e72f ecore-drm2: Minor formatting fix
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-09-19 11:45:43 -04:00
Derek Foreman 1848f9a8e6 ecore_drm2: Better handling of blank time checks
On some systems we'll successfully complete the vblank ioctl but get
a reply of 0.  When that happens we can't use that time for ticking
as it will break all of the entire world.

Fixes immediate screen blank on rpi3.

@ref T5977
2017-09-05 12:12:30 -05: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 eec565cc0f ecore_drm2: Add query for pending pageflip
We've been tracking this in ecore_evas, but ecore_evas isn't the only
caller, and it doesn't know about flips initiated by the evas engines.
2017-08-11 17:11:12 -05:00
Derek Foreman 9fd0ed736d ecore_drm2: Remove ecore_drm2_output_resolution_get()
No local callers.  Superseded by ecore_drm2_output_info_get()
2017-08-09 14:56:59 -05:00
Derek Foreman 5ecfe6a8b5 ecore_drm2: Remove ecore_drm2_output_crtc_size_get()
Replaced with ecore_drm2_output_info_get()
2017-08-09 14:56:59 -05:00
Derek Foreman 846db0e0e7 ecore_drm2: Remove ecore_drm2_output_geometry_get()
Replaced with ecore_drm2_output_info_get()
2017-08-09 14:56:59 -05:00
Derek Foreman 1b853dcfad ecore_drm2: Add ecore_drm2_output_info_get
We've got too many ways to query output information, so let's add more.
(this will soon replace all of them)
2017-08-09 14:56:59 -05: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 9b9d704292 ecore_drm2: Remove connector bitfield
This is unreliable - there's no reason to expect these connector ids
will be low enough to sensibly store in a bit field.
2017-08-09 14:56:58 -05:00
Derek Foreman 2f9cb33f0b ecore_drm2: remove unused crtc bitfield
We'll need something like this when multi-head works, but it can't
be implemented this way anyway.  There's no guarantee that crtc
ids will be low enough to fit sensibly in a bitfield.
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 acc76cadd3 ecore_drm2: Stop making dumb fbs and mmapping for gbm fds
We were doing this so E could do screenshots in a hackish way,
E has been fixed so this hack here no longer needs to live.
2017-07-31 11:12:05 -05:00
Derek Foreman df658a6d15 ecore_drm2: Remove dead code in blank time get
When I added the fallback block I left an if statement that could
never evaluate to true.  Remove it.
2017-07-31 10:57:56 -05:00
Carsten Haitzler 2c1e2db876 ecore_drm2 - fix startup if edid blob is null.. assume all 0's
this causes a crash when no edid is available. survive and dont crash.
this causes e wayland to not work at all on my baytrail laptop.

@fix
2017-07-30 23:27:56 +09:00
Derek Foreman 0584fc81a2 ecore_drm2: Add a fallback method for vblank waiting
We can't depend on vblank waits being implemented by the driver, but we
can count on page flips functioning, so add a fallback that does a page
flip and waits for it.
2017-07-28 15:35:03 -05:00
Derek Foreman 8e500c6835 ecore_drm2: Allow picking a sequence number for blanktime_get
This lets us do a blocking wait for a vsync.  Something we should try to
do as infrequently as possible, but in some cases we need it one time at
startup to catch graphics driver bugs.
2017-07-28 10:41:11 -05:00