[Mesa-dev] [PATCH 06/10] dri/common: Add option to disable exposure of 10 bpc color configs.

Mario Kleiner mario.kleiner.de at gmail.com
Tue Sep 5 05:01:10 UTC 2017


A few clients don't like RGB10X2 and RGB10A2 fbconfigs and
visuals. Add a new driconf option 'expose_rgb10_configs' to
allow per application enable/disable.

The option defaults to enabled.

Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
---
 src/mesa/drivers/dri/common/dri_util.c | 11 +++++++----
 src/util/xmlpool/t_options.h           |  5 +++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 31a3040..972a1a4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -55,6 +55,10 @@ const char __dri2ConfigOptions[] =
       DRI_CONF_SECTION_PERFORMANCE
          DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1)
       DRI_CONF_SECTION_END
+
+      DRI_CONF_SECTION_MISCELLANEOUS
+         DRI_CONF_EXPOSE_RGB10_CONFIGS("true")
+      DRI_CONF_SECTION_END
    DRI_CONF_END;
 
 /*****************************************************************/
@@ -144,6 +148,9 @@ driCreateNewScreen2(int scrn, int fd,
     psp->fd = fd;
     psp->myNum = scrn;
 
+    driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions);
+    driParseConfigFiles(&psp->optionCache, &psp->optionInfo, psp->myNum, "dri2");
+
     *driver_configs = psp->driver->InitScreen(psp);
     if (*driver_configs == NULL) {
 	free(psp);
@@ -179,10 +186,6 @@ driCreateNewScreen2(int scrn, int fd,
     if (psp->max_gl_es2_version >= 30)
        psp->api_mask |= (1 << __DRI_API_GLES3);
 
-    driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions);
-    driParseConfigFiles(&psp->optionCache, &psp->optionInfo, psp->myNum, "dri2");
-
-
     return psp;
 }
 
diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h
index d3f31fc..08f92c6 100644
--- a/src/util/xmlpool/t_options.h
+++ b/src/util/xmlpool/t_options.h
@@ -380,6 +380,11 @@ DRI_CONF_OPT_BEGIN_B(glsl_zero_init, def) \
         DRI_CONF_DESC(en,gettext("Force uninitialized variables to default to zero")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_EXPOSE_RGB10_CONFIGS(def) \
+DRI_CONF_OPT_BEGIN_B(expose_rgb10_configs, def) \
+DRI_CONF_DESC(en,gettext("Expose visuals and fbconfigs with rgb10a2 formats")) \
+DRI_CONF_OPT_END
+
 /**
  * \brief Initialization configuration options
  */
-- 
2.7.4



More information about the mesa-dev mailing list