diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-08-26 06:03:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-08-26 06:03:18 +0000 |
commit | af5e8f5366b05c3d4f8521f318c143a5c5dc3ea9 (patch) | |
tree | c5691445908b1beca9facf0e5e3c5d7f35f74228 /lib/mesa/src/gallium/winsys/amdgpu | |
parent | 27c93456b58343162f7c4ad20ca6bea0c9a91646 (diff) |
Merge Mesa 20.1.6
Diffstat (limited to 'lib/mesa/src/gallium/winsys/amdgpu')
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.am | 19 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.in | 864 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 114 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 84 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 141 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h | 22 |
9 files changed, 262 insertions, 988 deletions
diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.am b/lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.am deleted file mode 100644 index 1c2ec010f..000000000 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include Makefile.sources -include $(top_srcdir)/src/gallium/Automake.inc - -AM_CFLAGS = \ - $(GALLIUM_WINSYS_CFLAGS) \ - $(AMDGPU_CFLAGS) \ - $(LLVM_CFLAGS) \ - -I$(top_srcdir)/src/amd/ - -AM_CXXFLAGS = $(AM_CFLAGS) - -noinst_LTLIBRARIES = libamdgpuwinsys.la - -libamdgpuwinsys_la_LIBADD = \ - $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la - -libamdgpuwinsys_la_SOURCES = $(C_SOURCES) - -EXTRA_DIST = meson.build diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.in b/lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.in deleted file mode 100644 index 25f98c5a8..000000000 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/Makefile.in +++ /dev/null @@ -1,864 +0,0 @@ -# Makefile.in generated by automake 1.12.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.sources $(top_srcdir)/bin/depcomp \ - $(top_srcdir)/src/gallium/Automake.inc -@HAVE_LIBDRM_TRUE@am__append_1 = \ -@HAVE_LIBDRM_TRUE@ $(LIBDRM_LIBS) - -@HAVE_PLATFORM_ANDROID_TRUE@am__append_2 = \ -@HAVE_PLATFORM_ANDROID_TRUE@ $(ANDROID_LIBS) \ -@HAVE_PLATFORM_ANDROID_TRUE@ $(BACKTRACE_LIBS) - -@HAVE_DRISW_TRUE@am__append_3 = \ -@HAVE_DRISW_TRUE@ $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la - -@HAVE_DRISW_KMS_TRUE@am__append_4 = \ -@HAVE_DRISW_KMS_TRUE@ $(top_builddir)/src/gallium/winsys/sw/kms-dri/libswkmsdri.la \ -@HAVE_DRISW_KMS_TRUE@ $(LIBDRM_LIBS) - -subdir = src/gallium/winsys/amdgpu/drm -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ - $(top_srcdir)/m4/ax_check_gnu_make.m4 \ - $(top_srcdir)/m4/ax_check_python_mako_module.m4 \ - $(top_srcdir)/m4/ax_gcc_builtin.m4 \ - $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ - $(top_srcdir)/m4/ax_prog_bison.m4 \ - $(top_srcdir)/m4/ax_prog_flex.m4 \ - $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/VERSION $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libamdgpuwinsys_la_DEPENDENCIES = \ - $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la -am__objects_1 = amdgpu_bo.lo amdgpu_cs.lo amdgpu_surface.lo \ - amdgpu_winsys.lo -am_libamdgpuwinsys_la_OBJECTS = $(am__objects_1) -libamdgpuwinsys_la_OBJECTS = $(am_libamdgpuwinsys_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/bin/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libamdgpuwinsys_la_SOURCES) -DIST_SOURCES = $(libamdgpuwinsys_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDGPU_CFLAGS = @AMDGPU_CFLAGS@ -AMDGPU_LIBS = @AMDGPU_LIBS@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -ANDROID_CFLAGS = @ANDROID_CFLAGS@ -ANDROID_LIBS = @ANDROID_LIBS@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BACKTRACE_CFLAGS = @BACKTRACE_CFLAGS@ -BACKTRACE_LIBS = @BACKTRACE_LIBS@ -BSYMBOLIC = @BSYMBOLIC@ -CC = @CC@ -CCAS = @CCAS@ -CCASDEPMODE = @CCASDEPMODE@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CLANG_RESOURCE_DIR = @CLANG_RESOURCE_DIR@ -CLOCK_LIB = @CLOCK_LIB@ -CLOVER_STD_OVERRIDE = @CLOVER_STD_OVERRIDE@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXX11_CXXFLAGS = @CXX11_CXXFLAGS@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -D3D_DRIVER_INSTALL_DIR = @D3D_DRIVER_INSTALL_DIR@ -DEFINES = @DEFINES@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ -DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIGL_CFLAGS = @DRIGL_CFLAGS@ -DRIGL_LIBS = @DRIGL_LIBS@ -DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@ -DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@ -DRI_LIB_DEPS = @DRI_LIB_DEPS@ -DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGL_CFLAGS = @EGL_CFLAGS@ -EGL_LIB_DEPS = @EGL_LIB_DEPS@ -EGL_LIB_SUFFIX = @EGL_LIB_SUFFIX@ -EGL_NATIVE_PLATFORM = @EGL_NATIVE_PLATFORM@ -EGREP = @EGREP@ -ETNAVIV_CFLAGS = @ETNAVIV_CFLAGS@ -ETNAVIV_LIBS = @ETNAVIV_LIBS@ -EXEEXT = @EXEEXT@ -EXPAT_CFLAGS = @EXPAT_CFLAGS@ -EXPAT_LIBS = @EXPAT_LIBS@ -FGREP = @FGREP@ -GALLIUM_PIPE_LOADER_DEFINES = @GALLIUM_PIPE_LOADER_DEFINES@ -GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@ -GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@ -GC_SECTIONS = @GC_SECTIONS@ -GLES_LIB_SUFFIX = @GLES_LIB_SUFFIX@ -GLESv1_CM_LIB_DEPS = @GLESv1_CM_LIB_DEPS@ -GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@ -GLESv2_LIB_DEPS = @GLESv2_LIB_DEPS@ -GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@ -GLPROTO_CFLAGS = @GLPROTO_CFLAGS@ -GLPROTO_LIBS = @GLPROTO_LIBS@ -GLVND_CFLAGS = @GLVND_CFLAGS@ -GLVND_LIBS = @GLVND_LIBS@ -GLX_TLS = @GLX_TLS@ -GL_LIB = @GL_LIB@ -GL_LIB_DEPS = @GL_LIB_DEPS@ -GL_PC_CFLAGS = @GL_PC_CFLAGS@ -GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@ -GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@ -GL_PKGCONF_LIB = @GL_PKGCONF_LIB@ -GREP = @GREP@ -I915_CFLAGS = @I915_CFLAGS@ -I915_LIBS = @I915_LIBS@ -INDENT = @INDENT@ -INDENT_FLAGS = @INDENT_FLAGS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LD_BUILD_ID = @LD_BUILD_ID@ -LD_NO_UNDEFINED = @LD_NO_UNDEFINED@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBATOMIC_LIBS = @LIBATOMIC_LIBS@ -LIBCLC_INCLUDEDIR = @LIBCLC_INCLUDEDIR@ -LIBCLC_LIBEXECDIR = @LIBCLC_LIBEXECDIR@ -LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ -LIBDRM_LIBS = @LIBDRM_LIBS@ -LIBELF_CFLAGS = @LIBELF_CFLAGS@ -LIBELF_LIBS = @LIBELF_LIBS@ -LIBGLVND_DATADIR = @LIBGLVND_DATADIR@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSENSORS_LIBS = @LIBSENSORS_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ -LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ -LIB_DIR = @LIB_DIR@ -LIB_EXT = @LIB_EXT@ -LIPO = @LIPO@ -LLVM_CFLAGS = @LLVM_CFLAGS@ -LLVM_CONFIG = @LLVM_CONFIG@ -LLVM_CXXFLAGS = @LLVM_CXXFLAGS@ -LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@ -LLVM_LDFLAGS = @LLVM_LDFLAGS@ -LLVM_LIBS = @LLVM_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MSVC2013_COMPAT_CFLAGS = @MSVC2013_COMPAT_CFLAGS@ -MSVC2013_COMPAT_CXXFLAGS = @MSVC2013_COMPAT_CXXFLAGS@ -NINE_MAJOR = @NINE_MAJOR@ -NINE_MINOR = @NINE_MINOR@ -NINE_PATCH = @NINE_PATCH@ -NINE_VERSION = @NINE_VERSION@ -NM = @NM@ -NMEDIT = @NMEDIT@ -NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@ -NOUVEAU_LIBS = @NOUVEAU_LIBS@ -NVVIEUX_CFLAGS = @NVVIEUX_CFLAGS@ -NVVIEUX_LIBS = @NVVIEUX_LIBS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OMX_BELLAGIO_CFLAGS = @OMX_BELLAGIO_CFLAGS@ -OMX_BELLAGIO_LIBS = @OMX_BELLAGIO_LIBS@ -OMX_BELLAGIO_LIB_INSTALL_DIR = @OMX_BELLAGIO_LIB_INSTALL_DIR@ -OMX_TIZONIA_CFLAGS = @OMX_TIZONIA_CFLAGS@ -OMX_TIZONIA_LIBS = @OMX_TIZONIA_LIBS@ -OMX_TIZONIA_LIB_INSTALL_DIR = @OMX_TIZONIA_LIB_INSTALL_DIR@ -OPENCL_LIBNAME = @OPENCL_LIBNAME@ -OPENCL_VERSION = @OPENCL_VERSION@ -OSMESA_LIB = @OSMESA_LIB@ -OSMESA_LIB_DEPS = @OSMESA_LIB_DEPS@ -OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@ -OSMESA_PC_REQ = @OSMESA_PC_REQ@ -OSMESA_VERSION = @OSMESA_VERSION@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -POSIX_SHELL = @POSIX_SHELL@ -PTHREADSTUBS_CFLAGS = @PTHREADSTUBS_CFLAGS@ -PTHREADSTUBS_LIBS = @PTHREADSTUBS_LIBS@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -PWR8_CFLAGS = @PWR8_CFLAGS@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RADEON_CFLAGS = @RADEON_CFLAGS@ -RADEON_LIBS = @RADEON_LIBS@ -RANLIB = @RANLIB@ -RM = @RM@ -SCANNER_ARG = @SCANNER_ARG@ -SED = @SED@ -SELINUX_CFLAGS = @SELINUX_CFLAGS@ -SELINUX_LIBS = @SELINUX_LIBS@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIMPENROSE_CFLAGS = @SIMPENROSE_CFLAGS@ -SIMPENROSE_LIBS = @SIMPENROSE_LIBS@ -SSE41_CFLAGS = @SSE41_CFLAGS@ -STRIP = @STRIP@ -SWR_AVX2_CXXFLAGS = @SWR_AVX2_CXXFLAGS@ -SWR_AVX_CXXFLAGS = @SWR_AVX_CXXFLAGS@ -SWR_KNL_CXXFLAGS = @SWR_KNL_CXXFLAGS@ -SWR_SKX_CXXFLAGS = @SWR_SKX_CXXFLAGS@ -V3D_SIMULATOR_CFLAGS = @V3D_SIMULATOR_CFLAGS@ -V3D_SIMULATOR_LIBS = @V3D_SIMULATOR_LIBS@ -VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ -VALGRIND_LIBS = @VALGRIND_LIBS@ -VA_CFLAGS = @VA_CFLAGS@ -VA_LIBS = @VA_LIBS@ -VA_LIB_INSTALL_DIR = @VA_LIB_INSTALL_DIR@ -VA_MAJOR = @VA_MAJOR@ -VA_MINOR = @VA_MINOR@ -VC4_CFLAGS = @VC4_CFLAGS@ -VC4_LIBS = @VC4_LIBS@ -VDPAU_CFLAGS = @VDPAU_CFLAGS@ -VDPAU_LIBS = @VDPAU_LIBS@ -VDPAU_LIB_INSTALL_DIR = @VDPAU_LIB_INSTALL_DIR@ -VDPAU_MAJOR = @VDPAU_MAJOR@ -VDPAU_MINOR = @VDPAU_MINOR@ -VERSION = @VERSION@ -VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ -VISIBILITY_CXXFLAGS = @VISIBILITY_CXXFLAGS@ -VL_CFLAGS = @VL_CFLAGS@ -VL_LIBS = @VL_LIBS@ -VULKAN_ICD_INSTALL_DIR = @VULKAN_ICD_INSTALL_DIR@ -WAYLAND_CLIENT_CFLAGS = @WAYLAND_CLIENT_CFLAGS@ -WAYLAND_CLIENT_LIBS = @WAYLAND_CLIENT_LIBS@ -WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ -WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ -WAYLAND_PROTOCOLS_CFLAGS = @WAYLAND_PROTOCOLS_CFLAGS@ -WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ -WAYLAND_PROTOCOLS_LIBS = @WAYLAND_PROTOCOLS_LIBS@ -WAYLAND_SCANNER = @WAYLAND_SCANNER@ -WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ -WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ -WAYLAND_SERVER_CFLAGS = @WAYLAND_SERVER_CFLAGS@ -WAYLAND_SERVER_LIBS = @WAYLAND_SERVER_LIBS@ -WNO_OVERRIDE_INIT = @WNO_OVERRIDE_INIT@ -X11_INCLUDES = @X11_INCLUDES@ -XA_MAJOR = @XA_MAJOR@ -XA_MINOR = @XA_MINOR@ -XA_PATCH = @XA_PATCH@ -XA_VERSION = @XA_VERSION@ -XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@ -XCB_DRI2_LIBS = @XCB_DRI2_LIBS@ -XCB_DRI3_CFLAGS = @XCB_DRI3_CFLAGS@ -XCB_DRI3_LIBS = @XCB_DRI3_LIBS@ -XCB_DRI3_MODIFIERS_CFLAGS = @XCB_DRI3_MODIFIERS_CFLAGS@ -XCB_DRI3_MODIFIERS_LIBS = @XCB_DRI3_MODIFIERS_LIBS@ -XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@ -XCB_RANDR_LIBS = @XCB_RANDR_LIBS@ -XLIBGL_CFLAGS = @XLIBGL_CFLAGS@ -XLIBGL_LIBS = @XLIBGL_LIBS@ -XLIB_RANDR_CFLAGS = @XLIB_RANDR_CFLAGS@ -XLIB_RANDR_LIBS = @XLIB_RANDR_LIBS@ -XVMC_CFLAGS = @XVMC_CFLAGS@ -XVMC_LIBS = @XVMC_LIBS@ -XVMC_LIB_INSTALL_DIR = @XVMC_LIB_INSTALL_DIR@ -XVMC_MAJOR = @XVMC_MAJOR@ -XVMC_MINOR = @XVMC_MINOR@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -acv_mako_found = @acv_mako_found@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_pthread_config = @ax_pthread_config@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -ifGNUmake = @ifGNUmake@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -C_SOURCES := \ - amdgpu_bo.c \ - amdgpu_bo.h \ - amdgpu_cs.c \ - amdgpu_cs.h \ - amdgpu_public.h \ - amdgpu_surface.c \ - amdgpu_winsys.c \ - amdgpu_winsys.h - -GALLIUM_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - $(DEFINES) - - -# src/gallium/auxiliary must appear before src/gallium/drivers -# because there are stupidly two rbug_context.h files in -# different directories, and which one is included by the -# preprocessor is determined by the ordering of the -I flags. -GALLIUM_DRIVER_CFLAGS = \ - -I$(srcdir)/include \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - -I$(top_srcdir)/src/gallium/drivers \ - -I$(top_srcdir)/src/gallium/winsys \ - $(DEFINES) \ - $(VISIBILITY_CFLAGS) - -GALLIUM_DRIVER_CXXFLAGS = \ - -I$(srcdir)/include \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - -I$(top_srcdir)/src/gallium/drivers \ - -I$(top_srcdir)/src/gallium/winsys \ - $(DEFINES) \ - $(VISIBILITY_CXXFLAGS) - -GALLIUM_TARGET_CFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/loader \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - -I$(top_srcdir)/src/gallium/drivers \ - -I$(top_srcdir)/src/gallium/winsys \ - -I$(top_builddir)/src/util/ \ - -I$(top_builddir)/src/gallium/drivers/ \ - $(DEFINES) \ - $(PTHREAD_CFLAGS) \ - $(LIBDRM_CFLAGS) \ - $(VISIBILITY_CFLAGS) - -GALLIUM_COMMON_LIB_DEPS = -lm $(LIBUNWIND_LIBS) $(LIBSENSORS_LIBS) \ - $(CLOCK_LIB) $(PTHREAD_LIBS) $(DLOPEN_LIBS) $(am__append_1) \ - $(am__append_2) -GALLIUM_WINSYS_CFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - $(DEFINES) \ - $(VISIBILITY_CFLAGS) - -GALLIUM_PIPE_LOADER_WINSYS_LIBS = \ - $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \ - $(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la \ - $(am__append_3) $(am__append_4) -AM_CFLAGS = \ - $(GALLIUM_WINSYS_CFLAGS) \ - $(AMDGPU_CFLAGS) \ - $(LLVM_CFLAGS) \ - -I$(top_srcdir)/src/amd/ - -AM_CXXFLAGS = $(AM_CFLAGS) -noinst_LTLIBRARIES = libamdgpuwinsys.la -libamdgpuwinsys_la_LIBADD = \ - $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la - -libamdgpuwinsys_la_SOURCES = $(C_SOURCES) -EXTRA_DIST = meson.build -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.sources $(top_srcdir)/src/gallium/Automake.inc $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gallium/winsys/amdgpu/drm/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/gallium/winsys/amdgpu/drm/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(srcdir)/Makefile.sources $(top_srcdir)/src/gallium/Automake.inc: - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libamdgpuwinsys.la: $(libamdgpuwinsys_la_OBJECTS) $(libamdgpuwinsys_la_DEPENDENCIES) $(EXTRA_libamdgpuwinsys_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libamdgpuwinsys_la_OBJECTS) $(libamdgpuwinsys_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amdgpu_bo.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amdgpu_cs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amdgpu_surface.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amdgpu_winsys.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 7ff84cfb1..ec2fa3a56 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -27,18 +27,15 @@ #include "amdgpu_cs.h" +#include "util/hash_table.h" #include "util/os_time.h" #include "util/u_hash_table.h" #include "state_tracker/drm_driver.h" -#include <amdgpu_drm.h> +#include "drm-uapi/amdgpu_drm.h" #include <xf86drm.h> #include <stdio.h> #include <inttypes.h> -#ifndef AMDGPU_GEM_CREATE_VM_ALWAYS_VALID -#define AMDGPU_GEM_CREATE_VM_ALWAYS_VALID (1 << 6) -#endif - #ifndef AMDGPU_VA_RANGE_HIGH #define AMDGPU_VA_RANGE_HIGH 0x2 #endif @@ -151,6 +148,12 @@ static enum radeon_bo_domain amdgpu_bo_get_initial_domain( return ((struct amdgpu_winsys_bo*)buf)->initial_domain; } +static enum radeon_bo_flag amdgpu_bo_get_flags( + struct pb_buffer *buf) +{ + return ((struct amdgpu_winsys_bo*)buf)->flags; +} + static void amdgpu_bo_remove_fences(struct amdgpu_winsys_bo *bo) { for (unsigned i = 0; i < bo->num_fences; ++i) @@ -164,6 +167,7 @@ static void amdgpu_bo_remove_fences(struct amdgpu_winsys_bo *bo) void amdgpu_bo_destroy(struct pb_buffer *_buf) { struct amdgpu_winsys_bo *bo = amdgpu_winsys_bo(_buf); + struct amdgpu_screen_winsys *sws_iter; struct amdgpu_winsys *ws = bo->ws; assert(bo->bo && "must not be called for slab entries"); @@ -176,13 +180,31 @@ void amdgpu_bo_destroy(struct pb_buffer *_buf) if (ws->debug_all_bos) { simple_mtx_lock(&ws->global_bo_list_lock); - LIST_DEL(&bo->u.real.global_list_item); + list_del(&bo->u.real.global_list_item); ws->num_buffers--; simple_mtx_unlock(&ws->global_bo_list_lock); } + /* Close all KMS handles retrieved for other DRM file descriptions */ + simple_mtx_lock(&ws->sws_list_lock); + for (sws_iter = ws->sws_list; sws_iter; sws_iter = sws_iter->next) { + struct hash_entry *entry; + + if (!sws_iter->kms_handles) + continue; + + entry = _mesa_hash_table_search(sws_iter->kms_handles, bo); + if (entry) { + struct drm_gem_close args = { .handle = (uintptr_t)entry->data }; + + drmIoctl(sws_iter->fd, DRM_IOCTL_GEM_CLOSE, &args); + _mesa_hash_table_remove(sws_iter->kms_handles, entry); + } + } + simple_mtx_unlock(&ws->sws_list_lock); + simple_mtx_lock(&ws->bo_export_table_lock); - util_hash_table_remove(ws->bo_export_table, bo->bo); + _mesa_hash_table_remove_key(ws->bo_export_table, bo->bo); simple_mtx_unlock(&ws->bo_export_table_lock); if (bo->initial_domain & RADEON_DOMAIN_VRAM_GTT) { @@ -414,7 +436,7 @@ static void amdgpu_add_buffer_to_global_list(struct amdgpu_winsys_bo *bo) if (ws->debug_all_bos) { simple_mtx_lock(&ws->global_bo_list_lock); - LIST_ADDTAIL(&bo->u.real.global_list_item, &ws->global_bo_list); + list_addtail(&bo->u.real.global_list_item, &ws->global_bo_list); ws->num_buffers++; simple_mtx_unlock(&ws->global_bo_list_lock); } @@ -495,9 +517,6 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws, request.flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS; if (flags & RADEON_FLAG_GTT_WC) request.flags |= AMDGPU_GEM_CREATE_CPU_GTT_USWC; - if (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && - ws->info.has_local_buffers) - request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID; if (ws->zero_all_vram_allocs && (request.preferred_heap & AMDGPU_GEM_DOMAIN_VRAM)) request.flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED; @@ -546,8 +565,8 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws, bo->va = va; bo->u.real.va_handle = va_handle; bo->initial_domain = initial_domain; + bo->flags = flags; bo->unique_id = __sync_fetch_and_add(&ws->next_bo_unique_id, 1); - bo->is_local = !!(request.flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID); if (initial_domain & RADEON_DOMAIN_VRAM) ws->allocated_vram += align64(size, ws->info.gart_page_size); @@ -664,7 +683,7 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsigned heap, if (!slab->entries) goto fail_buffer; - LIST_INITHEAD(&slab->base.free); + list_inithead(&slab->base.free); base_id = __sync_fetch_and_add(&ws->next_bo_unique_id, slab->base.num_entries); @@ -692,7 +711,7 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsigned heap, assert(bo->u.slab.real->bo); } - LIST_ADDTAIL(&bo->u.slab.entry.head, &slab->base.free); + list_addtail(&bo->u.slab.entry.head, &slab->base.free); } return &slab->base; @@ -961,7 +980,7 @@ static void amdgpu_bo_sparse_destroy(struct pb_buffer *_buf) fprintf(stderr, "amdgpu: clearing PRT VA region on destroy failed (%d)\n", r); } - while (!list_empty(&bo->u.sparse.backing)) { + while (!list_is_empty(&bo->u.sparse.backing)) { struct amdgpu_sparse_backing *dummy = NULL; sparse_free_backing_buffer(bo, container_of(bo->u.sparse.backing.next, @@ -1017,7 +1036,7 @@ amdgpu_bo_sparse_create(struct amdgpu_winsys *ws, uint64_t size, if (!bo->u.sparse.commitments) goto error_alloc_commitments; - LIST_INITHEAD(&bo->u.sparse.backing); + list_inithead(&bo->u.sparse.backing); /* For simplicity, we always map a multiple of the page size. */ map_size = align64(size, RADEON_SPARSE_PAGE_SIZE); @@ -1204,6 +1223,13 @@ static unsigned eg_tile_split_rev(unsigned eg_tile_split) } } +#define AMDGPU_TILING_DCC_INDEPENDENT_128B_SHIFT 44 +#define AMDGPU_TILING_DCC_INDEPENDENT_128B_MASK 0x1 +#define AMDGPU_TILING_DCC_MAX_COMPRESSED_BLOCK_SIZE_SHIFT 45 +#define AMDGPU_TILING_DCC_MAX_COMPRESSED_BLOCK_SIZE_MASK 0x3 +#define AMDGPU_TILING_SCANOUT_SHIFT 63 +#define AMDGPU_TILING_SCANOUT_MASK 0x1 + static void amdgpu_buffer_get_metadata(struct pb_buffer *_buf, struct radeon_bo_metadata *md) { @@ -1226,6 +1252,9 @@ static void amdgpu_buffer_get_metadata(struct pb_buffer *_buf, md->u.gfx9.dcc_offset_256B = AMDGPU_TILING_GET(tiling_flags, DCC_OFFSET_256B); md->u.gfx9.dcc_pitch_max = AMDGPU_TILING_GET(tiling_flags, DCC_PITCH_MAX); md->u.gfx9.dcc_independent_64B = AMDGPU_TILING_GET(tiling_flags, DCC_INDEPENDENT_64B); + md->u.gfx9.dcc_independent_128B = AMDGPU_TILING_GET(tiling_flags, DCC_INDEPENDENT_128B); + md->u.gfx9.dcc_max_compressed_block_size = AMDGPU_TILING_GET(tiling_flags, DCC_MAX_COMPRESSED_BLOCK_SIZE); + md->u.gfx9.scanout = AMDGPU_TILING_GET(tiling_flags, SCANOUT); } else { md->u.legacy.microtile = RADEON_LAYOUT_LINEAR; md->u.legacy.macrotile = RADEON_LAYOUT_LINEAR; @@ -1263,6 +1292,9 @@ static void amdgpu_buffer_set_metadata(struct pb_buffer *_buf, tiling_flags |= AMDGPU_TILING_SET(DCC_OFFSET_256B, md->u.gfx9.dcc_offset_256B); tiling_flags |= AMDGPU_TILING_SET(DCC_PITCH_MAX, md->u.gfx9.dcc_pitch_max); tiling_flags |= AMDGPU_TILING_SET(DCC_INDEPENDENT_64B, md->u.gfx9.dcc_independent_64B); + tiling_flags |= AMDGPU_TILING_SET(DCC_INDEPENDENT_128B, md->u.gfx9.dcc_independent_128B); + tiling_flags |= AMDGPU_TILING_SET(DCC_MAX_COMPRESSED_BLOCK_SIZE, md->u.gfx9.dcc_max_compressed_block_size); + tiling_flags |= AMDGPU_TILING_SET(SCANOUT, md->u.gfx9.scanout); } else { if (md->u.legacy.macrotile == RADEON_LAYOUT_TILED) tiling_flags |= AMDGPU_TILING_SET(ARRAY_MODE, 4); /* 2D_TILED_THIN1 */ @@ -1408,9 +1440,7 @@ amdgpu_buffer_create(struct radeon_winsys *ws, static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, struct winsys_handle *whandle, - unsigned vm_alignment, - unsigned *stride, - unsigned *offset) + unsigned vm_alignment) { struct amdgpu_winsys *ws = amdgpu_winsys(rws); struct amdgpu_winsys_bo *bo = NULL; @@ -1420,6 +1450,7 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, amdgpu_va_handle va_handle = NULL; struct amdgpu_bo_info info = {0}; enum radeon_bo_domain initial = 0; + enum radeon_bo_flag flags = 0; int r; switch (whandle->type) { @@ -1433,11 +1464,6 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, return NULL; } - if (stride) - *stride = whandle->stride; - if (offset) - *offset = whandle->offset; - r = amdgpu_bo_import(ws->dev, type, whandle->handle, &result); if (r) return NULL; @@ -1485,6 +1511,10 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, initial |= RADEON_DOMAIN_VRAM; if (info.preferred_heap & AMDGPU_GEM_DOMAIN_GTT) initial |= RADEON_DOMAIN_GTT; + if (info.alloc_flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) + flags |= RADEON_FLAG_NO_CPU_ACCESS; + if (info.alloc_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) + flags |= RADEON_FLAG_GTT_WC; /* Initialize the structure. */ simple_mtx_init(&bo->lock, mtx_plain); @@ -1497,6 +1527,7 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, bo->va = va; bo->u.real.va_handle = va_handle; bo->initial_domain = initial; + bo->flags = flags; bo->unique_id = __sync_fetch_and_add(&ws->next_bo_unique_id, 1); bo->is_shared = true; @@ -1509,7 +1540,7 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, amdgpu_add_buffer_to_global_list(bo); - util_hash_table_set(ws->bo_export_table, bo->bo, bo); + _mesa_hash_table_insert(ws->bo_export_table, bo->bo, bo); simple_mtx_unlock(&ws->bo_export_table_lock); return &bo->base; @@ -1526,14 +1557,13 @@ error: static bool amdgpu_bo_get_handle(struct radeon_winsys *rws, struct pb_buffer *buffer, - unsigned stride, unsigned offset, - unsigned slice_size, struct winsys_handle *whandle) { struct amdgpu_screen_winsys *sws = amdgpu_screen_winsys(rws); struct amdgpu_winsys_bo *bo = amdgpu_winsys_bo(buffer); struct amdgpu_winsys *ws = bo->ws; enum amdgpu_bo_handle_type type; + struct hash_entry *entry; int r; /* Don't allow exports of slab entries and sparse buffers. */ @@ -1547,6 +1577,23 @@ static bool amdgpu_bo_get_handle(struct radeon_winsys *rws, type = amdgpu_bo_handle_type_gem_flink_name; break; case WINSYS_HANDLE_TYPE_KMS: + if (sws->fd == ws->fd) { + whandle->handle = bo->u.real.kms_handle; + + if (bo->is_shared) + return true; + + goto hash_table_set; + } + + simple_mtx_lock(&ws->sws_list_lock); + entry = _mesa_hash_table_search(sws->kms_handles, bo); + simple_mtx_unlock(&ws->sws_list_lock); + if (entry) { + whandle->handle = (uintptr_t)entry->data; + return true; + } + /* Fall through */ case WINSYS_HANDLE_TYPE_FD: type = amdgpu_bo_handle_type_dma_buf_fd; break; @@ -1566,15 +1613,19 @@ static bool amdgpu_bo_get_handle(struct radeon_winsys *rws, if (r) return false; + + simple_mtx_lock(&ws->sws_list_lock); + _mesa_hash_table_insert_pre_hashed(sws->kms_handles, + bo->u.real.kms_handle, bo, + (void*)(uintptr_t)whandle->handle); + simple_mtx_unlock(&ws->sws_list_lock); } + hash_table_set: simple_mtx_lock(&ws->bo_export_table_lock); - util_hash_table_set(ws->bo_export_table, bo->bo, bo); + _mesa_hash_table_insert(ws->bo_export_table, bo->bo, bo); simple_mtx_unlock(&ws->bo_export_table_lock); - whandle->stride = stride; - whandle->offset = offset; - whandle->offset += slice_size * whandle->layer; bo->is_shared = true; return true; } @@ -1675,4 +1726,5 @@ void amdgpu_bo_init_functions(struct amdgpu_screen_winsys *ws) ws->base.buffer_commit = amdgpu_bo_sparse_commit; ws->base.buffer_get_virtual_address = amdgpu_bo_get_va; ws->base.buffer_get_initial_domain = amdgpu_bo_get_initial_domain; + ws->base.buffer_get_flags = amdgpu_bo_get_flags; } diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h index 18ef7e1fa..9f37437cd 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h @@ -93,10 +93,10 @@ struct amdgpu_winsys_bo { amdgpu_bo_handle bo; /* NULL for slab entries and sparse buffers */ bool sparse; bool is_user_ptr; - bool is_local; uint32_t unique_id; uint64_t va; enum radeon_bo_domain initial_domain; + enum radeon_bo_flag flags; /* how many command streams is this bo referenced in? */ int num_cs_references; diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 976ec7770..4308cfb3f 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -349,32 +349,49 @@ static enum pipe_reset_status amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx) { struct amdgpu_ctx *ctx = (struct amdgpu_ctx*)rwctx; - uint32_t result, hangs; int r; /* Return a failure due to a GPU hang. */ - r = amdgpu_cs_query_reset_state(ctx->ctx, &result, &hangs); - if (r) { - fprintf(stderr, "amdgpu: amdgpu_cs_query_reset_state failed. (%i)\n", r); - return PIPE_NO_RESET; - } + if (ctx->ws->info.drm_minor >= 24) { + uint64_t flags; - switch (result) { - case AMDGPU_CTX_GUILTY_RESET: - return PIPE_GUILTY_CONTEXT_RESET; - case AMDGPU_CTX_INNOCENT_RESET: - return PIPE_INNOCENT_CONTEXT_RESET; - case AMDGPU_CTX_UNKNOWN_RESET: - return PIPE_UNKNOWN_CONTEXT_RESET; - case AMDGPU_CTX_NO_RESET: - default: - /* Return a failure due to a rejected command submission. */ - if (ctx->ws->num_total_rejected_cs > ctx->initial_num_total_rejected_cs) { - return ctx->num_rejected_cs ? PIPE_GUILTY_CONTEXT_RESET : - PIPE_INNOCENT_CONTEXT_RESET; + r = amdgpu_cs_query_reset_state2(ctx->ctx, &flags); + if (r) { + fprintf(stderr, "amdgpu: amdgpu_cs_query_reset_state failed. (%i)\n", r); + return PIPE_NO_RESET; + } + + if (flags & AMDGPU_CTX_QUERY2_FLAGS_RESET) { + if (flags & AMDGPU_CTX_QUERY2_FLAGS_GUILTY) + return PIPE_GUILTY_CONTEXT_RESET; + else + return PIPE_INNOCENT_CONTEXT_RESET; } - return PIPE_NO_RESET; + } else { + uint32_t result, hangs; + + r = amdgpu_cs_query_reset_state(ctx->ctx, &result, &hangs); + if (r) { + fprintf(stderr, "amdgpu: amdgpu_cs_query_reset_state failed. (%i)\n", r); + return PIPE_NO_RESET; + } + + switch (result) { + case AMDGPU_CTX_GUILTY_RESET: + return PIPE_GUILTY_CONTEXT_RESET; + case AMDGPU_CTX_INNOCENT_RESET: + return PIPE_INNOCENT_CONTEXT_RESET; + case AMDGPU_CTX_UNKNOWN_RESET: + return PIPE_UNKNOWN_CONTEXT_RESET; + } + } + + /* Return a failure due to a rejected command submission. */ + if (ctx->ws->num_total_rejected_cs > ctx->initial_num_total_rejected_cs) { + return ctx->num_rejected_cs ? PIPE_GUILTY_CONTEXT_RESET : + PIPE_INNOCENT_CONTEXT_RESET; } + return PIPE_NO_RESET; } /* COMMAND SUBMISSION */ @@ -1159,17 +1176,20 @@ static void add_fence_to_list(struct amdgpu_fence_list *fences, amdgpu_fence_reference(&fences->list[idx], (struct pipe_fence_handle*)fence); } -/* TODO: recognizing dependencies as no-ops doesn't take the parallel - * compute IB into account. The compute IB won't wait for these. - * Also, the scheduler can execute compute and SDMA IBs on any rings. - * Should we always insert dependencies? - */ static bool is_noop_fence_dependency(struct amdgpu_cs *acs, struct amdgpu_fence *fence) { struct amdgpu_cs_context *cs = acs->csc; - if (!amdgpu_fence_is_syncobj(fence) && + /* Detect no-op dependencies only when there is only 1 ring, + * because IBs on one ring are always executed one at a time. + * + * We always want no dependency between back-to-back gfx IBs, because + * we need the parallelism between IBs for good performance. + */ + if ((acs->ring_type == RING_GFX || + acs->ctx->ws->info.num_rings[acs->ring_type] == 1) && + !amdgpu_fence_is_syncobj(fence) && fence->ctx == acs->ctx && fence->fence.ip_type == cs->ib[IB_MAIN].ip_type && fence->fence.ip_instance == cs->ib[IB_MAIN].ip_instance && @@ -1378,9 +1398,6 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) simple_mtx_lock(&ws->global_bo_list_lock); LIST_FOR_EACH_ENTRY(bo, &ws->global_bo_list, u.real.global_list_item) { - if (bo->is_local) - continue; - list[num_handles].bo_handle = bo->u.real.kms_handle; list[num_handles].bo_priority = 0; ++num_handles; @@ -1405,10 +1422,6 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) unsigned num_handles = 0; for (i = 0; i < cs->num_real_buffers; ++i) { struct amdgpu_cs_buffer *buffer = &cs->real_buffers[i]; - - if (buffer->bo->is_local) - continue; - assert(buffer->u.real.priority_usage != 0); list[num_handles].bo_handle = buffer->bo->u.real.kms_handle; @@ -1663,9 +1676,6 @@ static int amdgpu_cs_flush(struct radeon_cmdbuf *rcs, if (ws->info.chip_class <= GFX6) { while (rcs->current.cdw & 7) radeon_emit(rcs, 0xf0000000); /* NOP packet */ - } else { - while (rcs->current.cdw & 7) - radeon_emit(rcs, 0x00000000); /* NOP packet */ } break; case RING_GFX: @@ -1756,7 +1766,7 @@ static int amdgpu_cs_flush(struct radeon_cmdbuf *rcs, /* Submit. */ util_queue_add_job(&ws->cs_queue, cs, &cs->flush_completed, - amdgpu_cs_submit_ib, NULL); + amdgpu_cs_submit_ib, NULL, 0); /* The submission has been queued, unlock the fence now. */ simple_mtx_unlock(&ws->bo_fence_lock); diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index 507859c2d..26c14d8ec 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -30,7 +30,7 @@ #include "amdgpu_bo.h" #include "util/u_memory.h" -#include <amdgpu_drm.h> +#include "drm-uapi/amdgpu_drm.h" struct amdgpu_ctx { struct amdgpu_winsys *ws; diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c index 4f410d5c8..5313e177e 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c @@ -26,7 +26,7 @@ */ #include "amdgpu_winsys.h" -#include "util/u_format.h" +#include "util/format/u_format.h" static int amdgpu_surface_sanity(const struct pipe_resource *tex) { diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index 2fe227c92..7ac2a61bd 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -30,23 +30,25 @@ #include "amdgpu_cs.h" #include "amdgpu_public.h" +#include "util/os_file.h" +#include "util/os_misc.h" #include "util/u_cpu_detect.h" #include "util/u_hash_table.h" #include "util/hash_table.h" #include "util/xmlconfig.h" -#include <amdgpu_drm.h> +#include "drm-uapi/amdgpu_drm.h" #include <xf86drm.h> #include <stdio.h> #include <sys/stat.h> #include <fcntl.h> -#include "amd/common/ac_llvm_util.h" -#include "amd/common/sid.h" +#include "ac_llvm_util.h" +#include "sid.h" #ifndef AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E #endif -static struct util_hash_table *dev_tab = NULL; +static struct hash_table *dev_tab = NULL; static simple_mtx_t dev_tab_mutex = _SIMPLE_MTX_INITIALIZER_NP; DEBUG_GET_ONCE_BOOL_OPTION(all_bos, "RADEON_ALL_BOS", false) @@ -100,7 +102,7 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, handle_env_var_force_family(ws); - ws->addrlib = amdgpu_addr_create(&ws->info, &ws->amdinfo, &ws->info.max_alignment); + ws->addrlib = ac_addrlib_create(&ws->info, &ws->amdinfo, &ws->info.max_alignment); if (!ws->addrlib) { fprintf(stderr, "amdgpu: Cannot create addrlib.\n"); goto fail; @@ -137,11 +139,12 @@ static void do_winsys_deinit(struct amdgpu_winsys *ws) pb_slabs_deinit(&ws->bo_slabs[i]); } pb_cache_deinit(&ws->bo_cache); - util_hash_table_destroy(ws->bo_export_table); + _mesa_hash_table_destroy(ws->bo_export_table, NULL); + simple_mtx_destroy(&ws->sws_list_lock); simple_mtx_destroy(&ws->global_bo_list_lock); simple_mtx_destroy(&ws->bo_export_table_lock); - AddrDestroy(ws->addrlib); + ac_addrlib_destroy(ws->addrlib); amdgpu_device_deinitialize(ws->dev); FREE(ws); } @@ -162,9 +165,9 @@ static void amdgpu_winsys_destroy(struct radeon_winsys *rws) destroy = pipe_reference(&ws->reference, NULL); if (destroy && dev_tab) { - util_hash_table_remove(dev_tab, ws->dev); - if (util_hash_table_count(dev_tab) == 0) { - util_hash_table_destroy(dev_tab); + _mesa_hash_table_remove_key(dev_tab, ws->dev); + if (_mesa_hash_table_num_entries(dev_tab) == 0) { + _mesa_hash_table_destroy(dev_tab, NULL); dev_tab = NULL; } } @@ -266,23 +269,43 @@ static bool amdgpu_read_registers(struct radeon_winsys *rws, 0xffffffff, 0, out) == 0; } -static unsigned hash_pointer(void *key) +static bool amdgpu_winsys_unref(struct radeon_winsys *rws) { - return _mesa_hash_pointer(key); -} + struct amdgpu_screen_winsys *sws = amdgpu_screen_winsys(rws); + struct amdgpu_winsys *aws = sws->aws; + bool ret; -static int compare_pointers(void *key1, void *key2) -{ - return key1 != key2; -} + simple_mtx_lock(&aws->sws_list_lock); -static bool amdgpu_winsys_unref(struct radeon_winsys *rws) -{ - /* radeon_winsys corresponds to amdgpu_screen_winsys, which is never - * referenced multiple times, so amdgpu_winsys_destroy always needs to be - * called. It handles reference counting for amdgpu_winsys. - */ - return true; + ret = pipe_reference(&sws->reference, NULL); + if (ret) { + struct amdgpu_screen_winsys **sws_iter; + struct amdgpu_winsys *aws = sws->aws; + + /* Remove this amdgpu_screen_winsys from amdgpu_winsys' list, so that + * amdgpu_winsys_create can't re-use it anymore + */ + for (sws_iter = &aws->sws_list; *sws_iter; sws_iter = &(*sws_iter)->next) { + if (*sws_iter == sws) { + *sws_iter = sws->next; + break; + } + } + } + + simple_mtx_unlock(&aws->sws_list_lock); + + if (ret && sws->kms_handles) { + struct drm_gem_close args; + + hash_table_foreach(sws->kms_handles, entry) { + args.handle = (uintptr_t)entry->data; + drmIoctl(sws->fd, DRM_IOCTL_GEM_CLOSE, &args); + } + _mesa_hash_table_destroy(sws->kms_handles, NULL); + } + + return ret; } static void amdgpu_pin_threads_to_L3_cache(struct radeon_winsys *rws, @@ -294,6 +317,18 @@ static void amdgpu_pin_threads_to_L3_cache(struct radeon_winsys *rws, util_cpu_caps.cores_per_L3); } +static uint32_t kms_handle_hash(const void *key) +{ + const struct amdgpu_winsys_bo *bo = key; + + return bo->u.real.kms_handle; +} + +static bool kms_handle_equals(const void *a, const void *b) +{ + return a == b; +} + PUBLIC struct radeon_winsys * amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, radeon_screen_create_t screen_create) @@ -301,22 +336,24 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, struct amdgpu_screen_winsys *ws; struct amdgpu_winsys *aws; amdgpu_device_handle dev; - uint32_t drm_major, drm_minor, r; + uint32_t drm_major, drm_minor; + int r; ws = CALLOC_STRUCT(amdgpu_screen_winsys); if (!ws) return NULL; + pipe_reference_init(&ws->reference, 1); ws->fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); /* Look up the winsys from the dev table. */ simple_mtx_lock(&dev_tab_mutex); if (!dev_tab) - dev_tab = util_hash_table_create(hash_pointer, compare_pointers); + dev_tab = util_hash_table_create_ptr_keys(); /* Initialize the amdgpu device. This should always return the same pointer * for the same fd. */ - r = amdgpu_device_initialize(fd, &drm_major, &drm_minor, &dev); + r = amdgpu_device_initialize(ws->fd, &drm_major, &drm_minor, &dev); if (r) { fprintf(stderr, "amdgpu: amdgpu_device_initialize failed.\n"); goto fail; @@ -325,13 +362,45 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, /* Lookup a winsys if we have already created one for this device. */ aws = util_hash_table_get(dev_tab, dev); if (aws) { - pipe_reference(NULL, &aws->reference); + struct amdgpu_screen_winsys *sws_iter; /* Release the device handle, because we don't need it anymore. * This function is returning an existing winsys instance, which * has its own device handle. */ amdgpu_device_deinitialize(dev); + + simple_mtx_lock(&aws->sws_list_lock); + for (sws_iter = aws->sws_list; sws_iter; sws_iter = sws_iter->next) { + r = os_same_file_description(sws_iter->fd, ws->fd); + + if (r == 0) { + close(ws->fd); + FREE(ws); + ws = sws_iter; + pipe_reference(NULL, &ws->reference); + simple_mtx_unlock(&aws->sws_list_lock); + goto unlock; + } else if (r < 0) { + static bool logged; + + if (!logged) { + os_log_message("amdgpu: os_same_file_description couldn't " + "determine if two DRM fds reference the same " + "file description.\n" + "If they do, bad things may happen!\n"); + logged = true; + } + } + } + simple_mtx_unlock(&aws->sws_list_lock); + + ws->kms_handles = _mesa_hash_table_create(NULL, kms_handle_hash, + kms_handle_equals); + if (!ws->kms_handles) + goto fail; + + pipe_reference(NULL, &aws->reference); } else { /* Create a new winsys. */ aws = CALLOC_STRUCT(amdgpu_winsys); @@ -339,6 +408,7 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, goto fail; aws->dev = dev; + aws->fd = ws->fd; aws->info.drm_major = drm_major; aws->info.drm_minor = drm_minor; @@ -382,9 +452,10 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, /* init reference */ pipe_reference_init(&aws->reference, 1); - LIST_INITHEAD(&aws->global_bo_list); - aws->bo_export_table = util_hash_table_create(hash_pointer, compare_pointers); + list_inithead(&aws->global_bo_list); + aws->bo_export_table = util_hash_table_create_ptr_keys(); + (void) simple_mtx_init(&aws->sws_list_lock, mtx_plain); (void) simple_mtx_init(&aws->global_bo_list_lock, mtx_plain); (void) simple_mtx_init(&aws->bo_fence_lock, mtx_plain); (void) simple_mtx_init(&aws->bo_export_table_lock, mtx_plain); @@ -396,7 +467,7 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, return NULL; } - util_hash_table_set(dev_tab, dev, aws); + _mesa_hash_table_insert(dev_tab, dev, aws); if (aws->reserve_vmid) { r = amdgpu_vm_reserve_vmid(dev, 0); @@ -435,6 +506,12 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, return NULL; } + simple_mtx_lock(&aws->sws_list_lock); + ws->next = aws->sws_list; + aws->sws_list = ws; + simple_mtx_unlock(&aws->sws_list_lock); + +unlock: /* We must unlock the mutex once the winsys is fully initialized, so that * other threads attempting to create the winsys from the same fd will * get a fully initialized winsys and not just half-way initialized. */ @@ -445,6 +522,8 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, fail_alloc: FREE(aws); fail: + if (ws->kms_handles) + _mesa_hash_table_destroy(ws->kms_handles, NULL); close(ws->fd); FREE(ws); simple_mtx_unlock(&dev_tab_mutex); diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h index 1ff160728..42bc8846d 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h @@ -31,7 +31,6 @@ #include "pipebuffer/pb_cache.h" #include "pipebuffer/pb_slab.h" #include "gallium/drivers/radeon/radeon_winsys.h" -#include "addrlib/inc/addrinterface.h" #include "util/simple_mtx.h" #include "util/u_queue.h" #include <amdgpu.h> @@ -42,6 +41,10 @@ struct amdgpu_cs; struct amdgpu_winsys { struct pipe_reference reference; + + /* File descriptor which was passed to amdgpu_device_initialize */ + int fd; + struct pb_cache bo_cache; /* Each slab buffer can only contain suballocations of equal sizes, so we @@ -75,7 +78,7 @@ struct amdgpu_winsys { struct util_queue cs_queue; struct amdgpu_gpu_info amdinfo; - ADDR_HANDLE addrlib; + struct ac_addrlib *addrlib; bool check_vm; bool debug_all_bos; @@ -87,9 +90,15 @@ struct amdgpu_winsys { struct list_head global_bo_list; unsigned num_buffers; + /* Single-linked list of all structs amdgpu_screen_winsys referencing this + * struct amdgpu_winsys + */ + simple_mtx_t sws_list_lock; + struct amdgpu_screen_winsys *sws_list; + /* For returning the same amdgpu_winsys_bo instance for exported * and re-imported buffers. */ - struct util_hash_table *bo_export_table; + struct hash_table *bo_export_table; simple_mtx_t bo_export_table_lock; }; @@ -97,6 +106,13 @@ struct amdgpu_screen_winsys { struct radeon_winsys base; struct amdgpu_winsys *aws; int fd; + struct pipe_reference reference; + struct amdgpu_screen_winsys *next; + + /* Maps a BO to its KMS handle valid for this DRM file descriptor + * Protected by amdgpu_winsys::sws_list_lock + */ + struct hash_table *kms_handles; }; static inline struct amdgpu_screen_winsys * |