Commit Graph

63 Commits

Author SHA1 Message Date
Elyes HAOUAS 1fd0435f21 Get rid of trailing whitespaces (4 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12002
2020-06-23 10:29:14 +02:00
Stefan Schmidt e1c26157f4 ecore_drm: ensure we have the symbol available at the right place.
Summary:
Linking under Fedora32 toolchain got more picky. Ecore_drm_device.c
needs the symbol so make sure we have it there.

Reviewers: devilhorns, raster

Reviewed By: raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11772
2020-05-05 11:29:19 +01:00
Mike Blumenkrantz 03a8ab1f51 ecore-drm: reuse any created xkb map if no cached map exists
this prevents creating many identical maps during init
2016-04-27 12:52:08 -04:00
Derek Foreman b5425dc51a ecore_drm: Disable custom tick if we can't wait for vblank
If we fail to schedule a VBlank event, then we should disable custom
ticks and fallback to timer-based animators. This patch fixes some
issues with Intel Atom based setups where rendering would fail when
using custom animators.

@fix
2016-03-14 15:00:11 -04:00
Derek Foreman ee0508a2bb ecore_drm: Update device copy of framebuffer after page flip completes
The device struct is API, so its copy of the fb pointer needs to be
kept in sync with the output struct's.  We do this when the flip completes
to try to prevent access to an fb that's about to flip.

This fixes Enlightenment screenshots.

@fix
2016-03-11 11:53:46 -05:00
Chris Michael d4307e3494 ecore-drm: Don't re-include config.h
As ecore_drm_private.h already includes config.h header, we don't need
to include it here in these files also

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:27:05 -05:00
Chris Michael 2dbe2732a2 ecore-drm: Update copyright notice
As portions of this code have been derived from existing code in
Weston, we should also be including their copyright/licence text to
give credit.

NB: Fixes T3286

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:22:22 -05:00
Derek Foreman ddc6962d77 ecore_drm: Add pointer warping API
Adds a new API: ecore_drm_device_pointer_warp() which warps the pointer
to the specified location.  All libinput seats with pointers are warped.
2016-02-18 15:50:16 -05:00
Derek Foreman 937ca952ed ecore-drm: Only queue re-flip on the head that needs it
Prevents stuttering when a head that was successfully set bounces
back to a previous frame the other head failed to set.
2016-02-18 15:50:15 -05:00
Derek Foreman 5d7271683b ecore_drm: Change page flipping logic so we can't tear
Summary:
Previously if we ever tried to queue up two page flips in less than a
retrace interval (which can easily happen since the evas clock isn't
based on vblank) we'd give up on ever using page flips again, and tear
on every screen update.

This fixes that by using a vblank callback for custom ticks and using
page flips whenever possible.

If a page flip fails it means a page flip raced with the vblank ticker,
so we need to queue up that frame when the current page flip completes.
This ensures that while we might drop interim frames, we will never
lose the most recent.

Now it should only be possible to tear if two ticks fire during the
wait for a page flip to complete.  This would result in rendering
taking place in the front buffer.  I don't think this can happen,
but an error is logged if it does.

Reviewers: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3594
2016-02-18 15:50:15 -05:00
Chris Michael 4ba349be4f ecore-drm: Destroy any existing eeze watch when we free the device
If a user frees a device without closing it we could end up with a
dangling eeze watch. This small patch just makes sure to delete the
watch if it exists

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-21 11:32:53 -05:00
Chris Michael 17fa5dee65 ecore-drm: Cleanup ecore-drm shutdown routine
This patch addresses an issue where when closing Enlightenment, the
shutdown procedure would previously end up calling the same functions
twice. These functions should be called from the ecore_evas drm
shutdown routine as the sprites, inputs, outputs, etc are all called
from the ecore_evas drm init routine.

@fix

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

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

@fix

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3572
2016-01-14 13:06:02 -05:00
Marcel Hollerbach 0a2f066c2d ecore_drm: close all devices in shutdown 2016-01-13 18:51:49 +01:00
Marcel Hollerbach 093846aaea ecore_drm: check if device is already opened before open and free
check if fd is -1 before opening a device, so a device cannot be opened
twice.

Also check if fd is != -1 before closing it.
2016-01-13 18:51:49 +01:00
Chris Michael f836aba678 ecore-drm: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-07 09:00:32 -05:00
JengHyun Kang b3dc27345a ecore-drm: Add a new API for keymap cache
Summary:
Originally, each keyboard devices could have their own keymap.
The one keyboard's keymap could different with others.
But for this, Ecore_Drm compile a new keymap when a keyboard is connected.
But this is a burden for some people who doesn't manage keymap for each keyboard.
They want to maintain only one keymap for system.
So, I added cached context/keymap and just ref/unref for each keyboard device.
People who want to different keymap for each keyboard just do not set cached
context/keymap. Then Ecore_Drm maintain keymaps about each keyboard devices.

Test Plan:
Connect a keyboard device and watch flow of ioctl.
Originally Ecore_Drm opened xkb data and compile keymap,
but after patch, that ioctl is disppeared.

@feature

Reviewers: raster, devilhorns, ManMower

Reviewed By: devilhorns, ManMower

Subscribers: cedric, input.hacker, ohduna, jpeg

Differential Revision: https://phab.enlightenment.org/D3503
2016-01-04 08:47:58 -05:00
JengHyun Kang eb9b894167 Add a new Ecore_Drm API for setting left-handed mouse
Summary:
Add a new Ecore_Drm API named ecore_drm_device_left_handed_set().
Libinput support various input options. Left handed mode is one of options.
Right-handed people and left-handed people use a mouse
using different button mapping.
So if a left handed option is enabled, libinput change right mouse button and
left mouse button.
So support this option, I added this api using libinput's left handed option.

@feature

Test Plan:
After set left handed mode, left mouse button generate button numbered 3,
and right mouse button generate button numbered 1.

Reviewers: raster, ManMower, devilhorns

Subscribers: ohduna, cedric, jpeg, input.hacker

Differential Revision: https://phab.enlightenment.org/D3431
2015-12-29 09:04:16 -05:00
Duna Oh 21b1a3f221 ecore-drm: Add logical pointer x, y variable in seat for reflecting multiple pointer's movement
Summary: When one pointer moves, we should update the position of other devices.

Test Plan:
(1) Two pointer devices are connected.
(2) Move the cursor to (x, y) position using "device 1".
(3) When you move the cursor using "device 2", the cursor doesn't start from (x, y) position. This causes discontinuous mouse motion.

Reviewers: raster, zmike, gwanglim, stefan_schmidt, devilhorns, ManMower

Reviewed By: devilhorns, ManMower

Subscribers: cedric, Jeon, input.hacker, jpeg

Differential Revision: https://phab.enlightenment.org/D3384
2015-11-30 11:05:07 -05:00
Chris Michael ebf6d95ed6 ecore-drm: Remove unused function
As we no longer have an fd handler to listen on the drm fd, we don't
need this function anymore

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-05 09:37:48 -05:00
Chris Michael ff8b141f87 ecore-drm: Fix issue of hanging in read()
Summary: As we already call drmHandleEvent when we pageflip, we don't
need to be using an fd handler to catch them. This should fix T2791

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-05 09:01:36 -05:00
Chris Michael 34415c05bd ecore-drm: Add some debug printing for driver details
Summary: In efforts to debug some non-working drm issues for people,
it would be helpful to know what drivers and versions they are using.
This commit just adds some debug printing for that information

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-30 16:00:32 -04:00
Chris Michael 443010b465 ecore-drm: Greatly improve drm rendering speed
Summary: This greatly improves rendering speed in evas drm engine.
Previously we would always call drmModeSetCrtc regardless if it was
needed or not. These changes greatly improve rendering speed in drm as
we now only call drmModeSetCrtc if it is needed.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 14:42:10 -04:00
Chris Michael 958b15c207 ecore-drm: Add new API function to mark an output as primary
Summary: This adds a new API function which we can use to mark a given
Ecore_Drm_Output as being the primary output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 2145cb18c2 ecore-drm: Add API function to find an output given a name
Summary: This adds a new API function to find an Ecore_Drm_Output
which matches a given name.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael c79922f392 ecore-drm: Set drm client capabilities to support universal planes
Summary: If we do not set client capabilities to support universal
planes, then libdrm does not expose the primary or cursor planes so
this adds a quick call to set DRM_CLIENT_CAP_UNIVERSAL_PLANES

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 29362040b2 ecore-drm: Add API function to return screen size range
Summary: This adds new API function to return the min & max width &
height of valid screen range for an Ecore_Drm_Device

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:45 -04:00
Chris Michael 403e5ad385 ecore-drm: Remove debug noise
Summary: No real function changes, just commented out some debug lines
so we have less noise for release

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-04 11:41:25 -04:00
Mike Blumenkrantz 3d71a10891 ecore-drm: add safety checks to all EAPI functions 2015-04-24 12:53:01 -04:00
Mike Blumenkrantz 4e7549683b ecore-drm: fix ecore_drm_devices_get() to return a const value
this is the internal device list, we're pretty hosed if someone decides
to free it because there's no const
2015-04-22 19:34:59 -04:00
Chris Michael d5005d0efc ecore-drm: Use #if 0 to comment out unused function
Summary: It was mentioned on the mailing list to use #if 0 instead of
commenting the block. This does not change any functionality

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-20 12:15:13 -04:00
Chris Michael 6195910698 Revert "ecore-drm: Remove 'defined but not used' function"
This reverts commit d625167e07.

Reverting this to use #if 0 as suggested by q66
2015-04-20 12:14:27 -04:00
Chris Michael d625167e07 ecore-drm: Remove 'defined but not used' function
Summary: As we no longer require the idler to repaint outputs, comment
out the function that was defined for the idler.

NB: I left it commented (and not totally removed) just in case it is
needed for a later (undiscovered) issue

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-20 11:47:55 -04:00
Chris Michael 6d243f5672 ecore-drm: Fix hotplugging of outputs
Summary: In order to process hotplugging of outputs, we need to send
the 'dev' structure as data to the callback so that we can update
outputs. This fixes hotplugging of outputs when running E

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-16 10:51:56 -04:00
Chris Michael 25de79b05a ecore-drm: Modify device pageflip function to accept ecore_drm_fb callbacks
Summary: This modifies the ecore_drm_device pageflip function to make
use of the ecore_drm_fb callbacks passed into the ecore_drm_fb_send
function

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:51 +02:00
Chris Michael e11be98ed0 ecore-drm: Add API function to find an output at given coordinates
Summary: This commit adds an API function that can be used to find an
output given an x/y coordinate pair.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael 70e8a00271 ecore-drm: Move doxygen documentation to main Ecore_Drm header
Summary: This moves all doxygen to the main Ecore_Drm header to match
rest of efl.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael 3832cd59b8 ecore-drm: Create drmEventContext Once during device open
Summary: This changes allows us to reuse the same drmEventContext once
so that when we get drm events, we are not constantly recreating the
drmEventContext.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael e3440c4683 ecore-drm: Skip repaints if we are VT switched away
Summary: This allows us to skip output rendering if we are VT switched
away.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael 5858513daa ecore-drm: Update drm device & output code to remove per-output dumb buffers
Summary: Since we now create the dumb buffers in the ecore_drm_device
structure, we don't need them on a per-output basis. This commit fixes
the output & device code to adjust to this.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael 8d1e57e52e ecore-drm: Delay destroy of output if there is a pending flip
Summary: If an output has a pending page flip, we cannot destroy it
until the page flip has completed. This commit adds support to delay
destroying an output until the page flip is completed.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-10 11:09:50 +02:00
Chris Michael c7ced198e6 ecore-drm: Move Eeze Udev Watch to Drm Device
Summary: Move the Eeze udev watch to inside the ecore_drm_device. This
allows us to only create One watch to catch all output changes. No
need for more than one watch (one per output) as was done previously

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-09 17:41:03 +02:00
Boram Park 9baacf802d ecore-drm: add ecore_drm_devices_get to get the list of drm devices
Summary:
    when enlightenment is working as wayland display server, enlightenment
    changes KDSETMODE to KD_GRAPHICS in _ecore_drm_tty_setup(). However,
    when enlightenment is killed by SIGSEGV, it doesn't changes KDSETMODE
    to KD_TEXT because englightenment process doesn't call ecore_drm_tty_close().
    To make possible enlightenment call ecore_drm_tty_close(), drm devices
    should be exposed.
    When enlightenment is killed by SIGSEGV, it will get drm devices with
    ecore_drm_device_get_list(), and will call ecore_drm_launcher_disconnect(),
    and ecore_drm_launcher_disconnect will call ecore_drm_tty_close() internally.

@feature

Change-Id: I1c594739ec96660a09cee77b823ace6548ee5282

Reviewers: zmike, cedric, raster, gwanglim, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2159
2015-03-17 09:31:18 -04:00
Chris Michael aabf45071c ecore-drm: Add function to return the pointer xy of Ecore_Drm_Device
Summary: This adds a function (ecore_drm_device_pointer_xy_get) to we
can return the mouse position inside ecore_evas_pointer_xy_get calls.
This is going to be used for centering the mouse when E-Wl starts up.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-04 11:49:44 -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
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
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
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 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