vblank: add tdm_vblank_get_output
[platform/core/uifw/libtdm.git] / include / tdm_types.h
index 3cd8560..d5e6b18 100644 (file)
@@ -38,6 +38,8 @@
 
 #include <tbm_surface.h>
 
+#include "tdm_common.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -57,8 +59,6 @@ extern "C" {
  * @endcode
  */
 
-#include <tdm_common.h>
-
 typedef enum {
        TDM_EVENT_LOOP_READABLE = (1 << 0),
        TDM_EVENT_LOOP_WRITABLE = (1 << 1),
@@ -67,6 +67,14 @@ typedef enum {
 } tdm_event_loop_mask;
 
 /**
+ * @brief The display capability enumeration
+ */
+typedef enum {
+       TDM_DISPLAY_CAPABILITY_PP       = (1 << 0), /**< if hardware supports pp operation */
+       TDM_DISPLAY_CAPABILITY_CAPTURE  = (1 << 1), /**< if hardware supports capture operation */
+} tdm_display_capability;
+
+/**
  * @brief The output mode structure
  */
 typedef struct _tdm_output_mode {
@@ -85,6 +93,7 @@ typedef struct _tdm_output_mode {
 typedef struct _tdm_prop {
        unsigned int id;
        char name[TDM_NAME_LEN];
+       tdm_value_type type;
 } tdm_prop;
 
 /**
@@ -106,6 +115,21 @@ typedef struct _tdm_info_layer {
 } tdm_info_layer;
 
 /**
+ * @brief The hwc window info structure
+ * @since 2.0.0
+ */
+typedef struct _tdm_hwc_window_info {
+       tdm_info_config src_config;
+       tdm_pos dst_pos;
+       tdm_transform transform;
+} tdm_hwc_window_info;
+
+typedef struct _tdm_hwc_region {
+       unsigned int num_rects;
+       tdm_pos const *rects;
+} tdm_hwc_region;
+
+/**
  * @brief The pp info structre
  */
 typedef struct _tdm_info_pp {
@@ -128,11 +152,80 @@ typedef struct _tdm_info_capture {
 } tdm_info_capture;
 
 /**
+ * @brief Possible composition types for a given window
+ * @since 2.0.0
+ */
+typedef enum {
+
+       /** Set by the client for an invisible window. The value by default.
+        *
+        * The device ignores windows of this type.
+        */
+       TDM_COMPOSITION_NONE = 0,
+
+       /** The client will composite this window into the client target window
+        *
+        * User can choose this type for window to avoid a hardware composition for
+        * this window.
+        *
+        * The device must not request any composition type changes for windows of
+        * this type.
+        */
+       TDM_COMPOSITION_CLIENT = 1,
+
+       /** Set by the client before tdm_output_hwc_validate().
+        *
+        * Upon tdm_output_hwc_validate(), the device may request a change from this type to
+        * TDM_COMPOSITION_DEVICE or TDM_COMPOSITION_CLIENT. */
+       TDM_COMPOSITION_DEVICE_CANDIDATE = 2,
+
+       /** Set by the HWC after tdm_output_hwc_validate().
+        *
+        * The device will handle the composition of this window through a hardware
+        * overlay or other similar means.
+        *
+        * Upon tdm_output_hwc_validate(), the device may request a change from this type to
+        * TDM_COMPOSITION_CLIENT or TDM_COMPOSITION_DEVICE_CANDIDATE. */
+       TDM_COMPOSITION_DEVICE = 3,
+
+       /** Similar to DEVICE, but the position of this layer may also be set
+        * asynchronously through layer_set_cursor_position. If this functionality is not
+        * supported on a layer that the client sets to TDM_COMPOSITION_CURSOR, the
+        * device must request that the composition type of that layer is changed to
+        * TDM_COMPOSITION_CLIENT upon the next call to tdm_output_hwc_validate().
+        *
+        * Upon tdm_output_hwc_validate(), the device may request a change from this type to
+        * either TDM_COMPOSITION_DEVICE or TDM_COMPOSITION_CLIENT. Changing to
+        * TDM_COMPOSITION_DEVICE will prevent the use of layer_set_cursor_position but
+        * still permit the device to composite the layer. */
+       TDM_COMPOSITION_CURSOR = 4,
+
+       /** This type is for the VIDEO window which can be set to the reserved hw overlay
+        *  which is assigned by the device.
+        *
+        * Normally, this VIDEO window displays under the primary hw overlayer of the output. */
+       TDM_COMPOSITION_VIDEO = 5,
+} tdm_hwc_window_composition;
+
+/**
+ * @brief The hwc window flag enumeration
+ * @since 2.0.0
+ */
+typedef enum {
+       TDM_HWC_WINDOW_FLAG_NONE     = 0,
+} tdm_hwc_window_flag;
+
+/**
  * @brief The tdm display object
  */
 typedef void tdm_display;
 
 /**
+ * @brief The tdm backend object
+ */
+typedef void tdm_backend;
+
+/**
  * @brief The tdm output object
  */
 typedef void tdm_output;
@@ -143,6 +236,12 @@ typedef void tdm_output;
 typedef void tdm_layer;
 
 /**
+ * @brief The tdm window object
+ * @since 2.0.0
+ */
+typedef void tdm_hwc_window;
+
+/**
  * @brief The tdm capture object
  */
 typedef void tdm_capture;
@@ -158,6 +257,16 @@ typedef void tdm_pp;
 typedef void tdm_vblank;
 
 /**
+ * @brief The output change handler
+ * @details This handler will be called when the status of a output object is
+ * changed in runtime.
+ */
+typedef void (*tdm_output_change_handler)(tdm_output *output,
+                                                                                 tdm_output_change_type type,
+                                                                                 tdm_value value,
+                                                                                 void *user_data);
+
+/**
  * @brief The vblank handler
  * @see output_set_vblank_handler() function of #tdm_func_display
  */
@@ -166,12 +275,34 @@ typedef void (*tdm_output_vblank_handler)(tdm_output *output, unsigned int seque
                                                                                  void *user_data);
 
 /**
- * @brief The commit handler
+ * @brief The output commit handler
  * @see output_set_commit_handler() function of #tdm_func_display
  */
 typedef void (*tdm_output_commit_handler)(tdm_output *output, unsigned int sequence,
                                                                                  unsigned int tv_sec, unsigned int tv_usec,
                                                                                  void *user_data);
+
+/**
+ * @brief The layer commit handler
+ */
+typedef void (*tdm_layer_commit_handler)(tdm_layer *layer, unsigned int sequence,
+                                                                                unsigned int tv_sec, unsigned int tv_usec,
+                                                                                void *user_data);
+
+/**
+ * @brief The hwc_window commit handler
+ */
+typedef void (*tdm_hwc_window_commit_handler)(tdm_hwc_window *hwc_window, unsigned int sequence,
+                                                                                unsigned int tv_sec, unsigned int tv_usec,
+                                                                                void *user_data);
+
+/**
+ * @brief The output target_buffer commit handler
+ */
+typedef void (*tdm_output_hwc_target_buffer_commit_handler)(tdm_output *output, unsigned int sequence,
+                                                                                unsigned int tv_sec, unsigned int tv_usec,
+                                                                                void *user_data);
+
 /**
  * @brief The done handler of a pp object
  */
@@ -184,6 +315,17 @@ typedef void (*tdm_pp_done_handler)(tdm_pp *pp, tbm_surface_h src,
 typedef void (*tdm_capture_done_handler)(tdm_capture *capture,
                                                                                 tbm_surface_h buffer, void *user_data);
 
+/**
+ * @brief The create handler of a vblank object
+ */
+typedef void (*tdm_vblank_create_handler)(tdm_vblank *vblank, void *user_data);
+
+/**
+ * @brief The 'need to validate' handler of an output object
+ * @since 2.0.0
+ */
+typedef void (*tdm_output_need_validate_handler)(tdm_output *output);
+
 #ifdef __cplusplus
 }
 #endif