tbm_bufmgr_debug_show: increasing size of title and data to avoid memory overflow
[platform/core/uifw/libtbm.git] / src / tbm_drm_helper.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_DRM_HELPER_H_
33 #define _TBM_DRM_HELPER_H_
34
35 /**
36  * @brief Initialize authentication server in display server.
37  * @details
38  * In DRM system, client sholud get authenticated fd from display server for using drm.
39    Tbm provides wayland protocol and helper function for passing and authenticating
40    fd from display server.
41  * @param[in] wl_display wayland display
42  * @param[in] fd fd of drm_master
43  * @param[in] device_name name of drm device
44  * @param[in] flags flags
45   * @see #tbm_drm_helper_wl_auth_server_deinit()
46  */
47 int tbm_drm_helper_wl_auth_server_init(void  *wl_display, int fd, const char *device_name, uint32_t flags);
48
49 /**
50  * @brief Deinitialize authentication server in display server
51  * @details
52  * In DRM system, client sholud get authenticated fd from display server for using drm.
53    Tbm provides wayland protocol and helper function for passing and authenticating
54    fd from display server.
55  * @see #tdm_helper_set_tbm_master_fd()
56  * @see #tbm_drm_helper_unset_tbm_master_fd()
57  */
58 void tbm_drm_helper_wl_auth_server_deinit(void);
59
60 /**
61  * @brief Get a fd from the specific enviroment variable.
62  * @details
63  * This function will dup the fd of the given enviroment variable.
64    The Caller SHOULD close the fd.
65    In DRM system, a drm-master-fd SHOULD be shared between TDM backend and
66    TBM backend in display server side by using "TDM_DRM_MASTER_FD" and "TBM_DRM_MASTER_FD".
67  * @param[in] env The given enviroment variable
68  * @return fd if success. Otherwise, -1.
69  * @see #tdm_helper_set_tbm_master_fd()
70  */
71 int  tbm_drm_helper_get_master_fd(void);
72
73 /**
74  * @brief Set the given fd to TBM_DRM_MASTER_FD enviroment variable.
75  * @details
76  * In DRM system, a drm-master-fd @b SHOULD be shared between TDM backend and
77    TBM backend in display server side by using "TDM_DRM_MASTER_FD"
78    and "TBM_DRM_MASTER_FD".
79  * @param[in] fd The given fd
80  * @see #tdm_helper_set_tbm_master_fd()
81  * @see #tbm_drm_helper_unset_tbm_master_fd()
82  */
83 void tbm_drm_helper_set_tbm_master_fd(int fd);
84
85 /**
86  * @brief Unset the TBM_DRM_MASTER_FD enviroment variable.
87  * @details
88  * In DRM system, a drm-master-fd @b SHOULD be shared between TDM backend and
89    TBM backend in display server side by using "TDM_DRM_MASTER_FD"
90    and "TBM_DRM_MASTER_FD".
91  * @param[in] env The given enviroment variable
92  * @param[in] fd The given fd
93  * @see #tdm_helper_set_tbm_master_fd()
94  * @see #tbm_drm_helper_unset_tbm_master_fd()
95  */
96 void tbm_drm_helper_unset_tbm_master_fd(void);
97
98 /**
99  * @brief Get infomation of drm authentication.
100  * @details
101  * In DRM system, client sholud get authenticated fd from display server for using drm.
102    Tbm provides wayland protocol and helper function for passing and authenticating
103    fd from display server.
104  * @param[out] fd The authenticated fd
105  * @param[out] device The device name
106  * @param[out] capabilities The capabilities of device
107  * @see #tdm_helper_set_tbm_master_fd()
108  * @see #tbm_drm_helper_unset_tbm_master_fd()
109  */
110 int tbm_drm_helper_get_auth_info(int *auth_fd, char **device, uint32_t *capabilities);
111
112 /**
113  * @brief Set the given fd to TBM_DRM_FD enviroment variable.
114  * @details
115  * Some client want to get drm fd used tbm_backend.
116    if tbm_backend allow that client use drm_fd, it SHOULD be set.
117  * @param[in] fd The given fd
118  * @see #tbm_drm_helper_get_fd()
119  */
120 void tbm_drm_helper_set_fd(int fd);
121
122 /**
123  * @brief Unset the given fd to TBM_DRM_FD enviroment variable.
124  * @details
125  * Some client want to get drm fd used tbm_backend.
126    if tbm_backend allow that client use drm_fd, it SHOULD be set.
127  * @param[in] fd The given fd
128  * @see #tbm_drm_helper_get_fd()
129  */
130 void tbm_drm_helper_unset_fd(void);
131
132 /**
133  * @brief Get the fd from TBM_DRM_FD enviroment variable.
134  * @details
135  * Some client want to get drm fd used tbm_backend.
136    client can get drm fd from this fucntion.
137    The Caller SHOULD close the fd.
138  * @return fd if success. Otherwise, -1.
139  * @see #tdm_helper_set_tbm_master_fd()
140  * @see #tbm_drm_helper_unset_tbm_master_fd()
141  */
142 int tbm_drm_helper_get_fd(void);
143
144 #endif                                                  /* _TBM_DRM_HELPER_H_ */