unsigned int type_id; /**< The connection type id */
unsigned int mode_count; /**< The count of available modes */
- tdm_output_mode
- *modes; /**< The @b newly-allocated array of modes. will be freed in frontend. */
+ tdm_output_mode *modes; /**< The @b newly-allocated array of modes. will be freed in frontend. */
unsigned int prop_count; /**< The count of available properties */
tdm_prop *props; /**< The @b newly-allocated array of properties. will be freed in frontend. */
/**
* @brief Get the mode of a output object
- * @deprecated
* @param[in] output A output object
* @param[out] mode A output mode
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
* The damage parameter describes a buffer damage region as defined in the
* description of hwc_window_set_buffer_damage().
*
+ * List of composited hwc_windows (hwc_windows which buffers are presented on #target_buffer)
+ * will be passed along with #target_buffer to allow tdm to make the smooth transition
+ * from a DEVICE type to a CLIENT type.
+ *
* Will be called before output_commit() if any of the layers are marked as
* TDM_COMPOSITION_CLIENT or TDM_COMPOSITION_DEVICE_CANDIDATE. If no layers are
* so marked, then it is not necessary to call this function. It is not necessary
* @param[in] output A output object
* @param[in] target The new target buffer
* @param[in] damage The buffer damage region
+ * @param[in] composited_wnds The array of composited hwc_wnds
+ * @param[in] num_wnds The size of #composited_wnds array
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @since 2.0.0
+ */
+ tdm_error (*output_hwc_set_client_target_buffer)(tdm_output *output, tbm_surface_h target_buffer, tdm_hwc_region damage);
+
+ /**
+ * @brief Unset the client(relative to the TDM) target buffer
+ * @details TODO
+ * @param[in] output A output object
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
* @since 2.0.0
*/
- tdm_error (*output_hwc_set_client_target_buffer)(tdm_output *output, tbm_surface_h target_buffer,
- tdm_hwc_region damage);
+ tdm_error (*output_hwc_unset_client_target_buffer)(tdm_output *output);
+
+ /**
+ * @brief Get the layer associated with the client target buffer
+ * @details TODO:
+ * @param[in] output A output object
+ * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @return A layer object.
+ * @since 2.0.0
+ */
+ tdm_layer *(*output_hwc_get_client_target_buffer_layer)(tdm_output *output, tdm_error *error);
+
+ /**
+ * @brief Get the buffer which is set to the client target buffer
+ * @details TODO:
+ * @param[in] output A output object
+ * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @return A layer object.
+ * @since 2.0.0
+ */
+ tbm_surface_h (*output_hwc_get_client_target_buffer)(tdm_output *output, tdm_error *error);
/**
* @brief Validate the output
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
* @since 2.0.0
*/
- tdm_error (*output_hwc_validate)(tdm_output *output, uint32_t *num_types);
+ tdm_error (*output_hwc_validate)(tdm_output *output, tdm_hwc_window **composited_wnds, uint32_t num_wnds,
+ uint32_t *num_types);
/**
* @brief Get changed composition types
tbm_surface_queue_h (*output_hwc_get_target_buffer_queue)(tdm_output *output,
tdm_error *error);
- void (*reserved3)(void);
- void (*reserved4)(void);
+ /**
+ * @brief Get the supported format array for video hwc windows of a output object.
+ * @param[in] output A output object
+ * @param[out] formats The available format array
+ * @param[out] count The count of formats
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+ tdm_error (*output_hwc_get_video_supported_formats)(tdm_layer *layer,
+ const tbm_format **formats, int *count);
+
+ /**
+ * @brief Creates a new video window on the given output.
+ * @param[in] output A output object
+ * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @return A created window object. If the video abilities isn't accessed return NULL
+ * @since 2.0.0
+ */
+ tdm_hwc_window *(*output_hwc_create_video_window)(tdm_output *output, tdm_error *error);
+
void (*reserved5)(void);
void (*reserved6)(void);
void (*reserved7)(void);
tdm_error *error);
/**
- * @brief Sets the desired Z order (height) of the given window. A window with
- * a greater Z value occludes a window with a lesser Z value.
- * @param[in] hwc_window A window object
- * @param[in] z the new Z order
- * @return #TDM_ERROR_NONE if success. Otherwise, error value.
- */
- tdm_error (*hwc_window_set_zpos)(tdm_hwc_window *hwc_window, uint32_t zpos);
-
- /**
* @brief Sets the desired composition type of the given window.
* @details During output_hwc_validate(), the device may request changes to
* the composition types of any of the layers as described in the definition
tdm_hwc_window_info *info);
/**
+ * @brief Get the geometry information to a layer object
+ * @param[in] layer A layer object
+ * @param[out] info The geometry information
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+ tdm_error (*hwc_window_get_info)(tdm_hwc_window *hwc_window,
+ tdm_hwc_window_info *info);
+
+ /**
* @brief Set a TDM buffer to a window object
* @details A TDM buffer will be applied when the output object
* of a layer object is committed.
* @param[in] hwc_window A window object
* @param[in] buffer A TDM buffer
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ *
+ * Implementation should return #TDM_ERROR_BUSY if #hwc_window can't
+ * be updated right now, this won't be interpreted like some critical
+ * error.
*/
tdm_error (*hwc_window_set_buffer)(tdm_hwc_window *hwc_window,
tbm_surface_h buffer);
/**
+ * @brief Unset a TDM buffer to a window object
+ * @details A TDM buffer will be applied when the output object
+ * of a layer object is committed.
+ * @param[in] hwc_window A window object
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ *
+ * Implementation should return #TDM_ERROR_BUSY if #hwc_window can't
+ * be updated right now, this won't be interpreted like some critical
+ * error.
+ */
+ tdm_error (*hwc_window_unset_buffer)(tdm_hwc_window *hwc_window);
+
+ /**
+ * @brief Get a buffer which is set to a window object
+ * @details A TDM buffer will be applied when the output object
+ * of a layer object is committed.
+ * @param[in] hwc_window A window object
+ * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @return A buffer which is @b assigend to a window object
+ *
+ * Implementation should return #TDM_ERROR_BUSY if #hwc_window can't
+ * be updated right now, this won't be interpreted like some critical
+ * error.
+ */
+ tbm_surface_h (*hwc_window_get_buffer)(tdm_hwc_window *hwc_window,
+ tdm_error *error);
+
+ /**
+ * @brief Get a layer associated with a window object
+ * @param[in] hwc_window A window object
+ * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @return A layer which is @b assigend to a window object
+ * @remark
+ * A backend module @b SHOULD implement this function. The backend should
+ * return the tdm_layer assoicated with a hwc_window which must be assigend
+ * hw overlay.\n
+ */
+ tdm_layer *(*hwc_window_get_layer)(tdm_hwc_window *hwc_window,
+ tdm_error *error);
+
+ /**
* @brief Set a flags to a window object
* @param[in] hwc_window A window object
* @param[in] flags A hwc_window flags
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*hwc_window_video_get_capability)(tdm_hwc_window *hwc_window,
- tdm_hwc_window_video_capability *video_capability);
+ tdm_hwc_window_video_capability *video_capability);
/**
- * @brief Get the window video supported format
- * @param[in] hwc_window A window object
- * @param[out] formats A hwc window supported formats
- * @param[out] count A number of the hwc window supported formats
+ * @brief Get the available property array of a video hwc window object.
+ * @param[in] hwc window A video hwc window object
+ * @param[out] props The available property array
+ * @param[out] count The count of properties
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+ tdm_error (*hwc_window_video_get_available_properties)(
+ tdm_hwc_window *hwc_window,
+ const tdm_prop **props, int *count);
+
+ /**
+ * @brief Get the property which has a given id.
+ * @param[in] hwc window A video hwc window object
+ * @param[in] id The property id
+ * @param[out] value The value
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
- tdm_error (*hwc_window_video_get_supported_format)(tdm_hwc_window *hwc_window,
- const tbm_format **formats,
- int *count);
+ tdm_error (*hwc_window_video_get_property)(tdm_hwc_window *hwc_window,
+ uint32_t id, tdm_value *value);
+
+ /**
+ * @brief Set the property which has a given id.
+ * @param[in] hwc window A video hwc window object
+ * @param[in] id The property id
+ * @param[in] value The value
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+ tdm_error (*hwc_window_video_set_property)(tdm_hwc_window *hwc_window,
+ uint32_t id, tdm_value value);
+
} tdm_func_hwc_window;
/**
tdm_event_loop_source_remove(tdm_event_loop_source *source);
/**
+ * @brief Get the ini value with given key
+ * @details
+ * @param[in] key The given key
+ * @param[in] default_value The default value
+ * @return the value of given key if success. Otherwise, default_value.
+ * @see #tdm_config_get_string
+ */
+int
+tdm_config_get_int(const char *key, int default_value);
+
+/**
+ * @brief Get the ini value with given key
+ * @details
+ * @param[in] key The given key
+ * @param[in] default_value The default value
+ * @return the value of given key if success. Otherwise, default_value.
+ * @see #tdm_config_get_int
+ */
+const char *
+tdm_config_get_string(const char *key, const char *default_value);
+
+
+/**
* @brief Trigger a 'need to validate' event.
* @param[in] output The output the event should be triggered for.
* @note The global display lock has to be locked before the call to this function.