{st,targets}/nine: use static/dynamic pipe-loader
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 14 Oct 2015 15:47:04 +0000 (16:47 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 21 Nov 2015 12:52:20 +0000 (12:52 +0000)
Analogous to previous commits.

v2: add the missing winsys libs linkage

Cc: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
src/gallium/targets/d3dadapter9/Makefile.am
src/gallium/targets/d3dadapter9/drm.c

index 776f86bda6d5525e5d00f2bfa78b2e565b27d23e..d1d9829b6c592d9ef31a7b210e0922554a40969e 100644 (file)
@@ -34,12 +34,6 @@ AM_CFLAGS = \
        $(GALLIUM_TARGET_CFLAGS) \
        $(VISIBILITY_CFLAGS)
 
-if HAVE_GALLIUM_STATIC_TARGETS
-AM_CPPFLAGS = \
-       -DGALLIUM_STATIC_TARGETS=1
-
-endif
-
 ninedir = $(D3D_DRIVER_INSTALL_DIR)
 nine_LTLIBRARIES = d3dadapter9.la
 
@@ -71,7 +65,6 @@ d3dadapter9_la_LIBADD = \
        $(top_builddir)/src/glsl/libnir.la \
        $(top_builddir)/src/gallium/state_trackers/nine/libninetracker.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la \
        $(EXPAT_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
@@ -80,7 +73,7 @@ EXTRA_DIST = d3dadapter9.sym
 
 TARGET_DRIVERS =
 TARGET_CPPFLAGS =
-TARGET_LIB_DEPS = $(top_builddir)/src/loader/libloader.la
+TARGET_LIB_DEPS =
 
 include $(top_srcdir)/src/gallium/drivers/i915/Automake.inc
 
@@ -104,7 +97,10 @@ include $(top_srcdir)/src/gallium/drivers/llvmpipe/Automake.inc
 if HAVE_GALLIUM_STATIC_TARGETS
 
 d3dadapter9_la_CPPFLAGS = $(AM_CPPFLAGS) $(TARGET_CPPFLAGS)
-d3dadapter9_la_LIBADD += $(TARGET_LIB_DEPS) \
+d3dadapter9_la_LIBADD += \
+       $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_static.la \
+       $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
+       $(TARGET_LIB_DEPS) \
        $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
 
 else # HAVE_GALLIUM_STATIC_TARGETS
index 78896cb34fd8e5eda1537bea76f9aa038f830e47..c890191124e0534de9083c9b1191eb692e6e8db4 100644 (file)
@@ -29,8 +29,7 @@
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
 
-#include "target-helpers/inline_drm_helper.h"
-#include "target-helpers/inline_wrapper_sw_helper.h"
+#include "target-helpers/drm_helper.h"
 #include "state_tracker/drm_driver.h"
 
 #include "d3dadapter/d3dadapter9.h"
@@ -91,12 +90,10 @@ drm_destroy( struct d3dadapter9_context *ctx )
     else if (ctx->hal)
         ctx->hal->destroy(ctx->hal);
 
-#if !GALLIUM_STATIC_TARGETS
     if (drm->swdev)
         pipe_loader_release(&drm->swdev, 1);
     if (drm->dev)
         pipe_loader_release(&drm->dev, 1);
-#endif
 
     close(drm->fd);
     FREE(ctx);
@@ -223,10 +220,6 @@ drm_create_adapter( int fd,
     ctx->fd = fd;
     ctx->base.linear_framebuffer = !!different_device;
 
-#if GALLIUM_STATIC_TARGETS
-    ctx->base.hal = dd_create_screen(fd);
-#else
-    /* use pipe-loader to dlopen appropriate drm driver */
     if (!pipe_loader_drm_probe_fd(&ctx->dev, fd)) {
         ERR("Failed to probe drm fd %d.\n", fd);
         FREE(ctx);
@@ -234,22 +227,15 @@ drm_create_adapter( int fd,
         return D3DERR_DRIVERINTERNALERROR;
     }
 
-    /* use pipe-loader to create a drm screen (hal) */
     ctx->base.hal = pipe_loader_create_screen(ctx->dev);
-#endif
     if (!ctx->base.hal) {
         ERR("Unable to load requested driver.\n");
         drm_destroy(&ctx->base);
         return D3DERR_DRIVERINTERNALERROR;
     }
 
-#if GALLIUM_STATIC_TARGETS
-    dmabuf_ret = dd_configuration(DRM_CONF_SHARE_FD);
-    throttle_ret = dd_configuration(DRM_CONF_THROTTLE);
-#else
     dmabuf_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_SHARE_FD);
     throttle_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_THROTTLE);
-#endif // GALLIUM_STATIC_TARGETS
     if (!dmabuf_ret || !dmabuf_ret->val.val_bool) {
         ERR("The driver is not capable of dma-buf sharing."
             "Abandon to load nine state tracker\n");
@@ -296,14 +282,10 @@ drm_create_adapter( int fd,
     driDestroyOptionCache(&userInitOptions);
     driDestroyOptionInfo(&defaultInitOptions);
 
-#if GALLIUM_STATIC_TARGETS
-    ctx->base.ref = sw_screen_wrap(ctx->base.hal);
-#else
     /* wrap it to create a software screen that can share resources */
-    if (pipe_loader_sw_probe_wrapped(&ctx->swdev, ctx->base.hal)) {
+    if (pipe_loader_sw_probe_wrapped(&ctx->swdev, ctx->base.hal))
         ctx->base.ref = pipe_loader_create_screen(ctx->swdev);
-    }
-#endif
+
     if (!ctx->base.ref) {
         ERR("Couldn't wrap drm screen to swrast screen. Software devices "
             "will be unavailable.\n");