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 <sc1.lim@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 <tbm_surface.h>
41 #include <tbm_surface_queue.h>
42 #include <tbm_surface_internal.h>
44 #include "tdm_types.h"
52 * @brief The header file for a frontend user.
55 * #include <tdm.h> //for a frontend user
60 * @brief The display capability enumeration
63 TDM_DISPLAY_CAPABILITY_PP = (1 << 0), /**< if hardware supports pp operation */
64 TDM_DISPLAY_CAPABILITY_CAPTURE = (1 << 1), /**< if hardware supports capture operation */
65 } tdm_display_capability;
68 * @brief The output change enumeration of #tdm_output_change_handler
71 TDM_OUTPUT_CHANGE_CONNECTION = (1 << 0), /**< connection chagne */
72 TDM_OUTPUT_CHANGE_DPMS = (1 << 1), /**< dpms change */
73 } tdm_output_change_type;
76 * @brief The output change handler
77 * @details This handler will be called when the status of a output object is
80 typedef void (*tdm_output_change_handler)(tdm_output *output,
81 tdm_output_change_type type,
86 * @brief Initialize a display object
87 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
88 * @return A display object
89 * @see tdm_display_deinit
92 tdm_display_init(tdm_error *error);
95 * @brief Deinitialize a display object
96 * @param[in] dpy A display object
97 * @see tdm_display_init
100 tdm_display_deinit(tdm_display *dpy);
103 * @brief Update a display object
105 * When new output is connected, a frontend user need to call this function.
106 * And a frontend user can the new output information with tdm_output_get_xxx functions.
107 * @param[in] dpy A display object
108 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
111 tdm_display_update(tdm_display *dpy);
114 * @brief Get the file descriptor
115 * @details TDM handles the events of fd with #tdm_display_handle_events.
116 * @param[in] dpy A display object
117 * @param[out] fd The file descriptor
118 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
119 * @see tdm_display_handle_events
122 tdm_display_get_fd(tdm_display *dpy, int *fd);
125 * @brief Handle the events
126 * @param[in] dpy A display object
127 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
128 * @see tdm_display_get_fd
131 tdm_display_handle_events(tdm_display *dpy);
134 * @brief Get the capabilities of a display object.
135 * @details A frontend user can get whether TDM supports pp/capture functionality with this function.
136 * @param[in] dpy A display object
137 * @param[out] capabilities The capabilities of a display object
138 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
141 tdm_display_get_capabilities(tdm_display *dpy,
142 tdm_display_capability *capabilities);
145 * @brief Get the pp capabilities of a display object.
146 * @param[in] dpy A display object
147 * @param[out] capabilities The pp capabilities
148 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
151 tdm_display_get_pp_capabilities(tdm_display *dpy,
152 tdm_pp_capability *capabilities);
155 * @brief Get the pp available format array of a display object.
156 * @param[in] dpy A display object
157 * @param[out] formats The pp available format array
158 * @param[out] count The count of formats
159 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
162 tdm_display_get_pp_available_formats(tdm_display *dpy,
163 const tbm_format **formats, int *count);
166 * @brief Get the pp available size of a display object.
167 * @details -1 means that a TDM backend module doesn't define the value.
168 * @param[in] dpy A display object
169 * @param[out] min_w The minimum width which TDM can handle
170 * @param[out] min_h The minimum height which TDM can handle
171 * @param[out] max_w The maximum width which TDM can handle
172 * @param[out] max_h The maximum height which TDM can handle
173 * @param[out] preferred_align The preferred align width which TDM can handle
174 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
177 tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h,
178 int *max_w, int *max_h, int *preferred_align);
181 * @brief Get the capture capabilities of a display object.
182 * @param[in] dpy A display object
183 * @param[out] capabilities The capture capabilities
184 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
187 tdm_display_get_capture_capabilities(tdm_display *dpy,
188 tdm_capture_capability *capabilities);
191 * @brief Get the capture available format array of a display object.
192 * @param[in] dpy A display object
193 * @param[out] formats The capture available format array
194 * @param[out] count The count of formats
195 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
198 tdm_display_get_catpure_available_formats(tdm_display *dpy,
199 const tbm_format **formats, int *count);
202 * @brief Get the output counts which a display object has.
203 * @param[in] dpy A display object
204 * @param[out] count The count of outputs
205 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
206 * @see tdm_display_get_output
209 tdm_display_get_output_count(tdm_display *dpy, int *count);
212 * @brief Get a output object which has the given index.
213 * @param[in] dpy A display object
214 * @param[in] index The index of a output object
215 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
216 * @return A output object if success. Otherwise, NULL.
217 * @see tdm_display_get_output_count
220 tdm_display_get_output(tdm_display *dpy, int index, tdm_error *error);
223 * @brief Create a pp object.
224 * @param[in] dpy A display object
225 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
226 * @return A pp object if success. Otherwise, NULL.
227 * @see tdm_pp_destroy
230 tdm_display_create_pp(tdm_display *dpy, tdm_error *error);
233 * @brief Get the model information of a output object.
234 * @param[in] output A output object
235 * @param[out] maker The output maker.
236 * @param[out] model The output model.
237 * @param[out] name The output name.
238 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
241 tdm_output_get_model_info(tdm_output *output, const char **maker,
242 const char **model, const char **name);
245 * @brief Get the connection status of a output object.
246 * @param[in] output A output object
247 * @param[out] status The connection status.
248 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
251 tdm_output_get_conn_status(tdm_output *output, tdm_output_conn_status *status);
254 * @brief Add a output change handler
255 * @details The handler will be called when the status of a
256 * output object is changed. connection, DPMS, etc.
257 * @param[in] output A output object
258 * @param[in] func A output change handler
259 * @param[in] user_data The user data
260 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
263 tdm_output_add_change_handler(tdm_output *output,
264 tdm_output_change_handler func,
268 * @brief Remove a output change handler
269 * @param[in] output A output object
270 * @param[in] func A output change handler
271 * @param[in] user_data The user data
272 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
275 tdm_output_remove_change_handler(tdm_output *output,
276 tdm_output_change_handler func,
280 * @brief Get the connection type of a output object.
281 * @param[in] output A output object
282 * @param[out] type The connection type.
283 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
286 tdm_output_get_output_type(tdm_output *output, tdm_output_type *type);
289 * @brief Get the layer counts which a output object has.
290 * @param[in] output A output object
291 * @param[out] count The count of layers
292 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
293 * @see tdm_output_get_layer
296 tdm_output_get_layer_count(tdm_output *output, int *count);
299 * @brief Get a layer object which has the given index.
300 * @param[in] output A output object
301 * @param[in] index The index of a layer object
302 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
303 * @return A layer object if success. Otherwise, NULL.
304 * @see tdm_output_get_layer_count
307 tdm_output_get_layer(tdm_output *output, int index, tdm_error *error);
310 * @brief Get the available property array of a output object.
311 * @param[in] output A output object
312 * @param[out] props The available property array
313 * @param[out] count The count of properties
314 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
317 tdm_output_get_available_properties(tdm_output *output, const tdm_prop **props,
321 * @brief Get the available mode array of a output object.
322 * @param[in] output A output object
323 * @param[out] modes The available mode array
324 * @param[out] count The count of modes
325 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
328 tdm_output_get_available_modes(tdm_output *output,
329 const tdm_output_mode **modes, int *count);
332 * @brief Get the available size of a output object.
333 * @details -1 means that a TDM backend module doesn't define the value.
334 * @param[in] output A output object
335 * @param[out] min_w The minimum width which TDM can handle
336 * @param[out] min_h The minimum height which TDM can handle
337 * @param[out] max_w The maximum width which TDM can handle
338 * @param[out] max_h The maximum height which TDM can handle
339 * @param[out] preferred_align The preferred align width which TDM can handle
340 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
343 tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h,
344 int *max_w, int *max_h, int *preferred_align);
347 * @brief Get the physical size of a output object.
348 * @param[in] output A output object
349 * @param[out] mmWidth The milimeter width
350 * @param[out] mmHeight The milimeter height
351 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
354 tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth,
355 unsigned int *mmHeight);
358 * @brief Get the subpixel of a output object.
359 * @param[in] output A output object
360 * @param[out] subpixel The subpixel
361 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
364 tdm_output_get_subpixel(tdm_output *output, unsigned int *subpixel);
367 * @brief Get the pipe of a output object.
368 * @param[in] output A output object
369 * @param[out] pipe The pipe
370 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
373 tdm_output_get_pipe(tdm_output *output, unsigned int *pipe);
376 * @brief Set the property which has a given id.
377 * @param[in] output A output object
378 * @param[in] id The property id
379 * @param[in] value The value
380 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
383 tdm_output_set_property(tdm_output *output, unsigned int id, tdm_value value);
386 * @brief Get the property which has a given id
387 * @param[in] output A output object
388 * @param[in] id The property id
389 * @param[out] value The value
390 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
393 tdm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value);
396 * @brief Wait for VBLANK
397 * @details After interval vblanks, a user vblank handler will be called.
398 * @param[in] output A output object
399 * @param[in] interval vblank interval
400 * @param[in] sync 0: asynchronous, 1:synchronous
401 * @param[in] func A user vblank handler
402 * @param[in] user_data The user data
403 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
404 * @see #tdm_output_vblank_handler
407 tdm_output_wait_vblank(tdm_output *output, int interval, int sync,
408 tdm_output_vblank_handler func, void *user_data);
411 * @brief Commit changes for a output object
412 * @details After all change of a output object are applied, a user commit handler
414 * @param[in] output A output object
415 * @param[in] sync 0: asynchronous, 1:synchronous
416 * @param[in] func A user commit handler
417 * @param[in] user_data The user data
418 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
421 tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
425 * @brief Set one of available modes of a output object
426 * @param[in] output A output object
427 * @param[in] mode A output mode
428 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
431 tdm_output_set_mode(tdm_output *output, const tdm_output_mode *mode);
434 * @brief Get the mode of a output object
435 * @param[in] output A output object
436 * @param[out] mode A output mode
437 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
440 tdm_output_get_mode(tdm_output *output, const tdm_output_mode **mode);
443 * @brief Set DPMS of a output object
444 * @param[in] output A output object
445 * @param[in] dpms_value DPMS value
446 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
449 tdm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value);
452 * @brief Get DPMS of a output object
453 * @param[in] output A output object
454 * @param[out] dpms_value DPMS value
455 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
458 tdm_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value);
461 * @brief Create a capture object of a output object
462 * @param[in] output A output object
463 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
464 * @return A capture object
465 * @see tdm_capture_destroy
468 tdm_output_create_capture(tdm_output *output, tdm_error *error);
471 * @brief Get the capabilities of a layer object.
472 * @param[in] layer A layer object
473 * @param[out] capabilities The capabilities of a layer object
474 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
477 tdm_layer_get_capabilities(tdm_layer *layer,
478 tdm_layer_capability *capabilities);
481 * @brief Get the available format array of a layer object.
482 * @param[in] layer A layer object
483 * @param[out] formats The available format array
484 * @param[out] count The count of formats
485 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
488 tdm_layer_get_available_formats(tdm_layer *layer, const tbm_format **formats,
492 * @brief Get the available property array of a layer object.
493 * @param[in] layer A layer object
494 * @param[out] props The available property array
495 * @param[out] count The count of properties
496 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
499 tdm_layer_get_available_properties(tdm_layer *layer, const tdm_prop **props,
503 * @brief Get the zpos of a layer object.
505 * - GRAPHIC layers have fixed zpos. It starts from 0. It's @b non-changeable.
506 * - But the zpos of VIDEO layers will be decided by a backend module side.
507 * - A frontend user only can set the relative zpos to VIDEO layers via #tdm_layer_set_video_pos
508 * - The zpos of video layers is less than GRAPHIC layers or more than GRAPHIC
509 * layers. ie, ..., -2, -1, 4, 5, ... (if 0 <= GRAPHIC layer's zpos < 4).
510 * -------------------------------- graphic layer 3 <-- top most layer
511 * -------------------------------- graphic layer 2
512 * -------------------------------- graphic layer 1
513 * -------------------------------- graphic layer 0
514 * -------------------------------- video layer -1
515 * -------------------------------- video layer -2 <-- lowest layer
516 * @param[in] layer A layer object
517 * @param[out] zpos The zpos
518 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
519 * @see tdm_layer_set_video_pos, tdm_layer_capability
522 tdm_layer_get_zpos(tdm_layer *layer, unsigned int *zpos);
525 * @brief Set the property which has a given id.
526 * @param[in] layer A layer object
527 * @param[in] id The property id
528 * @param[in] value The value
529 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
532 tdm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value);
535 * @brief Get the property which has a given id.
536 * @param[in] layer A layer object
537 * @param[in] id The property id
538 * @param[out] value The value
539 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
542 tdm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value);
545 * @brief Set the geometry information to a layer object
546 * @details The geometry information will be applied when the output object
547 * of a layer object is committed. If a layer has TDM_LAYER_CAPABILITY_NO_CROP
548 * capability, a layer will ignore the pos(crop) information of #tdm_info_layer's
550 * @param[in] layer A layer object
551 * @param[in] info The geometry information
552 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
553 * @see tdm_output_commit
556 tdm_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
559 * @brief Get the geometry information to a layer object
560 * @param[in] layer A layer object
561 * @param[out] info The geometry information
562 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
565 tdm_layer_get_info(tdm_layer *layer, tdm_info_layer *info);
568 * @brief Set a TDM buffer to a layer object
569 * @details A TDM buffer will be applied when the output object
570 * of a layer object is committed.
571 * @param[in] layer A layer object
572 * @param[in] buffer A TDM buffer
573 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
574 * @see tdm_output_commit
577 tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
580 * @brief Unset a TDM buffer from a layer object
581 * @details When this function is called, a current showing buffer will be
582 * disappeared from screen. Then nothing is showing on a layer object.
583 * @param[in] layer A layer object
584 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
587 tdm_layer_unset_buffer(tdm_layer *layer);
590 * @brief Get a displaying TDM buffer from a layer object
591 * @details A displaying TDM buffer is a current showing buffer on screen
592 * that is set to layer object and applied output object of a layer object.
593 * @param[in] layer A layer object
594 * @return A TDM buffer if success. Otherwise, NULL.
597 tdm_layer_get_displaying_buffer(tdm_layer *layer, tdm_error *error);
600 * @brief Set a TBM surface_queue to a layer object
601 * @details A TBM surface_queue will be applied when the output object
602 * of a layer object is committed. and TDM layer will be automatically updated
603 * @param[in] layer A layer object
604 * @param[in] buffer_queue A TBM surface_queue
605 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
606 * @see tdm_output_commit
609 tdm_layer_set_buffer_queue(tdm_layer *layer, tbm_surface_queue_h buffer_queue);
612 * @brief Unset a TBM surface_queue from a layer object
613 * @details When this function is called, a current surface_queue will be
614 * disappeared from screen. Then nothing is showing on a layer object.
615 * @param[in] layer A layer object
616 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
619 tdm_layer_unset_buffer_queue(tdm_layer *layer);
622 * @brief Check wheter a layer object is available for a frontend user to use.
623 * @details A layer object is not usable if a TDM buffer is showing on screen
624 * via this layer object. By calling #tdm_layer_unset_buffer, this layer object
625 * will become usable.
626 * @param[in] layer A layer object
627 * @param[out] usable 1 if usable, 0 if not usable
628 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
631 tdm_layer_is_usable(tdm_layer *layer, unsigned int *usable);
634 * @brief Set the relative zpos to a VIDEO layer object
635 * @details The zpos value is less than the minimum zpos of GRAPHIC layers, or
636 * it is more than the maximum zpos of GRAPHIC layers.
637 * @param[in] layer A VIDEO layer object
638 * @param[in] zpos The zpos
639 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
640 * @see tdm_layer_get_zpos, tdm_layer_capability
643 tdm_layer_set_video_pos(tdm_layer *layer, int zpos);
646 * @brief Create a capture object of a layer object
647 * @param[in] layer A layer object
648 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
649 * @return A capture object
650 * @see tdm_capture_destroy
653 tdm_layer_create_capture(tdm_layer *layer, tdm_error *error);
656 * @brief Destroy a pp object
657 * @param[in] pp A pp object
658 * @see tdm_display_create_pp
661 tdm_pp_destroy(tdm_pp *pp);
664 * @brief Set the geometry information to a pp object
665 * @param[in] pp A pp object
666 * @param[in] info The geometry information
667 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
671 tdm_pp_set_info(tdm_pp *pp, tdm_info_pp *info);
674 * @brief Attach a source buffer and a destination buffer to a pp object
675 * @param[in] pp A pp object
676 * @param[in] src A source buffer
677 * @param[in] dst A destination buffer
678 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
679 * @see tdm_pp_commit, tdm_buffer_add_release_handler, tdm_buffer_release_handler
682 tdm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
685 * @brief Commit changes for a pp object
686 * @param[in] pp A pp object
687 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
690 tdm_pp_commit(tdm_pp *pp);
693 * @brief Destroy a capture object
694 * @param[in] capture A capture object
695 * @see tdm_output_create_capture, tdm_layer_create_capture
698 tdm_capture_destroy(tdm_capture *capture);
701 * @brief Set the geometry information to a capture object
702 * @param[in] capture A capture object
703 * @param[in] info The geometry information
704 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
705 * @see tdm_capture_commit
708 tdm_capture_set_info(tdm_capture *capture, tdm_info_capture *info);
711 * @brief Attach a TDM buffer to a capture object
712 * @param[in] capture A capture object
713 * @param[in] buffer A TDM buffer
714 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
715 * @see tdm_capture_commit, tdm_buffer_add_release_handler, tdm_buffer_release_handler
718 tdm_capture_attach(tdm_capture *capture, tbm_surface_h buffer);
721 * @brief Commit changes for a capture object
722 * @param[in] capture A capture object
723 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
726 tdm_capture_commit(tdm_capture *capture);
729 * @brief The release handler of a TDM buffer
730 * @param[in] buffer A TDM buffer
731 * @param[in] user_data user data
732 * @see tdm_buffer_add_release_handler, tdm_buffer_remove_release_handler
734 typedef void (*tdm_buffer_release_handler)(tbm_surface_h buffer,
738 * @brief Add a release handler to a TDM buffer
740 * TDM has its own buffer release mechanism to let an frontend user know when a TDM buffer
741 * becomes available for a next job. A TDM buffer can be used for TDM to show
742 * it on screen or to capture an output and a layer. After all operations,
743 * TDM will release it immediately when TDM doesn't need it any more.
744 * @param[in] buffer A TDM buffer
745 * @param[in] func A release handler
746 * @param[in] user_data user data
747 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
748 * @see tdm_buffer_remove_release_handler
751 tdm_buffer_add_release_handler(tbm_surface_h buffer,
752 tdm_buffer_release_handler func, void *user_data);
755 * @brief Remove a release handler from a TDM buffer
756 * @param[in] buffer A TDM buffer
757 * @param[in] func A release handler
758 * @param[in] user_data user data
759 * @see tdm_buffer_add_release_handler
762 tdm_buffer_remove_release_handler(tbm_surface_h buffer,
763 tdm_buffer_release_handler func, void *user_data);