gallium: remove library_path argument from pipe_loader_create_screen()
[mesa.git] / src / gallium / auxiliary / pipe-loader / pipe_loader_sw.c
index 3d3326452319743faf8ac5262bef359eeb5e9e23..c79f7c9ee341b22b724292045ae0e9060af2acb7 100644 (file)
 #include "util/u_memory.h"
 #include "util/u_dl.h"
 #include "sw/dri/dri_sw_winsys.h"
+#include "sw/kms-dri/kms_dri_sw_winsys.h"
 #include "sw/null/null_sw_winsys.h"
 #include "sw/wrapper/wrapper_sw_winsys.h"
-#ifdef HAVE_PIPE_LOADER_XLIB
-/* Explicitly wrap the header to ease build without X11 headers */
-#include "sw/xlib/xlib_sw_winsys.h"
-#endif
 #include "target-helpers/inline_sw_helper.h"
 #include "state_tracker/drisw_api.h"
 
@@ -53,9 +50,9 @@ static struct sw_winsys *(*backends[])() = {
    null_sw_create
 };
 
-#ifdef HAVE_PIPE_LOADER_XLIB
+#ifdef HAVE_PIPE_LOADER_DRI
 bool
-pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display)
+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);
 
@@ -65,7 +62,7 @@ pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display)
    sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE;
    sdev->base.driver_name = "swrast";
    sdev->base.ops = &pipe_loader_sw_ops;
-   sdev->ws = xlib_create_sw_winsys(display);
+   sdev->ws = dri_create_sw_winsys(drisw_lf);
    if (!sdev->ws) {
       FREE(sdev);
       return false;
@@ -76,9 +73,9 @@ pipe_loader_sw_probe_xlib(struct pipe_loader_device **devs, Display *display)
 }
 #endif
 
-#ifdef HAVE_PIPE_LOADER_DRI
+#ifdef HAVE_PIPE_LOADER_KMS
 bool
-pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_funcs *drisw_lf)
+pipe_loader_sw_probe_kms(struct pipe_loader_device **devs, int fd)
 {
    struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device);
 
@@ -88,7 +85,7 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_f
    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);
+   sdev->ws = kms_dri_create_winsys(fd);
    if (!sdev->ws) {
       FREE(sdev);
       return false;
@@ -183,14 +180,13 @@ pipe_loader_sw_configuration(struct pipe_loader_device *dev,
 }
 
 static struct pipe_screen *
-pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
-                             const char *library_paths)
+pipe_loader_sw_create_screen(struct pipe_loader_device *dev)
 {
    struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(dev);
    struct pipe_screen *(*init)(struct sw_winsys *);
 
    if (!sdev->lib)
-      sdev->lib = pipe_loader_find_module(dev, library_paths);
+      sdev->lib = pipe_loader_find_module(&sdev->base, PIPE_SEARCH_DIR);
    if (!sdev->lib)
       return NULL;