Commit Graph

103 Commits

Author SHA1 Message Date
Derek Foreman 680b7b485d Fix xwayland related crash when mousing out of a window
XWayland likes to set a buffer on the cursor surface then delete it before
we release it.  I'm pretty sure when a client does that we're within spec
to just kill it, but users will likely find this response ungratifying.

So, instead, just gracefully fail to render the undefined surface.

@ref T5593
2017-10-24 13:57:00 -05:00
Derek Foreman f4f08ee99a Stop queuing wl_buffer release events
Now we just kick them out immediately.
2017-09-26 11:41:19 -05:00
Derek Foreman 1cdbcb0d94 Resynch with weston's dmabuf implementation
Weston's dmabuf implementation continues to be modular enough that we can
pull it in with minimal change.

This updates us to version 3 of the protocol - required by recent mesa to
use dmabuf buffers instead of wl_drm ones.

Currently only contains stubs for format query.
2017-08-10 11:32:45 -05:00
Derek Foreman 034211051b Remove some duplicate dmabuf validity checks
These have been moved into EFL where they belong.
2017-06-30 14:51:05 -05:00
Derek Foreman cb83120863 Remove old test for dmabuf validity
EFL now sets image load error for native surface set, so this hack is
no longer required.
2017-06-30 14:51:05 -05:00
Derek Foreman e26f2a12f5 Test dmabuf via native_surface_set even in software render
This is necessary to verify the the attributes struct is the same
version EFL can process, before we commit to displaying it.

@fix
2017-06-29 16:01:56 -05:00
Derek Foreman 4879b340a2 Initialize the Evas_Native_Surface to 0 for dmabuf tests
ref e6f17dee5d

Should probably clear this one too, though the recent native surface api
changes won't cause any breakage here, future ones might.
2017-06-23 11:55:37 -05:00
Derek Foreman 5de9f0f8a3 Allow enabling experimental hardware plane support
Hardware plane support is inactive unless a scanout handler is set, this
patch adds a scanout handler and uses it when the env var
E_USE_HARDWARE_PLANES is set.

In the future this env var will go away when hardware plane support is
stable enough to enable it everywhere.
2017-06-23 11:54:08 -05:00
Derek Foreman 18fbd1da32 Don't delete busy E_Comp_Wl_Buffers
Hardware planes are going to make E_Comp_Wl_Buffer lifetimes harder to
manage, so we need to let the E_Comp_Wl_Buffer object outlive the
resource attached to it.

We already track a busy count, so we just have to use it to prevent
deleting a busy buffer.
2017-06-23 11:52:04 -05:00
Derek Foreman acd0e4b036 Refactor wayland buffer releasing
This code should've been common but wasn't, so this might fix some
resource leaks.
2017-06-23 11:52:01 -05:00
Derek Foreman e6f17dee5d Clear the native surface structure before initializing it
Since the native surface "API" is isomorphic with pain and suffering, we
should be extra careful when we touch it.
2017-06-22 14:05:24 -05:00
Derek Foreman 2bd4a9dc85 clean up some code
remove write-only variable in the pixmap struct
2017-06-07 12:12:16 -05:00
Derek Foreman b37acd6e39 Revert "Stop misuing EVAS_NATIVE_SURFACE_VERSION macro"
This reverts commit 4a40614f2f.

Apparently this macro is unlike similar macros in other libraries
that have more sensible semantics.
2017-06-06 16:42:01 -05:00
Derek Foreman 4a40614f2f Stop misuing EVAS_NATIVE_SURFACE_VERSION macro
We should be stating the version the code supports, not the version
that the EFL version we compiled against supports.
2017-06-06 16:28:20 -05:00
Derek Foreman 52c379f4b2 Remove some duplicate operations
the native surface version was set outside of the switch statement,
so we don't need to re-set it to the same thing here.
2017-06-06 16:28:20 -05:00
Derek Foreman 4fca111eb5 Don't require dmabuf buffers to be writeable
Compositor doesn't need to write to this buffer, and most clients won't
allocate them in a way that the compositor can.  Relax the test criteria.
2017-05-30 11:58:32 -05:00
Mike Blumenkrantz 8c621db693 check image load error when checking dmabuf viability in gl
ref T5418
2017-04-21 16:16:38 -04:00
Mike Blumenkrantz ffb402786b remove uuid references from e_pixmap.c
I don't know what these are for?
2017-04-07 16:08:38 -04:00
Derek Foreman 1fe5b56500 Replace some ecore_time_get users with ecore_loop_time_get
I'm confident these sites can use loop time safely, and they're
frequent callers.
2017-02-10 15:18:19 -06:00
Mike Blumenkrantz aba6687b30 handle pixmap_refresh() failure cases more accurately under wayland
non-usable pixmaps here are still valid in some cases, such as when
no buffer is attached
2017-01-13 11:35:20 -05:00
Derek Foreman d83e885673 Use a monotonic clock for frame callback times 2016-12-15 09:59:21 -06:00
Derek Foreman 0493abf457 Fix wayland frame callback times
ecore_time_unix_get() * 1000 is too big to fit in a uint32, so take the
time we instantiate the wayland pixmap hash and use that as a base.
2016-12-13 13:54:21 -06:00
Derek Foreman ae9d2904c7 test dmabuf pixmaps properly
If we can't handle a dmabuf format we now properly tell the client instead
of accepting it anyway and falling apart later.
2016-12-06 16:37:35 -06:00
Mike Blumenkrantz 0e4ddaffbe use better check for getting wl surface alpha from cursor pixmaps
ref 6ba85cf864
2016-12-05 11:05:24 -05:00
Mike Blumenkrantz b1037cbc5c Revert "Check for deleted client in e_pixmap_image_is_argb"
This reverts commit 6ba85cf864.

returning false here causes csd regions to become opaque (black) during
close animations
2016-12-05 11:05:24 -05:00
Derek Foreman 6ba85cf864 Check for deleted client in e_pixmap_image_is_argb
Fixes a crash when closing Qt applications.
2016-11-29 11:13:50 -06:00
Derek Foreman 9f3de5e346 Fix wayland deferred buffer free crash
We'd sometimes get a stale pointer when doing a deferred buffer free.
2016-11-25 11:14:38 -06:00
Mike Blumenkrantz 38e4e2b9a9 always free wl pixmap buffer list on non-cache image clear
this is only used when the pixmap is freed, after which point accessing
the list guarantees a crash
2016-11-08 12:49:23 -05:00
Mike Blumenkrantz 03ad3620c7 add special case for returning pixmap argb of unusable wl cursor pixmaps
this is usually called before the surface commits, so ensure that the
most likely case is returned as the default until the commit occurs

fixes black rect flickerings around the cursor
2016-11-03 12:28:24 -04:00
Mike Blumenkrantz 13f408f1e1 add more parens for previous pixmap commit 2016-11-03 12:28:06 -04:00
Mike Blumenkrantz 669f00e2e2 avoid crash when calling e_pixmap_image_exists on wl pixmaps without buffers 2016-11-03 12:24:25 -04:00
Mike Blumenkrantz e3590f6c3e determine wl pixmap argb solely based on image_argb flag
the existence of a buffer does not mean that the pixmap can stop being
argb

fixes random black rects
2016-11-03 12:07:46 -04:00
Carsten Haitzler 1afddc3b5e explicitly use eina list types passing into EINA_LIST_FREE() 2016-10-03 11:55:55 +09:00
Romain Naour 8af42ec11d E: include uuid.h only when Wayland support is enabled.
libuuid is checked only when Wayland support is enabled and
uuid_t uuid is guarded by HAVE_WAYLAND.

So move include uuid.h below a HAVE_WAYLAND.

Signed-off-by: Romain Naour <romain.naour@gmail.com>

fix T4298
2016-08-08 11:36:54 -04:00
Chris Michael ab1c2ed5d1 Revert "e - fix major memory bloat when in gl mode - dont create shm segments"
This reverts commit ae6e09ec11.

This breaks resizing of windows inside Enlightenment. Evas_Engines
don't bind a pixmap permanently, they just bind during each render, so
on resize this caused a broken pixmap if we don't create a new one for
each size. This patch Would be correct IF engines worked differently
wrt x pixmap binding during render.
2016-07-26 10:31:03 -04:00
Carsten Haitzler ae6e09ec11 e - fix major memory bloat when in gl mode - dont create shm segments
so e pixmap was ALWAYS creating an ecore_x_image EVERY time for EVERY
window. this means allocate all the sysv shared memory segments for
every window even if never used. this is bad. it litters systems
with unused shared memory segments (ipcs and see) and eats up shared
mem limits/quotas too. we just don't need them in gl unless a window
is shaped or texture from pixmap is off. so allocate the pixmap on
demand, and otherwise leave the ecore x image NULL. this fixes this
bloat.

@fix
2016-07-26 13:27:56 +09:00
Derek Foreman e5e875ded8 Fix dmabuf breakage of non wayland builds.
#IWearTheHatOfShame
2016-05-19 10:23:22 -05:00
Derek Foreman 402c56e1f2 clean up warnings in dmabuf code 2016-05-18 12:34:23 -05:00
Derek Foreman 2d1802375d Add DMABuf support for wayland
This adds compositor handling of DMABuf buffers.  DMAbuf capabilities
are advertised for the drm back-ends, and DMAbuf buffers are handled
as native surfaces.
2016-05-18 12:05:34 -05:00
Derek Foreman 1774b59923 Add e_pixmap API for testing if a pixmap is a native surface
DMAbuf for wayland will complicate determining whether a pixmap can use
a native surface or not, so we add an API here to check this.

Note that this doesn't take compositor capabilities into account - for
example, X pixmaps need GL enabled to use native surfaces.  This is
already tested elsewhere.
2016-05-18 12:05:33 -05:00
Derek Foreman b8ab7b0738 Remove unwanted debug detritus from last commit
#Oops

Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2016-04-07 13:29:58 -04:00
Derek Foreman 68587276cf Clean up some header inclusion
Including certain headers in the wrong order can cause problems if
we're configured to use beta api (right now wayland forces this).

In most cases we should just be including e.h and not the individual
EFL headers anyway.  This fixes some of that.

fix T3426, T3428
2016-04-07 13:14:43 -04:00
Derek Foreman 8f0f9ce4f7 wayland: Fix xdg-popup crash
We need to remove the destroy listener when we delete a pixmap or it
leaves an invalid node on the signal list.
2016-04-01 14:07:45 -04:00
Derek Foreman a4fc286d7f Fix internal window borders on 32-bit computers
Our wayland window ids are 64 bit integers, we need to be careful
about the data type on 32-bit machines where pointers are smaller
than this.
2016-03-10 16:47:09 -05:00
Derek Foreman df7bc5963d Remove argb_convert for wayland buffers
Wayland buffers are currently either ARGB or XRGB - we don't need to
convert either of these, we just need to set alpha appropriately - which
we now do.
2016-03-08 12:46:32 -05:00
Derek Foreman dfc7c26ce4 Rework wayland buffer handling
We need to keep wayland buffers around even if they'll never be written
to again.  This is part of Buffer_Reference's task in weston, but we
already have our pixmap abstraction which can serve mostly the same
purpose.

Remove the "buffer reference" stuff from e_pixmap and replace it with a
kept buffer for the last commit.

Add shared memory pool references to keep pools from going away on us.
2016-03-08 12:46:32 -05:00
Derek Foreman e5e887c773 Add a NULL check in native_surface_init under wayland 2016-03-08 12:46:32 -05:00
Mike Blumenkrantz 6fe6fba44e redo wayland pixmap ids to use monotonic decreasing ints with no collisions
using pointers for this turned out to have some corner case collisions, so
now just use something totally unrelated to the surface to ensure uniqueness
2016-02-25 11:16:09 -05:00
Derek Foreman 6a65d2a546 Protect the wayland frame callback list from corruption
The resource destroy callback for frame callbacks will walk the frame list
to remove itself.  When freeing that list we need to make sure the
resource destroy callback doesn't see the same list we're walking and
corrupt it.
2016-02-18 12:31:31 -06:00
Mike Blumenkrantz ae6416c27c add wayland egl client support
definitely not a feature, I promise™
2015-11-02 16:25:02 -05:00