libdrm: Changes to 'upstream-unstable'
.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 | 48 +
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
57 files changed, 10725 insertions(+), 709 deletions(-)
New commits:
commit f045da45fee94a7179cced09a20b691c5167cef4
Author: Marek Olšák <marek.olsak@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.velikov@gmail.com>
Date: Fri Aug 7 17:29:11 2015 +0100
amdgpu: add symbols check test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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.velikov@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.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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.velikov@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.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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.velikov@gmail.com>
Date: Fri Aug 7 16:48:02 2015 +0100
amdgpu: squash trivial documentation typo
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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.velikov@gmail.com>
Date: Fri Aug 7 17:20:51 2015 +0100
amdgpu: cosmetic chances in license boilerplate
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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.velikov@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.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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 <zackr@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.velikov@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.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@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)
}
}
-void util_hash_table_foreach(struct util_hash_table *ht,
+drm_private void util_hash_table_foreach(struct util_hash_table *ht,
void (*callback)(void *key, void *value, void *data),
void *data)
{
@@ -236,7 +238,7 @@ void util_hash_table_foreach(struct util_hash_table *ht,
}
}
-void util_hash_table_destroy(struct util_hash_table *ht)
+drm_private void util_hash_table_destroy(struct util_hash_table *ht)
{
struct util_hash_iter iter;
struct util_hash_table_item *item;
diff --git a/amdgpu/util_hash_table.h b/amdgpu/util_hash_table.h
index 04fe704..e000128 100644
--- a/amdgpu/util_hash_table.h
+++ b/amdgpu/util_hash_table.h
@@ -34,6 +34,12 @@
#ifndef U_HASH_TABLE_H_
#define U_HASH_TABLE_H_
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "libdrm_macros.h"
+
/**
* Generic purpose hash table.
*/
@@ -45,21 +51,23 @@ struct util_hash_table;
* @param hash hash function
* @param compare should return 0 for two equal keys.
*/
-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));
-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);
-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);
-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);
-void util_hash_table_clear(struct util_hash_table *ht);
+drm_private void util_hash_table_clear(struct util_hash_table *ht);
-void util_hash_table_foreach(struct util_hash_table *ht,
+drm_private void util_hash_table_foreach(struct util_hash_table *ht,
void (*callback)(void *key, void *value, void *data),
void *data);
-void util_hash_table_destroy(struct util_hash_table *ht);
+drm_private void util_hash_table_destroy(struct util_hash_table *ht);
#endif /* U_HASH_TABLE_H_ */
commit 5f0f6387a6abe9e20c94d99a1e59aa7fa231b17a
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Fri Aug 7 16:40:45 2015 +0100
amdgpu/util_hash: hide private symbols from global namespace
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
diff --git a/amdgpu/util_hash.c b/amdgpu/util_hash.c
index b1e12c4..7e59041 100644
--- a/amdgpu/util_hash.c
+++ b/amdgpu/util_hash.c
@@ -214,8 +214,8 @@ static struct util_node **util_hash_find_node(struct util_hash *hash, unsigned a
return node;
}
-struct util_hash_iter util_hash_insert(struct util_hash *hash,
- unsigned key, void *data)
+drm_private struct util_hash_iter
+util_hash_insert(struct util_hash *hash, unsigned key, void *data)
{
util_data_might_grow(hash->data.d);
@@ -234,7 +234,7 @@ struct util_hash_iter util_hash_insert(struct util_hash *hash,
}
}
-struct util_hash * util_hash_create(void)
+drm_private struct util_hash *util_hash_create(void)
{
struct util_hash *hash = malloc(sizeof(struct util_hash));
if (!hash)
@@ -257,7 +257,7 @@ struct util_hash * util_hash_create(void)
return hash;
}
-void util_hash_delete(struct util_hash *hash)
+drm_private void util_hash_delete(struct util_hash *hash)
{
struct util_node *e_for_x = (struct util_node *)(hash->data.d);
struct util_node **bucket = (struct util_node **)(hash->data.d->buckets);
@@ -275,22 +275,22 @@ void util_hash_delete(struct util_hash *hash)
free(hash);
}
-struct util_hash_iter util_hash_find(struct util_hash *hash,
- unsigned key)
+drm_private struct util_hash_iter
+util_hash_find(struct util_hash *hash, unsigned key)
{
struct util_node **nextNode = util_hash_find_node(hash, key);
struct util_hash_iter iter = {hash, *nextNode};
return iter;
}
-unsigned util_hash_iter_key(struct util_hash_iter iter)
+drm_private unsigned util_hash_iter_key(struct util_hash_iter iter)
{
if (!iter.node || iter.hash->data.e == iter.node)
return 0;
return iter.node->key;
}
-void * util_hash_iter_data(struct util_hash_iter iter)
+drm_private void *util_hash_iter_data(struct util_hash_iter iter)
{
if (!iter.node || iter.hash->data.e == iter.node)
return 0;
@@ -327,21 +327,21 @@ static struct util_node *util_hash_data_next(struct util_node *node)
return a.e;
}
-struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter)
+drm_private struct util_hash_iter
+util_hash_iter_next(struct util_hash_iter iter)
{
struct util_hash_iter next = {iter.hash, util_hash_data_next(iter.node)};
return next;
}
-int util_hash_iter_is_null(struct util_hash_iter iter)
+drm_private int util_hash_iter_is_null(struct util_hash_iter iter)
{
if (!iter.node || iter.node == iter.hash->data.e)
return 1;
return 0;
}
-void * util_hash_take(struct util_hash *hash,
- unsigned akey)
+drm_private void *util_hash_take(struct util_hash *hash, unsigned akey)
{
struct util_node **node = util_hash_find_node(hash, akey);
if (*node != hash->data.e) {
@@ -356,13 +356,14 @@ void * util_hash_take(struct util_hash *hash,
return 0;
}
-struct util_hash_iter util_hash_first_node(struct util_hash *hash)
+drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash)
{
struct util_hash_iter iter = {hash, util_data_first_node(hash->data.d)};
return iter;
}
-struct util_hash_iter util_hash_erase(struct util_hash *hash, struct util_hash_iter iter)
+drm_private struct util_hash_iter
+util_hash_erase(struct util_hash *hash, struct util_hash_iter iter)
{
struct util_hash_iter ret = iter;
struct util_node *node = iter.node;
diff --git a/amdgpu/util_hash.h b/amdgpu/util_hash.h
index 8e0f9a2..01a4779 100644
--- a/amdgpu/util_hash.h
+++ b/amdgpu/util_hash.h
@@ -44,8 +44,14 @@
#ifndef UTIL_HASH_H
#define UTIL_HASH_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdbool.h>
+#include "libdrm_macros.h"
+
struct util_hash;
struct util_node;
@@ -55,8 +61,8 @@ struct util_hash_iter {
};
-struct util_hash *util_hash_create(void);
-void util_hash_delete(struct util_hash *hash);
+drm_private struct util_hash *util_hash_create(void);
+drm_private void util_hash_delete(struct util_hash *hash);
/**
@@ -65,8 +71,8 @@ void util_hash_delete(struct util_hash *hash);
* in the collision list.
* Function returns iterator pointing to the inserted item in the hash.
*/
-struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key,
- void *data);
+drm_private struct util_hash_iter
+util_hash_insert(struct util_hash *hash, unsigned key, void *data);
/**
* Removes the item pointed to by the current iterator from the hash.
@@ -75,25 +81,27 @@ struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key,
* Function returns iterator pointing to the item after the removed one in
* the hash.
*/
-struct util_hash_iter util_hash_erase(struct util_hash *hash,
- struct util_hash_iter iter);
+drm_private struct util_hash_iter
+util_hash_erase(struct util_hash *hash, struct util_hash_iter iter);
-void *util_hash_take(struct util_hash *hash, unsigned key);
+drm_private void *util_hash_take(struct util_hash *hash, unsigned key);
-struct util_hash_iter util_hash_first_node(struct util_hash *hash);
+drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash);
/**
* Return an iterator pointing to the first entry in the collision list.
*/
-struct util_hash_iter util_hash_find(struct util_hash *hash, unsigned key);
+drm_private struct util_hash_iter
+util_hash_find(struct util_hash *hash, unsigned key);
-int util_hash_iter_is_null(struct util_hash_iter iter);
-unsigned util_hash_iter_key(struct util_hash_iter iter);
-void *util_hash_iter_data(struct util_hash_iter iter);
+drm_private int util_hash_iter_is_null(struct util_hash_iter iter);
+drm_private unsigned util_hash_iter_key(struct util_hash_iter iter);
+drm_private void *util_hash_iter_data(struct util_hash_iter iter);
-struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter);
Reply to: