Commit Graph

22444 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
875c29c253 xv: inline SWriteQueryExtensionReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryExtension().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
9c3d48fa24 miext: damage: tolerate NULL pointers in DamageScreenFuncsRec
For now that case doensn't practically happen yet - all fields are at
least assigned to some default/dummy function. But in the future, we
might wanna get rid of dummies.

From now on, video drivers are allowed to assign them to NULL, if they
don't wanna have the default implementations and nothing happening
at all instead (no more need for having their own empty dummies)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:36:21 +02:00
Medvidek77
02bba6d9b3 Update meson.build 2025-07-31 16:13:59 +02:00
Medvidek77
e24a13065d Fixed xserver version 2025-07-31 16:13:59 +02:00
Janne Rovio
b1ff69a654 doc: refactor and improve X11 input extension porting documentation
* Removed unnecessary comments (<!-- .LP -->).
* Corrected punctuation and improved sentence structure.
* Ensured consistent capitalization (e.g., "X11" vs "X Server").
* Fixed minor typos and spelling errors.

Signed-off-by: Janne Rovio trollsix10@gmail.com
2025-07-31 16:10:28 +02:00
Enrico Weigelt, metux IT consult
4a073eb318 panoramix: add static protocol struct size asserts
Add compile-time checks on whether sizeof(foo) == SIZEOF(foo),
using new static assert macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:50:21 +02:00
Enrico Weigelt, metux IT consult
19c21b24ae dix: macro for checking X protocol types
The X protocol types from xorgproto all have corresponding sz_<typename>
defines with their actual network payload size (this can be checked via
SIZEOF() macro).

In theory, this should always be the same as sizeof(), but just to be sure,
adding a macro for a static assert on that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:50:21 +02:00
stefan11111
73e56fd076 glamor: handle if GBM_BO_USE_SCANOUT is not supported
Backport from Xwayland:
https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/433
111d318fc2

See also:
https://forums.developer.nvidia.com/t/gbm-surface-create-fails-if-flags-0/279951
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3304#note_1983279
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1535

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-31 15:48:41 +02:00
stefan11111
e6885d7e8b glamor: use gbm_bo_create_with_modifiers2()
This allows us to pass flags to the function, avoiding the forced
implicit GBM_BO_USE_SCANOUT which happens with the older version.

Backport from Xwayland:
f31ca9238f

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-31 15:48:41 +02:00
stefan11111
bf86850288 glamor: Only use modifier gbm API if explicit
If we're using implicit modifiers, we'll pass NULL and zero modifiers.
Lets just use the legacy API directly instead.

Backport from Xwayland:
08b0ea09de

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-31 15:48:41 +02:00
stefan11111
0f0b33b5b5 glamor: if glamor_get_modifiers make *num_modifiers 0, make *modifiers NULL
This likely wasn't a problem, as *num_modifiers was 0, so likely no
data was read from a potentially uninitilaized pointer, but it's
still better to explicitly set it to NULL.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-31 15:48:41 +02:00
Enrico Weigelt, metux IT consult
7a4bf5ab10 dbe: ProcDbeGetVisualInfo(): reduce temporary allocations
Since we're now constructing the payload step by step via x_rpcbuf,
there's no need to have an extra loop for collecting dbeScreenVisualInfo's,
we can just fetch and process them one by one, and so don't need extra
temporary storage for them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:47:49 +02:00
Enrico Weigelt, metux IT consult
1bcff3fe35 dbe: ProcDbeGetVisualInfo(): drop unncessary payload length computation
Since using x_rpcbuf, we don't need extra computation of the payload_length,
as the x_rpcbuf already knows the amount of data written into it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:47:49 +02:00
Enrico Weigelt, metux IT consult
b60c739384 dbe: ProcDbeGetVisualInfo(): use x_rpcbuf for visual info payload assembly
By using the new x_rpcbuf, it's easy to assemble packets step by step,
without even knowing the final size yet and doing the write out in
one step.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:47:49 +02:00
Enrico Weigelt, metux IT consult
8c3d608d4e os: xserver_poll: skip defining symbols already defined by mingw
mingw already has struct pollfd and POLL* defines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:28:08 +02:00
Enrico Weigelt, metux IT consult
9fdb2482de os: xtrans: drop define of EINPROGRESS
Never used anywhere and conflicts with system headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:24:30 +02:00
Enrico Weigelt, metux IT consult
90d0c2d4a0 os: xtrans: drop unused TRANS_CLOSEONEXEC
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:23:27 +02:00
Enrico Weigelt, metux IT consult
237e5f5e1e Xnamespace: fix printf patterns
For printing 32bit integers, we need to use PR*32 macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:23:05 +02:00
Enrico Weigelt, metux IT consult
d9db02d700 os: ospoll: use stdbool instead of X11's Bool
Low level OS specific code should not depend on higher level protocol
headers. This also removes yet another conflict with win32/mingw headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:22:07 +02:00
Enrico Weigelt, metux IT consult
91d20b0cb9 mi: use %lu instead of %zu in ErrorF() call
mingw doens't support `%zu` printf pattern yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:21:24 +02:00
Enrico Weigelt, metux IT consult
93f57f68a2 os: xserver_poll: replace own typedef by size_t
No need to have an own typedef here, just use standard size_t.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 14:50:05 +02:00
Enrico Weigelt, metux IT consult
e1b1c2f514 os: ospoll: use realloc() instead of reallocarray()
MacOS doesn't support reallocarray(), and we can't include os.h here
on win32/mingw.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 14:49:23 +02:00
callmetango
23f26bd95e README: mention June 2025 X.Org CVE fixes
Mention the integration of the June 2025 X.org CVE fixes into the XLibre
Xserver. Add a link to our Q&A discussions as well.

Fixes: #522
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-07-31 10:39:04 +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
8299ef3d81 os: xtrans: fix shadowed variable
`arg` is also a parameter of that functions, so we really shouldn't
also have a local variable by the same name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-30 20:40:51 +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
5e13b59163 NEWS: updated to version 25.0.0.7
Updated the NEWS with the shortlogs of version 25.0.0.6 and 25.0.0.7.

Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-07-30 19:20:10 +02:00
Enrico Weigelt, metux IT consult
53691f7174 os: xtranssock: undefine before redefining EADDRINUSE
prevent warning on doubly defined preprocessor symbol.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-30 19:09:44 +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
Oleh Nykyforchyn
0c23d26fb8 xserver: os/log.c: ignore alternate forms in log formats
This patch fixes Xserver crashes when evdev or synaptics input drivers are used.
These (and maybe other) driver use alternate forms "%#..." in formats for
xf86IDrvLogVerb() function, which in turn uses signal-safe vpnprintf().
The last function does not recognize alternate forms and exits abnormally, which
causes Xserver to crash. The patch make vpnprintf() to ignore alternate forms.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-07-29 16:21:02 +02:00
Oleh Nykyforchyn
d9330703c8 xserver: miext/sync/meson.build: compile misyncshm.c if xshmfence found
It is a patch that fixes xserver build if libdrm is too old.

Now misyncshm.c compilation depends on dri3, which is incorrect. If libdrm
is not recent enough, then dri3 is not built, the file misyncshm.c
is not compiled, and the function miSyncShmScreenInit() is unavailable.
It is called in glamor_sync.c if xshmfence is present, which causes
a compilation error. This patch makes misyncshm.c compile if xshmfence
is found.

Signed-off-by: Oleh Nykyforchyn <olen.nyk@gmail.com>
2025-07-29 14:20:51 +02:00
Enrico Weigelt, metux IT consult
c3b768802a record: stop using request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-29 11:45:53 +02:00
Enrico Weigelt, metux IT consult
e1bbe46cbf randr: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-29 11:45:53 +02:00
Enrico Weigelt, metux IT consult
5c3790511c Xext: ggext: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-29 11:45:53 +02:00
stefan11111
a956cfa211 config: fix build with -Dudev=false -Dudev_kms=true
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 17:24:05 +02:00
stefan11111
ed12dbbc18 meson.build: Check for libudev directly, instead of our flimsy os-speciffic guessing
Implement what was discussed in https://github.com/X11Libre/xserver/issues/478

Use dependency() instead of cc.check_header(), as the former is the
intended way to check for dependencies.

cc.check_headers would turn udev on on systems where libudev.h
is present, but libudev.pc isn't.

Thos would do the wrong thing on systems where the admin wants to
have that header for some reason, but doesn't want programs to use
libudev.

We also keep udev and udev_kms a tristate, so we try to do
the right thing when the user doesn't explicitly pass
values for udev and udev_kms.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 17:24:05 +02:00
Enrico Weigelt, metux IT consult
879bc0012d os: xdmcp: fix missing include of <X11/Xdmcp.h>
xdmcp.h is using types from <X11/Xdmcp.h>, but forgot to include it.
This just popped up with building w/ -Dxdmcp=false, because that file was
included in the wrong place (osdep.h) and only conditionally.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-28 16:20:58 +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
stefan11111
ca7a1e1e39 xfree86: fbdevhw: drop 'mode' argument from open() calls
The 'mode' argument for open() is only used when files
are created, and files aren't created here.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-28 15:35:25 +02:00
Enrico Weigelt, metux IT consult
0c261e0104 .github: fix intel driver repo url
Should not have `.git` suffix.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-25 17:14:25 +02:00
Enrico Weigelt, metux IT consult
296e7cb842 os: ospoll: add missing include of <assert.h>
We're using assert() here, so need to include <assert.h>

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-25 16:20:52 +02:00