Commit Graph

9943 Commits

Author SHA1 Message Date
stefan11111
6644e040ae kdrive: add recolorCursor card function
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 18:18:57 +02:00
Enrico Weigelt, metux IT consult
50cba096da kdrive: drop unused extern declaration of non-existent nClients variable
This variable doesn't even exist, so there shouldn't be any declaration of it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 17:40:49 +02:00
stefan11111
b773f7844d xfree86: loader: Make the X server work with both old
and new versions of the proprietary nvidia DDX driver

The 470 driver expects older abi, while the 570 driver
uses different code at runtime depending of the abi version.

This commit tells the new nvdia driver to use the older
abi that the 470 driver expects.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 17:02:12 +02:00
stefan11111
90846d49cc xfree86: add (optional) ScreenRec padding for legacy Nvidia driver
Commit 3cb3024fea removed pScratchPixmap field
in ScreenRec, which broke legacy Nvidia (proprietary) drivers (470.x), thus
we should add an empty/dummy field here, to ensure correct padding. But this
would break ABI again - can't do that within minor release line.

As compromise, adding a *build time* option CONFIG_LEGACY_NVIDIA_PADDING for
this, so operators/packagers can opt-in to this change.

As it breaks ABI, the option is disabled by default until the next major release
and intended for EXPERTS ONLY who need nvidia390 or nvidia470 drivers.

Note that ALL DRIVERS should be rebuild if it is applied!

This compile-time option, along with the hacks needed to support it
in a non-abi-breaking way, should be droppen in the next major release.

Co-authored-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 17:02:12 +02:00
Enrico Weigelt, metux IT consult
d6089c52c3 treewide: macro for computing extra units needed for reply header
Add and use macro X_REPLY_HEADER_UNITS() for computing how many
extra protocol units are needed for a reply header (for .length field)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 14:14:32 +02:00
Enrico Weigelt, metux IT consult
3e76baff89 xwin: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
5823fc2b7f xquartz: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
5bde454490 xnest: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
c77d47a3ac xfree86: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
97d72431cf kdrive: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
34c3a9c7e2 treewide: fix serverGeneration int type mismatch
The global (exported) serverGeneration field is `unsigned long`, while
many other places copy it and compare it two other integer types, eg.
plain `int` (which is signed). Even if it's unlikely ever reaching such
high number of generations that it will ever make trouble, it's still
a good idea to clean this up and use the same type everywhere.

For clearity, introducing a typedef `x_server_generation_t` which is
used everywhere, instead of raw `unsigned long`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:52:03 +02:00
callmetango
b59b6226d7 xfree86: enable semantic versioning
* switch major version from 25.0 to 25
* make loader respect legacy 25.0 module dirs (to be removed in version
  26)

Fixes: #646
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-08-11 20:25:52 +02:00
Enrico Weigelt, metux IT consult
35a43252ca treewide: replace PICT_a8r8g8b8 by PIXMAN_a8r8g8b8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
1bfd27e8f6 xfree86: parser: use xhostname()
Simplify DoSubstitution() by using xhostname(). Neither need to
care about OS specifics here, nor take care of zero-terminating the
hostname string - xhostname() is already doing this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 16:57:43 +02:00
Enrico Weigelt, metux IT consult
4d532adf7d vfb: use xhostname()
Simplify vfbWriteXWDFileHeader() by using xhostname(). Neither need to
care about OS specifics here, nor take care of zero-terminating the
hostname string - xhostname() is already doing this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 16:57:43 +02:00
Joseph Crowell
1744f34f83 xfree86: modesetting: meson: fix symbol test path 2025-08-07 16:48:50 +02:00
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