From 69e26b823f4c84b3f7a74d43176340d58f03f10f Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 17:04:33 +0900 Subject: [PATCH] virtual: add output create/destroy interface Change-Id: I1ee25761ef62df057c4bbfa63408f47501cda380 --- include/tdm.h | 23 +++++++++++++++++++++++ include/tdm_backend.h | 9 +++++++++ include/tdm_common.h | 1 + 3 files changed, 33 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index 7beccd0..979c35e 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -206,6 +206,16 @@ tdm_display_get_output_count(tdm_display *dpy, int *count); tdm_output * tdm_display_get_output(tdm_display *dpy, int index, tdm_error *error); +tdm_error +tdm_display_add_output_create_handler(tdm_display *dpy, + tdm_output_create_handler func, + void *user_data); + +void +tdm_display_remove_output_create_handler(tdm_display *dpy, + tdm_output_create_handler func, + void *user_data); + /** * @brief Find a output object which has the given name. * @param[in] dpy A display object @@ -238,6 +248,16 @@ tdm_error tdm_module_get_info(tdm_module *module, const char **name, const char **vendor, int *major, int *minor); +tdm_error +tdm_output_add_destroy_handler(tdm_output *output, + tdm_output_destroy_handler func, + void *user_data); + +void +tdm_output_remove_destroy_handler(tdm_output *output, + tdm_output_destroy_handler func, + void *user_data); + /** * @brief Get a backend module object of the given output. * @param[in] output A output object @@ -761,6 +781,9 @@ tdm_layer_get_displaying_buffer(tdm_layer *layer, tdm_error *error); tdm_error tdm_layer_set_buffer_queue(tdm_layer *layer, tbm_surface_queue_h buffer_queue); +tdm_error +tdm_layer_get_own_buffer_queue(tdm_layer *layer, tbm_surface_queue_h *buffer_queue); + /** * @brief Unset a TBM surface_queue from a layer object * @details When this function is called, a current surface_queue will be diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 72136b1..a28654a 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -682,6 +682,15 @@ typedef struct _tdm_func_layer { */ tdm_error (*layer_get_buffer_flags)(tdm_layer *layer, unsigned int *flags); + /** + * @brief Get buffer queue which the layer offers. + * @param[in] layer A layer object + * @param[out] buffer_queue The buffer queue + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + * @since 2.0.0 + */ + tdm_error (*layer_get_buffer_queue)(tdm_layer *layer, tbm_surface_queue_h *buffer_queue); + void (*reserved1)(void); void (*reserved2)(void); void (*reserved3)(void); diff --git a/include/tdm_common.h b/include/tdm_common.h index 328f837..cc79e90 100644 --- a/include/tdm_common.h +++ b/include/tdm_common.h @@ -134,6 +134,7 @@ typedef enum { TDM_LAYER_CAPABILITY_SCANOUT = (1 << 10), /**< if a layer allows a scanout buffer only */ TDM_LAYER_CAPABILITY_RESEVED_MEMORY = (1 << 11), /**< if a layer allows a reserved buffer only */ TDM_LAYER_CAPABILITY_NO_CROP = (1 << 12), /**< if a layer has no cropping capability */ + TDM_LAYER_CAPABILITY_BUFFER_QUEUE = (1 << 13), /**< if a layer has an own buffer queue */ } tdm_layer_capability; /** -- 2.7.4