Commit Graph

37 Commits

Author SHA1 Message Date
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
Derek Foreman 8635f56aeb wayland_shm: pass engine info to shm_surface_create
Gratuitous change to pass less parameters and make some code prettier.
2016-04-19 15:11:10 -04:00
Derek Foreman 0ada4d3d56 wayland_shm: Pull the damage stuff out of evas_shm
This doesn't really care what the buffers were allocated with, so
let's make this chunk of code useful to both the shm method and the
upcoming dmabuf one
2016-04-19 15:11:10 -04:00
Derek Foreman 2c33bae2d5 wayland_shm: Don't pass num_buff to reconfigure
We can't really reconfigure the number of buffers after they're created,
there's nothing above us that would try to do it...
2016-04-19 15:11:10 -04:00
Derek Foreman e5fb4cada7 wayland_shm: Gratuitous code simplification
Refactor evas_outbuf_setup a bit so there's only one call to
_evas_shm_surface_create.

Also makes the NULL return on unhandled rotation a lot more obvious.
2016-04-19 15:11:09 -04:00
Derek Foreman 405b278528 wayland_shm: Pass Evas_Engine_Info_Wayland_Shm directly to setup functions
We pretty much pass all its contents anyway.
2016-04-19 15:11:09 -04:00
Derek Foreman ed665ee6ee wayland_shm: Abstract the actual shm operations
Make the Surface carry function pointers and the shm surface create
function set them.  This refactor makes implementing dmabuf operations
simpler.
2016-04-19 15:11:09 -04:00
Derek Foreman 4c61ec5e05 wayland_shm: Remove unused dx, dy params from resize functions
We don't appear to actually use these for anything except long term storage
2016-04-19 15:11:09 -04:00
Derek Foreman 7e2f5e759e wayland_shm: Remove flags
We only used this for resize, and didn't actually even need it then.
2016-04-19 15:11:09 -04:00
Derek Foreman 745435deab wayland_shm: Don't use number of buffers in swap mode calculation
The number of allocated buffers shouldn't change a thing...
2016-04-19 15:11:09 -04:00
Derek Foreman f92c2d2330 wayland_shm: Return buffer age from shm_surface_assign
This makes refactoring the Surface abstraction a little easier.
2016-04-19 15:11:09 -04:00
Chris Michael 6a1a1305b5 evas-wayland-shm: Fix rotation for wayland shm engine
Prior to this fix, window rotation was not operating correctly and the
surface contents would get rendered at the wrong size and position.
This patch fixes the engine so that rotation operates properly now.

NB: Tested with the Window States(2) test in elementary

Thanks to shiin for reporting :)

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-21 09:29:32 -04:00
Derek Foreman ddae80af1d wayland: use wl_surface.damage_buffer if available
Summary:
wl_surface.damage_buffer() takes surface damage in buffer co-ordinates.

Right now since we don't use wayland's scaling, transforms, or viewports
it's exactly the same as wl_surface.damage().  In the future if we start
using those features it's much easier to do so with damage_buffer().

Reviewers: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3457
2015-12-28 09:09:04 -05:00
Tom Hacohen 4a92415d12 Evas engine wayland_shm: pass the correct enum value.
Following this patch, the correct enum type is now passed to this
function. It's also passing the same value (0), but now from the correct
enum. This doesn't change behaviour, and looks like what was intended.

This fixes the clang warning.
2015-10-09 14:24:30 +01:00
Chris Michael 37718b2cf6 evas-wayland-shm: Fix silly typo
Summary: OOpppss, this should be eina_rectangle_free

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-08 15:15:00 -04:00
Chris Michael dd8ec36962 evas-wayland-shm: Don't leak rectangles during flush
Summary: As we loop the regions of the output buffer and accumulate
changes to post, we should be freeing the rectangles when we are done
with them.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-08 13:35:07 -04:00
Chris Michael fae40e995b evas-wayland-shm: Pass along the wl_display parameter to the surface creation function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-30 15:10:49 -04:00
Chris Michael 37b767994e evas-wayland-shm: If no depth is specified during reconfigure, use existing depth
Summary: This fixes a crash which Could occur if no outbuf depth was
given during a call to reconfigure.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-30 13:53:10 -04:00
Derek Foreman f86e04b14f wayland-shm: Introduce buffer ages
Summary:
We now track each shm buffer's time since last draw so evas can tell
what it needs to re-render.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2893
2015-07-30 11:45:38 -04:00
Derek Foreman 997e84f14e wayland-shm: Assign buffers in the swap_mode callback
Summary:
This is when we're about to start a new render, so it's the best
time to set up the next buffer to draw to.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2892
2015-07-30 11:45:32 -04:00
Derek Foreman ebea504cbc wayland-shm: rename _evas_outbuf_swapmode_get() to _evas_outbuf_swap_mode_get()
Summary: Everyone else calls it swap_mode, let's be trendy.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2891
2015-07-30 11:45:26 -04:00
Derek Foreman cf3434a927 wayland-shm: Remove curr_buff from Shm_Surface
Summary:
We already have *current, but we're not using it properly.  Let's throw
out curr_buff and just use *current.

This temporarily makes swapmode_get do full renders, this will be
fixed in a future commit that adds proper buffer ages.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2890
2015-07-30 11:45:17 -04:00
Derek Foreman 525269dc98 wayland-shm: Use MAX_BUFFERS macro instead of magic 4
Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2888
2015-07-30 11:44:57 -04:00
Derek Foreman d2f5d240a4 wayland-shm: rename _evas_shm_surface_redraw() to _evas_shm_surface_post()
Summary:
It doesn't redraw anything, it posts a buffer full of data to the
compositor.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2887
2015-07-30 11:44:49 -04:00
Derek Foreman f59f83810c wayland-shm: remove _evas_shm_surface_swap()
Summary: It no longer does anything useful

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2886
2015-07-30 11:44:39 -04:00
Derek Foreman d68c382105 wayland-shm: Remove "mapped"
Summary:
Looks like the recent changes to swap/redraw have fixed a problem with
damage tracking and we no longer need this.

Damage history seems ok without it now.

@fix

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2876
2015-07-28 09:19:12 -04:00
Derek Foreman 0b284d0914 wayland-shm: re-organize some of the swap/redraw logic
Summary:
The way things were, we'd be committing a buffer we hadn't rendered to
yet.

Now redraw() contains all the attach/damage/commit logic, and swap() is
called afterwards to set up a new target buffer for the next render.

@fix

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2875
2015-07-28 09:19:07 -04:00
Chris Michael 43ddf5b69d evas-wayland-shm: Don't call surface commit until we've setup the frame listener
Summary: This fixes an issue where we may been missing a frame
callback due to the wl_surface_commit being called before the frame
callback listener was setup. Now we will setup the frame callback
listener before doing any wl_surface_commit so that we don't miss
frames.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-27 15:53:02 -04:00
Chris Michael faa99297e0 evas-wayland-shm: Fix T2352 (focused window borders blink)
Summary: This fixes an issue where the wrong swapmode was being
returned to the evas render function. This was causing focused windows
to blink.

NB: Big thanks to Derek for assisting !! :)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-30 11:15:00 -04:00
Chris Michael a3969b4d3a evas-wayland-shm: Use size of buffer when caching
Summary: evas_cache and evas_cache2 are expecting the width of the
buffer when caching so just use that directly rather than calculating
bpl.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-29 11:14:38 -04:00
Chris Michael 57bdbf6793 evas-wayland-shm: Fix redrawing issues that were causing 'flashing' in latest engine code.
Summary: As reported by derek & zmike, the previous engine refactor
left some issues where the app would 'flash' during redraws due to
buffer handling. This commit fixes that issue along with flashing
during resize.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-19 16:17:25 -04:00
Chris Michael 3ebe41af18 evas-wayland-shm: Refactor Evas Wayland Shm Engine (Fix T2201)
Summary: This patch set fixes the issue of Evas wayland shm engine
causing crashes when resizing efl apps in the E wayland compositor. It
refactors the evas engine to wait for release events on buffers, and
hooks into frame callbacks so that release events will get triggered
at the appropriate time.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-17 15:49:09 -04:00
Christopher Michael 0b5e371bc7 Remove old wayland shm engine code.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 83211
2013-01-24 09:13:54 +00:00
Carsten Haitzler 940a75b5a8 devilhorns: warning told me that x is not being used.. and that looks
bad... i added it into dest as thats obviously how it should be.. can
u double check?



SVN revision: 79312
2012-11-15 05:01:16 +00:00
Vincent Torri c15e9c6575 merge: and now Evas
I've tested make -j 3 install and it works nicely

I've tested expedite with software and opengl xlib,
and it works. Not tested other engines, so please
report any problems (engines or other) on the ML.

TODO: examples and tests, I'll add them later

ISSUE: Eina_Unicode size check. It indirectly depends on
       eina_config.h, which is created at the end of the
       configure script. So its size is always 0. I don't
       know how that size is used, so I can't do a lot,
       for now.


SVN revision: 78895
2012-11-04 11:51:42 +00:00