From e3f54ecdd9d266607afd7d8b62960b2154b63e9d Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 5 Sep 2006 19:36:45 +0200 Subject: Multithreaded application note. --- libdrm/xf86mm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libdrm/xf86mm.h') diff --git a/libdrm/xf86mm.h b/libdrm/xf86mm.h index 623f4d58..43ea71b8 100644 --- a/libdrm/xf86mm.h +++ b/libdrm/xf86mm.h @@ -31,6 +31,18 @@ #include #include "drm.h" +/* + * Note on multithreaded applications using this interface. + * Libdrm is not threadsafe, so common buffer, TTM, and fence objects need to + * be protected using an external mutex. + * + * Note: Don't protect the following functions, as it may lead to deadlocks: + * drmBOUnmap(), drmFenceBuffers(). + * The kernel is synchronizing and refcounting buffer maps. + * User space only needs to refcount object usage within the same application. + */ + + /* * List macros heavily inspired by the Linux kernel * list handling. No list looping yet. @@ -82,6 +94,7 @@ typedef struct _drmMMListHead ((__type *)(((char *) (__item)) - offsetof(__type, __field))) + typedef struct _drmBO{ drm_bo_type_t type; unsigned handle; -- cgit v1.2.3