[igt-dev] [PATCH i-g-t v2 0/4] Use C11 atomics

Guillaume Tucker guillaume.tucker at collabora.com
Thu Jun 13 13:53:18 UTC 2019


This series replaces calls to the __sync_* functions with the more
recent atomic_* ones defined in stdatomic.h in gem_create and
sw_sync.  It also adds dependency on libatomic when required, that is
to say when the CPU architecture doesn't provide native support for
some atomic operations.  This makes the tests more portable, in
particular for 32-bit MIPS which doesn't support 64-bit atomics.

v2:
 - add linker test to only add dependency on libatomic when needed
 - only add libatomic dependency to gem_create and sw_sync
 - use stdatomic.h and _Atomic type modifier
 - explicitly require libatomic in all Docker images

Guillaume Tucker (4):
  meson: add libatomic dependency
  gitlab-ci: add libatomic to docker images
  i915/gem_create: use atomic_* instead of __sync_*
  tests/sw_sync: use atomic_* instead of __sync_*

 Dockerfile.debian       |  1 +
 Dockerfile.debian-arm64 |  1 +
 Dockerfile.debian-armhf |  1 +
 Dockerfile.fedora       |  2 +-
 meson.build             | 13 +++++++++++++
 tests/Makefile.am       |  3 ++-
 tests/i915/gem_create.c | 16 ++++++++++++----
 tests/meson.build       | 17 +++++++++++++++--
 tests/sw_sync.c         | 12 ++++++------
 9 files changed, 52 insertions(+), 14 deletions(-)

--
2.20.1


More information about the igt-dev mailing list