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.
This commit is contained in:
Derek Foreman 2017-06-21 14:10:20 -05:00
parent 1552f85ede
commit 95bf3debd3
1 changed files with 24 additions and 1 deletions

View File

@ -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
{