Package version up to 4.4.0
[platform/core/uifw/libtbm.git] / include / tbm_bufmgr.h
1 /**************************************************************************
2
3 libtbm
4
5 Copyright 2012 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
8 Boram Park <boram1288.park@samsung.com>, Changyeon Lee <cyeon.lee@samsung.com>
9
10 Permission is hereby granted, free of charge, to any person obtaining a
11 copy of this software and associated documentation files (the
12 "Software"), to deal in the Software without restriction, including
13 without limitation the rights to use, copy, modify, merge, publish,
14 distribute, sub license, and/or sell copies of the Software, and to
15 permit persons to whom the Software is furnished to do so, subject to
16 the following conditions:
17
18 The above copyright notice and this permission notice (including the
19 next paragraph) shall be included in all copies or substantial portions
20 of the Software.
21
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
25 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 **************************************************************************/
31
32 #ifndef _TBM_BUFMGR_H_
33 #define _TBM_BUFMGR_H_
34
35 #include <tbm_type.h>
36 #include <tbm_type_common.h>
37 #include <tbm_bo.h>
38 #include <tbm_error.h>
39
40 /**
41  * \file tbm_bufmgr.h
42  * \brief Tizen Buffer Manager
43  */
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 /* Functions for buffer manager */
50
51 /**
52  * @brief Initializes the buffer manager.
53  * @details If fd is lower than zero, fd is get drm fd in tbm_bufmgr_init function\n
54  * @since_tizen 2.3
55  * @param[in] fd : file descripter of the system buffer manager
56  * @return a buffer manager
57  * @retval #tbm_bufmgr
58  * @see tbm_bufmgr_deinit();
59  * @par Example
60    @code
61    #include <tbm_bufmgr.h>
62    int bufmgr_fd;
63
64    tbm_bufmgr bufmgr;
65    bufmgr = tbm_bufmgr_init (bufmgr_fd);
66
67    ....
68
69    tbm_bufmgr_deinit (bufmgr);
70    @endcode
71  */
72 tbm_bufmgr tbm_bufmgr_init(int fd);
73
74 /**
75  * @brief Deinitializes the buffer manager.
76  * @since_tizen 2.3
77  * @param[in] bufmgr : the buffer manager
78  * @see tbm_bufmgr_init()
79  * @par Example
80    @code
81    #include <tbm_bufmgr.h>
82
83    int bufmgr_fd;
84    tbm_bufmgr bufmgr;
85    tbm_error_e error;
86    bufmgr = tbm_bufmgr_init (bufmgr_fd);
87    if (!bufmgr)
88    {
89       error = tbm_get_last_error ();
90       ...
91    }
92
93    ....
94
95    tbm_bufmgr_deinit (bufmgr);
96    @endcode
97  */
98 void tbm_bufmgr_deinit(tbm_bufmgr bufmgr);
99
100 /**
101  * @brief Gets the tbm buffer capability.
102  * @since_tizen 2.4
103  * @param[in] bufmgr : the buffer manager
104  * @return the tbm bufmgr capability
105  * @par Example
106    @code
107    #include <tbm_bufmgr.h>
108
109    int bufmgr_fd;
110    tbm_bufmgr bufmgr;
111    unsigned int capability;
112
113    bufmgr = tbm_bufmgr_init (bufmgr_fd);
114
115    capability = tbm_bufmgr_get_capability (bufmgr);
116
117    tbm_bufmgr_deinit (bufmgr);
118    @endcode
119  */
120 unsigned int tbm_bufmgr_get_capability(tbm_bufmgr bufmgr);
121
122 #ifdef __cplusplus
123 }
124 #endif
125 #endif                                                  /* _TBM_BUFMGR_H_ */