From 95bf3debd35f11253e29571ea929f5eedd4135a8 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 21 Jun 2017 14:10:20 -0500 Subject: [PATCH] native surface: Add scanout handlers When a native surface ends up on a hardware plane, the caller needs to know about it so it can prevent the resource from being destroyed while on scanout (which may cause an implicit page flip and a stall), and so it knows that the content may have changed usage domains. This adds stubs for dealing with this - only for wl dmabuf right now, but it may be useful for other surface types later. --- src/lib/evas/Evas_Legacy.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 3fd1fcb02a..523be80d52 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -4254,7 +4254,7 @@ EAPI void evas_object_image_memfile_set(Evas_Object *ob * Magic version number to know what the native surface struct looks like */ -#define EVAS_NATIVE_SURFACE_VERSION 4 +#define EVAS_NATIVE_SURFACE_VERSION 5 /** * Native surface types that image object supports @@ -4273,6 +4273,28 @@ typedef enum _Evas_Native_Surface_Type EVAS_NATIVE_SURFACE_WL_DMABUF, /**< Wayland system based type. using dmabuf @since 1.18 */ } Evas_Native_Surface_Type; +/** + * Native surface types that image object supports + * + * @see Evas_Native_Surface + * @see evas_object_image_native_surface_set() + */ +typedef enum _Evas_Native_Surface_Status +{ + EVAS_NATIVE_SURFACE_STATUS_SCANOUT_ON, + EVAS_NATIVE_SURFACE_STATUS_SCANOUT_OFF, + EVAS_NATIVE_SURFACE_STATUS_PLANE_ASSIGN, + EVAS_NATIVE_SURFACE_STATUS_PLANE_RELEASE, +} Evas_Native_Surface_Status; + +typedef void (*Evas_Native_Scanout_Handler)(void *scanout_data, Evas_Native_Surface_Status status); + +typedef struct _Evas_Native_Scanout +{ + Evas_Native_Scanout_Handler handler; + void *data; +} Evas_Native_Scanout; + /** * @brief A generic datatype for engine specific native surface information. * @@ -4328,6 +4350,7 @@ typedef struct _Evas_Native_Surface { void *attr; /**< Pointer to dmabuf attributes - contents copied */ void *resource; /**< Wayland resource pointer, kept as is */ + Evas_Native_Scanout scanout; } wl_dmabuf; /**< Set this struct fields if surface data is Wayland dmabuf based. @since 1.18 */ struct {