Commit Graph

12 Commits (597725e9511f8c0405fdd8d92d749bce58c0bce3)

Author SHA1 Message Date
Eric Engestrom 0926f0af54 meson,configure: include config.h automatically
This will prevent any more missing `#include "config.h"` bug, at the
cost of having to recompile some files that didn't need to be when
changing build options.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-20 18:19:26 +00:00
Eric Engestrom 2d50a404f6 xf86atomic: fix -Wundef warning
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-29 16:18:52 +00:00
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