Commit Graph

84 Commits

Author SHA1 Message Date
Elyes HAOUAS 47b71d898e Get rid of trailing whitespaces (13 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12012
2020-06-23 10:31:36 +02:00
Vincent Torri 8db62cb22b remove arguments of LOGFN in ecore_wayland modules as the are always the same
Reviewers: raster, devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11777
2020-05-06 09:18:31 -04:00
Chris Michael ea857a500f evas-wayland-shm: Remove cserve2 support
Summary:
ref T7226

Depends on D6923

Reviewers: raster, cedric, zmike, Hermet

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7226

Differential Revision: https://phab.enlightenment.org/D6924
2018-08-30 13:21:27 +09:00
Derek Foreman 6da0933d60 ecore_wl2: Add alpha to reconfigure
Currently we only ever make wayland windows with alpha, this is a step
towards changing that.
2018-04-20 13:00:27 -05:00
Derek Foreman e4122da211 ecore_wl2: Remove force from surface reconfigure
It no longer has any users or need to exist.
2018-01-26 15:53:59 -06:00
Derek Foreman 3ef4671085 wayland_shm: remove dirty bit entirely
Now that we're not using it for session recovery we can strip it out
entirely.
2018-01-26 15:53:59 -06:00
Derek Foreman dd5edfae03 wayland_shm: Rename all the evas_dmabuf functions
These are going to find a home in ecore_wl2, and this is the last
step before moving them all over there.
2017-12-01 10:58:44 -06:00
Derek Foreman 57622713de wayland_shm: Use wrapper functions instead of function pointers
switch to the new "API"
2017-12-01 10:58:44 -06:00
Derek Foreman dd8d60ad28 wayland_shm: Move surface free into surface_destroy
The caller shouldn't have to free this.
2017-12-01 10:58:44 -06:00
Derek Foreman 8a6c4fe5ff wayland_shm: Stop using outbuf and engine info in surface code
The surface stuff now no longer needs knowledge of those structures.
2017-12-01 10:58:44 -06:00
Derek Foreman 7eb0af45d6 wayland_shm: Pass alpha to surface_create
Stop extracting it from other structures, pass it directly.
2017-12-01 10:58:44 -06:00
Derek Foreman 2b3654c1fd wayland_shm: pass the ecore_wl2_window to surface create
No longer extract this from the engine info.
2017-12-01 10:58:44 -06:00
Derek Foreman 15fdbca653 wayland evas: Remove Ecore_Wl2_Display from engine info
We've got the Ecore_Wl2_Window so we can always get the display from
that.
2017-12-01 10:58:44 -06:00
Derek Foreman e3d6626c0d wayland_shm: Move surface create into dmabuf code
These functions can be combined since there's now only the dmabuf
path.
2017-12-01 10:58:44 -06:00
Derek Foreman 796de8cb86 wayland_shm: Don't use a fixed number of buffers
We no longer allocate 3 buffers at startup, we now allocate only as needed.

Trimming the queue will come later, as there are some situations where we
might need 3 buffers and later drop down to 2 (when on a hardware plane)

Most clients will only ever need 2 buffers, so this is a reasonable RAM
savings.
2017-11-17 14:33:36 -06:00
Derek Foreman f9ff2e4fa5 wayland_shm: Remove surface_type from surface
This has become not only a write-only variable, but also incorrectly set.

Just remove it.
2017-11-15 11:54:37 -06:00
Derek Foreman 6ea82f9f7e wayland_shm: Remove surface damage function
This is now in ecore_wl2
2017-11-10 13:43:45 -06:00
Derek Foreman b5674b7885 wayland_shm: Remove useless function
This serves no purpose anymore.
2017-11-08 15:12:51 -06:00
Derek Foreman 73bddb4471 wayland_shm: Make EVAS_WAYLAND_SHM_DISABLE_DMABUF use new code
Use the new wl_shm allocation functions making the old wl_shm code
unreachable even with the use of the disable env var.
2017-11-08 15:12:51 -06:00
Chris Michael 39184e78af evas-wayland-shm: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:21:59 -05:00
Derek Foreman e207e05067 wayland_shm: Remove hidden from the outbuf
Outbuf shouldn't have to track its hidden status, that should be ecore_evas
problem.  Until now we were doing this because our kludgey wayland
ticking made things difficult, but I think it's safe to remove now.
2017-10-12 12:24:03 -05:00
Derek Foreman 656d892581 wayland_shm: Remove hidden from surface posting calls
Now that we tick based on frame callbacks it should be impossible to post
an update while hidden.
2017-10-12 12:24:03 -05:00
Derek Foreman 4a23e69bcc wayland_shm: Remove surface_set function
Now that we use the display's shm and dmabuf pointers we don't need to
update them.
2017-10-12 12:24:03 -05:00
Derek Foreman 3f576e8436 wayland_shm: Add Outbuf to Surface struct
We're going to need that soon.
2017-10-12 12:24:03 -05:00
Derek Foreman 7faa20f3c8 wayland_shm: Handle dirty bit outside of the backends
We don't have to query that deeply to know whether we need to redraw the
buffer or not, we can make that decision in more generic code.
2017-10-12 12:24:03 -05:00
Derek Foreman 2a15d7b730 wayland_shm: Store the ecore_wl2_display in the Outbuf
We'll need it soon.
2017-10-12 12:24:03 -05:00
Cedric BAIL 3e88aa37bc evas: Render_Engine_Swap_Mode is actually about output swap. 2017-08-25 10:49:15 -07:00
Derek Foreman 972633e7e8 wayland_shm: Remove direct access to wl_surface
Querying it through Ecore_Wl2_Window now
2017-08-18 14:27:32 -05:00
Derek Foreman e3b9fbaed8 wayland: Put Ecore_Wl2_Win instead of wl_surface into the engines
We'll need to track some state in a common way, so attaching it to the
window seems like a good idea.
2017-08-18 14:27:31 -05:00
Chris Michael 6c9dc2a5ba evas-wayland-shm: Compare hidden flag during reconfigure
Small patch to compare if the hidden flag being passed in is the same
as the one stored in Outbuf. With the addition of xdg_shell v6
support, we cannot commit a surface with an existing buffer until the
surface has been configured. In order to facilitate this, we will use
the 'hidden' flag so that any surface_post does not actually attach a
buffer unless configure has already been handled on the surface.

ref T5090

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-11 12:36:33 -05:00
Chris Michael d1216ba7dd evas-wayland-shm: Minor formatting fix
NB: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-11 12:36:16 -05:00
Derek Foreman 4c1227433f wayland_shm: Add a way to update the stored wayland objects
On session recovery the engine needs to be given new copies of the
surface, dmabuf, and shm objects to run in the new connection.

This fixes session recovery breakage introduced when we stopped recreating
the outbuf on reconfigure.
2017-01-05 13:40:31 -06:00
Derek Foreman 7b0f937880 wayland_shm: Add a force flag to surface reconfigure
We're going to need a way to force reconfigure unconditionally to make
session recovery work again.
2017-01-05 13:40:31 -06:00
Chris Michael 5ebba44635 evas-wayland-shm: Don't destroy Outbuf on resize
On an engine resize, rather than destroy & recreate the Outbuf
structure (and the associated surface) we can just call the
eng_output_resize function (which in turn will call
outbuf_reconfigure) to update Outbuf with new properties. This saves
us from having to create a whole new Outbuf every time we resize.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-06 13:03:52 -05:00
Chris Michael 9492ee21df evas-wayland-shm: Fix issue of destroying & recreating wl_surfaces on hide
When a canvas gets hidden, we don't need to destroy & recreate the
wl_surface. We can simply attach a NULL wl_buffer to the surface which
achieves the same result. This saves us from having to always destroy
& recreate surfaces when we hide/show.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-02 14:25:10 -05:00
Derek Foreman 9b6ec1ecc3 wayland_shm: enable dmabuf by default
Software rendered wayland clients will now attempt
to use dmabuf on some platforms.  This results in a window
that a compositor may be able to drop into a plane without a copy.

Disable it with the env var EVAS_WAYLAND_SHM_DISABLE_DMABUF
but if you need to disable it, please ping me or file a bug report.
2016-12-01 15:05:52 -06:00
Derek Foreman af4a71bcf0 wayland evas engines: share engine info structure
These engines are incredibly similar - by sharing the same engine info
structure we'll be able to simplify the wayland ecore_evas bits and
make them much more maintainable.
2016-11-02 13:37:01 -05:00
Chris Michael 21a8fbde7e evas-wayland-shm: Don't post updates to surface if no surface
In the event that an ecore_evas (using wayland_shm) gets hidden then
the corresponding wl_surface gets destroyed. If evas_norender is
called after that, the outbuf_redraws_clear function follows.
Outbuf_redraw_clear function ends up trying to post updates to the
wl_surface however if that wl_surface is gone, then we end up crashing.

This patch addresses that issue by checking for a valid wl_surface
inside the engine before trying to post updates to that wl_surface.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 001d8255b8 evas-wayland-shm: Remove unused varible
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 12:18:30 -04:00
Chris Michael 0fa7abae7b evas-wayland-shm: Get page flips out of the render thread
Now that we have redraws_clear exposed through software generic, we can
use that to do the final buffer swap from the main thread instead of doing
it in outbuf_flush which runs from the render thread.

This becomes more important later when other call sites in the main thread
will perform buffer flips.

Based on 95a00b8e49 by Derek Foreman

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 12:00:39 -04:00
Chris Michael bb2a55ead6 evas-wayland-shm: Default to triple buffering
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:33:07 -04:00
Derek Foreman 7a978fe58c evas_engines: Send both surface and buffer damage to outbuf_flush callback
Some engines should using sending surface damage, until now we'd only ever
provided them with buffer damage.

The difference is that surface damage is the damage to the surface the
compositor is displaying, and the buffer damage is the damage to the
buffer the client has rendered.  These are different when the client
is using multiple buffers of different ages to render into.

Anything that calls eglSwapBuffersWithDamage, wl_surface_damage() or
wl_surface_damage_buffer() should be using surface damage, and not
buffer damage.

This patch is intended to make no functional change - any flush cb that
used buffer damage before still should.  Actual fixes to follow.

Apologies if I broke any engines - it's a bit of a copy and wasteland
out here.
2016-10-19 16:29:05 -05:00
Derek Foreman 455afb707f Revert "wayland_shm: Add swap mode fallback when buffer age changes"
This reverts commit 62ca4486ea.

Honestly, I think the gl_x11 code doesn't make sense either. :)

There's no logical reason that we have to do that, though it may be
hiding some other bug?  If that's the case, the bug should be fixed
properly.
2016-10-19 16:29:05 -05:00
Jean-Philippe Andre 62ca4486ea wayland_shm: Add swap mode fallback when buffer age changes
This copies the behaviour in opengl_x11 engine, where the buffer
age needs to be continuously the same to be taken into account.
If the age varies, then we fallback to a full redraw.

Apparently this fixes issues on actual devices. I tested this
patch in weston (I didn't have issues before and buffer age is 1).
2016-10-18 17:40:01 +09:00
Chris Michael 59a09e04aa evas-wayland-shm: Remove logically dead code
Coverity reports that this bpp check is actuall dead code due to the
fact that bpp can never be < 0.

Fixes Coverity CID1357144

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 10:56:01 -04:00
Derek Foreman d2a3502481 wayland_shm: Make dmabuf opt-in
Some weird bugs and performance issues around these days, and I
keep chasing them in dmabuf first.  Removing it from the equation for
now.
2016-06-23 13:55:03 -05:00
Derek Foreman 16108a972f wayland_shm: Fix bad indenting 2016-05-03 14:24:45 -05:00
Derek Foreman 4f6e7a8ab3 wayland_shm: Fix dmabuf fallback to shm
The outbuf code should free the surface structure, not the dmabuf
abstraction or a use after free occurs on fallback.

Re-organize some code to make sure we don't rely on anything that may
have already been freed.

Add a wl_surface_commit() to keep the animation timer alive through
the fallback process.
2016-05-03 14:24:45 -05:00
Derek Foreman 45a662c91c wayland_shm: Add dmabuf support
This adds a separate backend to the "shm" engine that allows allocation
of buffers via libdrm that can be turned into dmabuf handles and used
with the wayland dmabuf extension.

Currently only the intel buffer manager is supported.

The benefit of dmabuf buffers is that they don't require a texture upload
like shm buffers do, and when we have plane support they can be dropped
directly into a plane without a memcpy.
2016-04-19 15:11:10 -04:00
Derek Foreman 0d684d4559 wayland_shm: Refactor surface creation
Split this into two parts, one that makes the base surface, one that
calls the potential back ends.

Once the dmabuf backend is added this will allow a fallback path to
re-initialize the surface as wl_shm if dmabuf fails.
2016-04-19 15:11:10 -04:00