summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-06-21 12:50:10 +0100
committerEmil Velikov <[email protected]>2014-07-10 01:06:49 +0100
commit0bdc3e1afda111c5741a699da3ff891fedfe89de (patch)
tree45b059e54c82c58a9e19a5ff6bc76530c91520c5 /src
parent29ca7d2c9488d13e496ec65b6e1e1bf1d53042c5 (diff)
targets/dri-swrast: Convert to static/shared pipe-driver
Convert the final dri target to the single DRI (megadriver) library. Cleanup all the automake leftovers from the conversion stage and update the scons build. v2: Link in llvmpipe, when applicable. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/Automake.inc43
-rw-r--r--src/gallium/SConscript1
-rw-r--r--src/gallium/auxiliary/target-helpers/inline_sw_helper.h36
-rw-r--r--src/gallium/targets/Makefile.am10
-rw-r--r--src/gallium/targets/dri-swrast/Makefile.am55
-rw-r--r--src/gallium/targets/dri-swrast/SConscript49
-rw-r--r--src/gallium/targets/dri-swrast/swrast_drm_api.c74
-rw-r--r--src/gallium/targets/dri/Makefile.am14
-rw-r--r--src/gallium/targets/dri/SConscript19
-rw-r--r--src/gallium/targets/dri/target.c1
10 files changed, 71 insertions, 231 deletions
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index bef16c8aff6..73d65a4d10f 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -26,21 +26,6 @@ GALLIUM_DRIVER_CXXFLAGS = \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
-GALLIUM_DRI_CFLAGS = \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/src/gallium/state_trackers/dri \
- -I$(top_srcdir)/src/mesa/drivers/dri/common \
- -I$(top_srcdir)/src/gallium/include \
- -I$(top_srcdir)/src/gallium/auxiliary \
- -I$(top_srcdir)/src/gallium/drivers \
- -I$(top_srcdir)/src/gallium/winsys \
- -I$(top_srcdir)/src/mesa \
- -I$(top_srcdir)/src/mapi \
- $(DEFINES) \
- $(PTHREAD_CFLAGS) \
- $(LIBDRM_CFLAGS) \
- $(VISIBILITY_CFLAGS)
-
GALLIUM_TARGET_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/loader \
@@ -53,35 +38,12 @@ GALLIUM_TARGET_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
-
-GALLIUM_DRI_LINKER_FLAGS = \
- -shared \
- -shrext .so \
- -module \
- -avoid-version \
- $(GC_SECTIONS)
-
-if HAVE_LD_VERSION_SCRIPT
-GALLIUM_DRI_LINKER_FLAGS += \
- -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
-
-endif
-
-
GALLIUM_COMMON_LIB_DEPS = \
-lm \
$(CLOCK_LIB) \
$(PTHREAD_LIBS) \
$(DLOPEN_LIBS)
-GALLIUM_DRI_LIB_DEPS = \
- $(top_builddir)/src/mesa/libmesagallium.la \
- $(top_builddir)/src/gallium/auxiliary/libgallium.la \
- $(SELINUX_LIBS) \
- $(LIBDRM_LIBS) \
- $(EXPAT_LIBS) \
- $(GALLIUM_COMMON_LIB_DEPS)
-
GALLIUM_WINSYS_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
@@ -89,11 +51,6 @@ GALLIUM_WINSYS_CFLAGS = \
$(DEFINES) \
$(VISIBILITY_CFLAGS)
-if HAVE_MESA_LLVM
-GALLIUM_DRI_LINKER_FLAGS += $(LLVM_LDFLAGS)
-GALLIUM_DRI_LIB_DEPS += $(LLVM_LIBS)
-endif
-
GALLIUM_PIPE_LOADER_WINSYS_LIBS = \
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la
diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index df71b9aeada..8d9849e0009 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -107,7 +107,6 @@ if not env['embedded']:
if env['dri']:
SConscript([
- 'targets/dri-swrast/SConscript',
'targets/dri/SConscript',
])
diff --git a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h
index 596c691e9c1..8a144db09c3 100644
--- a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h
+++ b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h
@@ -57,5 +57,41 @@ sw_screen_create(struct sw_winsys *winsys)
return sw_screen_create_named(winsys, driver);
}
+#if defined(GALLIUM_SOFTPIPE)
+#if defined(DRI_TARGET)
+#include "target-helpers/inline_debug_helper.h"
+#include "sw/dri/dri_sw_winsys.h"
+#include "dri_screen.h"
+
+const __DRIextension **__driDriverGetExtensions_swrast(void);
+
+PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void)
+{
+ globalDriverAPI = &galliumsw_driver_api;
+ return galliumsw_driver_extensions;
+}
+
+INLINE struct pipe_screen *
+drisw_create_screen(struct drisw_loader_funcs *lf)
+{
+ struct sw_winsys *winsys = NULL;
+ struct pipe_screen *screen = NULL;
+
+ winsys = dri_create_sw_winsys(lf);
+ if (winsys == NULL)
+ return NULL;
+
+ screen = sw_screen_create(winsys);
+ if (screen == NULL) {
+ winsys->destroy(winsys);
+ return NULL;
+ }
+
+ screen = debug_screen_wrap(screen);
+ return screen;
+}
+#endif // DRI_TARGET
+#endif // GALLIUM_SOFTPIPE
+
#endif
diff --git a/src/gallium/targets/Makefile.am b/src/gallium/targets/Makefile.am
index 5e0ecc34a77..3cacb040a7a 100644
--- a/src/gallium/targets/Makefile.am
+++ b/src/gallium/targets/Makefile.am
@@ -24,6 +24,10 @@ SUBDIRS =
if HAVE_DRI2
SUBDIRS += dri
+else
+if HAVE_DRISW
+SUBDIRS += dri
+endif
endif
if HAVE_X11_DRIVER
@@ -58,12 +62,6 @@ if HAVE_CLOVER
SUBDIRS += opencl
endif
-if HAVE_GALLIUM_SOFTPIPE
-if HAVE_DRISW
-SUBDIRS += dri-swrast
-endif
-endif
-
if NEED_GALLIUM_LOADER
SUBDIRS += pipe-loader
endif
diff --git a/src/gallium/targets/dri-swrast/Makefile.am b/src/gallium/targets/dri-swrast/Makefile.am
deleted file mode 100644
index 3e3f1c7a2b0..00000000000
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright © 2012 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-
-include $(top_srcdir)/src/gallium/Automake.inc
-
-AM_CFLAGS = \
- $(GALLIUM_DRI_CFLAGS)
-AM_CPPFLAGS = \
- -DGALLIUM_RBUG \
- -DGALLIUM_TRACE \
- -DGALLIUM_SOFTPIPE
-
-dridir = $(DRI_DRIVER_INSTALL_DIR)
-dri_LTLIBRARIES = swrast_dri.la
-
-nodist_EXTRA_swrast_dri_la_SOURCES = dummy.cpp
-swrast_dri_la_SOURCES = swrast_drm_api.c
-
-swrast_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
-
-swrast_dri_la_LIBADD = \
- $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
- $(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \
- $(top_builddir)/src/gallium/state_trackers/dri/libdri.la \
- $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
- $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
- $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
- $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
- $(GALLIUM_DRI_LIB_DEPS)
-
-if HAVE_MESA_LLVM
-AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
-swrast_dri_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
-endif
-
-include $(top_srcdir)/install-gallium-links.mk
diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript
deleted file mode 100644
index 374444be2c6..00000000000
--- a/src/gallium/targets/dri-swrast/SConscript
+++ /dev/null
@@ -1,49 +0,0 @@
-Import('*')
-
-env = drienv.Clone()
-
-env.Append(CPPPATH = [
- '#/src/loader',
- '#/src/mapi',
- '#/src/mesa',
- '#/src/mesa/drivers/dri/common',
- '#/src/gallium/state_trackers/dri',
-])
-
-env.Prepend(LIBS = [
- st_dri,
- ws_dri,
- trace,
- rbug,
- mesa,
- glsl,
- gallium,
- megadrivers_stub,
- dri_common,
-])
-
-if True:
- env.Append(CPPDEFINES = [
- 'GALLIUM_SOFTPIPE',
- 'GALLIUM_RBUG',
- 'GALLIUM_TRACE',
- ])
- env.Prepend(LIBS = [softpipe])
-
-if env['llvm']:
- env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
- env.Prepend(LIBS = [llvmpipe])
-
-swrast_sources = [
- 'swrast_drm_api.c'
-]
-
-module = env.LoadableModule(
- target ='swrast_dri.so',
- source = swrast_sources,
- SHLIBPREFIX = '',
-)
-
-module = env.InstallSharedLibrary(module)
-
-env.Alias('dri-swrast', module)
diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c
deleted file mode 100644
index 102d5bd1a38..00000000000
--- a/src/gallium/targets/dri-swrast/swrast_drm_api.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2009, VMware, Inc.
- * All Rights Reserved.
- * Copyright 2010 George Sapountzis <[email protected]>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "pipe/p_compiler.h"
-#include "util/u_memory.h"
-
-#include "target-helpers/inline_debug_helper.h"
-#include "target-helpers/inline_sw_helper.h"
-
-#include "state_tracker/drm_driver.h"
-#include "sw/dri/dri_sw_winsys.h"
-#include "dri_screen.h"
-
-const __DRIextension **__driDriverGetExtensions_swrast(void);
-
-PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void)
-{
- globalDriverAPI = &galliumsw_driver_api;
- return galliumsw_driver_extensions;
-}
-
-DRM_DRIVER_DESCRIPTOR("swrast", NULL, NULL, NULL);
-
-struct pipe_screen *
-drisw_create_screen(struct drisw_loader_funcs *lf)
-{
- struct sw_winsys *winsys = NULL;
- struct pipe_screen *screen = NULL;
-
- winsys = dri_create_sw_winsys(lf);
- if (winsys == NULL)
- return NULL;
-
- screen = sw_screen_create(winsys);
- if (!screen)
- goto fail;
-
- screen = debug_screen_wrap(screen);
-
- return screen;
-
-fail:
- if (winsys)
- winsys->destroy(winsys);
-
- return NULL;
-}
-
-/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am
index 4da3e71d6af..61d6bc7aa3e 100644
--- a/src/gallium/targets/dri/Makefile.am
+++ b/src/gallium/targets/dri/Makefile.am
@@ -140,6 +140,20 @@ STATIC_TARGET_LIB_DEPS += \
endif
+if HAVE_GALLIUM_SOFTPIPE
+MEGADRIVERS += swrast
+STATIC_TARGET_CPPFLAGS += -DGALLIUM_SOFTPIPE
+STATIC_TARGET_LIB_DEPS += \
+ $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
+ $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
+endif
+
+if NEED_GALLIUM_LLVMPIPE_DRIVER
+STATIC_TARGET_CPPFLAGS += -DGALLIUM_LLVMPIPE
+STATIC_TARGET_LIB_DEPS += \
+ $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
+endif
+
gallium_dri_la_SOURCES += target.c
AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS)
gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS)
diff --git a/src/gallium/targets/dri/SConscript b/src/gallium/targets/dri/SConscript
index 27e2047740e..faf370f2c34 100644
--- a/src/gallium/targets/dri/SConscript
+++ b/src/gallium/targets/dri/SConscript
@@ -18,11 +18,16 @@ if env['build'] == 'release':
env.Append(CPPDEFINES = ['GALLIUM_RBUG'])
env.Prepend(LIBS = [rbug])
else:
- env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_RBUG', 'GALLIUM_GALAHAD', 'GALLIUM_SOFTPIPE'])
- env.Prepend(LIBS = [trace, rbug, galahad, softpipe, ws_wrapper])
+ env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_RBUG', 'GALLIUM_GALAHAD'])
+ env.Prepend(LIBS = [trace, rbug, galahad])
+
+if env['llvm']:
+ env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
+ env.Prepend(LIBS = [llvmpipe])
env.Append(CPPDEFINES = [
'GALLIUM_VMWGFX',
+ 'GALLIUM_SOFTPIPE',
'DRI_TARGET',
])
@@ -30,6 +35,8 @@ env.Prepend(LIBS = [
st_dri,
svgadrm,
svga,
+ ws_dri,
+ softpipe,
libloader,
mesa,
glsl,
@@ -39,9 +46,15 @@ env.Prepend(LIBS = [
])
module = env.LoadableModule(
- target = 'vmwgfx_dri.so',
+ target = 'gallium_dri.so',
source = 'target.c',
SHLIBPREFIX = '',
)
+# vmwgfx_dri.so
+env.Command('vmwgfx_dri.so', 'gallium_dri.so', "ln -f ${SOURCE} ${TARGET}")
+# swrast_dri.so
+env.Command('swrast_dri.so', 'gallium_dri.so', "ln -f ${SOURCE} ${TARGET}")
+
env.Alias('dri-vmwgfx', module)
+env.Alias('dri-swrast', module)
diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c
index fde4a4a7dcf..32a11ef6281 100644
--- a/src/gallium/targets/dri/target.c
+++ b/src/gallium/targets/dri/target.c
@@ -1 +1,2 @@
#include "target-helpers/inline_drm_helper.h"
+#include "target-helpers/inline_sw_helper.h"