Commit Graph

21142 Commits

Author SHA1 Message Date
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
325c403b5f render: picture: make PictFormatShort equal to pixman_format_code_t
Both types are already binary equal: both are enums using the same bit values,
but from compiler's perspective they're still different types, so it's warning.

>   ../glamor/glamor_trapezoid.c:123:47: warning: implicit conversion from
>   enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different
>   enumeration type 'pixman_format_code_t' [-Wenum-conversion]
>     123 |     image = pixman_image_create_bits(picture->format,
>          |             ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~^~~~~~
>    1 warning generated.

The PICT_* fields, values and macros are relics from pre-pixman days (pixman,
historically, essentially is the PICT_* stuff moved out to separate library)
This has been a practical way for doing the transition from the old internal
PICT_* code to pixman. Now it's time to finish it all up and drop the extra
glue layer.

In order to make it smooth, and also providing backwards compatibility for
drivers (until they all keep up), just aliasing the types and adding #define's
for the enum values.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 13:49:13 +02:00
Enrico Weigelt, metux IT consult
3d0df13d78 xkb: xkbDflts.h: drop not needed include of <dix-config.h>
All source files need to include it anyways, so no need to include it here,
and neither having an extra check for HAVE_DIX_CONFIG_H

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 13:04:58 +02:00
Enrico Weigelt, metux IT consult
8a23c1984b Xext: xv: fix redefinition of typedef 'XvPortNotifyPtr'
In file included from ../Xext/xvmc.c:14:
  ../Xext/xvdix_priv.h:31:21: warning: redefinition of typedef 'XvPortNotifyPtr' is a C11 feature [-Wtypedef-redefinition]
     31 | } XvPortNotifyRec, *XvPortNotifyPtr;
        |                     ^
  ../Xext/xvdix.h:73:34: note: previous definition is here
     73 | typedef struct _XvPortNotifyRec *XvPortNotifyPtr;
        |                                  ^
  1 warning generated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 17:12:55 +02:00
Enrico Weigelt, metux IT consult
ffc80b227a Xnamespace: fix wrong const char* authProto
The authProto field always is assigned to dynamically allocated buffer
(strdup()'ed) and needs to be freed sometimes, so cannot be const.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 14:14:26 +02:00
b-aaz
6574903366 include: meson.build: Fixed broken dependency on epoll-shim on FreeBSD.
The epoll-shim dependency did not get detected on FreeBSD,
because of missing prefix and dependency arguments in has_function()
call in include/meson.build.
Also added the path of epoll-shim headers include directory
(/usr/local/include/libepoll-shim/) to the compiler include search
paths for proper detection and build.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2025-08-05 14:04:05 +02:00
Enrico Weigelt, metux IT consult
95959758dc Xi: drop including <dix-config.h> from internal headers
All their consumers need to include <dix-config.h> at the very top anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 12:58:07 +02:00
Enrico Weigelt, metux IT consult
0d8e9ee708 os: xtranssock: drop weird check of "out of range" socket
A socket() call either returns a valid socket fd or -1, there's no need for
trying to check whether the returned fd is out of the OS's allowed range
of fd's, because if it would, the kernel would return error anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 12:18:19 +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
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