diff options
author | Dave Airlie <[email protected]> | 2016-10-14 07:12:33 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-10-19 10:15:43 +1000 |
commit | 3f7ef2488938d31b5ead043891fadc3cee4c6f05 (patch) | |
tree | e8ca48ce50b09485f1d0df789192394749dfd3e7 | |
parent | ec0bc14a700c2503d834ac0763f4cfbe312998fa (diff) |
anv: move to using shared wsi code
This moves the shared code to a common subdirectory
and makes anv linked to that code instead of the copy
it was using.
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/intel/vulkan/Makefile.am | 2 | ||||
-rw-r--r-- | src/intel/vulkan/Makefile.sources | 9 | ||||
-rw-r--r-- | src/vulkan/wsi/Makefile.am | 49 | ||||
-rw-r--r-- | src/vulkan/wsi/Makefile.sources | 11 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common.h (renamed from src/intel/vulkan/wsi_common.h) | 0 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_wayland.c (renamed from src/intel/vulkan/wsi_common_wayland.c) | 3 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_wayland.h (renamed from src/intel/vulkan/wsi_common_wayland.h) | 0 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_x11.c (renamed from src/intel/vulkan/wsi_common_x11.c) | 5 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_x11.h (renamed from src/intel/vulkan/wsi_common_x11.h) | 0 |
11 files changed, 78 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 8e779d4de9d..7e63bfa6ca0 100644 --- a/configure.ac +++ b/configure.ac @@ -2631,6 +2631,8 @@ VA_MINOR=`$PKG_CONFIG --modversion libva | $SED -n 's/.*\.\(.*\)\..*$/\1/p'` AC_SUBST([VA_MAJOR], $VA_MAJOR) AC_SUBST([VA_MINOR], $VA_MINOR) +AM_CONDITIONAL(HAVE_VULKAN_COMMON, test "x$VULKAN_DRIVERS" != "x") + AC_SUBST([XVMC_MAJOR], 1) AC_SUBST([XVMC_MINOR], 0) @@ -2789,7 +2791,8 @@ AC_CONFIG_FILES([Makefile src/mesa/drivers/x11/Makefile src/mesa/main/tests/Makefile src/util/Makefile - src/util/tests/hash_table/Makefile]) + src/util/tests/hash_table/Makefile + src/vulkan/wsi/Makefile]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index b63d135fcc7..1347120f186 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -115,6 +115,10 @@ if HAVE_INTEL_DRIVERS SUBDIRS += intel/tools endif +if HAVE_VULKAN_COMMON +SUBDIRS += vulkan/wsi +endif + ## Requires the i965 compiler (part of mesa) and wayland-drm if HAVE_INTEL_VULKAN SUBDIRS += intel/vulkan diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am index 54a51be7392..5d2b3a52582 100644 --- a/src/intel/vulkan/Makefile.am +++ b/src/intel/vulkan/Makefile.am @@ -49,6 +49,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/src \ -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/vulkan/wsi \ -I$(top_builddir)/src/compiler \ -I$(top_srcdir)/src/compiler \ -I$(top_builddir)/src/compiler/nir \ @@ -116,6 +117,7 @@ libvulkan_common_la_SOURCES = $(VULKAN_SOURCES) VULKAN_LIB_DEPS += \ libvulkan_common.la \ + $(top_builddir)/src/vulkan/wsi/libvulkan_wsi.la \ $(top_builddir)/src/mesa/drivers/dri/i965/libi965_compiler.la \ $(top_builddir)/src/compiler/nir/libnir.la \ $(top_builddir)/src/util/libmesautil.la \ diff --git a/src/intel/vulkan/Makefile.sources b/src/intel/vulkan/Makefile.sources index 62205d41db2..c51c146d7d9 100644 --- a/src/intel/vulkan/Makefile.sources +++ b/src/intel/vulkan/Makefile.sources @@ -42,19 +42,14 @@ VULKAN_FILES := \ anv_query.c \ anv_util.c \ anv_wsi.c \ - wsi_common.h \ genX_pipeline_util.h \ vk_format_info.h VULKAN_WSI_WAYLAND_FILES := \ - anv_wsi_wayland.c \ - wsi_common_wayland.c \ - wsi_common_wayland.h + anv_wsi_wayland.c VULKAN_WSI_X11_FILES := \ - anv_wsi_x11.c \ - wsi_common_x11.c \ - wsi_common_x11.h + anv_wsi_x11.c VULKAN_GEM_FILES := \ anv_gem.c diff --git a/src/vulkan/wsi/Makefile.am b/src/vulkan/wsi/Makefile.am new file mode 100644 index 00000000000..50a7401eeb9 --- /dev/null +++ b/src/vulkan/wsi/Makefile.am @@ -0,0 +1,49 @@ + +include Makefile.sources + +vulkan_includedir = $(includedir)/vulkan + +noinst_LTLIBRARIES = libvulkan_wsi.la + +AM_CPPFLAGS = \ + $(DEFINES) \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/src \ + -I$(top_srcdir)/src/gallium/auxiliary \ + -I$(top_srcdir)/src/gallium/include + +AM_CFLAGS = \ + $(VISIBILITY_CFLAGS) + +VULKAN_LIB_DEPS = + +VULKAN_WSI_SOURCES = \ + $(VULKAN_WSI_FILES) + +if HAVE_PLATFORM_X11 +AM_CPPFLAGS += \ + $(XCB_DRI3_CFLAGS) \ + -DVK_USE_PLATFORM_XCB_KHR \ + -DVK_USE_PLATFORM_XLIB_KHR + +VULKAN_WSI_SOURCES += $(VULKAN_WSI_X11_FILES) + +# FIXME: Use pkg-config for X11-xcb ldflags. +VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb +endif + +if HAVE_PLATFORM_WAYLAND +AM_CPPFLAGS += \ + -I$(top_builddir)/src/egl/wayland/wayland-drm \ + -I$(top_srcdir)/src/egl/wayland/wayland-drm \ + $(WAYLAND_CFLAGS) \ + -DVK_USE_PLATFORM_WAYLAND_KHR + +VULKAN_WSI_SOURCES += $(VULKAN_WSI_WAYLAND_FILES) + +VULKAN_LIB_DEPS += \ + $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \ + $(WAYLAND_LIBS) +endif + +libvulkan_wsi_la_SOURCES = $(VULKAN_WSI_SOURCES) diff --git a/src/vulkan/wsi/Makefile.sources b/src/vulkan/wsi/Makefile.sources new file mode 100644 index 00000000000..3139e6dbb7e --- /dev/null +++ b/src/vulkan/wsi/Makefile.sources @@ -0,0 +1,11 @@ + +VULKAN_WSI_FILES := \ + wsi_common.h + +VULKAN_WSI_WAYLAND_FILES := \ + wsi_common_wayland.c \ + wsi_common_wayland.h + +VULKAN_WSI_X11_FILES := \ + wsi_common_x11.c \ + wsi_common_x11.h
\ No newline at end of file diff --git a/src/intel/vulkan/wsi_common.h b/src/vulkan/wsi/wsi_common.h index ee675119302..ee675119302 100644 --- a/src/intel/vulkan/wsi_common.h +++ b/src/vulkan/wsi/wsi_common.h diff --git a/src/intel/vulkan/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index fc6775acb79..32a0a51349d 100644 --- a/src/intel/vulkan/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -24,6 +24,7 @@ #include <wayland-client.h> #include <wayland-drm-client-protocol.h> +#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -31,7 +32,7 @@ #include <string.h> #include "wsi_common_wayland.h" -#include "vk_format_info.h" + #include <util/hash_table.h> #include <util/u_vector.h> diff --git a/src/intel/vulkan/wsi_common_wayland.h b/src/vulkan/wsi/wsi_common_wayland.h index effba0ebba4..effba0ebba4 100644 --- a/src/intel/vulkan/wsi_common_wayland.h +++ b/src/vulkan/wsi/wsi_common_wayland.h diff --git a/src/intel/vulkan/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 02b6eb6b7c7..b5832c685e6 100644 --- a/src/intel/vulkan/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -27,12 +27,15 @@ #include <xcb/dri3.h> #include <xcb/present.h> -#include "util/hash_table.h" +#include "util/macros.h" #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> + +#include "util/hash_table.h" + #include "wsi_common.h" #include "wsi_common_x11.h" diff --git a/src/intel/vulkan/wsi_common_x11.h b/src/vulkan/wsi/wsi_common_x11.h index 7166f099fdb..7166f099fdb 100644 --- a/src/intel/vulkan/wsi_common_x11.h +++ b/src/vulkan/wsi/wsi_common_x11.h |