bring in common from DRI trunk
[profile/ivi/mesa.git] / src / mesa / drivers / dri / common / xmlpool.h
1 /* -*- mode:C; coding: mult-utf-8-unix -*-
2  *
3  * !!! Important: This file is encoded in UTF-8 !!!
4  *
5  * Note (Emacs): You need Mule. In Debian the package is called
6  * mule-ucs.
7  *
8  * Note (Emacs): You may have to enable multibyte characters in the
9  * Mule customization group or by setting
10  * default-enable-multibyte-characters to t in your .emacs:
11  */
12 /*
13  * XML DRI client-side driver configuration
14  * Copyright (C) 2003 Felix Kuehling
15  *
16  * Permission is hereby granted, free of charge, to any person obtaining a
17  * copy of this software and associated documentation files (the "Software"),
18  * to deal in the Software without restriction, including without limitation
19  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
20  * and/or sell copies of the Software, and to permit persons to whom the
21  * Software is furnished to do so, subject to the following conditions:
22  *
23  * The above copyright notice and this permission notice shall be included
24  * in all copies or substantial portions 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 MERCHANTABILITY,
28  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
29  * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
30  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
31  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
32  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33  * 
34  */
35 /**
36  * \file xmlpool.h
37  * \brief Pool of common options
38  * \author Felix Kuehling
39  *
40  * This file defines macros that can be used to construct driConfigOptions
41  * in the drivers.
42  */
43
44 #ifndef __XMLPOOL_H
45 #define __XMLPOOL_H
46
47 /*
48  * generic macros
49  */
50
51 /** \brief Begin __driConfigOptions */
52 #define DRI_CONF_BEGIN \
53 "<driinfo>\n"
54
55 /** \brief End __driConfigOptions */
56 #define DRI_CONF_END \
57 "</driinfo>\n"
58
59 /** \brief Begin a section of related options */
60 #define DRI_CONF_SECTION_BEGIN \
61 "<section>\n"
62
63 /** \brief End a section of related options */
64 #define DRI_CONF_SECTION_END \
65 "</section>\n"
66
67 /** \brief Begin an option definition */
68 #define DRI_CONF_OPT_BEGIN(name,type,def) \
69 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n"
70
71 /** \brief Begin an option definition with restrictions on valid values */
72 #define DRI_CONF_OPT_BEGIN_V(name,type,def,valid) \
73 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\" valid=\""valid"\">\n"
74
75 /** \brief End an option description */
76 #define DRI_CONF_OPT_END \
77 "</option>\n"
78
79 /** \brief A verbal description in a specified language (empty version) */
80 #define DRI_CONF_DESC(lang,text) \
81 "<description lang=\""#lang"\" text=\""text"\"/>\n"
82
83 /** \brief A verbal description in a specified language */
84 #define DRI_CONF_DESC_BEGIN(lang,text) \
85 "<description lang=\""#lang"\" text=\""text"\">\n"
86
87 /** \brief End a description */
88 #define DRI_CONF_DESC_END \
89 "</description>\n"
90
91 /** \brief A verbal description of an enum value */
92 #define DRI_CONF_ENUM(value,text) \
93 "<enum value=\""#value"\" text=\""text"\"/>\n"
94
95 /*
96  * predefined option sections and options with multi-lingual descriptions
97  */
98
99 /** \brief Debugging options */
100 #define DRI_CONF_SECTION_DEBUG \
101 DRI_CONF_SECTION_BEGIN \
102         DRI_CONF_DESC(en,"Debugging") \
103         DRI_CONF_DESC(de,"Fehlersuche")
104
105 #define DRI_CONF_NO_RAST(def) \
106 DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
107         DRI_CONF_DESC(en,"Disable 3D acceleration") \
108         DRI_CONF_DESC(de,"3D-Beschleunigung abschalten") \
109 DRI_CONF_OPT_END
110
111 #define DRI_CONF_PERFORMANCE_BOXES(def) \
112 DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
113         DRI_CONF_DESC(en,"Show performance boxes") \
114         DRI_CONF_DESC(de,"Zeige Performanceboxen") \
115 DRI_CONF_OPT_END
116
117 #define DRI_CONF_DEBUG_DMA(def) \
118 DRI_CONF_OPT_BEGIN(debug_dma,bool,def) \
119         DRI_CONF_DESC(en,"Debug DMA buffers") \
120         DRI_CONF_DESC(de,"DMA Puffer debuggen") \
121 DRI_CONF_OPT_END
122
123
124 /** \brief Texture-related options */
125 #define DRI_CONF_SECTION_QUALITY \
126 DRI_CONF_SECTION_BEGIN \
127         DRI_CONF_DESC(en,"Image Quality") \
128         DRI_CONF_DESC(de,"Bildqualität")
129
130 #define DRI_CONF_TEXTURE_DEPTH_FB       0
131 #define DRI_CONF_TEXTURE_DEPTH_32       1
132 #define DRI_CONF_TEXTURE_DEPTH_16       2
133 #define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
134 #define DRI_CONF_TEXTURE_DEPTH(def) \
135 DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
136         DRI_CONF_DESC_BEGIN(en,"Texture color depth") \
137                 DRI_CONF_ENUM(0,"Prefer frame buffer color depth") \
138                 DRI_CONF_ENUM(1,"Prefer 32 bits") \
139                 DRI_CONF_ENUM(2,"Prefer 16 bits") \
140                 DRI_CONF_ENUM(3,"Force 16 bits") \
141         DRI_CONF_DESC_END \
142         DRI_CONF_DESC_BEGIN(de,"Texturfarbtiefe") \
143                 DRI_CONF_ENUM(0,"Bevorzugt so wie Frambuffer") \
144                 DRI_CONF_ENUM(1,"Bevorzugt 32 Bits") \
145                 DRI_CONF_ENUM(2,"Bevorzugt 16 Bits") \
146                 DRI_CONF_ENUM(3,"Höchstens 16 Bits") \
147         DRI_CONF_DESC_END \
148 DRI_CONF_OPT_END
149
150 #define DRI_CONF_COLOR_REDUCTION_ROUND 0
151 #define DRI_CONF_COLOR_REDUCTION_DITHER 1
152 #define DRI_CONF_COLOR_REDUCTION(def) \
153 DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
154         DRI_CONF_DESC_BEGIN(en,"Default color reduction method") \
155                 DRI_CONF_ENUM(0,"Round or truncate") \
156                 DRI_CONF_ENUM(1,"Dither") \
157         DRI_CONF_DESC_END \
158         DRI_CONF_DESC_BEGIN(de,"Standardmethode zur Farbreduktion") \
159                 DRI_CONF_ENUM(0,"Runden oder Abschneiden") \
160                 DRI_CONF_ENUM(1,"Rastern") \
161         DRI_CONF_DESC_END \
162 DRI_CONF_OPT_END
163
164 #define DRI_CONF_ROUND_TRUNC 0
165 #define DRI_CONF_ROUND_ROUND 1
166 #define DRI_CONF_ROUND_MODE(def) \
167 DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
168         DRI_CONF_DESC_BEGIN(en,"Round or truncate colors") \
169                 DRI_CONF_ENUM(0,"Truncate") \
170                 DRI_CONF_ENUM(1,"Round") \
171         DRI_CONF_DESC_END \
172         DRI_CONF_DESC_BEGIN(de,"Farben runden oder abschneiden") \
173                 DRI_CONF_ENUM(0,"Abschneiden") \
174                 DRI_CONF_ENUM(1,"Runden") \
175         DRI_CONF_DESC_END \
176 DRI_CONF_OPT_END
177
178 #define DRI_CONF_DITHER_XERRORDIFF 0
179 #define DRI_CONF_DITHER_XERRORDIFFRESET 1
180 #define DRI_CONF_DITHER_ORDERED 2
181 #define DRI_CONF_DITHER_MODE(def) \
182 DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
183         DRI_CONF_DESC_BEGIN(en,"Color dithering") \
184                 DRI_CONF_ENUM(0,"Horizontal error diffusion") \
185                 DRI_CONF_ENUM(1,"Horizontal error diffusion, reset error at line start") \
186                 DRI_CONF_ENUM(2,"Ordered 2D dithering") \
187         DRI_CONF_DESC_END \
188         DRI_CONF_DESC_BEGIN(de,"Farben rastern") \
189                 DRI_CONF_ENUM(0,"Horizontale Fehlerstreuung") \
190                 DRI_CONF_ENUM(1,"Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen") \
191                 DRI_CONF_ENUM(2,"Geordnete 2D Farbrasterung") \
192         DRI_CONF_DESC_END \
193 DRI_CONF_OPT_END
194
195 /** \brief Performance-related options */
196 #define DRI_CONF_SECTION_PERFORMANCE \
197 DRI_CONF_SECTION_BEGIN \
198         DRI_CONF_DESC(en,"Performance") \
199         DRI_CONF_DESC(de,"Leistung")
200
201 #define DRI_CONF_TCL_SW 0
202 #define DRI_CONF_TCL_PIPELINED 1
203 #define DRI_CONF_TCL_VTXFMT 2
204 #define DRI_CONF_TCL_CODEGEN 3
205 #define DRI_CONF_TCL_MODE(def) \
206 DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
207         DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \
208                 DRI_CONF_ENUM(0,"Software") \
209                 DRI_CONF_ENUM(1,"TCL stage in MESA pipeline") \
210                 DRI_CONF_ENUM(2,"Bypass MESA's pipeline") \
211                 DRI_CONF_ENUM(3,"Bypass MESA's pipeline with state-based code generation") \
212         DRI_CONF_DESC_END \
213         DRI_CONF_DESC_BEGIN(de,"TCL Modus (Transformation, Clipping, Licht)") \
214                 DRI_CONF_ENUM(0,"Software") \
215                 DRI_CONF_ENUM(1,"TCL Stufe in MESA Pipeline") \
216                 DRI_CONF_ENUM(2,"Umgehe MESA's Pipeline") \
217                 DRI_CONF_ENUM(3,"Umgehe MESA's Pipeline mit zustandsbasierter Codegenerierung") \
218         DRI_CONF_DESC_END \
219 DRI_CONF_OPT_END
220
221 #define DRI_CONF_FTHROTTLE_BUSY 0
222 #define DRI_CONF_FTHROTTLE_USLEEPS 1
223 #define DRI_CONF_FTHROTTLE_IRQS 2
224 #define DRI_CONF_FTHROTTLE_MODE(def) \
225 DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
226         DRI_CONF_DESC_BEGIN(en,"Frame throttling") \
227                 DRI_CONF_ENUM(0,"Busy waiting") \
228                 DRI_CONF_ENUM(1,"Usleeps") \
229                 DRI_CONF_ENUM(2,"Software interrupts") \
230         DRI_CONF_DESC_END \
231         DRI_CONF_DESC_BEGIN(de,"Framethrottling") \
232                 DRI_CONF_ENUM(0,"Aktives Warten") \
233                 DRI_CONF_ENUM(1,"Usleeps") \
234                 DRI_CONF_ENUM(2,"Sortware Interrutps") \
235         DRI_CONF_DESC_END \
236 DRI_CONF_OPT_END
237
238 #define DRI_CONF_VBLANK_NEVER 0
239 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
240 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
241 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
242 #define DRI_CONF_VBLANK_MODE(def) \
243 DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
244         DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \
245                 DRI_CONF_ENUM(0,"Never, FPS rulez!") \
246                 DRI_CONF_ENUM(1,"Application preference, default interval 0") \
247                 DRI_CONF_ENUM(2,"Application preference, default interval 1") \
248                 DRI_CONF_ENUM(3,"Application preference, always synchronize with refresh") \
249         DRI_CONF_DESC_END \
250         DRI_CONF_DESC_BEGIN(de,"Synchronisation mit dem vertikalen Bildaufbau (swap intervals)") \
251                 DRI_CONF_ENUM(0,"Niemals, immer die maximale Framerate") \
252                 DRI_CONF_ENUM(1,"Anwendung entscheidet, Standardinterval 0") \
253                 DRI_CONF_ENUM(2,"Anwendung entscheidet, Standardinterval 1") \
254                 DRI_CONF_ENUM(3,"Anwendung entscheidet, immer mit Bildaufbau synchronisieren") \
255         DRI_CONF_DESC_END \
256 DRI_CONF_OPT_END
257
258 #endif