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 <jason@jlekstrand.net>
This commit is contained in:
Dave Airlie 2016-10-14 07:12:33 +01:00
parent ec0bc14a70
commit 3f7ef24889
11 changed files with 78 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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>

View File

@ -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"