When fetching possible planes for an output, we end up leaking object
properties here as these were never freed.
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
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
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
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>
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>
When we are sending an event for touch motion, we should be specifing
the modifers in the event structure (not setting them to zero).
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
We'll need to set outputs individually from the page flip handle to handle
page flip problems, so we need the per output setting logic in its own
function.
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
When trying to set a rotation on a given output, we would previously
always be returning EINA_TRUE. We should be returning EINA_FALSE when
the rotation_set fails.
@fix
Summary: ecore_drm_output_rotation_set should be returning EINA_FALSE when the output doesn't have a plane of requested type.
Test Plan:
1. call ecore_drm_output_rotation_set() with ECORE_DRM_PLANE_TYPE_CURSOR
2. If output doesn't have a plane of ECORE_DRM_PLANE_TYPE_CURSOR, the for statement does nothing. But return value is TRUE;
Reviewers: raster, stefan_schmidt, gwanglim, devilhorns, zmike
Subscribers: input.hacker, cedric, JHyun, ManMower, jpeg
Differential Revision: https://phab.enlightenment.org/D3678
This adds 2 new API functions for getting supported rotations of an
output, and for setting rotation on an output
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This adds an opaque structure to represent a hardware plane for use in
rotation, setting cursor/overlay/primary plane content, etc
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
ecore-drm: Add API functions for rotation support
This adds 2 new API functions for getting supported rotations from an
output, and for setting rotation on an output.
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This patch adds an internal function that we use during output
creation in order to create the planes necessary and get the supported
rotation values for an output
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This patch adds an API function to allow the Screen Setup dialog in
Enlightenment to support setting rotations on an output when running
under drm
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This patch adds an API function so that we can get the supported
rotations from an output. This is needed so that the Screen Setup
dialog in Enlightenment can list the rotations supported for the user
to choose from while running using drm
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This patch brings the tty code more inline with what the logind code
Was doing. It also fixes the return value from the vt_signal handler,
and opens the tty in non-blocking mode now.
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
For a case where we have more than one device open, if we set the
'logind' variable to false, then the second device would never close
properly.
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
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>
This patch cleans up some of the logind code to make use of the
existing tty functions as they both did the same thing
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
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>
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
When we introduced the usage of floor() in ecore_drm_evdev.c we forgot to
include math.h for it as well as linking against libm. This caused linking
failures on some systems while it still worked on others. Better fix it for
good.
Original patch by aerodynamik.
ref T2953
As we end up freeing the input hash inside the
_ecore_drm_inputs_shutdown function, it should be called before we
shutdown eina
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
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
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
Summary:
This adds two new APIs to enable/set key remap functionality and
a number of keys to be remapped to the other keys. As of now there is no
api to do this therefore we need to remap using linux utility such as
'setkeycodes'. By adding/calling these apis, each Ecore_Drm_Evdev device
will have its specific key remap hash and we can apply each remapping keys
for each key/keyboard device.
Test Plan:
(1) Enable key remap and set remapping of a key on a specific keyboard device
(2) Plug in the keyboard device and check the key is being remapped or not
(3) Check the other keys are coming normally
(4) Check the the remapping key on a specific keyboard doesn't affect to any other devices
Signed-off-by: Sung-Jin Park <input.hacker@gmail.com>
Reviewers: raster, zmike, gwanglim, ManMower, devilhorns
Subscribers: JHyun, ohduna, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3463
Summary:
When a input device is plugged in, _cb_open_restricted() is called before creating evdev.
So setting fd value on evdev was failed in _cb_open_restricted() and also closing evdev->fd was invalid.
Using a eina_hash which has 'path-fd' pairs, we can find fd value after evdev is created.
@fix
Test Plan:
(1) Multiple input devices are connected. Their evdev->fd remains zero or initial value.
(2) When one of those devices are plugged out, fd leak would happen.
Reviewers: raster, zmike, gwanglim, stefan_schmidt, devilhorns, ManMower
Subscribers: cedric, jpeg, Jeon, input.hacker
Differential Revision: https://phab.enlightenment.org/D3428
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
We cannot be sending an ecore_event for mouse move here as it is too
early in the startup process for that too happen. Raising the event
here never gets caught because the ecore_evas has not yet registered
for ecore_input listening.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
The second find of these. The other one was in evas generic loaders.
mmap() expects a void * as address here. If we want to let the kernel
choose the address we should really pass in NULL instead of the
integer 0.
Thanks goes to the sparse semantic parser for pointing this out.
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>
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>
Summary: If we already have a pending pageflip scheduled for a given
framebuffer, don't reschedule another one. This also includes a minor
fix when mmap'ing the framebuffer (previously was also mapped
PROT_READ).
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: drmHandleEvent will return 0 on success, or -1 on error. We
should trap for the error case so that we can cleanup any allocated
callback structures.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: If we are running using gl_drm, then we don't need to create
software dumb buffers on the drm device. Since we may not have the
dumb buffers (only used in software rendering), then we should not
always be checking the framebuffer size against the dumb buffer size.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
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>
Summary: If we go to setup a tty and it is already in graphics mode,
then there is no need to exit with a failed setup here. Instead, we
can actually continue to setup the tty.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>