(Stephane Marchesin, me) add hyperz support to radeon and r200 drivers. Only fast...
[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 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 /** \brief Performance-related options */
214 #define DRI_CONF_SECTION_PERFORMANCE \
215 DRI_CONF_SECTION_BEGIN \
216         DRI_CONF_DESC(en,"Performance") \
217         DRI_CONF_DESC(de,"Leistung")
218
219 #define DRI_CONF_TCL_SW 0
220 #define DRI_CONF_TCL_PIPELINED 1
221 #define DRI_CONF_TCL_VTXFMT 2
222 #define DRI_CONF_TCL_CODEGEN 3
223 #define DRI_CONF_TCL_MODE(def) \
224 DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
225         DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \
226                 DRI_CONF_ENUM(0,"Software") \
227                 DRI_CONF_ENUM(1,"TCL stage in MESA pipeline") \
228                 DRI_CONF_ENUM(2,"Bypass MESA's pipeline") \
229                 DRI_CONF_ENUM(3,"Bypass MESA's pipeline with state-based code generation") \
230         DRI_CONF_DESC_END \
231         DRI_CONF_DESC_BEGIN(de,"TCL Modus (Transformation, Clipping, Licht)") \
232                 DRI_CONF_ENUM(0,"Software") \
233                 DRI_CONF_ENUM(1,"TCL Stufe in MESA Pipeline") \
234                 DRI_CONF_ENUM(2,"Umgehe MESAs Pipeline") \
235                 DRI_CONF_ENUM(3,"Umgehe MESAs Pipeline mit zustandsbasierter Codegenerierung") \
236         DRI_CONF_DESC_END \
237 DRI_CONF_OPT_END
238
239 #define DRI_CONF_FTHROTTLE_BUSY 0
240 #define DRI_CONF_FTHROTTLE_USLEEPS 1
241 #define DRI_CONF_FTHROTTLE_IRQS 2
242 #define DRI_CONF_FTHROTTLE_MODE(def) \
243 DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
244         DRI_CONF_DESC_BEGIN(en,"Frame throttling") \
245                 DRI_CONF_ENUM(0,"Busy waiting") \
246                 DRI_CONF_ENUM(1,"Usleeps") \
247                 DRI_CONF_ENUM(2,"Software interrupts") \
248         DRI_CONF_DESC_END \
249         DRI_CONF_DESC_BEGIN(de,"Framethrottling") \
250                 DRI_CONF_ENUM(0,"Aktives Warten") \
251                 DRI_CONF_ENUM(1,"Usleeps") \
252                 DRI_CONF_ENUM(2,"Software Interrutps") \
253         DRI_CONF_DESC_END \
254 DRI_CONF_OPT_END
255
256 #define DRI_CONF_VBLANK_NEVER 0
257 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
258 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
259 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
260 #define DRI_CONF_VBLANK_MODE(def) \
261 DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
262         DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \
263                 DRI_CONF_ENUM(0,"Never, FPS rulez!") \
264                 DRI_CONF_ENUM(1,"Application preference, default interval 0") \
265                 DRI_CONF_ENUM(2,"Application preference, default interval 1") \
266                 DRI_CONF_ENUM(3,"Application preference, always synchronize with refresh") \
267         DRI_CONF_DESC_END \
268         DRI_CONF_DESC_BEGIN(de,"Synchronisation mit dem vertikalen Bildaufbau (swap intervals)") \
269                 DRI_CONF_ENUM(0,"Niemals, immer die maximale Framerate") \
270                 DRI_CONF_ENUM(1,"Anwendung entscheidet, Standardinterval 0") \
271                 DRI_CONF_ENUM(2,"Anwendung entscheidet, Standardinterval 1") \
272                 DRI_CONF_ENUM(3,"Anwendung entscheidet, immer mit Bildaufbau synchronisieren") \
273         DRI_CONF_DESC_END \
274 DRI_CONF_OPT_END
275
276 #define DRI_CONF_HYPERZ_DISABLED 0
277 #define DRI_CONF_HYPERZ_ENABLED 1
278 #define DRI_CONF_HYPERZ(def) \
279 DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
280         DRI_CONF_DESC(en,"Use hyperz") \
281         DRI_CONF_DESC(de,"Hyperz benutzen") \
282 DRI_CONF_OPT_END
283
284 #define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
285 DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
286         DRI_CONF_DESC(en,"Number of texture units") \
287         DRI_CONF_DESC(de,"Anzahl der Textureinheiten") \
288 DRI_CONF_OPT_END
289
290 /* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
291    On cards where there is no documentation (r200) or on rasterization-only hardware). */
292 #define DRI_CONF_SECTION_SOFTWARE \
293 DRI_CONF_SECTION_BEGIN \
294         DRI_CONF_DESC(de,"Funktionalität, die nicht durch die Hardware beschleunigt wird") \
295         DRI_CONF_DESC(en,"Features that are not hardware-accelerated")
296
297 #define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
298 DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
299         DRI_CONF_DESC(de,"GL_ARB_vertex_program aktivieren") \
300         DRI_CONF_DESC(en,"Enable GL_ARB_vertex_program") \
301         DRI_CONF_DESC(fr,"Activer GL_ARB_vertex_program") \
302 DRI_CONF_OPT_END
303
304 #define DRI_CONF_NV_VERTEX_PROGRAM(def) \
305 DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
306         DRI_CONF_DESC(de,"GL_NV_vertex_program aktivieren") \
307         DRI_CONF_DESC(en,"Enable GL_NV_vertex_program") \
308         DRI_CONF_DESC(fr,"Activer GL_NV_vertex_program") \
309 DRI_CONF_OPT_END
310
311 #endif