.gitignore | 2 Makefile.am | 6 Makefile.sources | 5 amdgpu/Makefile.am | 57 amdgpu/amdgpu-symbol-check | 51 amdgpu/amdgpu.h | 1178 +++++++ amdgpu/amdgpu_bo.c | 705 ++++ amdgpu/amdgpu_cs.c | 372 ++ amdgpu/amdgpu_device.c | 274 + amdgpu/amdgpu_gpu_info.c | 310 ++ amdgpu/amdgpu_internal.h | 190 + amdgpu/amdgpu_vamgr.c | 288 + amdgpu/libdrm_amdgpu.pc.in | 10 amdgpu/util_hash.c | 387 ++ amdgpu/util_hash.h | 107 amdgpu/util_hash_table.c | 262 + amdgpu/util_hash_table.h | 73 configure.ac | 46 debian/changelog | 8 debian/control | 32 debian/libdrm-amdgpu1.install | 1 debian/libdrm-amdgpu1.symbols | 35 debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff | 39 debian/patches/series | 1 debian/rules | 4 freedreno/Makefile.sources | 3 freedreno/freedreno_bo.c | 6 freedreno/freedreno_priv.h | 2 freedreno/kgsl/kgsl_bo.c | 1 freedreno/kgsl/kgsl_pipe.c | 2 freedreno/list.h | 137 freedreno/msm/msm_bo.c | 1 include/drm/amdgpu_drm.h | 645 ++++ intel/intel_bufmgr.h | 8 intel/intel_bufmgr_gem.c | 414 -- intel/test_decode.c | 2 libkms/libkms.h | 4 libkms/linux.c | 4 man/Makefile.am | 11 omap/omap_drm.c | 4 radeon/r600_pci_ids.h | 1 tests/Makefile.am | 12 tests/amdgpu/Makefile.am | 29 tests/amdgpu/amdgpu_test.c | 222 + tests/amdgpu/amdgpu_test.h | 236 + tests/amdgpu/basic_tests.c | 838 +++++ tests/amdgpu/bo_tests.c | 181 + tests/amdgpu/cs_tests.c | 387 ++ tests/amdgpu/frame.h | 1949 +++++++++++++ tests/amdgpu/uvd_messages.h | 813 +++++ tests/amdgpu/vce_ib.h | 318 ++ tests/amdgpu/vce_tests.c | 489 +++ tests/kmstest/main.c | 1 tests/modeprint/modeprint.c | 4 tests/name_from_fd.c | 2 tests/radeon/Makefile.am | 1 tests/radeon/list.h | 137 tests/radeon/rbo.h | 2 util_double_list.h | 137 util_math.h | 33 xf86drm.c | 28 xf86drm.h | 11 xf86drmMode.c | 30 xf86drmMode.h | 4 64 files changed, 10804 insertions(+), 748 deletions(-)
New commits: commit d89c15de45d69133ad8b2f5c438c96e54a742155 Author: Robert Hooker <sarv...@ubuntu.com> Date: Fri Aug 14 13:43:14 2015 -0400 Update changelog diff --git a/debian/changelog b/debian/changelog index 45e4cb5..9bd4434 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ libdrm (2.4.63-1) UNRELEASED; urgency=medium * New upstream release. - Drop Fix-headers-inclusion-in-xf86drmMode.c.diff, upstream. + * Add new libdrm-amdgpu1 package. -- Robert Hooker <sarv...@ubuntu.com> Fri, 14 Aug 2015 13:15:14 -0400 commit a22ec5c73c4061f740f27730afac7fcdb4c5570d Author: Robert Hooker <sarv...@ubuntu.com> Date: Fri Aug 14 13:30:47 2015 -0400 Add libdrm-amdgpu1 package. diff --git a/debian/control b/debian/control index cd39bab..981523a 100644 --- a/debian/control +++ b/debian/control @@ -28,6 +28,7 @@ Depends: libdrm-intel1 (= ${binary:Version}) [amd64 i386 kfreebsd-amd64 kfreebsd-i386 x32], libdrm-radeon1 (= ${binary:Version}), libdrm-nouveau2 (= ${binary:Version}) [linux-any], + libdrm-amdgpu1 (= ${binary:Version}) [linux-any], libdrm-omap1 (= ${binary:Version}) [any-arm], libdrm-freedreno1 (= ${binary:Version}) [any-arm], libdrm-exynos1 (= ${binary:Version}) [any-arm], @@ -302,3 +303,34 @@ Description: Userspace interface to tegra-specific kernel DRM services -- debugg OpenGL drivers. . This package provides the debugging symbols for the libdrm-tegra0 package. + +Package: libdrm-amdgpu1 +Architecture: linux-any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to amdgpu-specific kernel DRM services -- runtime + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + +Package: libdrm-amdgpu1-dbg +Section: debug +Priority: extra +Architecture: linux-any +Depends: + libdrm-amdgpu1 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to amdgpu-specific kernel DRM services -- debugging symbols + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-amdgpu1 package. diff --git a/debian/libdrm-amdgpu1.install b/debian/libdrm-amdgpu1.install new file mode 100644 index 0000000..34318da --- /dev/null +++ b/debian/libdrm-amdgpu1.install @@ -0,0 +1 @@ +usr/lib/*/libdrm_amdgpu.so.1* diff --git a/debian/libdrm-amdgpu1.symbols b/debian/libdrm-amdgpu1.symbols new file mode 100644 index 0000000..7ab54db --- /dev/null +++ b/debian/libdrm-amdgpu1.symbols @@ -0,0 +1,35 @@ +libdrm_amdgpu.so.1 libdrm-amdgpu1 #MINVER# + amdgpu_bo_alloc@Base 2.4.63 + amdgpu_bo_cpu_map@Base 2.4.63 + amdgpu_bo_cpu_unmap@Base 2.4.63 + amdgpu_bo_export@Base 2.4.63 + amdgpu_bo_free@Base 2.4.63 + amdgpu_bo_import@Base 2.4.63 + amdgpu_bo_list_create@Base 2.4.63 + amdgpu_bo_list_destroy@Base 2.4.63 + amdgpu_bo_list_update@Base 2.4.63 + amdgpu_bo_query_info@Base 2.4.63 + amdgpu_bo_set_metadata@Base 2.4.63 + amdgpu_bo_va_op@Base 2.4.63 + amdgpu_bo_wait_for_idle@Base 2.4.63 + amdgpu_create_bo_from_user_mem@Base 2.4.63 + amdgpu_cs_ctx_create@Base 2.4.63 + amdgpu_cs_ctx_free@Base 2.4.63 + amdgpu_cs_query_fence_status@Base 2.4.63 + amdgpu_cs_query_reset_state@Base 2.4.63 + amdgpu_cs_submit@Base 2.4.63 + amdgpu_device_deinitialize@Base 2.4.63 + amdgpu_device_initialize@Base 2.4.63 + amdgpu_query_buffer_size_alignment@Base 2.4.63 + amdgpu_query_crtc_from_id@Base 2.4.63 + amdgpu_query_firmware_version@Base 2.4.63 + amdgpu_query_gds_info@Base 2.4.63 + amdgpu_query_gpu_info@Base 2.4.63 + amdgpu_query_heap_info@Base 2.4.63 + amdgpu_query_hw_ip_count@Base 2.4.63 + amdgpu_query_hw_ip_info@Base 2.4.63 + amdgpu_query_info@Base 2.4.63 + amdgpu_read_mm_registers@Base 2.4.63 + amdgpu_va_range_alloc@Base 2.4.63 + amdgpu_va_range_free@Base 2.4.63 + amdgpu_va_range_query@Base 2.4.63 diff --git a/debian/rules b/debian/rules index f712b4a..ec465df 100755 --- a/debian/rules +++ b/debian/rules @@ -18,11 +18,13 @@ ifeq (linux, $(DEB_HOST_ARCH_OS)) confflags += --enable-udev confflags += --enable-vmwgfx confflags += --enable-nouveau + confflags += --enable-amdgpu NOUVEAU = yes else confflags += --disable-udev confflags += --disable-vmwgfx confflags += --disable-nouveau + confflags += --disable-amdgpu NOUVEAU = no # kfreebsd mangles freebsd's sys/types.h confflags += CFLAGS="$(shell pkg-config --cflags libbsd-overlay)" @@ -81,6 +83,7 @@ ifeq ($(INTEL), yes) endif ifeq ($(NOUVEAU), yes) dh_strip -plibdrm-nouveau2 --dbg-package=libdrm-nouveau2-dbg + dh_strip -plibdrm-amdgpu1 --dbg-package=libdrm-amdgpu1-dbg endif dh_strip -plibdrm-radeon1 --dbg-package=libdrm-radeon1-dbg ifeq ($(ARM), yes) @@ -98,6 +101,7 @@ ifeq ($(INTEL), yes) endif ifeq ($(NOUVEAU), yes) dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.38)' -- -c4 + dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.63)' -- -c4 endif dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4 ifeq ($(ARM), yes) commit 50d29efbc67c18a6ece430aa3583c3b2b2b27d1c Author: Robert Hooker <sarv...@ubuntu.com> Date: Fri Aug 14 13:18:41 2015 -0400 Drop Fix-headers-inclusion-in-xf86drmMode.c.diff, upstream diff --git a/debian/changelog b/debian/changelog index 1cd010f..45e4cb5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ libdrm (2.4.63-1) UNRELEASED; urgency=medium * New upstream release. + - Drop Fix-headers-inclusion-in-xf86drmMode.c.diff, upstream. -- Robert Hooker <sarv...@ubuntu.com> Fri, 14 Aug 2015 13:15:14 -0400 diff --git a/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff b/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff deleted file mode 100644 index 980b7d0..0000000 --- a/debian/patches/Fix-headers-inclusion-in-xf86drmMode.c.diff +++ /dev/null @@ -1,39 +0,0 @@ -From bc2b38f97b0cb398e99a7562ee6f3ae8cfbde73f Mon Sep 17 00:00:00 2001 -From: Julien Cristau <jcris...@debian.org> -Date: Sun, 26 Apr 2015 11:53:02 +0200 -Subject: [PATCH] Fix headers inclusion in xf86drmMode.c - -Add sys/sysctl.h to get sysctlbyname declaration on kFreeBSD - -Updated by Thorsten “mirabilos” Glaser <t.gla...@tarent.de> -to add autoconf check and only include <sys/sysctl.h> if it -is detected by configure as it’s unusable on Linux/x32 (and -others, e.g. other new architectures). - -Index: libdrm/xf86drmMode.c -=================================================================== ---- libdrm.orig/xf86drmMode.c -+++ libdrm/xf86drmMode.c -@@ -46,6 +46,9 @@ - #include <stdint.h> - #include <stdlib.h> - #include <sys/ioctl.h> -+#ifdef HAVE_SYS_SYSCTL_H -+#include <sys/sysctl.h> -+#endif - #include <stdio.h> - #include <stdbool.h> - -Index: libdrm/configure.ac -=================================================================== ---- libdrm.orig/configure.ac -+++ libdrm/configure.ac -@@ -53,7 +53,7 @@ AC_USE_SYSTEM_EXTENSIONS - AC_SYS_LARGEFILE - AC_FUNC_ALLOCA - --AC_CHECK_HEADERS([sys/mkdev.h]) -+AC_CHECK_HEADERS([sys/mkdev.h sys/sysctl.h]) - - # Initialize libtool - LT_PREREQ([2.2]) diff --git a/debian/patches/series b/debian/patches/series index c947b3c..8ca2297 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ -Fix-headers-inclusion-in-xf86drmMode.c.diff 01_default_perms.diff commit 5f1db6841a258379b4e99b97c8ade1f4905c1f23 Author: Robert Hooker <sarv...@ubuntu.com> Date: Fri Aug 14 13:15:32 2015 -0400 Bump changelog. diff --git a/debian/changelog b/debian/changelog index 2487024..1cd010f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdrm (2.4.63-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Robert Hooker <sarv...@ubuntu.com> Fri, 14 Aug 2015 13:15:14 -0400 + libdrm (2.4.62-1) unstable; urgency=medium [ Sven Joachim ] commit f045da45fee94a7179cced09a20b691c5167cef4 Author: Marek Olšák <marek.ol...@amd.com> Date: Fri Aug 14 14:19:29 2015 +0200 Bump version for release diff --git a/configure.ac b/configure.ac index 81e0f80..e2a2f16 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.62], + [2.4.63], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) commit 15350568ccae525899aeb963f1cb66287e876e63 Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 17:29:11 2015 +0100 amdgpu: add symbols check test Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/Makefile.am b/amdgpu/Makefile.am index 82e78c7..ed97803 100644 --- a/amdgpu/Makefile.am +++ b/amdgpu/Makefile.am @@ -52,3 +52,6 @@ libdrm_amdgpuinclude_HEADERS = \ pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm_amdgpu.pc + +TESTS = amdgpu-symbol-check +EXTRA_DIST = $(TESTS) diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check new file mode 100755 index 0000000..9a0b36c --- /dev/null +++ b/amdgpu/amdgpu-symbol-check @@ -0,0 +1,51 @@ +#!/bin/bash + +# The following symbols (past the first five) are taken from the public headers. +# A list of the latter should be available Makefile.am/libdrm_amdgpuinclude_HEADERS + +FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk '{print $3}' | while read func; do +( grep -q "^$func$" || echo $func ) <<EOF +__bss_start +_edata +_end +_fini +_init +amdgpu_bo_alloc +amdgpu_bo_cpu_map +amdgpu_bo_cpu_unmap +amdgpu_bo_export +amdgpu_bo_free +amdgpu_bo_import +amdgpu_bo_list_create +amdgpu_bo_list_destroy +amdgpu_bo_list_update +amdgpu_bo_query_info +amdgpu_bo_set_metadata +amdgpu_bo_va_op +amdgpu_bo_wait_for_idle +amdgpu_create_bo_from_user_mem +amdgpu_cs_ctx_create +amdgpu_cs_ctx_free +amdgpu_cs_query_fence_status +amdgpu_cs_query_reset_state +amdgpu_cs_submit +amdgpu_device_deinitialize +amdgpu_device_initialize +amdgpu_query_buffer_size_alignment +amdgpu_query_crtc_from_id +amdgpu_query_firmware_version +amdgpu_query_gds_info +amdgpu_query_gpu_info +amdgpu_query_heap_info +amdgpu_query_hw_ip_count +amdgpu_query_hw_ip_info +amdgpu_query_info +amdgpu_read_mm_registers +amdgpu_va_range_alloc +amdgpu_va_range_free +amdgpu_va_range_query +EOF +done) + +test ! -n "$FUNCS" || echo $FUNCS +test ! -n "$FUNCS" commit bddf4df4a17df30624f27c5e85f859a1b09f8fc0 Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 17:09:35 2015 +0100 amdgpu: hide the final internal functions from global namespace Thus the only symbols that we export are the ones officially provided by the API. Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index aacb42c..7607f2c 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -53,7 +53,7 @@ static void amdgpu_close_kms_handle(amdgpu_device_handle dev, drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &args); } -void amdgpu_bo_free_internal(amdgpu_bo_handle bo) +drm_private void amdgpu_bo_free_internal(amdgpu_bo_handle bo) { /* Remove the buffer from the hash tables. */ pthread_mutex_lock(&bo->dev->bo_table_mutex); diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index fd28bd9..ea35326 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -290,7 +290,7 @@ int amdgpu_cs_submit(amdgpu_context_handle context, * * \return absolute timeout in nanoseconds */ -uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout) +drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout) { int r; diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index bf941c1..c6bbae8 100644 --- a/amdgpu/amdgpu_device.c +++ b/amdgpu/amdgpu_device.c @@ -47,7 +47,7 @@ #define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) #define UINT_TO_PTR(x) ((void *)((intptr_t)(x))) -pthread_mutex_t fd_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t fd_mutex = PTHREAD_MUTEX_INITIALIZER; static struct util_hash_table *fd_tab; static unsigned handle_hash(void *key) @@ -127,6 +127,41 @@ static int amdgpu_get_auth(int fd, int *auth) return r; } +static void amdgpu_device_free_internal(amdgpu_device_handle dev) +{ + amdgpu_vamgr_reference(&dev->vamgr, NULL); + util_hash_table_destroy(dev->bo_flink_names); + util_hash_table_destroy(dev->bo_handles); + pthread_mutex_destroy(&dev->bo_table_mutex); + util_hash_table_remove(fd_tab, UINT_TO_PTR(dev->fd)); + close(dev->fd); + if ((dev->flink_fd >= 0) && (dev->fd != dev->flink_fd)) + close(dev->flink_fd); + free(dev); +} + +/** + * Assignment between two amdgpu_device pointers with reference counting. + * + * Usage: + * struct amdgpu_device *dst = ... , *src = ...; + * + * dst = src; + * // No reference counting. Only use this when you need to move + * // a reference from one pointer to another. + * + * amdgpu_device_reference(&dst, src); + * // Reference counters are updated. dst is decremented and src is + * // incremented. dst is freed if its reference counter is 0. + */ +static void amdgpu_device_reference(struct amdgpu_device **dst, + struct amdgpu_device *src) +{ + if (update_references(&(*dst)->refcount, &src->refcount)) + amdgpu_device_free_internal(*dst); + *dst = src; +} + int amdgpu_device_initialize(int fd, uint32_t *major_version, uint32_t *minor_version, @@ -232,29 +267,8 @@ cleanup: return r; } -void amdgpu_device_free_internal(amdgpu_device_handle dev) -{ - amdgpu_vamgr_reference(&dev->vamgr, NULL); - util_hash_table_destroy(dev->bo_flink_names); - util_hash_table_destroy(dev->bo_handles); - pthread_mutex_destroy(&dev->bo_table_mutex); - util_hash_table_remove(fd_tab, UINT_TO_PTR(dev->fd)); - close(dev->fd); - if ((dev->flink_fd >= 0) && (dev->fd != dev->flink_fd)) - close(dev->flink_fd); - free(dev); -} - int amdgpu_device_deinitialize(amdgpu_device_handle dev) { amdgpu_device_reference(&dev, NULL); return 0; } - -void amdgpu_device_reference(struct amdgpu_device **dst, - struct amdgpu_device *src) -{ - if (update_references(&(*dst)->refcount, &src->refcount)) - amdgpu_device_free_internal(*dst); - *dst = src; -} diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c index 0970769..0cc17f1 100644 --- a/amdgpu/amdgpu_gpu_info.c +++ b/amdgpu/amdgpu_gpu_info.c @@ -140,7 +140,7 @@ int amdgpu_query_firmware_version(amdgpu_device_handle dev, unsigned fw_type, return 0; } -int amdgpu_query_gpu_info_init(amdgpu_device_handle dev) +drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev) { int r, i; diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h index 7f86da9..4b07aff 100644 --- a/amdgpu/amdgpu_internal.h +++ b/amdgpu/amdgpu_internal.h @@ -119,9 +119,7 @@ struct amdgpu_context { * Functions. */ -void amdgpu_device_free_internal(amdgpu_device_handle dev); - -void amdgpu_bo_free_internal(amdgpu_bo_handle bo); +drm_private void amdgpu_bo_free_internal(amdgpu_bo_handle bo); drm_private struct amdgpu_bo_va_mgr* amdgpu_vamgr_get_global(struct amdgpu_device *dev); @@ -137,9 +135,9 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, drm_private void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size); -int amdgpu_query_gpu_info_init(amdgpu_device_handle dev); +drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev); -uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout); +drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout); /** * Inline functions. @@ -189,20 +187,4 @@ static inline void amdgpu_bo_reference(struct amdgpu_bo **dst, *dst = src; } -/** - * Assignment between two amdgpu_device pointers with reference counting. - * - * Usage: - * struct amdgpu_device *dst = ... , *src = ...; - * - * dst = src; - * // No reference counting. Only use this when you need to move - * // a reference from one pointer to another. - * - * amdgpu_device_reference(&dst, src); - * // Reference counters are updated. dst is decremented and src is - * // incremented. dst is freed if its reference counter is 0. - */ -void amdgpu_device_reference(struct amdgpu_device **dst, - struct amdgpu_device *src); #endif commit b47181897770520bb5afcebc2c2c3ffaf7729a36 Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 16:54:29 2015 +0100 amdgpu/amdgpu_vamgr: hide private symbols from global namespace Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h index ab01bb5..7f86da9 100644 --- a/amdgpu/amdgpu_internal.h +++ b/amdgpu/amdgpu_internal.h @@ -31,6 +31,8 @@ #include <assert.h> #include <pthread.h> + +#include "libdrm_macros.h" #include "xf86atomic.h" #include "amdgpu.h" #include "util_double_list.h" @@ -121,15 +123,19 @@ void amdgpu_device_free_internal(amdgpu_device_handle dev); void amdgpu_bo_free_internal(amdgpu_bo_handle bo); -struct amdgpu_bo_va_mgr* amdgpu_vamgr_get_global(struct amdgpu_device *dev); +drm_private struct amdgpu_bo_va_mgr* +amdgpu_vamgr_get_global(struct amdgpu_device *dev); -void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, struct amdgpu_bo_va_mgr *src); +drm_private void +amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, + struct amdgpu_bo_va_mgr *src); -uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, - uint64_t alignment, uint64_t base_required); +drm_private uint64_t +amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, + uint64_t alignment, uint64_t base_required); -void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, - uint64_t size); +drm_private void +amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size); int amdgpu_query_gpu_info_init(amdgpu_device_handle dev); diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c index e2a4c87..b5d330f 100644 --- a/amdgpu/amdgpu_vamgr.c +++ b/amdgpu/amdgpu_vamgr.c @@ -66,7 +66,8 @@ static void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr) pthread_mutex_destroy(&mgr->bo_va_mutex); } -struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev) +drm_private struct amdgpu_bo_va_mgr * +amdgpu_vamgr_get_global(struct amdgpu_device *dev) { int ref; ref = atomic_inc_return(&vamgr.refcount); @@ -76,16 +77,18 @@ struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev) return &vamgr; } -void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, - struct amdgpu_bo_va_mgr *src) +drm_private void +amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, + struct amdgpu_bo_va_mgr *src) { if (update_references(&(*dst)->refcount, NULL)) amdgpu_vamgr_deinit(*dst); *dst = src; } -uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, - uint64_t alignment, uint64_t base_required) +drm_private uint64_t +amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, + uint64_t alignment, uint64_t base_required) { struct amdgpu_bo_va_hole *hole, *n; uint64_t offset = 0, waste = 0; @@ -170,8 +173,8 @@ uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, return offset; } -void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, - uint64_t va, uint64_t size) +drm_private void +amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size) { struct amdgpu_bo_va_hole *hole; commit c19fa2b1ca8baec6ac8bb8aed6c0693c87e1a6de Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 16:48:02 2015 +0100 amdgpu: squash trivial documentation typo Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index b0c22d4..a3eea84 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -709,7 +709,7 @@ int amdgpu_bo_cpu_unmap(amdgpu_bo_handle buf_handle); /** * Wait until a buffer is not used by the device. * - * \param dev - \c [in] Device handle. See #amdgpu_lib_initialize() + * \param dev - \c [in] Device handle. See #amdgpu_device_initialize() * \param buf_handle - \c [in] Buffer handle. * \param timeout_ns - Timeout in nanoseconds. * \param buffer_busy - 0 if buffer is idle, all GPU access was completed commit a30da8e9b3bb74d62b641a9fa4c0100ad47f2bc4 Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 17:20:51 2015 +0100 amdgpu: cosmetic chances in license boilerplate Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index a90c1ac..b0c22d4 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -19,7 +19,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * -*/ + */ /** * \file amdgpu.h diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index a17bd0f..aacb42c 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -19,6 +19,7 @@ * 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. + * */ #ifdef HAVE_CONFIG_H diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 6caf7ff..fd28bd9 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -19,7 +19,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * -*/ + */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index c21bb74..bf941c1 100644 --- a/amdgpu/amdgpu_device.c +++ b/amdgpu/amdgpu_device.c @@ -19,14 +19,13 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * -*/ + */ /** * \file amdgpu_device.c * * Implementation of functions for AMD GPU device * - * */ #ifdef HAVE_CONFIG_H diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c index 5994e75..0970769 100644 --- a/amdgpu/amdgpu_gpu_info.c +++ b/amdgpu/amdgpu_gpu_info.c @@ -19,6 +19,7 @@ * 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. + * */ #ifdef HAVE_CONFIG_H diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h index 526a93f..ab01bb5 100644 --- a/amdgpu/amdgpu_internal.h +++ b/amdgpu/amdgpu_internal.h @@ -19,6 +19,7 @@ * 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. + * */ #ifndef _AMDGPU_INTERNAL_H_ diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c index dd0b420..e2a4c87 100644 --- a/amdgpu/amdgpu_vamgr.c +++ b/amdgpu/amdgpu_vamgr.c @@ -19,7 +19,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * -*/ + */ #ifdef HAVE_CONFIG_H #include "config.h" commit f4c2bfd63e55b9c878f4c1420af15a88c57b43a2 Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 17:17:43 2015 +0100 amdgpu: add a bunch of missing config.h includes Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 4ec1941..6caf7ff 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -20,6 +20,11 @@ * OTHER DEALINGS IN THE SOFTWARE. * */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <stdio.h> #include <string.h> diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index 5f21b32..c21bb74 100644 --- a/amdgpu/amdgpu_device.c +++ b/amdgpu/amdgpu_device.c @@ -29,6 +29,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <sys/stat.h> #include <errno.h> #include <string.h> diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c index 16a463e..5994e75 100644 --- a/amdgpu/amdgpu_gpu_info.c +++ b/amdgpu/amdgpu_gpu_info.c @@ -21,6 +21,10 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <errno.h> #include <string.h> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c index ced4f4f..dd0b420 100644 --- a/amdgpu/amdgpu_vamgr.c +++ b/amdgpu/amdgpu_vamgr.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <string.h> #include <errno.h> diff --git a/amdgpu/util_hash.c b/amdgpu/util_hash.c index 7e59041..87cb671 100644 --- a/amdgpu/util_hash.c +++ b/amdgpu/util_hash.c @@ -30,6 +30,10 @@ * Zack Rusin <za...@vmware.com> */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "util_hash.h" #include <stdlib.h> diff --git a/amdgpu/util_hash_table.c b/amdgpu/util_hash_table.c index ce6f1d5..fa7f6ea 100644 --- a/amdgpu/util_hash_table.c +++ b/amdgpu/util_hash_table.c @@ -38,6 +38,9 @@ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "util_hash_table.h" #include "util_hash.h" commit f4d14f147cfc2bdea4f1ffafcfd302ebdfbcef1d Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Fri Aug 7 16:44:33 2015 +0100 amdgpu/util_hash_table: hide private symbols from global namespace Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Jammy Zhou <jammy.z...@amd.com> diff --git a/amdgpu/util_hash_table.c b/amdgpu/util_hash_table.c index cb7213c..ce6f1d5 100644 --- a/amdgpu/util_hash_table.c +++ b/amdgpu/util_hash_table.c @@ -69,8 +69,9 @@ util_hash_table_item(struct util_hash_iter iter) return (struct util_hash_table_item *)util_hash_iter_data(iter); } -struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key), - int (*compare)(void *key1, void *key2)) +drm_private struct util_hash_table * +util_hash_table_create(unsigned (*hash)(void *key), + int (*compare)(void *key1, void *key2)) { struct util_hash_table *ht; @@ -126,7 +127,8 @@ util_hash_table_find_item(struct util_hash_table *ht, return NULL; } -void util_hash_table_set(struct util_hash_table *ht, void *key, void *value) +drm_private void +util_hash_table_set(struct util_hash_table *ht, void *key, void *value) { unsigned key_hash; struct util_hash_table_item *item; @@ -159,7 +161,7 @@ void util_hash_table_set(struct util_hash_table *ht, void *key, void *value) } } -void *util_hash_table_get(struct util_hash_table *ht, void *key) +drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key) { unsigned key_hash; struct util_hash_table_item *item; @@ -177,7 +179,7 @@ void *util_hash_table_get(struct util_hash_table *ht, void *key) return item->value; } -void util_hash_table_remove(struct util_hash_table *ht, void *key) +drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key) { unsigned key_hash; struct util_hash_iter iter; @@ -200,7 +202,7 @@ void util_hash_table_remove(struct util_hash_table *ht, void *key) util_hash_erase(ht->head, iter); } -void util_hash_table_clear(struct util_hash_table *ht) +drm_private void util_hash_table_clear(struct util_hash_table *ht) { struct util_hash_iter iter; struct util_hash_table_item *item; @@ -217,7 +219,7 @@ void util_hash_table_clear(struct util_hash_table *ht) }