diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2017-06-23 10:39:55 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2017-06-23 11:54:08 -0500 |
commit | 5de9f0f8a3238d95eea9a6cd4093c69158b40f05 (patch) | |
tree | 0f5fa2f20da491ca9ce3d31c73528b8e6fddcc5e | |
parent | 18fbd1da3236ba2ef6e272824a4e34404b2de2e6 (diff) | |
download | enlightenment-5de9f0f8a3238d95eea9a6cd4093c69158b40f05.tar.gz |
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.
-rw-r--r-- | src/bin/e_pixmap.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index b42851d8c8..9758c7e9bf 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -709,6 +709,31 @@ e_pixmap_is_pixels(E_Pixmap *cp) } } +#ifdef HAVE_WAYLAND +static void +_e_pixmap_scanout_handler(void *data, Evas_Native_Surface_Status status) +{ + E_Comp_Wl_Buffer *buffer; + + buffer = data; + switch (status) + { + case EVAS_NATIVE_SURFACE_STATUS_SCANOUT_ON: + buffer->busy++; + break; + case EVAS_NATIVE_SURFACE_STATUS_SCANOUT_OFF: + _e_pixmap_wl_resource_release(buffer); + break; + case EVAS_NATIVE_SURFACE_STATUS_PLANE_ASSIGN: + buffer->busy++; + break; + case EVAS_NATIVE_SURFACE_STATUS_PLANE_RELEASE: + _e_pixmap_wl_resource_release(buffer); + break; + } +} +#endif + E_API Eina_Bool e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns) { @@ -748,6 +773,11 @@ e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns) ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes; ns->data.wl_dmabuf.resource = cp->buffer->resource; + if (getenv("E_USE_HARDWARE_PLANES")) + { + ns->data.wl_dmabuf.scanout.handler = _e_pixmap_scanout_handler; + ns->data.wl_dmabuf.scanout.data = cp->buffer; + } ret = EINA_TRUE; } else if (!cp->buffer->shm_buffer) |