Commit Graph

9927 Commits

Author SHA1 Message Date
stefan11111
be7784fce2 kdrive: add fd notification machinery
This will be needed by Xfbdev's keyboard driver, which cannot work
with input threads yet.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 19:48:15 +02:00
Enrico Weigelt, metux IT consult
205c07979b kdrive: export some variables
Allow them to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
0eac1a0ce1 kdrive: export KdRingBell()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
50a5e0b8b4 kdrive: export KdSetLed()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
7213249f14 kdrive: export _KdEnqueuePointerEvent()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
9ce9eb9e42 kdrive: export KdScreenInit()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
0160aee88d kdrive: export KdSaveScreen()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
9c9aa173f1 kdrive: export KdCreateScreenResources()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
4d79e2e73d kdrive: export KdAllocatePrivates()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
d7dbd86045 kdrive: export KdParseRgba()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
cb4eec13ab kdrive: export KdParseKeyboard()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
e85363dfcc kdrive: export KdParsePointer()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
f4d455b684 kdrive: export KdDisableScreens()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
81fbad5115 kdrive: export KdInitScreen()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
2c91c8ad1d kdrive: export KdSetSuspend()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
d30b04499d kdrive: export KdSetColormap()
Allow it to be used by other places, eg. upcoming Xfbdev.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 16:20:36 +02:00
Enrico Weigelt, metux IT consult
6acd1c8a6f xfree86: drm_platform: fix warning on potentially unitialized variable
../hw/xfree86/os-support/shared/drm_platform.c:37:13: warning: variable 'paused' is uninitialized when used here [-Wuninitialized]
     37 |         if (paused) {
        |             ^~~~~~
  ../hw/xfree86/os-support/shared/drm_platform.c:31:16: note: initialize the variable 'paused' to silence this warning
     31 |     Bool paused, server_fd = FALSE;
        |                ^
        |                 = 0
  1 warning generated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 12:15:02 +02:00
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
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
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
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
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
3ac1db8b5e xwin: fix unused variables in winSetShapeMultiWindow()
Fix warnings on unused variables.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 17:05:29 +02:00
stefan11111
9cadd707e9 xfree86: loader: Ignore abi mismatch for the proprietary nvidia DDX
This is a proprietary DDX driver made by nvidia.
We can't rebuild it against Xlibre, so the abi check would always fail.

See: https://github.com/X11Libre/xserver/pull/262
See: https://github.com/X11Libre/xserver/issues/447
See: https://forums.gentoo.org/viewtopic-t-1174826.html

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-31 10:28:08 +02:00
Enrico Weigelt, metux IT consult
f1c1293803 xwin: win.h: missing include of dix/dix_priv.h
Needed for dixAddAtom()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-30 20:40:38 +02:00
Enrico Weigelt, metux IT consult
0888156f31 xwin: fix missing prototype of parse_file()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-30 20:40:21 +02:00
callmetango
cd81282968 config: Preserve section data when parsing duplicate files
Previously, when parsing multiple configuration files containing the same
section names, only the last occurrence of each section would be retained.
Earlier definitions were silently discarded due to unconditional memory
allocation and overwriting of pointers during parsing.

This resulted in incomplete or incorrect configuration state when users
intended to merge or extend configuration through multiple files.

The section parsing functions in Files.c, Flags.c, and Module.c now
accept existing section pointers. These functions allocate new memory only
if the input pointer is NULL, preserving earlier data when re-parsing.

read.c has been updated to detect and pass existing section pointers when
encountering duplicate sections across files, preventing loss of prior content.

With these changes, the parser properly accumulates and merges configuration
data across multiple files, ensuring that all relevant settings are preserved.

Backport from Xorg.

References:
https://gitlab.freedesktop.org/xorg/xserver/-/issues/467
https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2045

Fixes: #279
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-07-30 16:44:58 +02:00
Enrico Weigelt, metux IT consult
9986e17950 meson: move MAXCLIENTS and LIMITCLIENTS into dix-config.h
Both are potentially tunable variables, and MAXCLIENTS is (still) used by
intel-driver, but also by os specific parts that must not include misc.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-30 14:55:40 +02:00
stefan11111
61017cf734 xfree86: fbdevhw: first try /dev/fb, then /dev/fb* on the fallback probe
This commit changes legacy behavior, if anyone was relying on it,
they can make an issue and we can change it back.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
4f2f3ffca1 xfree86: fbdevhw: write more error diagnostics
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
1e7c19a2ec xfree86: fbdevhw: try framebuffers 1 through 7 on the fallback probe
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
9b30bb93f3 xfree86: fbdevhw: try the /dev/fb symlink on the fallback probe
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
e3af4da57b xfree86: fbdevhw: factor out code for checking devices passed by the user
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
731936d20b xfree86: fbdevhw: skip non-pci check on the fallback probe
if the framebuffer device was passed by the user and not guessed

Assume the user knows what they are doing if they tell us to
use a particular framebuffer device, and skip the checks we
have for guessed devices

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
d61cface87 xfree86: fbdevhw: factor out the code for setting the name of the card
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
stefan11111
6233fa8b9f xfree86: fbdevhw: use the fbdev passed by the user, if there is one
The fbdev pci probe doesn't use the fbdev passed by the user,
and instead tries to guess what framebuffer the user wants to use.

Only if that fails, fbdev falls back to the option passed by the user.

This is backwards, if the user explicitly passes a framebuffer
device to use, the X server should use that, and fall back on
guessing if that fails.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00