Merge branch 'tizen' into sandbox/cyeon/devel
[platform/core/uifw/libtdm.git] / src / tdm_config.h
1 /**************************************************************************
2  *
3  * libtdm
4  *
5  * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
6  *
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>
13  *
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:
21  *
22  * The above copyright notice and this permission notice (including the
23  * next paragraph) shall be included in all copies or substantial portions
24  * of the Software.
25  *
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.
33  *
34 **************************************************************************/
35
36 #ifndef _TDM_CONFIG_H_
37 #define _TDM_CONFIG_H_
38
39 #include "tdm_common.h"
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 #include "tdm_common.h"
46
47 /**
48  * @file tdm_config.h
49  * @brief The config header file for a frontend library
50  */
51
52 /**
53  * @brief Get the ini value with given key
54  * @details
55  * @param[in] key The given key
56  * @param[in] default_value The default value
57  * @return the value of given key if success. Otherwise, default_value.
58  * @see #tdm_config_get_string
59  */
60 int
61 tdm_config_get_int(const char *key, int default_value);
62
63 /**
64  * @brief Get the ini value with given key
65  * @details
66  * @param[in] key The given key
67  * @param[in] default_value The default value
68  * @return the value of given key if success. Otherwise, default_value.
69  * @see #tdm_config_get_int
70  */
71 const char *
72 tdm_config_get_string(const char *key, const char *default_value);
73
74 /**
75  * @brief Set the ini value with given key
76  * @details
77  * @param[in] key The given key
78  * @param[in] value The value
79  * @return TDM_ERROR_NONE if success. Otherwise, error value.
80  */
81 tdm_error
82 tdm_config_set_int(const char *key, int value);
83
84 /**
85  * @brief Set the ini value with given key
86  * @details
87  * @param[in] key The given key
88  * @param[in] value The value
89  * @return TDM_ERROR_NONE if success. Otherwise, error value.
90  */
91 tdm_error
92 tdm_config_set_string(const char *key, const char *value);
93
94
95 #define TDM_CONFIG_DELIM ", "
96
97 /*** general keys ************************************************************/
98
99 /* backends order list to load.
100  * default: libtdm-default.so
101  * ex) libtdm-default.so,libtdm-dummy.so
102  */
103 #define TDM_CONFIG_KEY_GENERAL_BACKENDS           "general:backends"
104
105 /* enable thd tdm thread. [0(disable), 1(enable)]
106  * default: 0
107  * ex) 1
108  */
109 #define TDM_CONFIG_KEY_GENERAL_THREAD             "general:thread"
110
111 /* enable the tdm commit-per-vblank functionality. [0(disable), 1(enable)]
112  * default: 0
113  * ex) 1
114  */
115 #define TDM_CONFIG_KEY_GENERAL_COMMIT_PER_VBLANK  "general:commit_per_vblank"
116
117 /* enable the tdm virtual output module. [0(disable), 1(enable)]
118  * default: 0
119  * ex) 1
120  */
121 #define TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT  "general:virtual_output"
122
123 /* set the tdm virtual output hwc target buffer bo to default. [0(unset), 1(set)]
124  * default: 0
125  * ex) 1
126  */
127 #define TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT_HWC_TARGET_BO_DEFAULT  "general:virtual_output_hwc_target_bo_default"
128
129
130 /*** debug keys **************************************************************/
131
132 /* debugging module list. [0(disable), 1(enable)]
133  * default: 1
134  * ex) 0
135  */
136 #define TDM_CONFIG_KEY_DEBUG_DLOG                 "debug:dlog"
137
138 /* debugging module list. [none,all,buffer,thread,event,mutex,vblank,commit]
139  * default: none
140  * ex) mutex,vblank
141  */
142 #define TDM_CONFIG_KEY_DEBUG_MODULE               "debug:module"
143
144 /* debugging dump list. [none,current,all,layer,pp,capture,window]
145  * default: none
146  * ex) layer,capture
147  */
148 #define TDM_CONFIG_KEY_DEBUG_DUMP                 "debug:dump"
149
150 /* debugging log path. [{filepath}]
151  * default:
152  * ex) /var/tdm.log
153  */
154 #define TDM_CONFIG_KEY_DEBUG_LOG_PATH             "debug:log_path"
155
156 /* debugging log level. [1(ERR),2(WRN),3(INFO),4(DBG)]
157  * default: 3
158  * ex) 4
159  */
160 #define TDM_CONFIG_KEY_DEBUG_LOG_LEVEL            "debug:log_level"
161
162 /* debugging log level to assert. [0(NONE),1(ERR),2(WRN),3(INFO),4(DBG)]
163  * default: 0
164  * ex) 1
165  */
166 #define TDM_CONFIG_KEY_DEBUG_ASSERT_LEVEL         "debug:assert_level"
167
168
169 #ifdef __cplusplus
170 }
171 #endif
172
173 #endif /* _TDM_CONFIG_H_ */