targets/dri-vmwgfx: Convert to static/shared pipe-drivers
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 16 Jun 2014 12:50:01 +0000 (13:50 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 2 Jul 2014 09:52:53 +0000 (10:52 +0100)
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 <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
configure.ac
src/gallium/SConscript
src/gallium/state_trackers/dri/drm/SConscript
src/gallium/targets/Makefile.am
src/gallium/targets/dri-vmwgfx/Makefile.am [deleted file]
src/gallium/targets/dri-vmwgfx/SConscript [deleted file]
src/gallium/targets/dri-vmwgfx/target.c [deleted file]
src/gallium/targets/dri-vmwgfx/vmw_powf.c [deleted file]
src/gallium/targets/dri/Makefile.am
src/gallium/targets/dri/SConscript [new file with mode: 0644]

index 9e5efcbfd8f676a6d4db1b1ce432617fb30cc501..4646212be8ac27a33f58b234646fef7afe1d01ab 100644 (file)
@@ -1919,7 +1919,7 @@ if test -n "$with_gallium_drivers"; then
             HAVE_GALLIUM_SVGA=yes
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
             gallium_require_drm_loader
-            gallium_check_st "svga/drm" "dri-vmwgfx" "xa/vmwgfx"
+            gallium_check_st "svga/drm" "dri/vmwgfx" "xa/vmwgfx"
             ;;
         xi915)
             HAVE_GALLIUM_I915=yes
@@ -2209,7 +2209,6 @@ AC_CONFIG_FILES([Makefile
                src/gallium/state_trackers/xvmc/Makefile
                src/gallium/targets/Makefile
                src/gallium/targets/dri-swrast/Makefile
-               src/gallium/targets/dri-vmwgfx/Makefile
                src/gallium/targets/dri/Makefile
                src/gallium/targets/egl-static/Makefile
                src/gallium/targets/gbm/Makefile
index 598b2f1ecb9313dd2a0cf123f8124cc679a839fc..df71b9aeada7daf9aa09d43862de58913305a863 100644 (file)
@@ -108,7 +108,7 @@ if not env['embedded']:
     if env['dri']:
         SConscript([
             'targets/dri-swrast/SConscript',
-            'targets/dri-vmwgfx/SConscript',
+            'targets/dri/SConscript',
         ])
 
 
index 258f7eed702caf01b3097c43182d2f0a08d12151..761603942c391bbdbcfe643737ac53de45fc385d 100644 (file)
@@ -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',
index 3e5d8e736d3c52a9e894ec6a3a32f85a87dd6404..5e0ecc34a77e8c816c66d6c1b4233665d45357e2 100644 (file)
@@ -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 (file)
index 58a3630..0000000
+++ /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 (file)
index 0d19944..0000000
+++ /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 (file)
index e3fbda1..0000000
+++ /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 (file)
index ca5e39b..0000000
+++ /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
index 613b798c393c060e2ef161f47c2268a3f92170ad..2c100ff3d7addcc16e5b38886b54c76cce24d5fc 100644 (file)
@@ -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 (file)
index 0000000..9908b51
--- /dev/null
@@ -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)