i965: Don't flag gather quirks for Gen8+
[mesa.git] / src / mesa / drivers / dri / common / xmlconfig.h
1 /*
2 * XML DRI client-side driver configuration
3 * Copyright (C) 2003 Felix Kuehling
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
21 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 *
23 */
24 /**
25 * \file xmlconfig.h
26 * \brief Driver-independent client-side part of the XML configuration
27 * \author Felix Kuehling
28 */
29
30 #ifndef __XMLCONFIG_H
31 #define __XMLCONFIG_H
32
33 /** \brief Option data types */
34 typedef enum driOptionType {
35 DRI_BOOL, DRI_ENUM, DRI_INT, DRI_FLOAT
36 } driOptionType;
37
38 /** \brief Option value */
39 typedef union driOptionValue {
40 GLboolean _bool; /**< \brief Boolean */
41 GLint _int; /**< \brief Integer or Enum */
42 GLfloat _float; /**< \brief Floating-point */
43 } driOptionValue;
44
45 /** \brief Single range of valid values
46 *
47 * For empty ranges (a single value) start == end */
48 typedef struct driOptionRange {
49 driOptionValue start; /**< \brief Start */
50 driOptionValue end; /**< \brief End */
51 } driOptionRange;
52
53 /** \brief Information about an option */
54 typedef struct driOptionInfo {
55 char *name; /**< \brief Name */
56 driOptionType type; /**< \brief Type */
57 driOptionRange *ranges; /**< \brief Array of ranges */
58 GLuint nRanges; /**< \brief Number of ranges */
59 } driOptionInfo;
60
61 /** \brief Option cache
62 *
63 * \li One in <driver>Screen caching option info and the default values
64 * \li One in each <driver>Context with the actual values for that context */
65 typedef struct driOptionCache {
66 driOptionInfo *info;
67 /**< \brief Array of option infos
68 *
69 * Points to the same array in the screen and all contexts */
70 driOptionValue *values;
71 /**< \brief Array of option values
72 *
73 * \li Default values in screen
74 * \li Actual values in contexts
75 */
76 GLuint tableSize;
77 /**< \brief Size of the arrays
78 *
79 * In the current implementation it's not actually a size but log2(size).
80 * The value is the same in the screen and all contexts. */
81 } driOptionCache;
82
83 /** \brief Parse XML option info from configOptions
84 *
85 * To be called in <driver>CreateScreen
86 *
87 * \param info pointer to a driOptionCache that will store the option info
88 * \param configOptions XML document describing available configuration opts
89 *
90 * For the option information to be available to external configuration tools
91 * it must be a public symbol __driConfigOptions. It is also passed as a
92 * parameter to driParseOptionInfo in order to avoid driver-independent code
93 * depending on symbols in driver-specific code. */
94 void driParseOptionInfo (driOptionCache *info,
95 const char *configOptions);
96 /** \brief Initialize option cache from info and parse configuration files
97 *
98 * To be called in <driver>CreateContext. screenNum and driverName select
99 * device sections. */
100 void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
101 GLint screenNum, const char *driverName);
102 /** \brief Destroy option info
103 *
104 * To be called in <driver>DestroyScreen */
105 void driDestroyOptionInfo (driOptionCache *info);
106 /** \brief Destroy option cache
107 *
108 * To be called in <driver>DestroyContext */
109 void driDestroyOptionCache (driOptionCache *cache);
110
111 /** \brief Check if there exists a certain option */
112 GLboolean driCheckOption (const driOptionCache *cache, const char *name,
113 driOptionType type);
114
115 /** \brief Query a boolean option value */
116 GLboolean driQueryOptionb (const driOptionCache *cache, const char *name);
117 /** \brief Query an integer option value */
118 GLint driQueryOptioni (const driOptionCache *cache, const char *name);
119 /** \brief Query a floating-point option value */
120 GLfloat driQueryOptionf (const driOptionCache *cache, const char *name);
121
122 #endif