gallium: move driinfo XML to pipe_loader
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 29 Jun 2017 15:37:18 +0000 (17:37 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 2 Aug 2017 07:50:57 +0000 (09:50 +0200)
We will switch to the pipe_loader loading the configuration options,
so that they can be passed to the driver independently of the state
tracker.

Put the description into its own file so that it can be merged easily
with driver-specific options in future commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/pipe-loader/Makefile.am
src/gallium/auxiliary/pipe-loader/Makefile.sources
src/gallium/auxiliary/pipe-loader/driinfo_gallium.h [new file with mode: 0644]
src/gallium/auxiliary/pipe-loader/pipe_loader.c
src/gallium/auxiliary/pipe-loader/pipe_loader.h
src/gallium/state_trackers/dri/dri_screen.c

index 8039a957b1b134d1a22554c715974f850eee56b4..4ebfc97e6d9871291985ff95bf911b1bb5c6d650 100644 (file)
@@ -5,6 +5,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 AM_CFLAGS = \
        -I$(top_srcdir)/src/loader \
        -I$(top_srcdir)/src/gallium/winsys \
+       -I$(top_builddir)/src/util \
        $(GALLIUM_PIPE_LOADER_DEFINES) \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS)
index d6e3c2c060afa02a6528fe3f4dbad0f36b233bd9..66dd22ccc3c28ed7206fe4a25903f399435eebf7 100644 (file)
@@ -2,7 +2,8 @@ COMMON_SOURCES := \
        pipe_loader.c \
        pipe_loader.h \
        pipe_loader_priv.h \
-       pipe_loader_sw.c
+       pipe_loader_sw.c \
+       driinfo_gallium.h
 
 DRM_SOURCES := \
        pipe_loader_drm.c
diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
new file mode 100644 (file)
index 0000000..48a57c9
--- /dev/null
@@ -0,0 +1,35 @@
+// DriConf options supported by all Gallium DRI drivers.
+DRI_CONF_SECTION_PERFORMANCE
+   DRI_CONF_MESA_GLTHREAD("false")
+   DRI_CONF_MESA_NO_ERROR("false")
+   DRI_CONF_DISABLE_EXT_BUFFER_AGE("false")
+   DRI_CONF_DISABLE_OML_SYNC_CONTROL("false")
+DRI_CONF_SECTION_END
+
+DRI_CONF_SECTION_QUALITY
+   DRI_CONF_FORCE_S3TC_ENABLE("false")
+   DRI_CONF_PP_CELSHADE(0)
+   DRI_CONF_PP_NORED(0)
+   DRI_CONF_PP_NOGREEN(0)
+   DRI_CONF_PP_NOBLUE(0)
+   DRI_CONF_PP_JIMENEZMLAA(0, 0, 32)
+   DRI_CONF_PP_JIMENEZMLAA_COLOR(0, 0, 32)
+DRI_CONF_SECTION_END
+
+DRI_CONF_SECTION_DEBUG
+   DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
+   DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
+   DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
+   DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
+   DRI_CONF_FORCE_GLSL_VERSION(0)
+   DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
+   DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
+   DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
+   DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
+   DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false")
+DRI_CONF_SECTION_END
+
+DRI_CONF_SECTION_MISCELLANEOUS
+   DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false")
+   DRI_CONF_GLSL_ZERO_INIT("false")
+DRI_CONF_SECTION_END
index cd93648fdc39020283975b5c4af107b219ad375e..bb65be15289176d325bf1b85e40447df4cfc5cb0 100644 (file)
@@ -31,6 +31,7 @@
 #include "util/u_memory.h"
 #include "util/u_string.h"
 #include "util/u_dl.h"
+#include "util/xmlpool.h"
 
 #ifdef _MSC_VER
 #include <stdlib.h>
@@ -46,6 +47,10 @@ static int (*backends[])(struct pipe_loader_device **, int) = {
    &pipe_loader_sw_probe
 };
 
+const char gallium_driinfo_xml[] =
+#include "driinfo_gallium.h"
+;
+
 int
 pipe_loader_probe(struct pipe_loader_device **devs, int ndev)
 {
index 969feace7f19516c78625bb44074f0841822a50c..d24480dfd91e450c1dcff3595b561eb5b2509c06 100644 (file)
@@ -183,6 +183,8 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev);
 bool
 pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd);
 
+extern const char gallium_driinfo_xml[];
+
 #ifdef __cplusplus
 }
 #endif
index 43e67b6555f58db866f4c757a3748193fc1b48b4..79d7282b5115bcd67b4c58e2a6b3ff5650dc8d8e 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 #include "utils.h"
-#include "util/xmlpool.h"
 
 #include "dri_screen.h"
 #include "dri_context.h"
 
 const __DRIconfigOptionsExtension gallium_config_options = {
    .base = { __DRI_CONFIG_OPTIONS, 1 },
-   .xml =
-
-   DRI_CONF_BEGIN
-      DRI_CONF_SECTION_PERFORMANCE
-         DRI_CONF_MESA_GLTHREAD("false")
-         DRI_CONF_MESA_NO_ERROR("false")
-         DRI_CONF_DISABLE_EXT_BUFFER_AGE("false")
-         DRI_CONF_DISABLE_OML_SYNC_CONTROL("false")
-      DRI_CONF_SECTION_END
-
-      DRI_CONF_SECTION_QUALITY
-         DRI_CONF_FORCE_S3TC_ENABLE("false")
-         DRI_CONF_PP_CELSHADE(0)
-         DRI_CONF_PP_NORED(0)
-         DRI_CONF_PP_NOGREEN(0)
-         DRI_CONF_PP_NOBLUE(0)
-         DRI_CONF_PP_JIMENEZMLAA(0, 0, 32)
-         DRI_CONF_PP_JIMENEZMLAA_COLOR(0, 0, 32)
-      DRI_CONF_SECTION_END
-
-      DRI_CONF_SECTION_DEBUG
-         DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
-         DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
-         DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
-         DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
-         DRI_CONF_FORCE_GLSL_VERSION(0)
-         DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
-         DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
-         DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
-         DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
-         DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false")
-      DRI_CONF_SECTION_END
-
-      DRI_CONF_SECTION_MISCELLANEOUS
-         DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false")
-         DRI_CONF_GLSL_ZERO_INIT("false")
-      DRI_CONF_SECTION_END
-   DRI_CONF_END
+   .xml = gallium_driinfo_xml
 };
 
 #define false 0