Commit Graph

36 Commits

Author SHA1 Message Date
Carsten Haitzler 3c307c4b25 ecore wl - make comment note about allocating buffers 2020-06-23 14:01:10 +01:00
Alastair Poole 53044bf107 ecore_wl2: EFL Wayland Build on FreeBSD
This enables a user to build EFL with wayland support enabled
on FreeBSD. It is NOT functioning, but everything starts at
some point.

This requires also linking against -lepoll-shim.
Meson arguments:
-Deeze=false -Dv4l2=false -Dfb=false -Ddrm=false -Dwl=true \
-Dsystemd=false

@fix T8659
2020-04-21 18:19:36 +01:00
Carsten Haitzler de5eea226a ecore wl2 - fall back to shm if dmabuf fails in buf init
so even if shm was an allowed mode/flag, we never fell back to shm if
dmabufs were not possible (/dev/dri/renderD128  didn't exist or wansn't
open-able). that's decidedly a bad thing to do.

@fix
2019-07-22 00:36:07 +01:00
Derek Foreman ee3df4efc3 ecore_wl2: Better error handling for dmabuf sync ioctls
Summary:
Turns out these can fail with EINTR or EAGAIN, and we're supposed
to try again.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6250
2018-06-19 13:43:55 -04:00
Derek Foreman 4ec261064f ecore_wl2: Fix dmabuf locking
Summary:
The ioctls weren't properly used so no locking took place at all, leading
to rendering anomalies when placing dmabuf buffers in hardware planes.

Also, forgetting to check error returns left no indication that the
ioctl was failing, so we now emit a warning if the ioctl fails.

Reviewers: zmike

Reviewed By: zmike

Subscribers: devilhorns, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6237
2018-06-05 11:40:37 -05:00
Derek Foreman f53bc90c62 ecore_wl2: Don't unmap buffers at unlock
We should be using dmabuf sync ioctls instead of mmap/munmap every draw,
this makes that happen.  The surface code continues to do what its always
done, and map/unlock.
2018-04-20 13:00:28 -05:00
Derek Foreman 324c4ede00 ecore_wl2: Add ERR for buffer lock errors
Should never double lock or double unlock, this isn't refcounted, and
probably doesn't need to be.
2018-04-20 13:00:28 -05:00
Derek Foreman 6b3f999cf4 ecore_wl2: Add dma_buf lock/unlock ioctls
These should help with coherency later when we don't unmap for every
surface post.
2018-04-20 13:00:28 -05:00
Derek Foreman 1fddfdfaae ecore_wl2: Add lock/unlock function pointers to buffers
For backend specific lock/unlock behaviour
2018-04-20 13:00:28 -05:00
Derek Foreman 52e2ef8b22 ecore_wl2: Add ecore_wl2_buffer_lock
Currently we're making mapping implicitly take a lock.
2018-04-20 13:00:28 -05:00
Derek Foreman ec3784774d ecore_wl2: Disable horizontal resize optimization
We had a "clever" optimization that would keep a buffer on resize
if it was resizing up horizontal and fit within the previously
allocated stride.

Unfortunately, there still needs to be a buffer reconfigure between
client and compositor that wasn't taking place.  Remove this for now.
2018-02-27 16:27:56 -06:00
Marcel Hollerbach c4f33c67a8 move from efl.vpath to eina_vpath
The usages from efl.vpath are moved to to eina_vpath
2018-02-22 09:26:55 +01:00
Derek Foreman 288b693ac4 ecore_wl2: fix ecore_wl2_buffer_wl_buffer_get
It was currently only used internally and had the side effect of
creating a new buffer instead of just returning the existing one.

Now it's useful to external callers, as it only returns the existing
wl_buffer and has no freaky side effects.
2018-01-26 15:54:00 -06:00
Derek Foreman e11bb10a4e ecore_wl2: Move smarts from surface_map to buffer_map
This simplifies the surface code so that it no longer needs access to
buffer structure members.
2018-01-26 15:53:59 -06:00
Derek Foreman 1a5e307f73 ecore_wl2: Add buffer_fit API and use it from surface code
This tries to resize the buffer's useable area to fit the specified size -
this is possible if the stride of the buffer is larger than the current
width.
2018-01-26 15:53:59 -06:00
Derek Foreman 7d81a16cdb ecore_wl2: Add buffer age inc and use it in surface code
Technically not necessary, since we could do this with get and set, but
it's a little more convenient to the user this way.
2018-01-26 15:53:59 -06:00
Derek Foreman dce3fcda86 ecore_wl2: Add buffer_age_set and use it in surface code 2018-01-26 15:53:59 -06:00
Derek Foreman e97a8cefe8 ecore_wl2: Add buffer_age_get API and use it in surface code 2018-01-26 15:53:59 -06:00
Derek Foreman ebcce5aefa ecore_wl2: Add API for setting buffer busy status and use it
Since surfaces will be managed by plug-ins, we need to make sure they
don't rely on internal structures.
2018-01-26 15:53:59 -06:00
Derek Foreman e3a3e02042 ecore_wl2: Add API for querying buffer lock status and use it
Since surfaces will be managed by plug-ins, we need to make sure they
don't rely on internal structures.
2018-01-26 15:53:59 -06:00
Derek Foreman 520821e432 wayland: Reduce number of unneccessary display flushes
b48781aa6c fixed multiple bugs where the
display wasn't flushed correctly, however it was a little overzealous.

Some of the flushes were added after calls that only updated internal
state, some in internal functions in which the caller was already going
to flush, and some were after wayland protocol calls that are double
buffered anyway and won't do anything until a following commit.

Also, I've removes at least one long standing flush where the recently
added flush is in a better location than the original.
2018-01-19 12:40:40 -06:00
Derek Foreman 5b4b18836a wayland_shm: Remove struct _Dmabuf_Surface
It's all piled into Surface now.
2017-12-01 10:58:44 -06:00
Chris Michael 83c292ffc4 ecore-wl2: Fix resource leak
Coverity detected a resource leak here because we were not freeing the
malloc'd 'obo' variable.

Fixes Coverity CID1382907

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-26 12:12:53 -05:00
Derek Foreman cf605549c5 ecore_wl2: Add dmabuf allocations for vc4
This should theoretically be better for software rendering on rpi3 since
it allows the compositor to use our sw rendered buffers as a texture.
2017-11-21 16:31:23 -06:00
Derek Foreman 9f3edead9d ecore_wl2: Fix buffer manager refcounting
commit 0cf806005e correctly fixed a
leaked buffer.  However, other code was already accounting for the
leaked reference to the buffer manager, so an extra deref happened
and broke the universe - but only on hardware that no developer
has access to for testing.
2017-11-21 10:11:47 -06:00
Chris Michael 0cf806005e ecore-wl2: Destroy buffer before we exit the buffer_test function
Small patch to destroy our test buffer before we exit the
_ecore_wl2_buffer_test function so that we do not leak here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-20 11:27:15 -05:00
Derek Foreman 04ce069cba ecore_wl2: Properly handle buffer test failure during buffer_init
The buffer manager is already cleaned up at this point, don't try to
do it again.
2017-11-17 14:32:50 -06:00
Derek Foreman 1bd513305e ecore_wl2: fix user pointer for dmabuf param listener
Proving once again that those that defeat type safety usually get what
they deserve.
2017-11-16 13:18:48 -06:00
Derek Foreman 925be86f9e ecore_wl2: Fix dmabuf test failure
We need to destroy the buffer manager on fail, since it will exist but
only be able to create buffers we can't actually use.
2017-11-16 13:18:48 -06:00
Derek Foreman c08920820b ecore_wl2: Don't try to close drm_fd if we never opened it
derp.
2017-11-16 13:13:38 -06:00
Derek Foreman fcdbc07fe3 ecore_wl2: Don't open rendernode if we're not going to use it
We should only open this when actually testing dmabuf.  Otherwise we're
just wasting time and adding an opportunity to fail shm init over
unrelated issues.
2017-11-15 11:54:37 -06:00
Derek Foreman 23f5b41176 ecore_wl2: Reset buffer_manager to NULL on failure
Calling this multiple times even after it fails the first time is a legit
thing now.  We'll be doing that when we want to test dmabuf at connection
start.
2017-11-15 11:54:37 -06:00
Derek Foreman 517f929aa5 ecore_wl2: Send a dmabuf non-immediate create at startup
We use immediate mode dmabuf creation at runtime, but this can result in
clients being killed with no option to fallback if the buffers can't be
consumed by the compositor.

This test should catch when a system can allocate a dmabuf buffer and the
compositor claims to accept dmabuf, but the buffer can't actually be used
for whatever reason.  We'll then use wl_shm at runtime instead of dmabuf.
2017-11-15 11:54:37 -06:00
Derek Foreman 3ac556f2e1 ecore_wl2: factor out part of buffer creation
So we can use it to make a non-immediate mode buffer test.
2017-11-15 11:54:37 -06:00
Derek Foreman 04cebba623 ecore_wl2: Filter buffer types by compositor capabilities
It does us no good to be able to allocate dmabuf capable memory if the
compositor can't handle it.  This should fix failures on systems where
allocation is possible but the compositor doesn't advertise dmabuf.
2017-11-15 11:54:37 -06:00
Derek Foreman 9fdcf7d0eb wayland_shm/ecore_wl2: Move buffer allocation into ecore_wl2
This moves all the platform specific buffer allocation into ecore_wl2
instead of the engine.

Note that this makes an internal struct available in the header.  This
will be removed shortly.
2017-11-15 11:54:37 -06:00