summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.h13
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c23
2 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 315ab32fde0..9a461608d99 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -44,6 +44,7 @@ extern "C" {
#endif
struct pipe_screen;
+struct drisw_loader_funcs;
enum pipe_loader_device_type {
PIPE_LOADER_DEVICE_SOFTWARE,
@@ -119,6 +120,18 @@ pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display);
#endif
/**
+ * Initialize sw dri device give the drisw_loader_funcs.
+ *
+ * This function is platform-specific.
+ *
+ * \sa pipe_loader_probe
+ */
+bool
+pipe_loader_sw_probe_dri(struct pipe_loader_device **devs,
+ struct drisw_loader_funcs *drisw_lf);
+
+
+/**
* Get a list of known software devices.
*
* This function is platform-specific.
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 7e2585e1c7b..abc87a2c744 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -29,9 +29,11 @@
#include "util/u_memory.h"
#include "util/u_dl.h"
+#include "sw/dri/dri_sw_winsys.h"
#include "sw/null/null_sw_winsys.h"
#include "sw/xlib/xlib_sw_winsys.h"
#include "target-helpers/inline_sw_helper.h"
+#include "state_tracker/drisw_api.h"
struct pipe_loader_sw_device {
struct pipe_loader_device base;
@@ -70,6 +72,27 @@ pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display)
}
#endif
+bool
+pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_funcs *drisw_lf)
+{
+ struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device);
+
+ if (!sdev)
+ return false;
+
+ sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE;
+ sdev->base.driver_name = "swrast";
+ sdev->base.ops = &pipe_loader_sw_ops;
+ sdev->ws = dri_create_sw_winsys(drisw_lf);
+ if (!sdev->ws) {
+ FREE(sdev);
+ return false;
+ }
+ *devs = &sdev->base;
+
+ return true;
+}
+
int
pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev)
{