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

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
src/gallium/state_trackers/xa/Makefile.am
src/gallium/state_trackers/xa/xa_tracker.c
src/gallium/targets/xa/Makefile.am
src/gallium/targets/xa/target.c

index 0d50c27253bd8798202ce8cea1dc8e634fda8e95..968778f995c4c0acd4584e9a4c1a50cdee9f5549 100644 (file)
@@ -28,11 +28,6 @@ AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS)
 
-if HAVE_GALLIUM_STATIC_TARGETS
-AM_CPPFLAGS = \
-       -DGALLIUM_STATIC_TARGETS=1
-endif
-
 xa_includedir = $(includedir)
 xa_include_HEADERS = \
        xa_composite.h \
index 3011598e0d928c5308eb3f93c8fb88842e1b2838..faa630c144ba9f22360fc5ccbf3b60b9dc664d4e 100644 (file)
@@ -152,21 +152,13 @@ xa_tracker_create(int drm_fd)
     struct xa_tracker *xa = calloc(1, sizeof(struct xa_tracker));
     enum xa_surface_type stype;
     unsigned int num_formats;
-    int loader_fd;
 
     if (!xa)
        return NULL;
 
-#if GALLIUM_STATIC_TARGETS
-    xa->screen = dd_create_screen(drm_fd);
-    (void) loader_fd; /* silence unused var warning */
-#else
-    loader_fd = dup(drm_fd);
-    if (loader_fd == -1)
-        return NULL;
-    if (pipe_loader_drm_probe_fd(&xa->dev, loader_fd))
+    if (pipe_loader_drm_probe_fd(&xa->dev, dup(drm_fd)))
        xa->screen = pipe_loader_create_screen(xa->dev);
-#endif
+
     if (!xa->screen)
        goto out_no_screen;
 
@@ -214,10 +206,8 @@ xa_tracker_create(int drm_fd)
  out_no_pipe:
     xa->screen->destroy(xa->screen);
  out_no_screen:
-#if !GALLIUM_STATIC_TARGETS
     if (xa->dev)
        pipe_loader_release(&xa->dev, 1);
-#endif
     free(xa);
     return NULL;
 }
@@ -228,9 +218,7 @@ xa_tracker_destroy(struct xa_tracker *xa)
     free(xa->supported_formats);
     xa_context_destroy(xa->default_ctx);
     xa->screen->destroy(xa->screen);
-#if !GALLIUM_STATIC_TARGETS
     pipe_loader_release(&xa->dev, 1);
-#endif
     free(xa);
 }
 
index 545d17eb4e1cd1677edeece1c17df277f20977f0..a63fd6903a4b925490085e41b18a60a3d4aa537a 100644 (file)
@@ -60,7 +60,7 @@ if HAVE_GALLIUM_STATIC_TARGETS
 
 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
 
@@ -74,7 +74,10 @@ include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
 libxatracker_la_SOURCES += target.c
 libxatracker_la_CPPFLAGS = $(TARGET_CPPFLAGS)
-libxatracker_la_LIBADD += $(TARGET_LIB_DEPS)
+libxatracker_la_LIBADD += \
+       $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_static.la \
+       $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
+       $(TARGET_LIB_DEPS)
 
 else # HAVE_GALLIUM_STATIC_TARGETS
 
index fde4a4a7dcfc59615a0c82c473297e7fa9ce58d8..42b1346d341debbd2a04d64a8893dd7f86b64db1 100644 (file)
@@ -1 +1 @@
-#include "target-helpers/inline_drm_helper.h"
+#include "target-helpers/drm_helper.h"