Commit Graph

929 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 427a2eec18 os: replace GenerateRandomData() by custom arc4random_buf() on platforms that missing it
arc4random_buf() is a pretty standard libc function on Unix'oid platforms,
but not all our targets have it, thus we need a fallback there. Currently we
have GenerateRandomData(), which either just wraps arc4random_buf() or provides
some fallback implementation.

For those cases it's easier to just implement missing functions directly
instead of having custom wrapper functions. So, drop GenerateRandomData()
in favor of arc4random_buf() and provide fallback implementation for where
it is missing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult 103334c3f5 os: don't include client.h anymore
There's no need to include client.h anymore. But still leaving it, in case
some external consumer relying on it's presence.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult 0bef44c198 (submit/os-screensaver) os: unexport screen saver timer functions
These functions aren't supposed to be used by drivers, so move them
out of the public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult 59463b7a99 (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA
PANORAMIX was the original working title of the extension, before it became
official standard. Just nobody cared about fixing the symbols to the official
naming.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult aa5a3a5cb3 (submit/drop-cygwin) drop remains of cygwin support
Cygwin support doesn't seem to be used anymore, so it can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult f31f2a69ee (submit/unexport-CloseDownConnection) os: unexport CloseDownConnection()
Not used by any drivers, so no need to export it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult 419c6d7881 (submit/unexport-ddx-callbacks) os: rename ddx.h to ddx_priv.h
Make it clear that stuff from this file really isn't supposed to be used
by dynamically loaded modules like drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult be817f8247 (submit/unexport-ddx-callbacks) os: unexport ddx callbacks
The DDX callbacks (where core/DIX calls into DDX) aren't supposed to be
called by drivers directly, so unexport them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult 477820977f (submit/fix-char-signedness) os: utils: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/utils.c:75:
../os/utils.c: In function ‘VerifyDisplayName’:
../os/utils.c:624:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  624 |         if (!isdigit(d[i])) {
      |                       ^
../os/utils.c: In function ‘ProcessCommandLine’:
../os/utils.c:942:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  942 |             if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
      |                                            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult f4035b7fe0 (submit/fix-char-signedness) os: access: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/access.c:96:
../os/access.c: In function ‘ResetHosts’:
../os/access.c:981:49: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  981 |                 lhostname[i] = tolower(ohostname[i]);
      |                                                 ^
2024-08-29 20:51:22 +02:00
Enrico Weigelt, metux IT consult ee302a1ac0 (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H
The symbol controls whether to include dix-config.h, and it's always set,
thus we don't need it (and dozens of ifdef's) anymore.

This commit only removes them from our own source files, where we can
guarantee that dix-config.h is present - leaving the (potentially exported)
headers untouched.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult f50d7d72ad (submit/os-utils) os: utils: drop obsolete REMOVE_ENV_LD conditional
This always had been set since it's incarnation back two decades
ago, on XFree86 4.3.0.1. Probably no need to keep that around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult 97a84d7e18 (submit/os-utils) os: utils: drop unused USE_ISPRINT
This always had been disabled since it's incarnation XFree86 4.3.0.1,
back two decades ago, so there's likely no need for it.

Fixes: d568221710
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult c9ac30a8b4 (submit/os-utils) os: utils: drop REMOVE_LONG_ENV conditional
This always had been enabled since it's incarnation back two decades ago,
so it doesn't seem to be necessary keeping that conditional any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult 5770dd2c22 (submit/os-utils) os: utils: drop unused VENDORSUPPORT
This doesn't seem to be used anymore for two decades now,
so there's probably no need to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult 7efc54566d (submit/os-utils) os: utils: drop unused NO_OUTPUT_PIPES
This hasn't been used/enabled for over 20 years, so there's probably
no reason for keeping it even longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult 30195614c4 (submit/os-utils) os: utils: minor code formatting cleanup
Just correcting some small indention issues, no actual change.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult 0bc252a068 (submit/split-input.h) include: move private definitions out of input.h
It's not good having the public server api headers clobbered with private
definitions, so cleaning them up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult d25a4b4328 (submit/split-client.h) os: unexport client id retrieval functions
These aren't used by any (known) external modules, thus no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult ebb5e8cf56 (submit/split-client.h) os: unexport DetermineClientPid() and DetermineClientCmd()
These aren't used by any drivers/modules, so no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult fd77dbfa68 (submit/split-client.h) os: split off internal definitions from client.h
The client.h file is part of the public module API, but it also contains
definitions that aren't useful for being used in modules. Splitting them
out into their own client_priv.h file, which isn't part of the API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult b026cf8939 (submit/fix-ftbs-solaris) os: fix link failure on Illumos
On SunOS, the BSD socket API as well as hostname lookups isn't
implemented in libc, but separate libraries. We need to link them
explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult b2586a5560 (submit/fix-ftbs-solaris) os: fix FTBS on Illumos due missing symbols
Several feature defines need to be set before including system headers,
otherwise build breaks:

> /usr/include/X11/Xtrans/Xtranssock.c: In function '_XSERVTransSocketRead':
> /usr/include/X11/Xtrans/Xtranssock.c:2161:14: error: 'struct msghdr' has no member named 'msg_control'
>  2161 |             .msg_control = cmsgbuf.buf,
>       |              ^~~~~~~~~~~
> /usr/include/X11/Xtrans/Xtranssock.c:2162:14: error: 'struct msghdr' has no member named 'msg_controllen'
>  2162 |             .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int))
>       |              ^~~~~~~~~~~~~~
>
> ../os/access.c:339:14: error: implicit declaration of function 'asprintf'; did you mean 'Xasprintf'? [-Werror=implicit-function-declaration]
>   339 |     length = asprintf(addr, "%s%c%s", type, delimiter, value);
>       |              ^~~~~~~~
>       |              Xasprintf

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:21 +02:00
Enrico Weigelt, metux IT consult 28c19fe092 (submit/unexport-WaitForSomething) os: unexport WaitForSomething()
Not used by any drivers, so no need to export it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 68fb79a0e5 (submit/miext-extinit) Xext: geext: move out noGEExtension to corresponding extension
The OS abstraction isn't really the right place for those flags,
they are're probably better off in their corresponding extensions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 1077abca43 (submit/miext-extinit) xfree86: vidmode: unexport noXFree86VidModeExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 0ed49c0280 (submit/miext-extinit) xfree86: dga: unexport noXFree86DGAExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 089d03422c (submit/miext-extinit) xfree86: dri2: unexport noXFree86DRI2Extension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 269b4d4ac5 (submit/miext-extinit) xfree86: dri: unexport noXFree86DRIExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 11fe7c5654 (submit/miext-extinit) miext: move over extinit_priv.h from include
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult c842dde3ef (submit/miext-extinit) composite: move noCompositeExtension into the extension code
This flag is better off in the extension code instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 99284fd6d6 (submit/miext-extinit) Xext: shape: unexport noXFixesExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 8abee65500 (submit/miext-extinit) Xext: xf86bigfont: unexport noXFree86BigfontExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult dc440cd822 (submit/miext-extinit) Xext: security: unexport noSecurityExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 0dc18761a0 (submit/miext-extinit) Xext: shm: unexport noMITShmExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 73f1b8fb78 (submit/miext-extinit) Xext: saver: unexport noScreenSaverExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult dd63a5ef99 (submit/miext-extinit) Xext: shape: unexport noShapeExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 799d5e0aa0 (submit/miext-extinit) res: unexport noResExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult a699367662 (submit/miext-extinit) render: unexport noRenderExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 7ff13f102c (submit/miext-extinit) randr: unexport noRRExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult adfb3031b0 (submit/miext-extinit) panoramix: move noPanoramiXExtension field into extension.
This field is better of in the corresponding extension,
than in the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 948e288d2c (submit/miext-extinit) xtest: unexport noTestExtensions field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult bb44e6fa97 (submit/miext-extinit) glx: unexport noGlxExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 4c3c409099 (submit/miext-extinit) dpms: unexport noDPMSExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 1e1f73938b (submit/miext-extinit) dbe: unexport noDbeExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 21e7a265cd (submit/miext-extinit) damageext: unexport noDamageExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 1a557186dd (submit/recv-fds) os: read file descriptors into client struct at once
Instead of having the request handler ask for fd's one by one, just read them
all into a little array in ClientRec struct. And also automatically clean up
after request had been handled.

Request handlers need to set the entries to -1 if they shouldn't be closed
automatically.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:20 +02:00
Enrico Weigelt, metux IT consult 1b16405b49 (submit/os-backtrace-vla) os: backtrace: use fixed size array instead of vla
The backtrace buffer size (BT_SIZE) is determined by compile time,
so we can change BT_SIZE into a #define to turn vla into fixed array.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-29 20:51:19 +02:00
Enrico Weigelt, metux IT consult 8e32cec204 xv: move noXvExtension to xvmain.c
It's more appropriate having those kind of flags in the corresponding
extension.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1512>
2024-07-26 23:51:13 +00:00
Enrico Weigelt, metux IT consult 61233adbca treewide: replace xnfreallocarray macro call by XNFreallocarray()
The xnfreallocarray was added along (and just as an alias to) XNFreallocarray
back a decade ago. It's just used in a few places and it's only saves us from
passing the first parameter (NULL), so the actual benefit isn't really huge.

No (known) driver is using it, so the macro can be dropped entirely.

Fixes: ae75d50395
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
2024-07-26 23:41:33 +00:00