Update DRI drivers to current DRI CVS and make them work.
[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_PREFERRED_BPT(def,valid) \
131 DRI_CONF_OPT_BEGIN_V(preferred_bpt,enum,def,valid) \
132         DRI_CONF_DESC_BEGIN(en,"Preferred texture color depth") \
133                 DRI_CONF_ENUM(0,"Same as frame buffer") \
134         DRI_CONF_DESC_END \
135         DRI_CONF_DESC_BEGIN(de,"Bevorzugte Textur Farbtiefe") \
136                 DRI_CONF_ENUM(0,"So wie der Framebuffer") \
137         DRI_CONF_DESC_END \
138 DRI_CONF_OPT_END
139
140 /** \brief Performance-related options */
141 #define DRI_CONF_SECTION_PERFORMANCE \
142 DRI_CONF_SECTION_BEGIN \
143         DRI_CONF_DESC(en,"Performance") \
144         DRI_CONF_DESC(de,"Leistung")
145
146 #define DRI_CONF_TCL_SW 0
147 #define DRI_CONF_TCL_PIPELINED 1
148 #define DRI_CONF_TCL_VTXFMT 2
149 #define DRI_CONF_TCL_CODEGEN 3
150 #define DRI_CONF_TCL_MODE(def) \
151 DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
152         DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \
153                 DRI_CONF_ENUM(0,"Software") \
154                 DRI_CONF_ENUM(1,"TCL stage in MESA pipeline") \
155                 DRI_CONF_ENUM(2,"Bypass MESA's pipeline") \
156                 DRI_CONF_ENUM(3,"Bypass MESA's pipeline with state-based code generation") \
157         DRI_CONF_DESC_END \
158         DRI_CONF_DESC_BEGIN(de,"TCL Modus (Transformation, Clipping, Licht)") \
159                 DRI_CONF_ENUM(0,"Software") \
160                 DRI_CONF_ENUM(1,"TCL Stufe in MESA Pipeline") \
161                 DRI_CONF_ENUM(2,"Umgehe MESA's Pipeline") \
162                 DRI_CONF_ENUM(3,"Umgehe MESA's Pipeline mit zustandsbasierter Codegenerierung") \
163         DRI_CONF_DESC_END \
164 DRI_CONF_OPT_END
165
166 #define DRI_CONF_FTHROTTLE_BUSY 0
167 #define DRI_CONF_FTHROTTLE_USLEEPS 1
168 #define DRI_CONF_FTHROTTLE_IRQS 2
169 #define DRI_CONF_FTHROTTLE_MODE(def) \
170 DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
171         DRI_CONF_DESC_BEGIN(en,"Frame throttling") \
172                 DRI_CONF_ENUM(0,"Busy waiting") \
173                 DRI_CONF_ENUM(1,"Usleeps") \
174                 DRI_CONF_ENUM(2,"Software interrupts") \
175         DRI_CONF_DESC_END \
176         DRI_CONF_DESC_BEGIN(de,"Framethrottling") \
177                 DRI_CONF_ENUM(0,"Aktives Warten") \
178                 DRI_CONF_ENUM(1,"Usleeps") \
179                 DRI_CONF_ENUM(2,"Sortware Interrutps") \
180         DRI_CONF_DESC_END \
181 DRI_CONF_OPT_END
182
183 #define DRI_CONF_VBLANK_NEVER 0
184 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
185 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
186 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
187 #define DRI_CONF_VBLANK_MODE(def) \
188 DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
189         DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \
190                 DRI_CONF_ENUM(0,"Never, FPS rulez!") \
191                 DRI_CONF_ENUM(1,"Application preference, default interval 0") \
192                 DRI_CONF_ENUM(2,"Application preference, default interval 1") \
193                 DRI_CONF_ENUM(3,"Application preference, always synchronize with refresh") \
194         DRI_CONF_DESC_END \
195         DRI_CONF_DESC_BEGIN(de,"Synchronisation mit dem vertikalen Bildaufbau (swap intervals)") \
196                 DRI_CONF_ENUM(0,"Niemals, immer die maximale Framerate") \
197                 DRI_CONF_ENUM(1,"Anwendung entscheidet, Standardinterval 0") \
198                 DRI_CONF_ENUM(2,"Anwendung entscheidet, Standardinterval 1") \
199                 DRI_CONF_ENUM(3,"Anwendung entscheidet, immer mit Bildaufbau synchronisieren") \
200         DRI_CONF_DESC_END \
201 DRI_CONF_OPT_END
202
203 #endif