Module: Mesa
Branch: master
Commit: 7eedc79658d47bf336a0efa1074634d9e5f4fb2f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7eedc79658d47bf336a0efa1074634d9e5f4fb2f

Author: Martin Peres <[email protected]>
Date:   Thu Oct 15 18:29:45 2020 +0300

driconf: add a way to override GLX extensions

Support for DRI1 is not implemented, but who still uses that?

v2:
 - Add the option to the list of new features
 - Drop overriding the Xorg-exposed extensions

Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Signed-off-by: Martin Peres <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

---

 docs/relnotes/new_features.txt                      | 1 +
 src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 +
 src/glx/dri2_glx.c                                  | 5 +++++
 src/glx/dri3_glx.c                                  | 5 +++++
 src/mesa/drivers/dri/common/dri_util.c              | 4 ++++
 src/util/driconf.h                                  | 6 ++++++
 6 files changed, 22 insertions(+)

diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index 0e2d6f67d24..f4e80ebde5e 100644
--- a/docs/relnotes/new_features.txt
+++ b/docs/relnotes/new_features.txt
@@ -11,3 +11,4 @@ VK_KHR_copy_commands2 on RADV
 VK_KHR_shader_terminate_invocation on RADV
 NGG GS support in ACO
 VK_KHR_shader_terminate_invocation on ANV
+driconf: add glx_extension_override
diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h 
b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
index 7147bd49fbe..6691b2f7fba 100644
--- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
+++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
@@ -37,6 +37,7 @@ DRI_CONF_SECTION_DEBUG
    DRI_CONF_FORCE_GL_NAMES_REUSE(false)
    DRI_CONF_FORCE_GL_VENDOR()
    DRI_CONF_OVERRIDE_VRAM_SIZE()
+   DRI_CONF_GLX_EXTENSION_OVERRIDE()
 DRI_CONF_SECTION_END
 
 DRI_CONF_SECTION_MISCELLANEOUS
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 6c2e8d2bb6c..e449f34a04e 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -1362,6 +1362,11 @@ dri2CreateScreen(int screen, struct glx_display * priv)
                                  &disable) || !disable)
       __glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
 
+   if (psc->config->base.version > 1 &&
+          psc->config->configQuerys(psc->driScreen, "glx_extension_override",
+                                    &tmp) == 0)
+      __glXParseExtensionOverride(&psc->base, tmp);
+
    /* DRI2 supports SubBuffer through DRI2CopyRegion, so it's always
     * available.*/
    psp->copySubBuffer = dri2CopySubBuffer;
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index 32d4fb38e39..97933874537 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -998,6 +998,11 @@ dri3_create_screen(int screen, struct glx_display * priv)
                                  &disable) || !disable)
       __glXEnableDirectExtension(&psc->base, "GLX_EXT_buffer_age");
 
+   if (psc->config->base.version > 1 &&
+          psc->config->configQuerys(psc->driScreen, "glx_extension_override",
+                                    &tmp) == 0)
+      __glXParseExtensionOverride(&psc->base, tmp);
+
    free(driverName);
 
    tmp = getenv("LIBGL_SHOW_FPS");
diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index 430a585f99d..1bea3d13326 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -52,6 +52,10 @@
 #include "main/macros.h"
 
 driOptionDescription __dri2ConfigOptions[] = {
+      DRI_CONF_SECTION_DEBUG
+         DRI_CONF_GLX_EXTENSION_OVERRIDE()
+      DRI_CONF_SECTION_END
+
       DRI_CONF_SECTION_PERFORMANCE
          DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1)
       DRI_CONF_SECTION_END
diff --git a/src/util/driconf.h b/src/util/driconf.h
index e2a58215836..326d58ca8b7 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -217,6 +217,12 @@
 #define DRI_CONF_FORCE_GL_NAMES_REUSE(def) \
    DRI_CONF_OPT_B(force_gl_names_reuse, def, "Force GL names reuse")
 
+#define DRI_CONF_GLX_EXTENSION_OVERRIDE(def) \
+   DRI_CONF_OPT_S(glx_extension_override, def, \
+                  "Allow enabling/disabling a list of GLX extensions")
+
+
+
 /**
  * \brief Image quality-related options
  */

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to