pipe-loader: wire up the 'static' sw pipe-loader
Analogous to previous commit with a small catch. As the sw inline helpers are mere wrappers, and the screen <> winsys split is more prominent (with the latter not being part of the final pipe-driver), things will just work. v2: rebase on top of earlier 'consolitate teardown' changes Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
@@ -40,7 +40,9 @@
|
|||||||
struct pipe_loader_sw_device {
|
struct pipe_loader_sw_device {
|
||||||
struct pipe_loader_device base;
|
struct pipe_loader_device base;
|
||||||
const struct sw_driver_descriptor *dd;
|
const struct sw_driver_descriptor *dd;
|
||||||
|
#ifndef GALLIUM_STATIC_TARGETS
|
||||||
struct util_dl_library *lib;
|
struct util_dl_library *lib;
|
||||||
|
#endif
|
||||||
struct sw_winsys *ws;
|
struct sw_winsys *ws;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -48,6 +50,41 @@ struct pipe_loader_sw_device {
|
|||||||
|
|
||||||
static const struct pipe_loader_ops pipe_loader_sw_ops;
|
static const struct pipe_loader_ops pipe_loader_sw_ops;
|
||||||
|
|
||||||
|
#ifdef GALLIUM_STATIC_TARGETS
|
||||||
|
static const struct sw_driver_descriptor driver_descriptors = {
|
||||||
|
.create_screen = sw_screen_create,
|
||||||
|
.winsys = {
|
||||||
|
#ifdef HAVE_PIPE_LOADER_DRI
|
||||||
|
{
|
||||||
|
.name = "dri",
|
||||||
|
.create_winsys = dri_create_sw_winsys,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_PIPE_LOADER_KMS
|
||||||
|
{
|
||||||
|
.name = "kms_dri",
|
||||||
|
.create_winsys = kms_dri_create_winsys,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* XXX: Do not include these two for non autotools builds.
|
||||||
|
* They don't have neither opencl nor nine, where these are used.
|
||||||
|
*/
|
||||||
|
#ifndef DROP_PIPE_LOADER_MISC
|
||||||
|
{
|
||||||
|
.name = "null",
|
||||||
|
.create_winsys = null_sw_create,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "wrapped",
|
||||||
|
.create_winsys = wrapper_sw_winsys_wrap_pipe_screen,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
{ 0 },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev)
|
pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev)
|
||||||
{
|
{
|
||||||
@@ -55,6 +92,11 @@ pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev)
|
|||||||
sdev->base.driver_name = "swrast";
|
sdev->base.driver_name = "swrast";
|
||||||
sdev->base.ops = &pipe_loader_sw_ops;
|
sdev->base.ops = &pipe_loader_sw_ops;
|
||||||
|
|
||||||
|
#ifdef GALLIUM_STATIC_TARGETS
|
||||||
|
sdev->dd = &driver_descriptors;
|
||||||
|
if (!sdev->dd)
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
sdev->lib = pipe_loader_find_module(&sdev->base, PIPE_SEARCH_DIR);
|
sdev->lib = pipe_loader_find_module(&sdev->base, PIPE_SEARCH_DIR);
|
||||||
if (!sdev->lib)
|
if (!sdev->lib)
|
||||||
return false;
|
return false;
|
||||||
@@ -67,6 +109,7 @@ pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev)
|
|||||||
sdev->lib = NULL;
|
sdev->lib = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -74,8 +117,10 @@ pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev)
|
|||||||
static void
|
static void
|
||||||
pipe_loader_sw_probe_teardown_common(struct pipe_loader_sw_device *sdev)
|
pipe_loader_sw_probe_teardown_common(struct pipe_loader_sw_device *sdev)
|
||||||
{
|
{
|
||||||
|
#ifndef GALLIUM_STATIC_TARGETS
|
||||||
if (sdev->lib)
|
if (sdev->lib)
|
||||||
util_dl_close(sdev->lib);
|
util_dl_close(sdev->lib);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PIPE_LOADER_DRI
|
#ifdef HAVE_PIPE_LOADER_DRI
|
||||||
@@ -222,8 +267,10 @@ pipe_loader_sw_release(struct pipe_loader_device **dev)
|
|||||||
{
|
{
|
||||||
struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(*dev);
|
struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(*dev);
|
||||||
|
|
||||||
|
#ifndef GALLIUM_STATIC_TARGETS
|
||||||
if (sdev->lib)
|
if (sdev->lib)
|
||||||
util_dl_close(sdev->lib);
|
util_dl_close(sdev->lib);
|
||||||
|
#endif
|
||||||
|
|
||||||
FREE(sdev);
|
FREE(sdev);
|
||||||
*dev = NULL;
|
*dev = NULL;
|
||||||
|
Reference in New Issue
Block a user