Commit Graph

14 Commits

Author SHA1 Message Date
Yonggang Luo 62a68481fa mapi: Remove usage of USE_ELF_TLS
After commit c47fd3dc00 ("windows: Use TLS context/dispatch with shared-glapi")
USE_ELF_TLS are always defined by
pre_args += '-DUSE_ELF_TLS'
So we can remove it safety

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
2022-07-29 23:59:11 +00:00
Alex Xu (Hello71) 3aab34171d Fix TSD stubs for non-initial-exec case (fixes #5667).
ppc64le TSD disabled for now since I am insufficiently familiar with ppc
asm. x86 pthread stubs deleted because adding USE_ELF_TLS to the #if is
isn't worth the effort since it only saves a single function call on
initial entry (TSD stubs are not used for read-only text now). also
potentially fix non-pthread TSD builds (_glapi_Dispatch was undefined),
but untested (could still be broken).

Tested-by: Jesse Natalie <jenatali@microsoft.com>
Tested-by: Jan Beich <jbeich@freebsd.org>
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13935>
2021-12-08 00:10:29 -05:00
Alex Xu (Hello71) 8570a2a280 Use initial-exec TLS for glibc only, enable TLS elsewhere
It is not portable to use initial-exec TLS in dlopened libraries. glibc
and FreeBSD allocate extra memory for extra initial-exec variables
specifically for libGL, but other libcs including musl do not.

Keep initial-exec disabled on FreeBSD since it is apparently broken for
some reason:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/966#note_394512
81dbdb15d5

Enable TLS on OpenBSD and Haiku based on the u_thread.h comment that
emutls is better than pthread_getspecific, which seems plausible given
that emutls has strictly more information to work with.

Fixes #966.

Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722>
2021-11-20 11:56:34 -05:00
Erik Faye-Lund 61d40ae4d0 mapi: do not call thread-unsafe dispatch getter
When not using the USE_ELF_TLS code-path, this function is
thread-unsafe, because it returns u_current_table if set without
consulting the ThreadSafe variable in u_current.c.

There's a short period where this can cause problems, if a program uses
multiple threads, but only have made a single context current so far. If
the program issues OpenGL commands from the initialized thread while a
new thread is setting u_current_table to __glapi_noop_table, we will
return the wrong table here.

It doesn't seem right to have two versions of the code that does the
same anyway, so let's use the version that doesn't have this problem
instead.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7280>
2020-10-26 12:35:21 +00:00
Dylan Baker ee4f1bc187 util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIAN
As requested by Tim.

This was generated with:
grep 'PIPE_ARCH_.*_ENDIAN' -rIl | xargs sed -ie 's@PIPE_ARCH_\(.*\)_ENDIAN@UTIL_ARCH_\1_ENDIAN@'g

v2: - add this patch

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-11-05 16:39:55 +00:00
Dylan Baker f9f60da813 util/u_endian: set PIPE_ARCH_*_ENDIAN to 1
This will allow it to be used as a drop in replacement for
_mesa_little_endian in a number of cases.

v2: - Always define PIPE_ARCH_LITTLE_ENDIAN and PIPE_ARCH_BIG_ENDIAN,
      define the one that reflects the host system to 1 and the other to 0
    - replace all uses of #ifdef, #ifndef, and #if defined() with #if
      and #if ! with PIPE_ARCH_*_ENDIAN

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-11-05 16:39:55 +00:00
Bas Nieuwenhuizen 9f37c9903b mesa: Rename GLX_USE_TLS to USE_ELF_TLS.
These days it is not GLX only and it does not work with all TLS
implementations.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-08-03 20:18:17 +02:00
Ben Crocker c26be2b2e9 mapi: Enable assembly language API acceleration for PPC64LE (V2)
Implement assembly language API acceleration for PPC64LE,
analogous to long-standing implementations for X86 and X86-64.

See also similar implementation in libglvnd.

Tested with Piglit.

Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2017-06-28 08:20:45 +01:00
Emil Velikov 4562d88c1d mapi: replace mapi_table abstraction
Replace all instances of mapi_table with the actual struct _glapi_table.
The former may have been needed when the OpenVG was around. But since
that one is long gone, there' no point in having the current confusing
mix of the two.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-05-04 18:17:03 +01:00
Brian Paul c3f352e836 mapi: remove u_macros.h
Only U_STRINGIFY() is used in entry.c

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-03-05 06:59:43 -07:00
Brian Paul 41c87cc566 mapi: replace INLINE with inline
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-03-04 08:33:48 -07:00
Brian Paul 846a7e8630 glapi: rename u_current dispatch table functions
Put "table" in the names to make things more understandable.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:47:12 -07:00
Rico Schüller 3998cfa933 mesa: remove outdated version lines in comments
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-06-05 08:54:27 -06:00
Matt Turner d5e9426b96 build: Move src/mapi/mapi/* to src/mapi/
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-15 12:04:25 -07:00
Renamed from src/mapi/mapi/entry.c (Browse further)