Commit c642e87d authored by Emil Velikov's avatar Emil Velikov

auxiliary/vl: rework the build of the VL code

Rather than shoving all the VL code for non-VL targets, increasing
their size, just split it out and use it when needed. This gives us
the side effect of building vl_winsys_dri.c once, dropping a few
automake warnings, and reducing the size of the dri modules as below

   text    data     bss     dec     hex filename
5850573  187549 1977928 8016050  7a50b2 before/nouveau_dri.so
5508486  187100  391240 6086826  5ce0aa after/nouveau_dri.so

The above data is for a nouveau + swrast + kms_swrast 'megadriver'.

v2: Do not include the vl sources in the auxiliary library.
v3: Rebase. Add nine.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
parent 86a51eb8
......@@ -30,7 +30,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(C_SOURCES) \
$(VL_SOURCES)
$(VL_STUB_SOURCES)
LOCAL_C_INCLUDES := \
$(GALLIUM_TOP)/auxiliary/util \
......
......@@ -18,7 +18,6 @@ AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
libgallium_la_SOURCES = \
$(C_SOURCES) \
$(VL_SOURCES) \
$(GENERATED_SOURCES)
if HAVE_MESA_LLVM
......@@ -52,6 +51,28 @@ noinst_LTLIBRARIES += libgalliumvl_stub.la
libgalliumvl_stub_la_SOURCES = \
$(VL_STUB_SOURCES)
if NEED_GALLIUM_VL
noinst_LTLIBRARIES += libgalliumvl.la
libgalliumvl_la_CFLAGS = \
$(AM_CFLAGS) \
$(VL_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
if HAVE_GALLIUM_STATIC_TARGETS
libgalliumvl_la_CFLAGS += \
-DGALLIUM_STATIC_TARGETS=1
endif # HAVE_GALLIUM_STATIC_TARGETS
libgalliumvl_la_SOURCES = \
$(VL_SOURCES)
endif
EXTRA_DIST = \
Android.mk SConscript \
indices/u_indices.c \
......@@ -62,5 +83,4 @@ EXTRA_DIST = \
util/u_format.csv \
util/u_format_pack.py \
util/u_format_parse.py \
util/u_format_table.py \
vl/vl_winsys_dri.c
util/u_format_table.py
......@@ -335,6 +335,7 @@ VL_SOURCES := \
vl/vl_video_buffer.h \
vl/vl_vlc.h \
vl/vl_winsys.h \
vl/vl_winsys_dri.c \
vl/vl_zscan.c \
vl/vl_zscan.h
......
......@@ -36,7 +36,7 @@ env.Depends('util/u_format_table.c', [
source = env.ParseSourceList('Makefile.sources', [
'C_SOURCES',
'VL_SOURCES',
'VL_STUB_SOURCES',
'GENERATED_SOURCES'
])
......
......@@ -72,6 +72,7 @@ d3dadapter9_la_LDFLAGS += \
endif # HAVE_LD_VERSION_SCRIPT
d3dadapter9_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/nine/libninetracker.la \
$(top_builddir)/src/util/libmesautil.la \
......
......@@ -43,6 +43,7 @@ gallium_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/auxiliary/libgalliumvl_stub.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
......
......@@ -65,6 +65,7 @@ egl_gallium_la_SOURCES = \
egl_gallium_la_LIBADD = \
$(top_builddir)/src/loader/libloader.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/identity/libidentity.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
......
......@@ -33,6 +33,7 @@ gbm_gallium_drm_la_SOURCES =
gbm_gallium_drm_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(LIBDRM_LIBS) \
......
include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
$(VL_CFLAGS) \
$(GALLIUM_TARGET_CFLAGS)
omxdir = $(OMX_LIB_INSTALL_DIR)
omx_LTLIBRARIES = libomx_mesa.la
nodist_EXTRA_libomx_mesa_la_SOURCES = dummy.cpp
libomx_mesa_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
libomx_mesa_la_SOURCES =
libomx_mesa_la_LDFLAGS = \
-shared \
......@@ -26,6 +24,7 @@ endif # HAVE_LD_VERSION_SCRIPT
libomx_mesa_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/omx/libomxtracker.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(OMX_LIBS) \
......@@ -48,16 +47,12 @@ include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
libomx_mesa_la_SOURCES += target.c
libomx_mesa_la_CPPFLAGS = $(TARGET_CPPFLAGS) -DGALLIUM_STATIC_TARGETS=1
libomx_mesa_la_CPPFLAGS = $(TARGET_CPPFLAGS)
libomx_mesa_la_LIBADD += $(TARGET_LIB_DEPS) \
$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
else # HAVE_GALLIUM_STATIC_TARGETS
libomx_mesa_la_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
libomx_mesa_la_LIBADD += \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
$(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
......
......@@ -36,9 +36,19 @@ AM_CPPFLAGS = \
pipedir = $(libdir)/gallium-pipe
pipe_LTLIBRARIES =
PIPE_LIBS = \
PIPE_LIBS =
if NEED_GALLIUM_VL
PIPE_LIBS += \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la
else
PIPE_LIBS += \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la
endif
PIPE_LIBS += \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(top_builddir)/src/util/libmesautil.la \
$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
......
include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
$(VL_CFLAGS) \
$(GALLIUM_TARGET_CFLAGS)
vadir = $(VA_LIB_INSTALL_DIR)
va_LTLIBRARIES = gallium_drv_video.la
nodist_EXTRA_gallium_drv_video_la_SOURCES = dummy.cpp
gallium_drv_video_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
gallium_drv_video_la_SOURCES =
gallium_drv_video_la_LDFLAGS = \
-shared \
......@@ -27,6 +25,7 @@ endif # HAVE_LD_VERSION_SCRIPT
# NOTE: gallium_drv_video does not use(link against) libva
gallium_drv_video_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/va/libvatracker.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(VL_LIBS) \
......@@ -45,16 +44,12 @@ include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
gallium_drv_video_la_SOURCES += target.c
gallium_drv_video_la_CPPFLAGS = $(TARGET_CPPFLAGS) -DGALLIUM_STATIC_TARGETS=1
gallium_drv_video_la_CPPFLAGS = $(TARGET_CPPFLAGS)
gallium_drv_video_la_LIBADD += $(TARGET_LIB_DEPS) \
$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
else # HAVE_GALLIUM_STATIC_TARGETS
gallium_drv_video_la_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
gallium_drv_video_la_LIBADD += \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
$(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
......
include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
$(VL_CFLAGS) \
$(GALLIUM_TARGET_CFLAGS)
vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
vdpau_LTLIBRARIES = libvdpau_gallium.la
nodist_EXTRA_libvdpau_gallium_la_SOURCES = dummy.cpp
libvdpau_gallium_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
libvdpau_gallium_la_SOURCES =
libvdpau_gallium_la_LDFLAGS = \
-shared \
......@@ -32,6 +30,7 @@ endif # HAVE_LD_DYNAMIC_LIST
# NOTE: libvdpau_gallium does not use(link against) libvdpau
libvdpau_gallium_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(VL_LIBS) \
......@@ -55,16 +54,12 @@ include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
if HAVE_GALLIUM_STATIC_TARGETS
libvdpau_gallium_la_SOURCES += target.c
libvdpau_gallium_la_CPPFLAGS = $(TARGET_CPPFLAGS) -DGALLIUM_STATIC_TARGETS=1
libvdpau_gallium_la_CPPFLAGS = $(TARGET_CPPFLAGS)
libvdpau_gallium_la_LIBADD += $(TARGET_LIB_DEPS) \
$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
else # HAVE_GALLIUM_STATIC_TARGETS
libvdpau_gallium_la_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
libvdpau_gallium_la_LIBADD += \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
$(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
......
......@@ -35,6 +35,7 @@ libxatracker_la_SOURCES =
libxatracker_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/xa/libxatracker.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(LIBDRM_LIBS) \
......
include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
$(VL_CFLAGS) \
$(GALLIUM_TARGET_CFLAGS)
xvmcdir = $(XVMC_LIB_INSTALL_DIR)
xvmc_LTLIBRARIES = libXvMCgallium.la
nodist_EXTRA_libXvMCgallium_la_SOURCES = dummy.cpp
libXvMCgallium_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
libXvMCgallium_la_SOURCES =
libXvMCgallium_la_LDFLAGS = \
-shared \
......@@ -26,6 +24,7 @@ endif # HAVE_LD_VERSION_SCRIPT
libXvMCgallium_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/util/libmesautil.la \
$(XVMC_LIBS) \
......@@ -46,16 +45,11 @@ include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
if HAVE_GALLIUM_STATIC_TARGETS
libXvMCgallium_la_SOURCES += target.c
libXvMCgallium_la_CPPFLAGS = $(TARGET_CPPFLAGS) -DGALLIUM_STATIC_TARGETS=1
libXvMCgallium_la_CPPFLAGS = $(TARGET_CPPFLAGS)
libXvMCgallium_la_LIBADD += $(TARGET_LIB_DEPS) \
$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
else # HAVE_GALLIUM_STATIC_TARGETS
libXvMCgallium_la_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
# XXX: Use the pipe-loader-client over pipe-loader ?
libXvMCgallium_la_LIBADD += \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment