From 0bdc3e1afda111c5741a699da3ff891fedfe89de Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sat, 21 Jun 2014 12:50:10 +0100 Subject: 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 Tested-by: Rob Clark Tested-by: Thomas Helland Acked-by: Tom Stellard --- src/gallium/targets/Makefile.am | 10 ++-- src/gallium/targets/dri-swrast/Makefile.am | 55 ------------------ src/gallium/targets/dri-swrast/SConscript | 49 ---------------- src/gallium/targets/dri-swrast/swrast_drm_api.c | 74 ------------------------- src/gallium/targets/dri/Makefile.am | 14 +++++ src/gallium/targets/dri/SConscript | 19 ++++++- src/gallium/targets/dri/target.c | 1 + 7 files changed, 35 insertions(+), 187 deletions(-) delete mode 100644 src/gallium/targets/dri-swrast/Makefile.am delete mode 100644 src/gallium/targets/dri-swrast/SConscript delete mode 100644 src/gallium/targets/dri-swrast/swrast_drm_api.c (limited to 'src/gallium/targets') 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 - * - * 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" -- cgit v1.2.3