From f7cbb12fd4eead74948cd4968d030bc4b856009b Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 11 Apr 2016 16:09:12 -0500 Subject: [PATCH] ecore_wl2: Add API to get dmabuf protocol object --- src/lib/ecore_wl2/Ecore_Wl2.h | 22 ++++++++++++++++++++++ src/lib/ecore_wl2/ecore_wl2_display.c | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index fd2e9d1..49302fa 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -326,6 +326,28 @@ EAPI struct wl_display *ecore_wl2_display_get(Ecore_Wl2_Display *display); EAPI struct wl_shm *ecore_wl2_display_shm_get(Ecore_Wl2_Display *display); /** + * Retrieve the wl_dmabuf from a given Ecore_Wl2_Display + * + * + * @param display The Ecore_Wl2_Display for which to retrieve the existing + * Wayland dmabuf interface from + * + * + * @return The wl_dmabuf which this Ecore_Wl2_Display is using + * + * @ingroup Ecore_Wl2_Display_Group + * + * @note This is intended for client use only and should be used only + * after ecore_wl2_display_connect(). Also, the return type is + * void * instead of zpw_linux_dmabuf_v1 * since we don't want + * to change our public API every time the version changes in + * wayland-protocols. + * + * @since 1.18 + */ +EAPI void * ecore_wl2_display_dmabuf_get(Ecore_Wl2_Display *display); + +/** * Return an Eina_Iterator that can be used to iterate through globals * * @param display The Ecore_Wl2_Display for which to return a global iterator diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c index 42ea79d..27f7bc8 100644 --- a/src/lib/ecore_wl2/ecore_wl2_display.c +++ b/src/lib/ecore_wl2/ecore_wl2_display.c @@ -703,6 +703,13 @@ ecore_wl2_display_shm_get(Ecore_Wl2_Display *display) return display->wl.shm; } +EAPI void * +ecore_wl2_display_dmabuf_get(Ecore_Wl2_Display *display) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL); + return display->wl.dmabuf; +} + EAPI Eina_Iterator * ecore_wl2_display_globals_get(Ecore_Wl2_Display *display) { -- 2.7.4