summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-10-17 21:51:24 +0100
committerEmil Velikov <[email protected]>2015-11-21 12:52:18 +0000
commitd54ca54faa2a6dde3c4d2125fd41d10dfcf2f91e (patch)
tree31d1e226b627bddcfa21e0d9a27da26b903d89b3 /src/gallium/targets
parentf58a6f7be3efa6a13d7ac321f304de2703870def (diff)
pipe-loader: rework the sw backend
Move the winsys into the pipe-target, similar to the hardware pipe-driver. v2: - move int declaration outside of loop (Brian) - fold the teardown into a goto + separate function. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/targets')
-rw-r--r--src/gallium/targets/d3dadapter9/Makefile.am3
-rw-r--r--src/gallium/targets/dri/Makefile.am3
-rw-r--r--src/gallium/targets/omx/Makefile.am3
-rw-r--r--src/gallium/targets/opencl/Makefile.am1
-rw-r--r--src/gallium/targets/pipe-loader/Makefile.am5
-rw-r--r--src/gallium/targets/pipe-loader/pipe.sym2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_swrast.c34
-rw-r--r--src/gallium/targets/va/Makefile.am3
-rw-r--r--src/gallium/targets/vdpau/Makefile.am3
-rw-r--r--src/gallium/targets/xa/Makefile.am3
-rw-r--r--src/gallium/targets/xvmc/Makefile.am3
11 files changed, 46 insertions, 17 deletions
diff --git a/src/gallium/targets/d3dadapter9/Makefile.am b/src/gallium/targets/d3dadapter9/Makefile.am
index bd6d620e819..d125ba8918d 100644
--- a/src/gallium/targets/d3dadapter9/Makefile.am
+++ b/src/gallium/targets/d3dadapter9/Makefile.am
@@ -110,8 +110,7 @@ d3dadapter9_la_LIBADD += $(TARGET_LIB_DEPS) \
else # HAVE_GALLIUM_STATIC_TARGETS
d3dadapter9_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS
diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am
index 95efdd4451c..038a12bfdfe 100644
--- a/src/gallium/targets/dri/Makefile.am
+++ b/src/gallium/targets/dri/Makefile.am
@@ -98,8 +98,7 @@ gallium_dri_la_LIBADD += $(TARGET_LIB_DEPS) \
else # HAVE_GALLIUM_STATIC_TARGETS
gallium_dri_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS
diff --git a/src/gallium/targets/omx/Makefile.am b/src/gallium/targets/omx/Makefile.am
index a4dff487dd8..2454cbe424a 100644
--- a/src/gallium/targets/omx/Makefile.am
+++ b/src/gallium/targets/omx/Makefile.am
@@ -56,8 +56,7 @@ libomx_mesa_la_LIBADD += $(TARGET_LIB_DEPS) \
else # HAVE_GALLIUM_STATIC_TARGETS
libomx_mesa_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS
diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
index c78b26832ff..004d6d786df 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -19,7 +19,6 @@ lib@OPENCL_LIBNAME@_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/clover/libclover.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
$(ELF_LIB) \
-ldl \
-lclangCodeGen \
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index 4f25b4f6073..4bc3b55f26b 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -27,6 +27,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/winsys \
+ $(GALLIUM_PIPE_LOADER_DEFINES) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS) \
-DGALLIUM_RBUG \
@@ -208,6 +209,10 @@ AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
pipe_swrast_la_LIBADD += \
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
endif
+
+pipe_swrast_la_LIBADD += \
+ $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+
endif
EXTRA_DIST = pipe.sym
diff --git a/src/gallium/targets/pipe-loader/pipe.sym b/src/gallium/targets/pipe-loader/pipe.sym
index 19b1d77b040..b2fa619f7de 100644
--- a/src/gallium/targets/pipe-loader/pipe.sym
+++ b/src/gallium/targets/pipe-loader/pipe.sym
@@ -1,7 +1,7 @@
{
global:
driver_descriptor;
- swrast_create_screen;
+ swrast_driver_descriptor;
local:
*;
};
diff --git a/src/gallium/targets/pipe-loader/pipe_swrast.c b/src/gallium/targets/pipe-loader/pipe_swrast.c
index f7f354acf3f..cf617f37e20 100644
--- a/src/gallium/targets/pipe-loader/pipe_swrast.c
+++ b/src/gallium/targets/pipe-loader/pipe_swrast.c
@@ -1,7 +1,11 @@
#include "target-helpers/inline_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
-#include "state_tracker/drm_driver.h"
+#include "state_tracker/sw_driver.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"
PUBLIC struct pipe_screen *
swrast_create_screen(struct sw_winsys *ws);
@@ -17,3 +21,31 @@ swrast_create_screen(struct sw_winsys *ws)
return screen;
}
+
+PUBLIC
+struct sw_driver_descriptor swrast_driver_descriptor = {
+ .create_screen = swrast_create_screen,
+ .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
+ {
+ .name = "null",
+ .create_winsys = null_sw_create,
+ },
+ {
+ .name = "wrapped",
+ .create_winsys = wrapper_sw_winsys_wrap_pipe_screen,
+ },
+ { 0 },
+ }
+};
diff --git a/src/gallium/targets/va/Makefile.am b/src/gallium/targets/va/Makefile.am
index 9613f041b58..2fd24a8bdd9 100644
--- a/src/gallium/targets/va/Makefile.am
+++ b/src/gallium/targets/va/Makefile.am
@@ -53,8 +53,7 @@ gallium_drv_video_la_LIBADD += $(TARGET_LIB_DEPS) \
else # HAVE_GALLIUM_STATIC_TARGETS
gallium_drv_video_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS
diff --git a/src/gallium/targets/vdpau/Makefile.am b/src/gallium/targets/vdpau/Makefile.am
index 7eb62c1cc78..34b7ef40b20 100644
--- a/src/gallium/targets/vdpau/Makefile.am
+++ b/src/gallium/targets/vdpau/Makefile.am
@@ -65,8 +65,7 @@ libvdpau_gallium_la_LIBADD += $(TARGET_LIB_DEPS) \
else # HAVE_GALLIUM_STATIC_TARGETS
libvdpau_gallium_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS
diff --git a/src/gallium/targets/xa/Makefile.am b/src/gallium/targets/xa/Makefile.am
index 02c42c665ed..0fba3b2f3a1 100644
--- a/src/gallium/targets/xa/Makefile.am
+++ b/src/gallium/targets/xa/Makefile.am
@@ -79,8 +79,7 @@ libxatracker_la_LIBADD += $(TARGET_LIB_DEPS)
else # HAVE_GALLIUM_STATIC_TARGETS
libxatracker_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS
diff --git a/src/gallium/targets/xvmc/Makefile.am b/src/gallium/targets/xvmc/Makefile.am
index b3285890822..f1045d4f745 100644
--- a/src/gallium/targets/xvmc/Makefile.am
+++ b/src/gallium/targets/xvmc/Makefile.am
@@ -53,8 +53,7 @@ libXvMCgallium_la_LIBADD += $(TARGET_LIB_DEPS) \
else # HAVE_GALLIUM_STATIC_TARGETS
libXvMCgallium_la_LIBADD += \
- $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
- $(GALLIUM_PIPE_LOADER_WINSYS_LIBS)
+ $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la
endif # HAVE_GALLIUM_STATIC_TARGETS