fix some 0->NULLs
[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 Framebuffer") \
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_DEF_MAX_ANISOTROPY(def,range) \
151 DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
152 DRI_CONF_DESC(en,"Default maximum value for anisotropic texture filtering") \
153 DRI_CONF_DESC(de,"Standard Maximalwert für anisotropische Texturfilterung") \
154 DRI_CONF_OPT_END
155
156 #define DRI_CONF_NO_NEG_LOD_BIAS(def) \
157 DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
158 DRI_CONF_DESC(en,"Forbid negative texture LOD bias") \
159 DRI_CONF_DESC(de,"Verbiete negativen Textur-LOD-Bias") \
160 DRI_CONF_OPT_END
161
162 #define DRI_CONF_FORCE_S3TC_ENABLE(def) \
163 DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \
164 DRI_CONF_DESC(en,"enable s3tc even if software support is not available") \
165 DRI_CONF_DESC(de,"Benutze s3tc auch ohne Softwareunterstuetzung") \
166 DRI_CONF_OPT_END
167
168 #define DRI_CONF_COLOR_REDUCTION_ROUND 0
169 #define DRI_CONF_COLOR_REDUCTION_DITHER 1
170 #define DRI_CONF_COLOR_REDUCTION(def) \
171 DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
172 DRI_CONF_DESC_BEGIN(en,"Default color reduction method") \
173 DRI_CONF_ENUM(0,"Round or truncate") \
174 DRI_CONF_ENUM(1,"Dither") \
175 DRI_CONF_DESC_END \
176 DRI_CONF_DESC_BEGIN(de,"Standardmethode zur Farbreduktion") \
177 DRI_CONF_ENUM(0,"Runden oder Abschneiden") \
178 DRI_CONF_ENUM(1,"Rastern") \
179 DRI_CONF_DESC_END \
180 DRI_CONF_OPT_END
181
182 #define DRI_CONF_ROUND_TRUNC 0
183 #define DRI_CONF_ROUND_ROUND 1
184 #define DRI_CONF_ROUND_MODE(def) \
185 DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
186 DRI_CONF_DESC_BEGIN(en,"Round or truncate colors") \
187 DRI_CONF_ENUM(0,"Truncate") \
188 DRI_CONF_ENUM(1,"Round") \
189 DRI_CONF_DESC_END \
190 DRI_CONF_DESC_BEGIN(de,"Farben runden oder abschneiden") \
191 DRI_CONF_ENUM(0,"Abschneiden") \
192 DRI_CONF_ENUM(1,"Runden") \
193 DRI_CONF_DESC_END \
194 DRI_CONF_OPT_END
195
196 #define DRI_CONF_DITHER_XERRORDIFF 0
197 #define DRI_CONF_DITHER_XERRORDIFFRESET 1
198 #define DRI_CONF_DITHER_ORDERED 2
199 #define DRI_CONF_DITHER_MODE(def) \
200 DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
201 DRI_CONF_DESC_BEGIN(en,"Color dithering") \
202 DRI_CONF_ENUM(0,"Horizontal error diffusion") \
203 DRI_CONF_ENUM(1,"Horizontal error diffusion, reset error at line start") \
204 DRI_CONF_ENUM(2,"Ordered 2D dithering") \
205 DRI_CONF_DESC_END \
206 DRI_CONF_DESC_BEGIN(de,"Farben rastern") \
207 DRI_CONF_ENUM(0,"Horizontale Fehlerstreuung") \
208 DRI_CONF_ENUM(1,"Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen") \
209 DRI_CONF_ENUM(2,"Geordnete 2D Farbrasterung") \
210 DRI_CONF_DESC_END \
211 DRI_CONF_OPT_END
212
213 #define DRI_CONF_FLOAT_DEPTH(def) \
214 DRI_CONF_OPT_BEGIN(float_depth,bool,def) \
215 DRI_CONF_DESC(en,"Floating point depth buffer") \
216 DRI_CONF_DESC(de,"Fließkomma z-Puffer") \
217 DRI_CONF_OPT_END
218
219 /** \brief Performance-related options */
220 #define DRI_CONF_SECTION_PERFORMANCE \
221 DRI_CONF_SECTION_BEGIN \
222 DRI_CONF_DESC(en,"Performance") \
223 DRI_CONF_DESC(de,"Leistung")
224
225 #define DRI_CONF_TCL_SW 0
226 #define DRI_CONF_TCL_PIPELINED 1
227 #define DRI_CONF_TCL_VTXFMT 2
228 #define DRI_CONF_TCL_CODEGEN 3
229 #define DRI_CONF_TCL_MODE(def) \
230 DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
231 DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \
232 DRI_CONF_ENUM(0,"Software") \
233 DRI_CONF_ENUM(1,"TCL stage in MESA pipeline") \
234 DRI_CONF_ENUM(2,"Bypass MESA's pipeline") \
235 DRI_CONF_ENUM(3,"Bypass MESA's pipeline with state-based code generation") \
236 DRI_CONF_DESC_END \
237 DRI_CONF_DESC_BEGIN(de,"TCL Modus (Transformation, Clipping, Licht)") \
238 DRI_CONF_ENUM(0,"Software") \
239 DRI_CONF_ENUM(1,"TCL Stufe in MESA Pipeline") \
240 DRI_CONF_ENUM(2,"Umgehe MESAs Pipeline") \
241 DRI_CONF_ENUM(3,"Umgehe MESAs Pipeline mit zustandsbasierter Codegenerierung") \
242 DRI_CONF_DESC_END \
243 DRI_CONF_OPT_END
244
245 #define DRI_CONF_FTHROTTLE_BUSY 0
246 #define DRI_CONF_FTHROTTLE_USLEEPS 1
247 #define DRI_CONF_FTHROTTLE_IRQS 2
248 #define DRI_CONF_FTHROTTLE_MODE(def) \
249 DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
250 DRI_CONF_DESC_BEGIN(en,"Frame throttling") \
251 DRI_CONF_ENUM(0,"Busy waiting") \
252 DRI_CONF_ENUM(1,"Usleeps") \
253 DRI_CONF_ENUM(2,"Software interrupts") \
254 DRI_CONF_DESC_END \
255 DRI_CONF_DESC_BEGIN(de,"Framethrottling") \
256 DRI_CONF_ENUM(0,"Aktives Warten") \
257 DRI_CONF_ENUM(1,"Usleeps") \
258 DRI_CONF_ENUM(2,"Software Interrutps") \
259 DRI_CONF_DESC_END \
260 DRI_CONF_OPT_END
261
262 #define DRI_CONF_VBLANK_NEVER 0
263 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
264 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
265 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
266 #define DRI_CONF_VBLANK_MODE(def) \
267 DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
268 DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \
269 DRI_CONF_ENUM(0,"Never, FPS rulez!") \
270 DRI_CONF_ENUM(1,"Application preference, default interval 0") \
271 DRI_CONF_ENUM(2,"Application preference, default interval 1") \
272 DRI_CONF_ENUM(3,"Application preference, always synchronize with refresh") \
273 DRI_CONF_DESC_END \
274 DRI_CONF_DESC_BEGIN(de,"Synchronisation mit dem vertikalen Bildaufbau (swap intervals)") \
275 DRI_CONF_ENUM(0,"Niemals, immer die maximale Framerate") \
276 DRI_CONF_ENUM(1,"Anwendung entscheidet, Standardinterval 0") \
277 DRI_CONF_ENUM(2,"Anwendung entscheidet, Standardinterval 1") \
278 DRI_CONF_ENUM(3,"Anwendung entscheidet, immer mit Bildaufbau synchronisieren") \
279 DRI_CONF_DESC_END \
280 DRI_CONF_OPT_END
281
282 #define DRI_CONF_HYPERZ_DISABLED 0
283 #define DRI_CONF_HYPERZ_ENABLED 1
284 #define DRI_CONF_HYPERZ(def) \
285 DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
286 DRI_CONF_DESC(en,"Use hyperz") \
287 DRI_CONF_DESC(de,"Hyperz benutzen") \
288 DRI_CONF_OPT_END
289
290 #define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
291 DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
292 DRI_CONF_DESC(en,"Number of texture units") \
293 DRI_CONF_DESC(de,"Anzahl der Textureinheiten") \
294 DRI_CONF_OPT_END
295
296 #define DRI_CONF_TEXTURE_HEAPS_ALL 0
297 #define DRI_CONF_TEXTURE_HEAPS_CARD 1
298 #define DRI_CONF_TEXTURE_HEAPS_GART 2
299 #define DRI_CONF_TEXTURE_HEAPS(def) \
300 DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
301 DRI_CONF_DESC_BEGIN(en,"Used types of texture memory") \
302 DRI_CONF_ENUM(0,"All available") \
303 DRI_CONF_ENUM(1,"Only card memory (if available)") \
304 DRI_CONF_ENUM(2,"Only GART (AGP/PCIE) memory (if available)") \
305 DRI_CONF_DESC_END \
306 DRI_CONF_DESC_BEGIN(de,"Verwendete Texturspeicherarten") \
307 DRI_CONF_ENUM(0,"Alle verfügbaren") \
308 DRI_CONF_ENUM(1,"Nur Grafikspeicher (falls vorhanden)") \
309 DRI_CONF_ENUM(2,"Nur GART (AGP/PCIE) Speicher (falls vorhanden)") \
310 DRI_CONF_DESC_END \
311 DRI_CONF_OPT_END
312
313 /* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
314 On cards where there is no documentation (r200) or on rasterization-only hardware). */
315 #define DRI_CONF_SECTION_SOFTWARE \
316 DRI_CONF_SECTION_BEGIN \
317 DRI_CONF_DESC(de,"Funktionalität, die nicht durch die Hardware beschleunigt wird") \
318 DRI_CONF_DESC(en,"Features that are not hardware-accelerated")
319
320 #define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
321 DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
322 DRI_CONF_DESC(de,"GL_ARB_vertex_program aktivieren") \
323 DRI_CONF_DESC(en,"Enable GL_ARB_vertex_program") \
324 DRI_CONF_DESC(fr,"Activer GL_ARB_vertex_program") \
325 DRI_CONF_OPT_END
326
327 #define DRI_CONF_NV_VERTEX_PROGRAM(def) \
328 DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
329 DRI_CONF_DESC(de,"GL_NV_vertex_program aktivieren") \
330 DRI_CONF_DESC(en,"Enable GL_NV_vertex_program") \
331 DRI_CONF_DESC(fr,"Activer GL_NV_vertex_program") \
332 DRI_CONF_OPT_END
333
334 #endif