From 37b7a76266a2a620dd760624c451f83de2147fe4 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 16 Jun 2014 13:50:01 +0100 Subject: targets/dri-vmwgfx: Convert to static/shared pipe-drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert the final hardware driver to a single dri provider which includes all the pipe-drivers. Update the scons build and drop the unused vmw_powf.c. Cc: José Fonseca Cc: Brian Paul Cc: Jakob Bornecrantz Signed-off-by: Emil Velikov Tested-by: Rob Clark Tested-by: Thomas Helland Acked-by: Tom Stellard --- src/gallium/SConscript | 2 +- src/gallium/state_trackers/dri/drm/SConscript | 2 +- src/gallium/targets/Makefile.am | 6 ---- src/gallium/targets/dri-vmwgfx/Makefile.am | 51 -------------------------- src/gallium/targets/dri-vmwgfx/SConscript | 33 ----------------- src/gallium/targets/dri-vmwgfx/target.c | 52 --------------------------- src/gallium/targets/dri-vmwgfx/vmw_powf.c | 17 --------- src/gallium/targets/dri/Makefile.am | 8 +++++ src/gallium/targets/dri/SConscript | 41 +++++++++++++++++++++ 9 files changed, 51 insertions(+), 161 deletions(-) delete mode 100644 src/gallium/targets/dri-vmwgfx/Makefile.am delete mode 100644 src/gallium/targets/dri-vmwgfx/SConscript delete mode 100644 src/gallium/targets/dri-vmwgfx/target.c delete mode 100644 src/gallium/targets/dri-vmwgfx/vmw_powf.c create mode 100644 src/gallium/targets/dri/SConscript (limited to 'src/gallium') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 598b2f1ecb9..df71b9aeada 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -108,7 +108,7 @@ if not env['embedded']: if env['dri']: SConscript([ 'targets/dri-swrast/SConscript', - 'targets/dri-vmwgfx/SConscript', + 'targets/dri/SConscript', ]) diff --git a/src/gallium/state_trackers/dri/drm/SConscript b/src/gallium/state_trackers/dri/drm/SConscript index 258f7eed702..761603942c3 100644 --- a/src/gallium/state_trackers/dri/drm/SConscript +++ b/src/gallium/state_trackers/dri/drm/SConscript @@ -15,7 +15,7 @@ env.Append(CPPPATH = [ xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h ]) -env.Append(CPPDEFINES = [('SPLIT_TARGETS', '1')]) +env.Append(CPPDEFINES = [('GALLIUM_STATIC_TARGETS', '1')]) st_dri = env.ConvenienceLibrary( target = 'st_dri', diff --git a/src/gallium/targets/Makefile.am b/src/gallium/targets/Makefile.am index 3e5d8e736d3..5e0ecc34a77 100644 --- a/src/gallium/targets/Makefile.am +++ b/src/gallium/targets/Makefile.am @@ -58,12 +58,6 @@ if HAVE_CLOVER SUBDIRS += opencl endif -if HAVE_GALLIUM_SVGA -if HAVE_DRI2 -SUBDIRS += dri-vmwgfx -endif -endif - if HAVE_GALLIUM_SOFTPIPE if HAVE_DRISW SUBDIRS += dri-swrast diff --git a/src/gallium/targets/dri-vmwgfx/Makefile.am b/src/gallium/targets/dri-vmwgfx/Makefile.am deleted file mode 100644 index 58a36306be8..00000000000 --- a/src/gallium/targets/dri-vmwgfx/Makefile.am +++ /dev/null @@ -1,51 +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 - -dridir = $(DRI_DRIVER_INSTALL_DIR) -dri_LTLIBRARIES = vmwgfx_dri.la - -nodist_EXTRA_vmwgfx_dri_la_SOURCES = dummy.cpp -vmwgfx_dri_la_SOURCES = \ - target.c \ - vmw_powf.c - -vmwgfx_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS) - -vmwgfx_dri_la_LIBADD = \ - $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \ - $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ - $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \ - $(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la \ - $(top_builddir)/src/gallium/drivers/trace/libtrace.la \ - $(top_builddir)/src/gallium/drivers/rbug/librbug.la \ - $(top_builddir)/src/gallium/drivers/svga/libsvga.la \ - $(GALLIUM_DRI_LIB_DEPS) - -include $(top_srcdir)/install-gallium-links.mk diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript deleted file mode 100644 index 0d19944f5c0..00000000000 --- a/src/gallium/targets/dri-vmwgfx/SConscript +++ /dev/null @@ -1,33 +0,0 @@ -Import('*') - -env = drienv.Clone() - -if env['suncc']: - print 'warning: not building dri-vmwgfx' - Return() - -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.Prepend(LIBS = [ - st_dri, - svgadrm, - svga, - mesa, - glsl, - gallium, - COMMON_DRI_DRM_OBJECTS -]) - -module = env.LoadableModule( - target = 'vmwgfx_dri.so', - source = 'target.c', - SHLIBPREFIX = '', -) - -env.Alias('dri-vmwgfx', module) diff --git a/src/gallium/targets/dri-vmwgfx/target.c b/src/gallium/targets/dri-vmwgfx/target.c deleted file mode 100644 index e3fbda1d665..00000000000 --- a/src/gallium/targets/dri-vmwgfx/target.c +++ /dev/null @@ -1,52 +0,0 @@ - -#include "target-helpers/inline_wrapper_sw_helper.h" -#include "target-helpers/inline_debug_helper.h" -#include "state_tracker/drm_driver.h" -#include "svga/drm/svga_drm_public.h" -#include "svga/svga_public.h" - -static struct pipe_screen * -create_screen(int fd) -{ - struct svga_winsys_screen *sws; - struct pipe_screen *screen; - - sws = svga_drm_winsys_screen_create(fd); - if (!sws) - return NULL; - - screen = svga_screen_create(sws); - if (!screen) - return NULL; - - screen = sw_screen_wrap(screen); - - screen = debug_screen_wrap(screen); - - return screen; -} - -static const struct drm_conf_ret throttle_ret = { - .type = DRM_CONF_INT, - .val.val_int = 2, -}; - -static const struct drm_conf_ret share_fd_ret = { - .type = DRM_CONF_BOOL, - .val.val_int = true, -}; - -static const struct drm_conf_ret *drm_configuration(enum drm_conf conf) -{ - switch (conf) { - case DRM_CONF_THROTTLE: - return &throttle_ret; - case DRM_CONF_SHARE_FD: - return &share_fd_ret; - default: - break; - } - return NULL; -} - -DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen, drm_configuration) diff --git a/src/gallium/targets/dri-vmwgfx/vmw_powf.c b/src/gallium/targets/dri-vmwgfx/vmw_powf.c deleted file mode 100644 index ca5e39b389a..00000000000 --- a/src/gallium/targets/dri-vmwgfx/vmw_powf.c +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Powf may leave an unresolved symbol pointing to a libstdc++.so powf. - * However, not all libstdc++.so include this function, so optionally - * replace the powf function with calls to expf and logf. - */ - -#ifdef VMW_RESOLVE_POWF - -extern float expf(float x); -extern float logf(float x); -extern float powf(float x, float y); - -float powf(float x, float y) { - return expf(logf(x)*y); -} - -#endif diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index 613b798c393..2c100ff3d7a 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -111,6 +111,14 @@ STATIC_TARGET_LIB_DEPS += \ $(RADEON_LIBS) endif +if HAVE_GALLIUM_SVGA +MEGADRIVERS += vmwgfx +STATIC_TARGET_CPPFLAGS += -DGALLIUM_VMWGFX +STATIC_TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \ + $(top_builddir)/src/gallium/drivers/svga/libsvga.la +endif + if HAVE_GALLIUM_FREEDRENO MEGADRIVERS += freedreno STATIC_TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO diff --git a/src/gallium/targets/dri/SConscript b/src/gallium/targets/dri/SConscript new file mode 100644 index 00000000000..9908b519fdb --- /dev/null +++ b/src/gallium/targets/dri/SConscript @@ -0,0 +1,41 @@ +Import('*') + +env = drienv.Clone() + +if env['suncc']: + print 'warning: not building dri-vmwgfx' + Return() + +env.Append(CPPPATH = [ + '#/src/loader', +]) + +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_VMWGFX', +]) + +env.Prepend(LIBS = [ + st_dri, + svgadrm, + svga, + libloader, + mesa, + glsl, + gallium, + COMMON_DRI_DRM_OBJECTS +]) + +module = env.LoadableModule( + target = 'vmwgfx_dri.so', + source = 'target.c', + SHLIBPREFIX = '', +) + +env.Alias('dri-vmwgfx', module) -- cgit v1.2.3