aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/pipe-loader
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-04-22 20:00:10 -0400
committerMarek Olšák <[email protected]>2019-04-23 21:20:26 -0400
commitd8b296d3ad96cb04ee57234a0b1a6a046e08a1a7 (patch)
tree70c9d4183d333f6b17f616b8e638b2eb8c572bcd /src/gallium/auxiliary/pipe-loader
parent8ae50e6004e6279493d7ea771f540cc871a90149 (diff)
gallium: replace drm_driver_descriptor::configuration with driconf_xml
PIPE_CAPs are better. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/pipe-loader')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.c16
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.h10
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c40
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h3
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c7
5 files changed, 16 insertions, 60 deletions
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
@@ -87,25 +87,15 @@ pipe_loader_base_release(struct pipe_loader_device **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,
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
@@ -91,16 +91,6 @@ 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.
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
@@ -69,89 +69,74 @@ 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
@@ -296,16 +281,15 @@ pipe_loader_drm_release(struct pipe_loader_device **dev)
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 *
@@ -324,16 +308,10 @@ pipe_loader_drm_get_driinfo_xml(const char *driver_name)
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;
@@ -341,6 +319,6 @@ out:
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
@@ -34,8 +34,7 @@ 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);
};
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
@@ -293,9 +293,8 @@ pipe_loader_sw_release(struct pipe_loader_device **dev)
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;
}
@@ -316,6 +315,6 @@ pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
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
};