1 /**************************************************************************
5 * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
7 * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
8 * JinYoung Jeon <jy0.jeon@samsung.com>,
9 * Taeheon Kim <th908.kim@samsung.com>,
10 * YoungJun Cho <yj44.cho@samsung.com>,
11 * SooChan Lim <sc1.lim@samsung.com>,
12 * Boram Park <boram1288.park@samsung.com>
14 * Permission is hereby granted, free of charge, to any person obtaining a
15 * copy of this software and associated documentation files (the
16 * "Software"), to deal in the Software without restriction, including
17 * without limitation the rights to use, copy, modify, merge, publish,
18 * distribute, sub license, and/or sell copies of the Software, and to
19 * permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
29 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
30 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 **************************************************************************/
40 #include <sys/types.h>
41 #include <tbm_surface.h>
42 #include <tbm_surface_queue.h>
43 #include <tbm_surface_internal.h>
45 #include "tdm_types.h"
46 #include "tdm_deprecated.h"
54 * @brief The header file for a frontend user.
57 * #include <tdm.h> //for a frontend user
62 * @brief Initialize a display object
63 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
64 * @return A display object
65 * @see tdm_display_deinit
68 tdm_display_init(tdm_error *error);
71 * @brief Deinitialize a display object
72 * @param[in] dpy A display object
73 * @see tdm_display_init
76 tdm_display_deinit(tdm_display *dpy);
79 * @brief Get the file descriptor
80 * @details TDM handles the events of fd with #tdm_display_handle_events.
81 * @param[in] dpy A display object
82 * @param[out] fd The file descriptor
83 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
84 * @see tdm_display_handle_events
87 tdm_display_get_fd(tdm_display *dpy, int *fd);
90 * @brief Handle the events
91 * @param[in] dpy A display object
92 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
93 * @see tdm_display_get_fd
96 tdm_display_handle_events(tdm_display *dpy);
99 * @brief Flush the all events to clients
100 * @param[in] dpy A display object
103 tdm_display_flush(tdm_display *dpy);
106 * @brief Get the capabilities of a display object.
107 * @details A frontend user can get whether TDM supports pp/capture functionality with this function.
108 * @param[in] dpy A display object
109 * @param[out] capabilities The capabilities of a display object
110 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
113 tdm_display_get_capabilities(tdm_display *dpy,
114 tdm_display_capability *capabilities);
117 * @brief Get the pp capabilities of a display object.
118 * @param[in] dpy A display object
119 * @param[out] capabilities The pp capabilities
120 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
123 tdm_display_get_pp_capabilities(tdm_display *dpy,
124 tdm_pp_capability *capabilities);
127 * @brief Get the pp available format array of a display object.
128 * @param[in] dpy A display object
129 * @param[out] formats The pp available format array
130 * @param[out] count The count of formats
131 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
134 tdm_display_get_pp_available_formats(tdm_display *dpy,
135 const tbm_format **formats, int *count);
138 * @brief Get the pp available size of a display object.
139 * @details -1 means that a TDM backend module doesn't define the value.
140 * @param[in] dpy A display object
141 * @param[out] min_w The minimum width which TDM can handle
142 * @param[out] min_h The minimum height which TDM can handle
143 * @param[out] max_w The maximum width which TDM can handle
144 * @param[out] max_h The maximum height which TDM can handle
145 * @param[out] preferred_align The preferred align width which TDM can handle
146 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
149 tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h,
150 int *max_w, int *max_h, int *preferred_align);
153 * @brief Get the capture capabilities of a display object.
154 * @param[in] dpy A display object
155 * @param[out] capabilities The capture capabilities
156 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
159 tdm_display_get_capture_capabilities(tdm_display *dpy,
160 tdm_capture_capability *capabilities);
163 * @brief Get the capture available format array of a display object.
164 * @param[in] dpy A display object
165 * @param[out] formats The capture available format array
166 * @param[out] count The count of formats
167 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
170 tdm_display_get_capture_available_formats(tdm_display *dpy,
171 const tbm_format **formats, int *count);
174 * @brief Get the capture available size of a display object.
175 * @details -1 means that a TDM backend module doesn't define the value.
176 * @param[in] dpy A display object
177 * @param[out] min_w The minimum width which TDM can handle
178 * @param[out] min_h The minimum height which TDM can handle
179 * @param[out] max_w The maximum width which TDM can handle
180 * @param[out] max_h The maximum height which TDM can handle
181 * @param[out] preferred_align The preferred align width which TDM can handle
182 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
185 tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h,
186 int *max_w, int *max_h, int *preferred_align);
189 * @brief Get the output counts which a display object has.
190 * @param[in] dpy A display object
191 * @param[out] count The count of outputs
192 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
193 * @see tdm_display_get_output
196 tdm_display_get_output_count(tdm_display *dpy, int *count);
199 * @brief Get a output object which has the given index.
200 * @param[in] dpy A display object
201 * @param[in] index The index of a output object
202 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
203 * @return A output object if success. Otherwise, NULL.
204 * @see tdm_display_get_output_count
207 tdm_display_get_output(tdm_display *dpy, int index, tdm_error *error);
210 * @brief Find a output object which has the given name.
211 * @param[in] dpy A display object
212 * @param[in] name The name of a output object
213 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
214 * @return A output object if success. Otherwise, NULL.
217 tdm_display_find_output(tdm_display *dpy, const char *name, tdm_error *error);
220 * @brief Create a pp object.
221 * @param[in] dpy A display object
222 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
223 * @return A pp object if success. Otherwise, NULL.
224 * @see tdm_pp_destroy
227 tdm_display_create_pp(tdm_display *dpy, tdm_error *error);
230 * @brief Get the information of the TDM backend module.
231 * @param[in] module A backend module object
232 * @param[out] name The name of the TDM backend module
233 * @param[out] vendor The vendor of the TDM backend module
234 * @param[out] version The version of the TDM backend module
235 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
238 tdm_module_get_info(tdm_module *module, const char **name,
239 const char **vendor, int *major, int *minor);
242 * @brief Get a backend module object of the given output.
243 * @param[in] output A output object
244 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
245 * @return A backend object if success. Otherwise, NULL.
248 tdm_output_get_backend_module(tdm_output *output, tdm_error *error);
251 * @brief Get the capabilities of a output object.
252 * @param[in] output A output object
253 * @param[out] capabilities The capabilities of a output object
254 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
257 tdm_output_get_capabilities(tdm_output *output,
258 tdm_output_capability *capabilities);
261 * @brief Get the model information of a output object.
262 * @param[in] output A output object
263 * @param[out] maker The output maker.
264 * @param[out] model The output model.
265 * @param[out] name The output name.
266 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
269 tdm_output_get_model_info(tdm_output *output, const char **maker,
270 const char **model, const char **name);
273 * @brief Get the connection status of a output object.
274 * @param[in] output A output object
275 * @param[out] status The connection status.
276 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
279 tdm_output_get_conn_status(tdm_output *output, tdm_output_conn_status *status);
282 * @brief Add a output change handler
283 * @details The handler will be called when the status of a
284 * output object is changed. connection, DPMS, etc.
285 * @param[in] output A output object
286 * @param[in] func A output change handler
287 * @param[in] user_data The user data
288 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
291 tdm_output_add_change_handler(tdm_output *output,
292 tdm_output_change_handler func,
296 * @brief Remove a output change handler
297 * @param[in] output A output object
298 * @param[in] func A output change handler
299 * @param[in] user_data The user data
300 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
303 tdm_output_remove_change_handler(tdm_output *output,
304 tdm_output_change_handler func,
308 * @brief Get the connection type of a output object.
309 * @param[in] output A output object
310 * @param[out] type The connection type.
311 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
314 tdm_output_get_output_type(tdm_output *output, tdm_output_type *type);
317 * @brief Get the layer counts which a output object has.
318 * @param[in] output A output object
319 * @param[out] count The count of layers
320 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
321 * @see tdm_output_get_layer
324 tdm_output_get_layer_count(tdm_output *output, int *count);
327 * @brief Get a layer object which has the given index.
328 * @param[in] output A output object
329 * @param[in] index The index of a layer object
330 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
331 * @return A layer object if success. Otherwise, NULL.
332 * @see tdm_output_get_layer_count
335 tdm_output_get_layer(tdm_output *output, int index, tdm_error *error);
338 * @brief Get the available property array of a output object.
339 * @param[in] output A output object
340 * @param[out] props The available property array
341 * @param[out] count The count of properties
342 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
345 tdm_output_get_available_properties(tdm_output *output, const tdm_prop **props,
349 * @brief Get the available mode array of a output object.
350 * @param[in] output A output object
351 * @param[out] modes The available mode array
352 * @param[out] count The count of modes
353 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
356 tdm_output_get_available_modes(tdm_output *output,
357 const tdm_output_mode **modes, int *count);
360 * @brief Get the available size of a output object.
361 * @details -1 means that a TDM backend module doesn't define the value.
362 * @param[in] output A output object
363 * @param[out] min_w The minimum width which TDM can handle
364 * @param[out] min_h The minimum height which TDM can handle
365 * @param[out] max_w The maximum width which TDM can handle
366 * @param[out] max_h The maximum height which TDM can handle
367 * @param[out] preferred_align The preferred align width which TDM can handle
368 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
371 tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h,
372 int *max_w, int *max_h, int *preferred_align);
375 * @brief Get the available cursor size of a output object.
376 * @details -1 means that a TDM backend module doesn't define the value.
377 * @param[in] output A output object
378 * @param[out] min_w The minimum width which TDM can handle
379 * @param[out] min_h The minimum height which TDM can handle
380 * @param[out] max_w The maximum width which TDM can handle
381 * @param[out] max_h The maximum height which TDM can handle
382 * @param[out] preferred_align The preferred align width which TDM can handle
383 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
386 tdm_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h,
387 int *max_w, int *max_h, int *preferred_align);
390 * @brief Get the physical size of a output object.
391 * @param[in] output A output object
392 * @param[out] mmWidth The milimeter width
393 * @param[out] mmHeight The milimeter height
394 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
397 tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth,
398 unsigned int *mmHeight);
401 * @brief Get the subpixel of a output object.
402 * @param[in] output A output object
403 * @param[out] subpixel The subpixel
404 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
407 tdm_output_get_subpixel(tdm_output *output, unsigned int *subpixel);
410 * @brief Get the pipe of a output object.
411 * @param[in] output A output object
412 * @param[out] pipe The pipe
413 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
416 tdm_output_get_pipe(tdm_output *output, unsigned int *pipe);
419 * @brief Get the index of a primary layer.
420 * @param[in] output A output object
421 * @param[out] index The primary layer index
422 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
425 tdm_output_get_primary_index(tdm_output *output, int *index);
428 * @brief Set the property which has a given id.
429 * @param[in] output A output object
430 * @param[in] id The property id
431 * @param[in] value The value
432 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
435 tdm_output_set_property(tdm_output *output, unsigned int id, tdm_value value);
438 * @brief Get the property which has a given id
439 * @param[in] output A output object
440 * @param[in] id The property id
441 * @param[out] value The value
442 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
445 tdm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value);
448 * @brief Wait for VBLANK
449 * @details After interval vblanks, a user vblank handler will be called.
450 * @param[in] output A output object
451 * @param[in] interval vblank interval
452 * @param[in] sync 0: asynchronous, 1:synchronous
453 * @param[in] func A user vblank handler
454 * @param[in] user_data The user data
455 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
456 * @see #tdm_output_vblank_handler
459 tdm_output_wait_vblank(tdm_output *output, int interval, int sync,
460 tdm_output_vblank_handler func, void *user_data);
463 * @brief Commit changes for a output object
464 * @details After all change of a output object are applied, a user commit handler
466 * @param[in] output A output object
467 * @param[in] sync 0: asynchronous, 1:synchronous
468 * @param[in] func A user commit handler
469 * @param[in] user_data The user data
470 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
471 * @see #tdm_layer_commit
474 tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
478 * @brief Remove the user vblank handler
479 * @param[in] output A output object
480 * @param[in] func A user vblank handler
481 * @param[in] user_data The user data
482 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
485 tdm_output_remove_vblank_handler(tdm_output *output, tdm_output_vblank_handler func, void *user_data);
488 * @brief Remove the user commit handler
489 * @param[in] output A output object
490 * @param[in] func A user commit handler
491 * @param[in] user_data The user data
492 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
495 tdm_output_remove_commit_handler(tdm_output *output, tdm_output_commit_handler func, void *user_data);
498 * @brief Set one of available modes of a output object
499 * @param[in] output A output object
500 * @param[in] mode A output mode
501 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
504 tdm_output_set_mode(tdm_output *output, const tdm_output_mode *mode);
507 * @brief Get the mode of a output object
508 * @param[in] output A output object
509 * @param[out] mode A output mode
510 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
513 tdm_output_get_mode(tdm_output *output, const tdm_output_mode **mode);
516 * @brief Set DPMS of a output object synchronously
517 * @param[in] output A output object
518 * @param[in] dpms_value DPMS value
519 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
520 * @see tdm_output_set_dpms_async
523 tdm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value);
526 * @brief Set DPMS of a output object asynchronously
527 * @details This function can be used when a output supports the asynchronous DPMS
528 * control. The output has #TDM_OUTPUT_CAPABILITY_ASYNC_DPMS flags which
529 * #tdm_output_get_capabilities returns. If an output change handler is added with
530 * #tdm_output_add_change_handler, the output change handler will be called when
531 * the DPMS status is changed indeed.
532 * @param[in] output A output object
533 * @param[in] dpms_value DPMS value
534 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
535 * @see tdm_output_add_change_handler, tdm_output_set_dpms,
536 * tdm_output_get_capabilities, #TDM_OUTPUT_CAPABILITY_ASYNC_DPMS.
539 tdm_output_set_dpms_async(tdm_output *output, tdm_output_dpms dpms_value);
542 * @brief Get DPMS of a output object
543 * @param[in] output A output object
544 * @param[out] dpms_value DPMS value
545 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
548 tdm_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value);
551 * @brief Check if a output object has the capture capability
552 * @param[in] output A output object
553 * @param[out] has_capability 1: has the capability, 0: not has the capability
554 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
557 tdm_output_has_capture_capability(tdm_output *output, unsigned int *has_capability);
560 * @brief Create a capture object of a output object
561 * @param[in] output A output object
562 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
563 * @return A capture object
564 * @see tdm_capture_destroy
567 tdm_output_create_capture(tdm_output *output, tdm_error *error);
570 * @brief Get a hwc associated with a output object.
571 * @param[in] output A output object
572 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
573 * @return A hwc object
577 tdm_output_get_hwc(tdm_output *output, tdm_error *error);
580 * @brief Get a output object of a layer object
581 * @param[in] layer A layer object
582 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
583 * @return A TDM output object if success. Otherwise, NULL.
586 tdm_layer_get_output(tdm_layer *layer, tdm_error *error);
589 * @brief Get the index of a layer object.
590 * @param[in] layer A layer object
591 * @param[out] index The index of a layer object
592 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
595 tdm_layer_get_index(tdm_layer *layer, int *index);
598 * @brief Get the capabilities of a layer object.
599 * @param[in] layer A layer object
600 * @param[out] capabilities The capabilities of a layer object
601 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
604 tdm_layer_get_capabilities(tdm_layer *layer,
605 tdm_layer_capability *capabilities);
608 * @brief Get the available format array of a layer object.
609 * @param[in] layer A layer object
610 * @param[out] formats The available format array
611 * @param[out] count The count of formats
612 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
615 tdm_layer_get_available_formats(tdm_layer *layer, const tbm_format **formats,
619 * @brief Get the available property array of a layer object.
620 * @param[in] layer A layer object
621 * @param[out] props The available property array
622 * @param[out] count The count of properties
623 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
626 tdm_layer_get_available_properties(tdm_layer *layer, const tdm_prop **props,
630 * @brief Get the zpos of a layer object.
632 * - GRAPHIC layers have fixed zpos. It starts from 0. It's @b non-changeable.
633 * - But the zpos of VIDEO layers will be decided by a backend module side.
634 * - A frontend user only can set the relative zpos to VIDEO layers via #tdm_layer_set_video_pos
635 * - The zpos of video layers is less than GRAPHIC layers or more than GRAPHIC
636 * layers. ie, ..., -2, -1, 4, 5, ... (if 0 <= GRAPHIC layer's zpos < 4).
637 * -------------------------------- graphic layer 3 <-- top most layer
638 * -------------------------------- graphic layer 2
639 * -------------------------------- graphic layer 1
640 * -------------------------------- graphic layer 0
641 * -------------------------------- video layer -1
642 * -------------------------------- video layer -2 <-- lowest layer
643 * @param[in] layer A layer object
644 * @param[out] zpos The zpos
645 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
646 * @see tdm_layer_set_video_pos, tdm_layer_capability
649 tdm_layer_get_zpos(tdm_layer *layer, int *zpos);
652 * @brief Set the property which has a given id.
653 * @param[in] layer A layer object
654 * @param[in] id The property id
655 * @param[in] value The value
656 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
659 tdm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value);
662 * @brief Get the property which has a given id.
663 * @param[in] layer A layer object
664 * @param[in] id The property id
665 * @param[out] value The value
666 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
669 tdm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value);
672 * @brief Set the geometry information to a layer object
673 * @details The geometry information will be applied when the output object
674 * of a layer object is committed. If a layer has TDM_LAYER_CAPABILITY_NO_CROP
675 * capability, a layer will ignore the pos(crop) information of #tdm_info_layer's
677 * @param[in] layer A layer object
678 * @param[in] info The geometry information
679 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
680 * @see tdm_layer_commit
683 tdm_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
686 * @brief Get the geometry information to a layer object
687 * @param[in] layer A layer object
688 * @param[out] info The geometry information
689 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
692 tdm_layer_get_info(tdm_layer *layer, tdm_info_layer *info);
695 * @brief Set a TDM buffer to a layer object
696 * @details A TDM buffer will be applied when the output object
697 * of a layer object is committed.
698 * @param[in] layer A layer object
699 * @param[in] buffer A TDM buffer
700 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
701 * @see tdm_layer_commit
704 tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
707 * @brief Unset a TDM buffer from a layer object
708 * @details When this function is called, a current showing buffer will be
709 * disappeared from screen. Then nothing is showing on a layer object.
710 * @param[in] layer A layer object
711 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
714 tdm_layer_unset_buffer(tdm_layer *layer);
717 * @brief Commit changes for a layer object
718 * @details After all change of a layer object are applied, a user commit handler
720 * @param[in] layer A layer object
721 * @param[in] func A user commit handler
722 * @param[in] user_data The user data
723 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
726 tdm_layer_commit(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data);
729 tdm_layer_is_committing(tdm_layer *layer, unsigned int *committing);
732 * @brief Remove the user commit handler
733 * @param[in] layer A layer object
734 * @param[in] func A user commit handler
735 * @param[in] user_data The user data
736 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
739 tdm_layer_remove_commit_handler(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data);
742 * @brief Get a displaying TDM buffer from a layer object
743 * @details A displaying TDM buffer is a current showing buffer on screen
744 * that is set to layer object and applied output object of a layer object.
745 * @param[in] layer A layer object
746 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
747 * @return A TDM buffer if success. Otherwise, NULL.
750 tdm_layer_get_displaying_buffer(tdm_layer *layer, tdm_error *error);
753 * @brief Set a TBM surface_queue to a layer object
754 * @details A TBM surface_queue will be applied when the output object
755 * of a layer object is committed. and TDM layer will be automatically updated
756 * @param[in] layer A layer object
757 * @param[in] buffer_queue A TBM surface_queue
758 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
759 * @see tdm_layer_commit
762 tdm_layer_set_buffer_queue(tdm_layer *layer, tbm_surface_queue_h buffer_queue);
765 * @brief Unset a TBM surface_queue from a layer object
766 * @details When this function is called, a current surface_queue will be
767 * disappeared from screen. Then nothing is showing on a layer object.
768 * @param[in] layer A layer object
769 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
772 tdm_layer_unset_buffer_queue(tdm_layer *layer);
775 * @brief Check wheter a layer object is available for a frontend user to use.
776 * @details A layer object is not usable if a TDM buffer is showing on screen
777 * via this layer object. By calling #tdm_layer_unset_buffer, this layer object
778 * will become usable.
779 * @param[in] layer A layer object
780 * @param[out] usable 1 if usable, 0 if not usable
781 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
784 tdm_layer_is_usable(tdm_layer *layer, unsigned int *usable);
787 * @brief Set the relative zpos to a VIDEO layer object
788 * @details The zpos value is less than the minimum zpos of GRAPHIC layers, or
789 * it is more than the maximum zpos of GRAPHIC layers.
790 * @param[in] layer A VIDEO layer object
791 * @param[in] zpos The zpos
792 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
793 * @see tdm_layer_get_zpos, tdm_layer_capability
796 tdm_layer_set_video_pos(tdm_layer *layer, int zpos);
799 * @brief Create a capture object of a layer object
800 * @param[in] layer A layer object
801 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
802 * @return A capture object
803 * @see tdm_capture_destroy
806 tdm_layer_create_capture(tdm_layer *layer, tdm_error *error);
809 * @brief Get buffer flags from a layer object
810 * @param[in] layer A layer object
811 * @param[out] flags a buffer flags value
812 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
815 tdm_layer_get_buffer_flags(tdm_layer *layer, unsigned int *flags);
818 * @brief Creates a new window on the given hwc.
819 * @param[in] hwc A hwc object
820 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
821 * @return A created window object
825 tdm_hwc_create_window(tdm_hwc *hwc, tdm_error *error);
828 * @brief Get the video supported format array for hwc windows of a output object.
829 * @param[in] hwc A hwc object
830 * @param[out] formats The available format array
831 * @param[out] count The count of formats
832 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
835 tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats,
839 * @brief Get the hwc video capability
840 * @param[in] hwc A hwc object
841 * @param[out] video_capability A hwc video capability
842 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
845 tdm_hwc_get_video_capability(tdm_hwc *hwc, tdm_hwc_video_capability *video_capability);
848 * @brief Get the available property array of a hwc object.
849 * @param[in] hwc A hwc
850 * @param[out] props The available property array
851 * @param[out] count The count of properties
852 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
855 tdm_hwc_get_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *count);
858 * @brief Get a target buffer queue
859 * @details The client composites the tdm_hwd_windows which have
860 * TDM_COMPOSITE_CLIENT types on the buffer from this target buffer queue.
861 * Then, the client set the buffer by calling tdm_hwc_set_client_target_buffer.
862 * @param[in] output A output object
863 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
864 * @return A buffer queue
868 tdm_hwc_get_client_target_buffer_queue(tdm_hwc *hwc, tdm_error *error);
871 * @brief Set the client(relative to the TDM) target buffer
872 * @details This function lets the backend know the target buffer.
873 * The target buffer contains the result of the gl composition with the
874 * tdm_hwc_windows which marked as TDM_COMPOSITION_CLIENT.
875 * @param[in] hwc A output hwc
876 * @param[in] target_buffer The new target buffer
877 * @param[in] damage The buffer damage region
878 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
882 tdm_hwc_set_client_target_buffer(tdm_hwc *hwc, tbm_surface_h target_buffer, tdm_region damage);
885 * @brief Validate the output
886 * @details Instructs the backend to inspect all of the hw layer state and
887 * determine if there are any composition type changes necessary before
888 * presenting the hwc.
889 * @param[in] hwc A hwc object
890 * @param[in] composited_wnds the hwc window list which is visible.
891 * @param[in] num_wnds the number of the visible windows in the composited_wnds
892 * @param[out] num_types The number of composition type changes
893 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
895 * The backend has to return the num_types when the assgined comopsite types of
896 * the tdm_hwc_windows in the composited_wnds. If the num_types is greater than
897 * 0, the cleint must get the changed composite types of the tdm_hwc_windows
898 * and change the comopsite types
902 tdm_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_wnds,
903 uint32_t *num_types);
906 * @brief Get changed composition types
907 * @details Retrieves the windows for which the backend requires a different
908 * composition types that had been set prior to the last call to tdm_hwc_validate().
909 * The client will either update its state with these types and call
910 * tdm_hwc_accept_changes, or will set new types and attempt to validate the
911 * display again. The number of elements returned must be the same as the
912 * value returned in num_types from the last call to tdm_hwc_validate().
913 * @param[in] hwc A hwc object
914 * @param[out] num_elements the number of hwc_windows
915 * @param[out] windows An array of windows
916 * @param[out] composition_types An array of composition types, each corresponding
917 * to an element of windows
918 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
923 tdm_hwc_get_changed_composition_types(tdm_hwc *hwc, uint32_t *num_elements,
924 tdm_hwc_window **hwc_window,
925 tdm_hwc_window_composition *composition_types);
928 * @brief Accepts the changes required by the backend
929 * @details Accepts the changes required by the backend from the previous
930 * tdm_hwc_validate() and tdm_hwc_get_chaged_composition_types().
931 * @param[in] hwc A hwc object
932 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
936 tdm_hwc_accept_changes(tdm_hwc *hwc);
939 * @brief Commit changes for a hwc
940 * @details After all change of a window object are applied, a user commit handler
942 * @param[in] hwc A hwc object
943 * @param[in] sync 0: asynchronous, 1:synchronous
944 * @param[in] func A user commit handler
945 * @param[in] user_data The user data
946 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
949 tdm_hwc_commit(tdm_hwc *hwc, int sync, tdm_hwc_commit_handler func, void *user_data);
952 * @brief Destroys the given window.
953 * @param[in] window the pointer of the window to destroy
957 tdm_hwc_window_destroy(tdm_hwc_window *hwc_window);
960 * @brief Acquire a buffer queue for the window object
961 * @details These buffers are used to composite by hardware a client content in
963 * @param[in] hwc_window A window object
964 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
965 * @return A tbm buffer queue
969 tdm_hwc_window_acquire_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error);
972 * @brief Release a buffer queue for the window object
973 * @details Release buffer queue when the client no longer uses buferrs of queue.
974 * @param[in] hwc_window A window object
975 * @param[in] A tbm buffer queue
979 tdm_hwc_window_release_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue);
982 * @brief Sets the desired composition type of the given window.
983 * @details During tdm_hwc_validate(), the backend may request changes to
984 * the composition types of any of the layers as described in the definition
985 * of tdm_hwc_window_composition_t above.
986 * @param[in] hwc_window A window object
987 * @param[in] composition_type The new composition type
988 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
992 tdm_hwc_window_set_composition_type(tdm_hwc_window *hwc_window,
993 tdm_hwc_window_composition composition_type);
996 * @brief Set the buffer damage
997 * @details Provides the region of the source buffer which has been modified
998 * since the last frame. This region does not need to be validated before
999 * calling tdm_output_commit().
1000 * Once set through this function, the damage region remains the same until a
1001 * subsequent call to this function.
1002 * If damage.num_rects > 0, then it may be assumed that any portion of the source
1003 * buffer not covered by one of the rects has not been modified this frame. If
1004 * damage.num_rects == 0, then the whole source buffer must be treated as if it
1005 * has been modified.
1006 * If the layer's contents are not modified relative to the prior frame, damage
1007 * will contain exactly one empty rect([0, 0, 0, 0]).
1008 * The damage rects are relative to the pre-transformed buffer, and their origin
1009 * is the top-left corner. They will not exceed the dimensions of the latched
1011 * @param[in] hwc_window A window object
1012 * @param[in] damage The new buffer damage region
1013 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1017 tdm_hwc_window_set_buffer_damage(tdm_hwc_window *hwc_window, tdm_region damage);
1020 * @brief Set the information to a window object
1021 * @details The information will be applied when the hwc object is committed.
1022 * @param[in] hwc_window A window object
1023 * @param[in] info The information
1024 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1028 tdm_hwc_window_set_info(tdm_hwc_window *hwc_window, tdm_hwc_window_info *info);
1031 * @brief Set a TBM buffer to a window object
1032 * @details A TBM buffer will be applied when the output object of a layer
1033 * object is committed.
1034 * @param[in] hwc_window A window object
1035 * @param[in] buffer A TBM buffer
1036 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1040 tdm_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h buffer);
1043 * @brief Set the property which has a given id.
1044 * @param[in] hwc_window A hwc window object
1045 * @param[in] id The property id
1046 * @param[in] value The value of the propery id
1047 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1050 tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value value);
1053 * @brief Get the property which has a given id.
1054 * @param[in] hwc_window A hwc window object
1055 * @param[in] id The property id
1056 * @param[out] value The value of the propery id
1057 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1060 tdm_hwc_window_get_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value *value);
1063 * @brief Get the constraints of hwc_window
1064 * @param[in] hwc_window A hwc window object
1065 * @param[out] constraints The tdm_hwc_window_constraint types
1066 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1069 tdm_hwc_window_get_constraints(tdm_hwc_window *hwc_window, int *constraints);
1072 * @brief Destroy a pp object
1073 * @param[in] pp A pp object
1074 * @see tdm_display_create_pp
1077 tdm_pp_destroy(tdm_pp *pp);
1080 * @brief Set the geometry information to a pp object
1081 * @param[in] pp A pp object
1082 * @param[in] info The geometry information
1083 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1084 * @see tdm_pp_commit
1087 tdm_pp_set_info(tdm_pp *pp, tdm_info_pp *info);
1090 * @brief Set the PP done handler to a pp object
1092 * The user PP done handler will be called after converting a source buffer's image
1093 * to a destination buffer.
1094 * @param[in] pp A pp object
1095 * @param[in] func A user PP done handler
1096 * @param[in] user_data The user data
1097 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1100 tdm_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void *user_data);
1103 * @brief Attach a source buffer and a destination buffer to a pp object
1104 * @param[in] pp A pp object
1105 * @param[in] src A source buffer
1106 * @param[in] dst A destination buffer
1107 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1108 * @see tdm_pp_commit, tdm_pp_set_done_handler
1111 tdm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
1114 * @brief Commit changes for a pp object
1115 * @param[in] pp A pp object
1116 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1119 tdm_pp_commit(tdm_pp *pp);
1122 * @brief Destroy a capture object
1123 * @param[in] capture A capture object
1124 * @see tdm_output_create_capture, tdm_layer_create_capture
1127 tdm_capture_destroy(tdm_capture *capture);
1130 * @brief Set the geometry information to a capture object
1131 * @param[in] capture A capture object
1132 * @param[in] info The geometry information
1133 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1134 * @see tdm_capture_commit
1137 tdm_capture_set_info(tdm_capture *capture, tdm_info_capture *info);
1140 * @brief Set the capture done handler to a capture object
1142 * The user capture done handler will be called after capturing a screen into a
1144 * @param[in] capture A capture object
1145 * @param[in] func A user capture done handler
1146 * @param[in] user_data The user data
1147 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1150 tdm_capture_set_done_handler(tdm_capture *capture, tdm_capture_done_handler func, void *user_data);
1153 * @brief Attach a TDM buffer to a capture object
1154 * @param[in] capture A capture object
1155 * @param[in] buffer A TDM buffer
1156 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1157 * @see tdm_capture_commit, tdm_capture_set_done_handler
1160 tdm_capture_attach(tdm_capture *capture, tbm_surface_h buffer);
1163 * @brief Commit changes for a capture object
1164 * @param[in] capture A capture object
1165 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1168 tdm_capture_commit(tdm_capture *capture);
1171 * @brief The release handler of a TDM buffer
1172 * @param[in] buffer A TDM buffer
1173 * @param[in] user_data user data
1174 * @see tdm_buffer_add_release_handler, tdm_buffer_remove_release_handler
1176 typedef void (*tdm_buffer_release_handler)(tbm_surface_h buffer,
1180 * @brief Add a release handler to a TDM buffer
1182 * TDM has its own buffer release mechanism to let an frontend user know when a TDM buffer
1183 * becomes available for a next job. A TDM buffer can be used for TDM to show
1184 * it on screen or to capture an output and a layer. After all operations,
1185 * TDM will release it immediately when TDM doesn't need it any more.
1186 * @param[in] buffer A TDM buffer
1187 * @param[in] func A release handler
1188 * @param[in] user_data user data
1189 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1190 * @see tdm_buffer_remove_release_handler
1193 tdm_buffer_add_release_handler(tbm_surface_h buffer,
1194 tdm_buffer_release_handler func, void *user_data);
1197 * @brief Remove a release handler from a TDM buffer
1198 * @param[in] buffer A TDM buffer
1199 * @param[in] func A release handler
1200 * @param[in] user_data user data
1201 * @see tdm_buffer_add_release_handler
1204 tdm_buffer_remove_release_handler(tbm_surface_h buffer,
1205 tdm_buffer_release_handler func, void *user_data);
1208 * @brief The handler of a vblank object
1209 * @see #tdm_vblank_wait, #tdm_vblank_wait_seq
1211 typedef void (*tdm_vblank_handler)(tdm_vblank *vblank, tdm_error error, unsigned int sequence,
1212 unsigned int tv_sec, unsigned int tv_usec, void *user_data);
1215 * @brief Set the vblank fps for the given PID and name.
1216 * @param[in] pid The process ID
1217 * @param[in] name The client vblank name
1218 * @param[in] fps The client vblank fps
1219 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1222 tdm_vblank_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps);
1225 * @brief Set the ignore global fps for the given PID and name.
1226 * @param[in] pid The process ID
1227 * @param[in] name The client vblank name
1228 * @param[in] ignore 1: ignore 0:not ignore(default)
1229 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1232 tdm_vblank_set_client_ignore_global_fps(unsigned int pid, const char *name, unsigned int ignore);
1235 * @brief Set the vblank global fps for the entire system.
1236 * @param[in] enable 1:enable, 0:disable
1237 * @param[in] fps The vblank global fps
1239 * This global fps will be applied to all client's vblanks for all outputs.
1240 * If the client's vblank fps is less than this, the global fps will be ignored
1241 * for that client. And if a client calls #tdm_vblank_ignore_global_fps to ignore
1242 * the global fps, it will be ignored also.
1243 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1246 tdm_vblank_enable_global_fps(unsigned int enable, unsigned int fps);
1249 * @brief Add the vblank create handler.
1250 * @param[in] dpy A display object
1251 * @param[in] func The user vblank create handler
1252 * @param[in] user_data The user data
1254 * The user vblank create handler will be called when new vblank object created.
1255 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1258 tdm_vblank_add_create_handler(tdm_display *dpy, tdm_vblank_create_handler func, void *user_data);
1261 * @brief Remove the vblank create handler.
1262 * @param[in] dpy A display object
1263 * @param[in] func The user vblank create handler
1264 * @param[in] user_data The user data
1265 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1268 tdm_vblank_remove_create_handler(tdm_display *dpy, tdm_vblank_create_handler func, void *user_data);
1271 * @brief Create a vblank object
1272 * @param[in] dpy A display object
1273 * @param[in] output A output object
1274 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
1275 * @return A vblank object
1276 * @see #tdm_vblank_destroy
1279 tdm_vblank_create(tdm_display *dpy, tdm_output *output, tdm_error *error);
1282 * @brief Destroy a vblank object
1283 * @param[in] vblank A vblank object
1284 * @see #tdm_vblank_create
1287 tdm_vblank_destroy(tdm_vblank *vblank);
1290 * @brief Get a output object of a vblank object
1291 * @param[in] vblank A vblank object
1292 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
1293 * @return A TDM output object if success. Otherwise, NULL.
1294 * @see #tdm_vblank_create
1297 tdm_vblank_get_output(tdm_vblank *vblank, tdm_error *error);
1300 * @brief Get the client PID for a vblank object
1301 * @param[in] vblank A vblank object
1302 * @param[out] pid PID of vblank's client
1303 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1306 tdm_vblank_get_client_pid(tdm_vblank *vblank, pid_t *pid);
1309 * @brief Set the name to a vblank object
1310 * @details The default name is "unknown"
1311 * @param[in] vblank A vblank object
1312 * @param[in] name vblank name
1313 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1316 tdm_vblank_set_name(tdm_vblank *vblank, const char *name);
1319 * @brief Get the name for a vblank object
1320 * @details The default name is "unknown"
1321 * @param[in] vblank A vblank object
1322 * @param[out] name vblank name
1323 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1326 tdm_vblank_get_name(tdm_vblank *vblank, const char **name);
1329 * @brief Set the fps to a vblank object
1330 * @details Default is the @b vertical @b refresh @b rate of the given output.
1331 * It could be ignored when the fixed fps is set by #tdm_vblank_set_fixed_fps
1332 * @param[in] vblank A vblank object
1333 * @param[in] fps over 0
1334 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1337 tdm_vblank_set_fps(tdm_vblank *vblank, unsigned int fps);
1340 * @brief Get the fps for a vblank object
1341 * @param[in] vblank A vblank object
1342 * @param[out] fps over 0
1343 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1346 tdm_vblank_get_fps(tdm_vblank *vblank, unsigned int *fps);
1349 * @brief Set the fixed fps to a vblank object
1351 * It could be ignored when the global fps is set by #tdm_vblank_enable_global_fps
1352 * @param[in] vblank A vblank object
1353 * @param[in] fps over 0
1354 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1357 tdm_vblank_set_fixed_fps(tdm_vblank *vblank, unsigned int fps);
1360 * @brief Ignore the vblank global fps
1362 * The global fps will be applied to all client's vblanks for all outputs.
1363 * If the client's vblank fps is less than this, the global fps will be ignored
1364 * for that client. And if a client calls #tdm_vblank_ignore_global_fps to ignore
1365 * the global fps, it will be ignored also.
1366 * @param[in] vblank A vblank object
1367 * @param[in] ignore 1: ignore 0:not ignore(default)
1368 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1371 tdm_vblank_ignore_global_fps(tdm_vblank *vblank, unsigned int ignore);
1374 * @brief Set the offset(milli-second) to a vblank object
1375 * @details Default is @b 0.
1376 * @param[in] vblank A vblank object
1377 * @param[in] offset the offset(milli-second)
1378 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1381 tdm_vblank_set_offset(tdm_vblank *vblank, int offset);
1384 * @brief Get the offset(milli-second) for a vblank object
1385 * @param[in] vblank A vblank object
1386 * @param[out] offset the offset(milli-second)
1387 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1390 tdm_vblank_get_offset(tdm_vblank *vblank, int *offset);
1393 * @brief Enable/Disable the fake vblank to a vblank object
1395 * If enable_fake == 0, #tdm_vblank_wait will return TDM_ERROR_DPMS_OFF
1396 * when DPMS off. Otherwise, #tdm_vblank_wait will return TDM_ERROR_NONE
1398 * @param[in] vblank A vblank object
1399 * @param[in] enable_fake 1:enable, 0:disable
1400 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1403 tdm_vblank_set_enable_fake(tdm_vblank *vblank, unsigned int enable_fake);
1406 * @brief Get the fake vblank
1407 * @param[in] vblank A vblank object
1408 * @param[out] enable_fake 1:enable, 0:disable
1409 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1412 tdm_vblank_get_enable_fake(tdm_vblank *vblank, unsigned int *enable_fake);
1415 * @brief Wait for a vblank
1417 * Once #tdm_vblank_wait returns TDM_ERROR_NONE, the user vblank handler(#tdm_vblank_handler)
1418 * SHOULD be called after the given interval. \n
1419 * The sequence value of tdm_vblank_handler is the relative value of fps.
1420 * If fps = 10, this sequence value should be increased by 10 during 1 second.
1421 * @param[in] vblank A vblank object
1422 * @param[in] req_sec The vblank request time(second)
1423 * @param[in] req_usec The vblank request time(micro-second)
1424 * @param[in] interval The vblank interval
1425 * @param[in] func The user vblank handler
1426 * @param[in] user_data The user data
1427 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1430 tdm_vblank_wait(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec,
1431 unsigned int interval, tdm_vblank_handler func, void *user_data);
1434 * @brief Wait for a vblank with the target sequence number
1435 * @param[in] vblank A vblank object
1436 * @param[in] req_sec The vblank request time(second)
1437 * @param[in] req_usec The vblank request time(micro-second)
1438 * @param[in] sequence The target sequence number
1439 * @param[in] func The user client vblank handler
1440 * @param[in] user_data The user data
1441 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1444 tdm_vblank_wait_seq(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec,
1445 unsigned int sequence, tdm_vblank_handler func, void *user_data);
1451 #endif /* _TDM_H_ */