diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 02:30:08 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 02:30:08 +0000 |
commit | 1d35364040c0ffa99133522fa5ab3bd6131d8bf7 (patch) | |
tree | 0ea3d9ca4ad10692c6477168b67e98cb50ea6bd3 /lib/mesa/src/util/xmlconfig.c | |
parent | b24b5b9049e889ee4eb39b565bcc8d48bd45ab48 (diff) |
Merge Mesa 21.3.7
Diffstat (limited to 'lib/mesa/src/util/xmlconfig.c')
-rw-r--r-- | lib/mesa/src/util/xmlconfig.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/mesa/src/util/xmlconfig.c b/lib/mesa/src/util/xmlconfig.c index 62b5e0d92..dde6e5fa0 100644 --- a/lib/mesa/src/util/xmlconfig.c +++ b/lib/mesa/src/util/xmlconfig.c @@ -48,9 +48,9 @@ typedef int regex_t; #define REG_EXTENDED 0 #define REG_NOSUB 0 #define REG_NOMATCH 1 -inline int regcomp(regex_t *r, const char *s, int f) { return 0; } -inline int regexec(regex_t *r, const char *s, int n, void *p, int f) { return REG_NOMATCH; } -inline void regfree(regex_t* r) {} +static inline int regcomp(regex_t *r, const char *s, int f) { return 0; } +static inline int regexec(regex_t *r, const char *s, int n, void *p, int f) { return REG_NOMATCH; } +static inline void regfree(regex_t* r) {} #else #include <regex.h> #endif @@ -595,6 +595,7 @@ struct OptConfData { int screenNum; const char *driverName, *execName; const char *kernelDriverName; + const char *deviceName; const char *engineName; const char *applicationName; uint32_t engineVersion; @@ -648,11 +649,12 @@ static void parseDeviceAttr(struct OptConfData *data, const char **attr) { uint32_t i; - const char *driver = NULL, *screen = NULL, *kernel = NULL; + const char *driver = NULL, *screen = NULL, *kernel = NULL, *device = NULL; for (i = 0; attr[i]; i += 2) { if (!strcmp(attr[i], "driver")) driver = attr[i+1]; else if (!strcmp(attr[i], "screen")) screen = attr[i+1]; else if (!strcmp(attr[i], "kernel_driver")) kernel = attr[i+1]; + else if (!strcmp(attr[i], "device")) device = attr[i+1]; else XML_WARNING("unknown device attribute: %s.", attr[i]); } if (driver && strcmp(driver, data->driverName)) @@ -660,6 +662,9 @@ parseDeviceAttr(struct OptConfData *data, const char **attr) else if (kernel && (!data->kernelDriverName || strcmp(kernel, data->kernelDriverName))) data->ignoringDevice = data->inDevice; + else if (device && (!data->deviceName || + strcmp(device, data->deviceName))) + data->ignoringDevice = data->inDevice; else if (screen) { driOptionValue screenNum; if (!parseValue(&screenNum, DRI_INT, screen)) @@ -1059,6 +1064,7 @@ parseStaticConfig(struct OptConfData *data) const struct driconf_device *d = driconf[i]; const char *devattr[] = { "driver", d->driver, + "device", d->device, NULL }; @@ -1087,6 +1093,8 @@ parseStaticConfig(struct OptConfData *data) const char *appattr[] = { "name", a->name, "executable", a->executable, + "executable_regexp", a->executable_regexp, + "sha1", a->sha1, "application_name_match", a->application_name_match, "application_versions", a->application_versions, NULL @@ -1149,6 +1157,7 @@ void driParseConfigFiles(driOptionCache *cache, const driOptionCache *info, int screenNum, const char *driverName, const char *kernelDriverName, + const char *deviceName, const char *applicationName, uint32_t applicationVersion, const char *engineName, uint32_t engineVersion) { @@ -1159,6 +1168,7 @@ driParseConfigFiles(driOptionCache *cache, const driOptionCache *info, userData.screenNum = screenNum; userData.driverName = driverName; userData.kernelDriverName = kernelDriverName; + userData.deviceName = deviceName; userData.applicationName = applicationName ? applicationName : ""; userData.applicationVersion = applicationVersion; userData.engineName = engineName ? engineName : ""; |