const tbm_format **formats, int *count);
/**
+ * @brief Get the capture available size of a display object.
+ * @details -1 means that a TDM backend module doesn't define the value.
+ * @param[in] dpy A display object
+ * @param[out] min_w The minimum width which TDM can handle
+ * @param[out] min_h The minimum height which TDM can handle
+ * @param[out] max_w The maximum width which TDM can handle
+ * @param[out] max_h The maximum height which TDM can handle
+ * @param[out] preferred_align The preferred align width which TDM can handle
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h,
+ int *max_w, int *max_h, int *preferred_align);
+
+/**
+ * @brief Get the max layer counts which a display object can show on screen.
+ * @details -1 means that a TDM backend module doesn't define the value.
+ * @param[in] dpy A display object
+ * @param[out] count The max count of layers
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_display_get_max_layer_count(tdm_display *dpy, int *max_count);
+
+/**
* @brief Get the output counts which a display object has.
* @param[in] dpy A display object
* @param[out] count The count of outputs
int *max_w, int *max_h, int *preferred_align);
/**
+ * @brief Get the available cursor size of a output object.
+ * @details -1 means that a TDM backend module doesn't define the value.
+ * @param[in] output A output object
+ * @param[out] min_w The minimum width which TDM can handle
+ * @param[out] min_h The minimum height which TDM can handle
+ * @param[out] max_w The maximum width which TDM can handle
+ * @param[out] max_h The maximum height which TDM can handle
+ * @param[out] preferred_align The preferred align width which TDM can handle
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h,
+ int *max_w, int *max_h, int *preferred_align);
+
+/**
* @brief Get the physical size of a output object.
* @param[in] output A output object
* @param[out] mmWidth The milimeter width
* @param[in] func A user commit handler
* @param[in] user_data The user data
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ * @see #tdm_layer_commit
*/
tdm_error
tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
void *user_data);
/**
+ * @brief Remove the user vblank handler
+ * @param[in] output A output object
+ * @param[in] func A user vblank handler
+ * @param[in] user_data The user data
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_output_remove_vblank_handler(tdm_output *output, tdm_output_vblank_handler func, void *user_data);
+
+/**
+ * @brief Remove the user commit handler
+ * @param[in] output A output object
+ * @param[in] func A user commit handler
+ * @param[in] user_data The user data
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_output_remove_commit_handler(tdm_output *output, tdm_output_commit_handler func, void *user_data);
+
+/**
* @brief Set one of available modes of a output object
* @param[in] output A output object
* @param[in] mode A output mode
* @param[in] layer A layer object
* @param[in] info The geometry information
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
- * @see tdm_output_commit
+ * @see tdm_layer_commit
*/
tdm_error
tdm_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
* @param[in] layer A layer object
* @param[in] buffer A TDM buffer
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
- * @see tdm_output_commit
+ * @see tdm_layer_commit
*/
tdm_error
tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
tdm_layer_unset_buffer(tdm_layer *layer);
/**
+ * @brief Commit changes for a layer object
+ * @details After all change of a layer object are applied, a user commit handler
+ * will be called.
+ * @param[in] layer A layer object
+ * @param[in] func A user commit handler
+ * @param[in] user_data The user data
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_layer_commit(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data);
+
+tdm_error
+tdm_layer_is_committing(tdm_layer *layer, unsigned int *committing);
+
+/**
* @brief Get a displaying TDM buffer from a layer object
* @details A displaying TDM buffer is a current showing buffer on screen
* that is set to layer object and applied output object of a layer object.
* @param[in] layer A layer object
* @param[in] buffer_queue A TBM surface_queue
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
- * @see tdm_output_commit
+ * @see tdm_layer_commit
*/
tdm_error
tdm_layer_set_buffer_queue(tdm_layer *layer, tbm_surface_queue_h buffer_queue);
unsigned int tv_sec, unsigned int tv_usec, void *user_data);
/**
+ * @brief Set the vblank fps for the given PID and name.
+ * @param[in] pid The process ID
+ * @param[in] name The client vblank name
+ * @param[in] fps The client vblank fps
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_vblank_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps);
+
+/**
* @brief Create a vblank object
* @param[in] dpy A display object
* @param[in] output A output object
tdm_vblank_destroy(tdm_vblank *vblank);
/**
+ * @brief Set the name to a vblank object
+ * @details The default name is "unknown"
+ * @param[in] vblank A vblank object
+ * @param[in] name vblank name
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_vblank_set_name(tdm_vblank *vblank, const char *name);
+
+/**
+ * @brief Get the name for a vblank object
+ * @details The default name is "unknown"
+ * @param[in] vblank A vblank object
+ * @param[out] name vblank name
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_vblank_get_name(tdm_vblank *vblank, const char **name);
+
+/**
* @brief Set the fps to a vblank object
* @details Default is the @b vertical @b refresh @b rate of the given output.
* @param[in] vblank A vblank object
tdm_vblank_set_fps(tdm_vblank *vblank, unsigned int fps);
/**
+ * @brief Get the fps for a vblank object
+ * @param[in] vblank A vblank object
+ * @param[out] fps over 0
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_vblank_get_fps(tdm_vblank *vblank, unsigned int *fps);
+
+/**
* @brief Set the offset(milli-second) to a vblank object
* @details Default is @b 0.
* @param[in] vblank A vblank object
tdm_vblank_set_offset(tdm_vblank *vblank, int offset);
/**
+ * @brief Get the offset(milli-second) for a vblank object
+ * @param[in] vblank A vblank object
+ * @param[out] offset the offset(milli-second)
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_vblank_get_offset(tdm_vblank *vblank, int *offset);
+
+/**
* @brief Enable/Disable the fake vblank to a vblank object
* @details
* If enable_fake == 0, #tdm_vblank_wait will return TDM_ERROR_DPMS_OFF
/**
* @brief Get the fake vblank
* @param[in] vblank A vblank object
- * @return 1 if enable. Otherwise, 0.
+ * @param[out] enable_fake 1:enable, 0:disable
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
-unsigned int
-tdm_vblank_get_enable_fake(tdm_vblank *vblank);
+tdm_error
+tdm_vblank_get_enable_fake(tdm_vblank *vblank, unsigned int *enable_fake);
/**
* @brief Wait for a vblank