[5/5] gallium: replace drm_driver_descriptor::configuration with driconf_xml

Submitted by Marek Olšák on April 23, 2019, 1:23 a.m.

Details

Message ID 20190423012348.30019-5-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák April 23, 2019, 1:23 a.m.
From: Marek Olšák <marek.olsak@amd.com>

The configuration callback duplicated the PIPE_CAP system.
---
 .../auxiliary/pipe-loader/pipe_loader.c       | 16 +----
 .../auxiliary/pipe-loader/pipe_loader.h       | 10 ----
 .../auxiliary/pipe-loader/pipe_loader_drm.c   | 40 +++----------
 .../auxiliary/pipe-loader/pipe_loader_priv.h  |  3 +-
 .../auxiliary/pipe-loader/pipe_loader_sw.c    |  7 +--
 .../auxiliary/target-helpers/drm_helper.h     | 58 +++----------------
 .../target-helpers/drm_helper_public.h        | 13 +----
 .../include/state_tracker/drm_driver.h        | 45 +++-----------
 src/gallium/targets/pipe-loader/pipe_i915.c   |  7 +--
 src/gallium/targets/pipe-loader/pipe_msm.c    |  7 +--
 .../targets/pipe-loader/pipe_nouveau.c        |  7 +--
 src/gallium/targets/pipe-loader/pipe_r300.c   |  7 +--
 src/gallium/targets/pipe-loader/pipe_r600.c   |  7 +--
 .../targets/pipe-loader/pipe_radeonsi.c       | 21 ++-----
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c |  7 +--
 15 files changed, 45 insertions(+), 210 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index fc8ee8e8dcd..29718a2aa20 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -80,39 +80,29 @@  pipe_loader_release(struct pipe_loader_device **devs, int ndev)
 void
 pipe_loader_base_release(struct pipe_loader_device **dev)
 {
    driDestroyOptionCache(&(*dev)->option_cache);
    driDestroyOptionInfo(&(*dev)->option_info);
 
    FREE(*dev);
    *dev = NULL;
 }
 
-const struct drm_conf_ret *
-pipe_loader_configuration(struct pipe_loader_device *dev,
-                          enum drm_conf conf)
-{
-   return dev->ops->configuration(dev, conf);
-}
-
 void
 pipe_loader_load_options(struct pipe_loader_device *dev)
 {
    if (dev->option_info.info)
       return;
 
-   const char *xml_options = gallium_driinfo_xml;
-   const struct drm_conf_ret *xml_options_conf =
-      pipe_loader_configuration(dev, DRM_CONF_XML_OPTIONS);
-
-   if (xml_options_conf)
-      xml_options = xml_options_conf->val.val_pointer;
+   const char *xml_options = dev->ops->get_driconf_xml(dev);
+   if (!xml_options)
+      xml_options = gallium_driinfo_xml;
 
    driParseOptionInfo(&dev->option_info, xml_options);
    driParseConfigFiles(&dev->option_cache, &dev->option_info, 0,
                        dev->driver_name, NULL);
 }
 
 char *
 pipe_loader_get_driinfo_xml(const char *driver_name)
 {
 #ifdef HAVE_LIBDRM
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 9b264145347..a0d9c8a7dec 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -83,30 +83,20 @@  int
 pipe_loader_probe(struct pipe_loader_device **devs, int ndev);
 
 /**
  * Create a pipe_screen for the specified device.
  *
  * \param dev Device the screen will be created for.
  */
 struct pipe_screen *
 pipe_loader_create_screen(struct pipe_loader_device *dev);
 
-/**
- * Query the configuration parameters for the specified device.
- *
- * \param dev Device that will be queried.
- * \param conf The drm_conf id of the option to be queried.
- */
-const struct drm_conf_ret *
-pipe_loader_configuration(struct pipe_loader_device *dev,
-                          enum drm_conf conf);
-
 /**
  * Ensure that dev->option_cache is initialized appropriately for the driver.
  *
  * This function can be called multiple times.
  *
  * \param dev Device for which options should be loaded.
  */
 void
 pipe_loader_load_options(struct pipe_loader_device *dev);
 
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 7aa733d5f59..3006f78311a 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -62,103 +62,88 @@  struct pipe_loader_drm_device {
 
 #define pipe_loader_drm_device(dev) ((struct pipe_loader_drm_device *)dev)
 
 static const struct pipe_loader_ops pipe_loader_drm_ops;
 
 #ifdef GALLIUM_STATIC_TARGETS
 static const struct drm_driver_descriptor driver_descriptors[] = {
     {
         .driver_name = "i915",
         .create_screen = pipe_i915_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "iris",
         .create_screen = pipe_iris_create_screen,
-        .configuration = pipe_iris_configuration_query,
+        .driconf_xml = &iris_driconf_xml,
     },
     {
         .driver_name = "nouveau",
         .create_screen = pipe_nouveau_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "r300",
         .create_screen = pipe_r300_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "r600",
         .create_screen = pipe_r600_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "radeonsi",
         .create_screen = pipe_radeonsi_create_screen,
-        .configuration = pipe_radeonsi_configuration_query,
+        .driconf_xml = &radeonsi_driconf_xml,
     },
     {
         .driver_name = "vmwgfx",
         .create_screen = pipe_vmwgfx_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "kgsl",
         .create_screen = pipe_freedreno_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "msm",
         .create_screen = pipe_freedreno_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "virtio_gpu",
         .create_screen = pipe_virgl_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "v3d",
         .create_screen = pipe_v3d_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "vc4",
         .create_screen = pipe_vc4_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "panfrost",
         .create_screen = pipe_panfrost_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "etnaviv",
         .create_screen = pipe_etna_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "tegra",
         .create_screen = pipe_tegra_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
     {
         .driver_name = "lima",
         .create_screen = pipe_lima_create_screen,
-        .configuration = pipe_default_configuration_query,
     },
 };
 
 static const struct drm_driver_descriptor default_driver_descriptor = {
         .driver_name = "kmsro",
         .create_screen = pipe_kmsro_create_screen,
-        .configuration = pipe_default_configuration_query,
 };
 
 #endif
 
 static const struct drm_driver_descriptor *
 get_driver_descriptor(const char *driver_name, struct util_dl_library **plib)
 {
 #ifdef GALLIUM_STATIC_TARGETS
    for (int i = 0; i < ARRAY_SIZE(driver_descriptors); i++) {
       if (strcmp(driver_descriptors[i].driver_name, driver_name) == 0)
@@ -289,58 +274,51 @@  pipe_loader_drm_release(struct pipe_loader_device **dev)
 #ifndef GALLIUM_STATIC_TARGETS
    if (ddev->lib)
       util_dl_close(ddev->lib);
 #endif
 
    close(ddev->fd);
    FREE(ddev->base.driver_name);
    pipe_loader_base_release(dev);
 }
 
-static const struct drm_conf_ret *
-pipe_loader_drm_configuration(struct pipe_loader_device *dev,
-                              enum drm_conf conf)
+static const char *
+pipe_loader_drm_get_driconf_xml(struct pipe_loader_device *dev)
 {
    struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
 
-   if (!ddev->dd->configuration)
+   if (!ddev->dd->driconf_xml)
       return NULL;
 
-   return ddev->dd->configuration(conf);
+   return *ddev->dd->driconf_xml;
 }
 
 static struct pipe_screen *
 pipe_loader_drm_create_screen(struct pipe_loader_device *dev,
                               const struct pipe_screen_config *config)
 {
    struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
 
    return ddev->dd->create_screen(ddev->fd, config);
 }
 
 char *
 pipe_loader_drm_get_driinfo_xml(const char *driver_name)
 {
    char *xml = NULL;
    struct util_dl_library *lib = NULL;
    const struct drm_driver_descriptor *dd =
       get_driver_descriptor(driver_name, &lib);
-   if (!dd)
-      goto out;
 
-   const struct drm_conf_ret *conf = dd->configuration(DRM_CONF_XML_OPTIONS);
-   if (!conf)
-      goto out;
+   if (dd && dd->driconf_xml)
+      xml = strdup(*dd->driconf_xml);
 
-   xml = strdup((const char *)conf->val.val_pointer);
-
-out:
    if (lib)
       util_dl_close(lib);
    return xml;
 }
 
 static const struct pipe_loader_ops pipe_loader_drm_ops = {
    .create_screen = pipe_loader_drm_create_screen,
-   .configuration = pipe_loader_drm_configuration,
+   .get_driconf_xml = pipe_loader_drm_get_driconf_xml,
    .release = pipe_loader_drm_release
 };
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
index 699040d7162..01b7c54425f 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
@@ -27,22 +27,21 @@ 
 
 #ifndef PIPE_LOADER_PRIV_H
 #define PIPE_LOADER_PRIV_H
 
 #include "pipe_loader.h"
 
 struct pipe_loader_ops {
    struct pipe_screen *(*create_screen)(struct pipe_loader_device *dev,
                                         const struct pipe_screen_config *config);
 
-   const struct drm_conf_ret *(*configuration)(struct pipe_loader_device *dev,
-                                               enum drm_conf conf);
+   const char *(*get_driconf_xml)(struct pipe_loader_device *dev);
 
    void (*release)(struct pipe_loader_device **dev);
 };
 
 /**
  * Open the pipe driver module that contains the specified driver.
  */
 struct util_dl_library *
 pipe_loader_find_module(const char *driver_name,
                         const char *library_paths);
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 587b6f8567b..f2541e8691d 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -286,36 +286,35 @@  pipe_loader_sw_release(struct pipe_loader_device **dev)
 #endif
 
 #ifdef HAVE_PIPE_LOADER_KMS
    if (sdev->fd != -1)
       close(sdev->fd);
 #endif
 
    pipe_loader_base_release(dev);
 }
 
-static const struct drm_conf_ret *
-pipe_loader_sw_configuration(struct pipe_loader_device *dev,
-                             enum drm_conf conf)
+static const char *
+pipe_loader_sw_get_driconf_xml(struct pipe_loader_device *dev)
 {
    return NULL;
 }
 
 static struct pipe_screen *
 pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
                              const struct pipe_screen_config *config)
 {
    struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(dev);
    struct pipe_screen *screen;
 
    screen = sdev->dd->create_screen(sdev->ws);
    if (!screen)
       sdev->ws->destroy(sdev->ws);
 
    return screen;
 }
 
 static const struct pipe_loader_ops pipe_loader_sw_ops = {
    .create_screen = pipe_loader_sw_create_screen,
-   .configuration = pipe_loader_sw_configuration,
+   .get_driconf_xml = pipe_loader_sw_get_driconf_xml,
    .release = pipe_loader_sw_release
 };
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index 101e0e2c22c..830c0abcb7f 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -1,25 +1,19 @@ 
 #ifndef DRM_HELPER_H
 #define DRM_HELPER_H
 
 #include <stdio.h>
 #include "target-helpers/inline_debug_helper.h"
 #include "target-helpers/drm_helper_public.h"
 #include "state_tracker/drm_driver.h"
 #include "util/xmlpool.h"
 
-const struct drm_conf_ret *
-pipe_default_configuration_query(enum drm_conf conf)
-{
-   return NULL;
-}
-
 #ifdef GALLIUM_I915
 #include "i915/drm/i915_drm_public.h"
 #include "i915/i915_public.h"
 
 struct pipe_screen *
 pipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
 {
    struct i915_winsys *iws;
    struct pipe_screen *screen;
 
@@ -47,52 +41,34 @@  pipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
 
 struct pipe_screen *
 pipe_iris_create_screen(int fd, const struct pipe_screen_config *config)
 {
    struct pipe_screen *screen;
 
    screen = iris_drm_screen_create(fd, config);
    return screen ? debug_screen_wrap(screen) : NULL;
 }
 
-const struct drm_conf_ret *
-pipe_iris_configuration_query(enum drm_conf conf)
-{
-   static const struct drm_conf_ret xml_options_ret = {
-      .type = DRM_CONF_POINTER,
-      .val.val_pointer =
-#include "iris/iris_driinfo.h"
-   };
-
-   switch (conf) {
-   case DRM_CONF_XML_OPTIONS:
-      return &xml_options_ret;
-   default:
-      break;
-   }
-   return pipe_default_configuration_query(conf);
-}
+const char *iris_driconf_xml =
+      #include "iris/iris_driinfo.h"
+      ;
 
 #else
 
 struct pipe_screen *
 pipe_iris_create_screen(int fd, const struct pipe_screen_config *config)
 {
    fprintf(stderr, "iris: driver missing\n");
    return NULL;
 }
 
-const struct drm_conf_ret *
-pipe_iris_configuration_query(enum drm_conf conf)
-{
-   return NULL;
-}
+const char *iris_driconf_xml = NULL;
 
 #endif
 
 #ifdef GALLIUM_NOUVEAU
 #include "nouveau/drm/nouveau_drm_public.h"
 
 struct pipe_screen *
 pipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config)
 {
    struct pipe_screen *screen;
@@ -197,52 +173,34 @@  pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
 
    /* First, try amdgpu. */
    rw = amdgpu_winsys_create(fd, config, radeonsi_screen_create);
 
    if (!rw)
       rw = radeon_drm_winsys_create(fd, config, radeonsi_screen_create);
 
    return rw ? debug_screen_wrap(rw->screen) : NULL;
 }
 
-const struct drm_conf_ret *
-pipe_radeonsi_configuration_query(enum drm_conf conf)
-{
-   static const struct drm_conf_ret xml_options_ret = {
-      .type = DRM_CONF_POINTER,
-      .val.val_pointer =
-#include "radeonsi/si_driinfo.h"
-   };
-
-   switch (conf) {
-   case DRM_CONF_XML_OPTIONS:
-      return &xml_options_ret;
-   default:
-      break;
-   }
-   return pipe_default_configuration_query(conf);
-}
+const char *radeonsi_driconf_xml =
+      #include "radeonsi/si_driinfo.h"
+      ;
 
 #else
 
 struct pipe_screen *
 pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
 {
    fprintf(stderr, "radeonsi: driver missing\n");
    return NULL;
 }
 
-const struct drm_conf_ret *
-pipe_radeonsi_configuration_query(enum drm_conf conf)
-{
-   return NULL;
-}
+const char *radeonsi_driconf_xml = NULL;
 
 #endif
 
 #ifdef GALLIUM_VMWGFX
 #include "svga/drm/svga_drm_public.h"
 #include "svga/svga_public.h"
 
 struct pipe_screen *
 pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config)
 {
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
index 4b34d274926..fedb5c0fc17 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
@@ -1,40 +1,36 @@ 
 #ifndef _DRM_HELPER_PUBLIC_H
 #define _DRM_HELPER_PUBLIC_H
 
-enum drm_conf;
-struct drm_conf_ret;
-
 struct pipe_screen;
 struct pipe_screen_config;
 
+const char *iris_driconf_xml;
+const char *radeonsi_driconf_xml;
+
 struct pipe_screen *
 pipe_i915_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_iris_create_screen(int fd, const struct pipe_screen_config *config);
-const struct drm_conf_ret *
-pipe_iris_configuration_query(enum drm_conf conf);
 
 struct pipe_screen *
 pipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_r300_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_r600_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config);
-const struct drm_conf_ret *
-pipe_radeonsi_configuration_query(enum drm_conf conf);
 
 struct pipe_screen *
 pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_freedreno_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_virgl_create_screen(int fd, const struct pipe_screen_config *config);
 
@@ -55,14 +51,11 @@  pipe_etna_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_imx_drm_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_tegra_create_screen(int fd, const struct pipe_screen_config *config);
 
 struct pipe_screen *
 pipe_lima_create_screen(int fd, const struct pipe_screen_config *config);
 
-const struct drm_conf_ret *
-pipe_default_configuration_query(enum drm_conf conf);
-
 #endif /* _DRM_HELPER_PUBLIC_H */
diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
index 3f52f1be885..f8d77a79721 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -4,75 +4,46 @@ 
 
 #include "pipe/p_compiler.h"
 
 #include "winsys_handle.h"
 
 struct pipe_screen;
 struct pipe_screen_config;
 struct pipe_context;
 struct pipe_resource;
 
-/**
- * Configuration queries.
- */
-enum drm_conf {
-   /* XML string describing the available config options. */
-   DRM_CONF_XML_OPTIONS, /* DRM_CONF_POINTER */
-   DRM_CONF_MAX
-};
-
-/**
- * Type of configuration answer
- */
-enum drm_conf_type {
-   DRM_CONF_POINTER
-};
-
-/**
- * Return value from the configuration function.
- */
-struct drm_conf_ret {
-   enum drm_conf_type type;
-   union {
-      void *val_pointer;
-   } val;
-};
-
 struct drm_driver_descriptor
 {
    /**
     * Identifying prefix/suffix of the binary, used by the pipe-loader.
     */
    const char *driver_name;
 
+   /**
+    * Pointer to the XML string describing driver-specific driconf options.
+    * Use DRI_CONF_* macros to create the string.
+    */
+   const char **driconf_xml;
+
    /**
     * Create a pipe srcreen.
     *
     * This function does any wrapping of the screen.
     * For example wrapping trace or rbug debugging drivers around it.
     */
    struct pipe_screen* (*create_screen)(int drm_fd,
                                         const struct pipe_screen_config *config);
-
-   /**
-    * Return a configuration value.
-    *
-    * If this function is NULL, or if it returns NULL
-    * the state tracker- or state
-    * tracker manager should provide a reasonable default value.
-    */
-   const struct drm_conf_ret *(*configuration) (enum drm_conf conf);
 };
 
 extern const struct drm_driver_descriptor driver_descriptor;
 
 /**
  * Instantiate a drm_driver_descriptor struct.
  */
-#define DRM_DRIVER_DESCRIPTOR(driver_name_str, func, conf) \
+#define DRM_DRIVER_DESCRIPTOR(driver_name_str, driconf, func)  \
 const struct drm_driver_descriptor driver_descriptor = {       \
    .driver_name = driver_name_str,                             \
+   .driconf_xml = driconf,                                     \
    .create_screen = func,                                      \
-   .configuration = (conf),				       \
 };
 
 #endif
diff --git a/src/gallium/targets/pipe-loader/pipe_i915.c b/src/gallium/targets/pipe-loader/pipe_i915.c
index 61429858445..b4f5a72f296 100644
--- a/src/gallium/targets/pipe-loader/pipe_i915.c
+++ b/src/gallium/targets/pipe-loader/pipe_i915.c
@@ -16,17 +16,12 @@  create_screen(int fd, const struct pipe_screen_config *config)
 
    screen = i915_screen_create(iws);
    if (!screen)
       return NULL;
 
    screen = debug_screen_wrap(screen);
 
    return screen;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   return NULL;
-}
-
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("i915", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("i915", NULL, create_screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_msm.c b/src/gallium/targets/pipe-loader/pipe_msm.c
index 004db95e78a..43b8f0b4ea4 100644
--- a/src/gallium/targets/pipe-loader/pipe_msm.c
+++ b/src/gallium/targets/pipe-loader/pipe_msm.c
@@ -10,17 +10,12 @@  create_screen(int fd, const struct pipe_screen_config *config)
 
    screen = fd_drm_screen_create(fd, NULL);
    if (!screen)
       return NULL;
 
    screen = debug_screen_wrap(screen);
 
    return screen;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   return NULL;
-}
-
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("msm", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("msm", NULL, create_screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_nouveau.c b/src/gallium/targets/pipe-loader/pipe_nouveau.c
index 9adba1c85c0..06fe95624d1 100644
--- a/src/gallium/targets/pipe-loader/pipe_nouveau.c
+++ b/src/gallium/targets/pipe-loader/pipe_nouveau.c
@@ -10,17 +10,12 @@  create_screen(int fd, const struct pipe_screen_config *config)
 
    screen = nouveau_drm_screen_create(fd);
    if (!screen)
       return NULL;
 
    screen = debug_screen_wrap(screen);
 
    return screen;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   return NULL;
-}
-
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("nouveau", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("nouveau", NULL, create_screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_r300.c b/src/gallium/targets/pipe-loader/pipe_r300.c
index 1c42f4e36ad..17b310ee189 100644
--- a/src/gallium/targets/pipe-loader/pipe_r300.c
+++ b/src/gallium/targets/pipe-loader/pipe_r300.c
@@ -6,17 +6,12 @@ 
 
 static struct pipe_screen *
 create_screen(int fd, const struct pipe_screen_config *config)
 {
    struct radeon_winsys *sws;
 
    sws = radeon_drm_winsys_create(fd, config, r300_screen_create);
    return sws ? debug_screen_wrap(sws->screen) : NULL;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   return NULL;
-}
-
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r300", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("r300", NULL, create_screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_r600.c b/src/gallium/targets/pipe-loader/pipe_r600.c
index f5f1c446e2d..855aa9e4bd3 100644
--- a/src/gallium/targets/pipe-loader/pipe_r600.c
+++ b/src/gallium/targets/pipe-loader/pipe_r600.c
@@ -6,17 +6,12 @@ 
 
 static struct pipe_screen *
 create_screen(int fd, const struct pipe_screen_config *config)
 {
    struct radeon_winsys *rw;
 
    rw = radeon_drm_winsys_create(fd, config, r600_screen_create);
    return rw ? debug_screen_wrap(rw->screen) : NULL;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   return NULL;
-}
-
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r600", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("r600", NULL, create_screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_radeonsi.c b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
index 09c06b380d6..5657595af19 100644
--- a/src/gallium/targets/pipe-loader/pipe_radeonsi.c
+++ b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
@@ -13,29 +13,16 @@  create_screen(int fd, const struct pipe_screen_config *config)
 
    /* First, try amdgpu. */
    rw = amdgpu_winsys_create(fd, config, radeonsi_screen_create);
 
    if (!rw)
       rw = radeon_drm_winsys_create(fd, config, radeonsi_screen_create);
 
    return rw ? debug_screen_wrap(rw->screen) : NULL;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   static const struct drm_conf_ret xml_options_ret = {
-      .type = DRM_CONF_POINTER,
-      .val.val_pointer =
-#include "radeonsi/si_driinfo.h"
-   };
-
-   switch (conf) {
-   case DRM_CONF_XML_OPTIONS:
-      return &xml_options_ret;
-   default:
-      break;
-   }
-   return NULL;
-}
+static const char *driconf_xml =
+   #include "radeonsi/si_driinfo.h"
+   ;
 
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("radeonsi", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("radeonsi", &driconf_xml, create_screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
index c4484e03344..a60a5e89814 100644
--- a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
+++ b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
@@ -16,17 +16,12 @@  create_screen(int fd, const struct pipe_screen_config *config)
 
    screen = svga_screen_create(sws);
    if (!screen)
       return NULL;
 
    screen = debug_screen_wrap(screen);
 
    return screen;
 }
 
-static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
-{
-   return NULL;
-}
-
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("vmwgfx", create_screen, drm_configuration)
+DRM_DRIVER_DESCRIPTOR("vmwgfx", NULL, create_screen)