Commit Graph

21126 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
bbabd96e6c meson: rename symbol MITSHM to CONFIG_MITSHM
some bit better naming for config symbols.
Yet leaving the old one defined, until all drivers have kept up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:39:28 +02:00
Enrico Weigelt, metux IT consult
34039b29c6 Xext: xf86bigfont: clean up ifdef zoo on MITSHM
Clean up the ifdef zoo a bit and also add markers on the endif.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:39:28 +02:00
Enrico Weigelt, metux IT consult
2713d7e818 Xnamespace: fix possible memleak
In an OOM error path, we've forgotten an free() call.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:21:10 +02:00
Enrico Weigelt, metux IT consult
c25a0a533e glx: fix duplicate typedef
../glx/indirect_table.c
  In file included from ../glx/indirect_table.c:28:
  In file included from ../glx/glxserver.h:66:
  ../include/glx_extinit.h:33:28: warning: redefinition of typedef '__GLXscreen' is a C11 feature [-Wtypedef-redefinition]
     33 | typedef struct __GLXscreen __GLXscreen;
        |                            ^
  ../glx/glxscreens.h:113:28: note: previous definition is here
    113 | typedef struct __GLXscreen __GLXscreen;
        |                            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 10:18:19 +02:00
Enrico Weigelt, metux IT consult
02f04ec0aa glamor: don't redefine ALIGN macro if it exists
On FreeBSD the ALIGN macro already exists in the standard headers,
so we sholdn't redefine it here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 10:16:32 +02:00
Enrico Weigelt, metux IT consult
04c2c107d7 randr: rrcrtc: clean up declaration of xRRSetPanningReply
Declare struct where needed and drop zero-initialized fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 17:26:41 +02:00
Enrico Weigelt, metux IT consult
f1eed8bc90 Xext: use x_rpcbuf_t instead of struct x_rpcbuf
For consistency, always use the typedef instead of raw struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 17:01:24 +02:00
Enrico Weigelt, metux IT consult
510464d343 Xext: sync: clean up reply struct declarations
Declare them where needed and drop null-initialized fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 16:59:06 +02:00
Enrico Weigelt, metux IT consult
9b32a62d04 Xi: ProcXIGetProperty(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and byte-swap, instead of
writing in little pieces via complicated callbacks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
232c8d97f8 Xi: simplify ProcXListDeviceProperties() and ProcXIListProperties()
Skip allocation of temporay buffer for the atom IDs, instead walk through
the property list and write the IDs directly into the rpcbuf.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
79ca3103f7 Xi: use x_rpcbuf_t in ProcXListDeviceProperties() and ProcXIListProperties()
x_rpcbuf_t allows easy accumulation of payload data and doing byteswap
(when necessary) at the same time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
f0341145f0 Xi: ProcXGetDeviceProperty(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and byte-swap, instead of
writing in little pieces via complicated callbacks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
a857543be6 Xi: ProcXGetSelectedExtensionEvents(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and byte-swapping, instead
of writing in little pieces via complicated callbacks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
0680117493 Xi: ProcXGetSelectedExtensionEvents(): protect from allocation failure
If allocation fails, bail out with BadAlloc, instead of segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
036cbb4ff2 Xi: ProcXGetDeviceDontPropagateList(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and byte-swapping, instead of
writing in little pieces via complicated callbacks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:58:07 +02:00
Enrico Weigelt, metux IT consult
e6e2b88cff io: os: simplify FlushClient()
Since nobody's passing in extra data here anymore, this function
can be radically simplified now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:55:36 +02:00
Enrico Weigelt, metux IT consult
1298653ddb os: io: FlushClient(): check for broken connection earlier
Move up the check for broken/NULL transport connection in order to
simplify the code a bit more.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:55:36 +02:00
Enrico Weigelt, metux IT consult
1c13cfa6ca os: io: factor out making room in output buffer
First step for simplifying the output path - this is really complicated now:

FlushClient() is called in two cases:

a) we really need to send out critical data (eg. critical events now),
   here we have no extra data
b) going to write new data in the output buffer, but it's already full
   here we do have extra data

In case b) (only called from WriteToClient()) we're first trying to write out
as much as we can, and if there's still not enough room, the buffer is resized.
The write-out path is a complex look trying to write buffered data first, then
the new data. That's even more complex since using writev() with 3 pieces
(old buffer, new data, padding), and considering each of those could be written
just partially.

By the way, there's really no need that the new data is strictly written
along with the already buffered one - practically that's not even any actual
performance optimization - so it's just making things unncessarily complicated.

Therefore reduce it to what's really needed: ensure enough room in the output
buffer (and potentially flush out or resize the buffer). In a later, remove the
whole extra data part from FlushClient(), as it's not needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:55:36 +02:00
Enrico Weigelt, metux IT consult
a3a068d6d3 os: connection: simplify connection error sending
It's such a cold and rarely used path, we really don't need writev() for
efficiency, so instead doing two trivial write()'s. And the complex size
calculation as well as extra padding isn't necessary, if we just make
the string of size 4*n.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 15:47:09 +02:00
Enrico Weigelt, metux IT consult
8ad4b6a309 .github: freebsd: install libudev-devd
Allow building with udev features, eg. XORG_PLATFORM_BUS.
Using libudev-devd, which provides a libudev api while speaking to devd.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 14:46:54 +02:00
Enrico Weigelt, metux IT consult
ead8331996 kdrive: move ephyr build option check into kdrive's meson.build
As more kdrive-based servers are coming, it's time to refactor the meson
structure a little bit, so all kdrive specific logic is in its own subdir.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 12:57:16 +02:00
Joseph Crowell
76b1f47179 xfree86: drivers: common: remove incorrect #ifndef _XORG_CONFIG_H_
These functions are not defined anywhere else and are still necessary in the AMD drivers when using #include <xorg-config.h>
2025-08-04 12:43:01 +02:00
Oleh Nykyforchyn
dfbf61b998 xserver: hw/xfree86/man: update manual page
It is patch 5/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

Manual page is updated.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00
Oleh Nykyforchyn
7fb3e9cdab xserver: hw/xfree86/{common,parser}: use regular expressions for matching
It is patch 4/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

This patch introduces matching against a regular expression using regex library.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00
Oleh Nykyforchyn
d4a7263940 xserver: hw/xfree86/{common,parser}: use pattern groups for devices matching to classes
It is patch 3/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

This patch defines a function MatchAddrToken that actually matches an attribute against
a list of pattern groups (in fact, Match... lines). It is used to check whether a particular
input/optput class should be applied to a device, thus replacing the tangled and difficult
to control code in InputClass.c and OutputClass.c.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00
Oleh Nykyforchyn
f7a892d7d0 xserver: hw/xfree86/parser: create pattern group from a string and print it
It is patch 2/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

This patch adds a function xf86createMatchGroup to build a pattern group from a string in
MatchProduct, MatchDevice or similar directives. It implements rudimentary logic ("or",
"and", and "not") to construct complex conditions for a device to an input/output class
to be applied based on the device attributes. Also xf86printMatchPattern is defined, which
is necessary to save an actual config file. Pattern groups are not used for matching yet,
the original functionality is preserved.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00
Oleh Nykyforchyn
a94f76459b xserver: hw/xfree86/parser: prepare types for pattern matching
It is patch 1/5 of a series that refactors matching input and output devices to classes and
extends possibilities to describe them, in particular, it allows use of regular expressions.

This patch introduces enum xf86Match for different modes of matching present in Xserver code:
case sensitive/insensitive, equal strings, being  substring, comparison of filenames or
pathnames etc, and introduces struct xf86MatchPattern to hold a pattern together with a mode.
These types are not used yet.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-04 12:02:19 +02:00
Enrico Weigelt, metux IT consult
967ae609b6 dix: drop DDXBEFORERESET symbol
Reduce complexity for things that really don't matter much:

The ddxBeforeReset() function is called when the Xserver going to reset
(new server generation). Right now, the only DDX really needing that is
Xwin, on all the others it's just no-op.

We've got an extra complicated build logic, which ifdef's out this all when
Xwin isn't built at all. The saving is extremely minimal - just skipping
few stub functions, which in most sessions aren't even called.

Therefore, get rid of this extra complexity that isn't giving us any
notable gain.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 11:41:48 +02:00
Enrico Weigelt, metux IT consult
8e83caecde .github: mingw: force enable some more Xservers
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 10:59:52 +02:00
Enrico Weigelt, metux IT consult
66e8a5aff3 kdrive: xephyr: link pthread on mingw for nanosleep()
For strange reaons, nanosleep() is in libpthread on mingw platform,
so we have to link it here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 10:59:52 +02:00
Enrico Weigelt, metux IT consult
5102b5d9e9 kdrive: ephyr: include glamor_priv.h only when glamor is enabled
Necessary for building on platforms without any GL at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 10:59:52 +02:00
Enrico Weigelt, metux IT consult
520ae4fb3f kdrive: ephyr: don't use %hhu in error messages
The win32/mingw libc doesn't support this conversion type.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 10:59:52 +02:00
Enrico Weigelt, metux IT consult
eccbd65c75 kdrive: allow win32 build w/o sysv ipc
Win32 doesn't have SysV IPC, so we need to build it w/o this here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 10:59:52 +02:00
Enrico Weigelt, metux IT consult
dc4ea884b3 .github: add FreeBSD build
Add building the Xserver in a FreeBSD 14.3 VM.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 17:42:24 +02:00
Enrico Weigelt, metux IT consult
a1bafe0a06 kdrive: ephyr: don't try to install handler for SIGUSR1 on win32
Windows has no Unix-type signals.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 17:18:09 +02:00
Enrico Weigelt, metux IT consult
1056dccf53 xfree86: fbdevhw: fix prototypes of fbdevhwstub
The prototypes between the stub functions and the real ones mismatched.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 17:07:33 +02:00
Enrico Weigelt, metux IT consult
0a705ae42c kdrive: don't include <err.h> anymore
We don't need it at all (and even shouldn't use it), and this breaks
the win32/mingw build.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 17:00:54 +02:00
Enrico Weigelt, metux IT consult
193ed3d1f3 kdrive: fix build on win32/mingw
Yet one more clash between <windows.h> and Xserver on `CreateWindow` symbol:
The windows header has a `#define CreateWindow CreateWindowA`, so we need
to #undef it everywhere we're using `CreateWindow` - until we've got that
ugly header out of the way completely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 16:39:08 +02:00
Enrico Weigelt, metux IT consult
0023226f3b Xext: sync: drop unneeded include of <sys/time.h>
We neither need to guard including <sys/time.h> from mingw, nor do we
need that include here at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 13:28:17 +02:00
stefan11111
7c732656f8 xfree86: loader: warn when implicitly ignoring abi mismatch
for the nvidia proprietary DDX driver

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-01 13:27:58 +02:00
stefan11111
32da71a6e5 xfree86: loader: simplify setting IgnoreABI option
IgnoreABI option is kept in a single bit of an unsigned long variable
LoaderOptions that has no other use.

This patch replaces it with a variable named LoaderIgnoreAbi
and a proc for setting it.

Inspired by b61b35a0b3

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-01 13:27:58 +02:00
Enrico Weigelt, metux IT consult
bfebe14527 .github: add windows / mingw build
add CI build on MingW / Windows.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:49:24 +02:00
Enrico Weigelt, metux IT consult
235a8e0f91 os: ospoll: include winsock2.h on WIN32 instead of misc.h
On WIN32 we need to include winsock2.h, but we can't include misc.h here
becaues it pulling in X11 headers that are conflicting with win32 headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:41:20 +02:00
Enrico Weigelt, metux IT consult
d71ca03756 doc: Xinput.xml: some indention cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:40:01 +02:00
Enrico Weigelt, metux IT consult
d9f82ada19 os: xtranssock: win32: use separate symbol for socket close
Instead of redefining existing standard libc symbols, pick another symbol
that's mapped to the corresponding platform specific function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:32:03 +02:00
Enrico Weigelt, metux IT consult
7fd5a6759e dix: inpututils: don't use %hhx printf pattern
mingw's printf() doesn't understand it yet, and it's not really
important here, so just use `%hx` instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:31:00 +02:00
Enrico Weigelt, metux IT consult
2353d7a710 os: xtrans: replace _XSERVTransSetOption() by _XSERVTransNonBlock()
The only option left is TRANS_NONBLOCKING, and we only enable and
never disable it. Thus trim down the code into one function for
exactly that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:30:52 +02:00
Enrico Weigelt, metux IT consult
09a80bb1d5 doc: Xserver-spec.xml: replace tabs by 8 characters
Little indention cleanup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:32:22 +02:00
Enrico Weigelt, metux IT consult
8bdc1a6cf3 Revert "doc: refactor and improve X11 input extension porting documentation"
This reverts commit b1ff69a654.

broke the docs build ... and it also seems certain pieces got even missing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:27:00 +02:00
Enrico Weigelt, metux IT consult
ad53be3a32 os: xtrans: drop use of FNDELAY
That's an ancient symbol, which had been replaced by O_NDELAY long ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:10:58 +02:00