Commit Graph

10 Commits (e3c97d1a2473cd06a964599d10465f1e6a4d9015)

Author SHA1 Message Date
Emil Velikov cec65e2fcc Fix SunOS/NetBSD atomic macro
Reported-by: Evgeny Litvinenko <evgeny.v.litvinenko@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-21 17:43:14 +01:00
Maarten Lankhorst 7caa442e76 Use __sync_add_and_fetch instead of __sync_fetch_and_add for atomic_dec_and_test
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-13 20:21:57 +01:00
Maarten Lankhorst cd4685498b Add atomic_inc_return to atomics.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-13 20:21:00 +01:00
Alan Coopersmith dd89e1efd0 Stop undefining _ATOMIC_TYPE in Solaris/NetBSD section of xf86atomic.h
Since the atomic_set() macro references _ATOMIC_TYPE, undefining it
broke that macro, resulting in build errors of:
"intel_bufmgr_gem.c", line 775: undefined symbol: _ATOMIC_TYPE

Now that we're leaving the macro in the namespace, renamed it to start
with LIBDRM_ instead of _ to avoid polluting others namespace.

Regression introduced in 87fdd32c87 Add NetBSD atomic ops support.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-By: Thomas Klausner <wiz@NetBSD.org>
2015-02-12 14:18:31 -08:00
Thomas Klausner 87fdd32c87 Add NetBSD atomic ops support.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-26 10:08:41 +01:00
Thomas Klausner 96cf455425 Fix libdrm's atomic_dec_and_test on Solaris.
_nv means new value, not old value!

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-26 10:08:40 +01:00
Lionel Landwerlin 63fc571863 atomic: add atomic_add_unless()
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2014-09-15 14:50:47 +01:00
Alan Coopersmith c9065c5963 Correct the Solaris definitions of atomic_add & atomic_dec
The #defines added in 966c9907c0 were
mapping these to functions that don't exist.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-16 17:37:58 -07:00
Pauli Nieminen 966c9907c0 libdrm_radeon: Optimize cs_gem_reloc to do less looping.
bo->referenced_in_cs is checked if bo is already in cs. Adding and removing
reference in bo is done with atomic operations to allow parallel access to a
bo from multiple contexts.

cs->id generation code quarentees there is not duplicated ids which limits
number of cs->ids to 32. If there is more cs objects rest will get id 0.

V2:
 - Fix configure to check for atomics operations if libdrm_radeon is only selected.
 - Make atomic operations private to libdrm.

This optimization decreases cs_write_reloc share of torcs profiling from 4.3%
to 2.6%.

Tested-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2010-03-17 12:42:21 +02:00
Pauli Nieminen 21105bc186 libdrm: Move intel_atomic.h to libdrm core for sharing.
intel_atomic.h includes very usefull atomic operations for
lock free parrallel access of variables. Moving these to
core libdrm for code sharing with radeon.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2010-03-17 11:48:00 +02:00