Commit Graph

22696 Commits

Author SHA1 Message Date
Sultan Alsawaf
7f7753dd87 modesetting: Don't recursively force present to unflip
Present calls drmmode_set_mode_major() as part of ms_present_unflip(),
which leads to a crash due to the recursive attempt to force present to
unflip when it already is.

Fix it by simply skipping the forced present unflip when present itself is
unflipping. This also speeds up drmmmode_prepare_modeset() when present
isn't even flipping to begin with.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1791

Fixes: 899c87af1f ("modesetting: unflip before any setcrtc() calls")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1793>
2026-03-19 18:48:28 +01:00
Povilas Kanapickas
9edc105abd Revert "glamor: explicitly draw endpoints of line segments"
This reverts commit 530e80375e.

The commit breaks xts5/Xlib9/XDrawLines/XDrawLines test as per
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1801#note_2812218

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1858>
2026-03-19 18:48:04 +01:00
stefan11111
a2976e3023 treewide: Pull DEFAULT_LOGDIR into dix-config.h
With this, X servers don't have to parse this option separately,
and can just use it after including dix-config.h

Linux kdrive servers (currently Xfbdev only) now support logging.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2026-03-18 14:09:52 +01:00
EXtremeExploit
16fe763707 os/log: Fix syslog identification
Signed-off-by: EXtremeExploit <pedro.montes.alcalde@gmail.com>
2026-03-18 10:13:41 +01:00
NexusSfan
13234efe7b Fix Hurd support for the vesa driver.
Also, nitpick, but `__GNU__` is the correct ifdef to use, not `__hurd__`.

Signed-off-by: NexusSfan <nexussfan@duck.com>
2026-03-16 13:30:13 +01:00
Mikhail Dmitrichenko
9036215b02 dix: avoid null ptr deref at doListFontsAndAliases
In the `doListFontsAndAliases` function in dixfonts.c, when a font alias
is encountered (`err == FontNameAlias`) as a result of
`list_next_font_or_alias` call, the code allocates memory for
`resolved` variable (`resolvedlen + 1` bytes) for storing target font
name. In this case, if the `malloc(resolvedlen + 1)` call fails,
`resolved` remains NULL.

Later, when check (`else if (err == FontNameAlias)`) is TRUE, the code
uses `memcpy` to copy nullable `resolved` into `tmp_pattern` without
checking if `resolved` is NULL, so there is a potential null ptr
dereference.

This commit replaces `malloc` with `XNFalloc` for allocating memory for
`resolved`. `XNFalloc` will internally check result of `malloc` and stop
program execution if allocation was failed, preventing potential NULL
dereferencing.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2114>
2026-03-16 13:26:38 +01:00
Mikhail Dmitrichenko
4eeb22c8be render: fix multiple mem leaks on err paths
Free nested allocations when initialization fails.
Several code paths returned early on error without releasing
memory owned by embedded structures, leading to leaks.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2125>
2026-03-16 13:26:38 +01:00
Merlion Spiller
0f5c85f51b COPYING: add author to HPND-sell-MIT-disclaimer-xserver
the license notice comes from these files:
- dix/registry.c
- Xext/xselinuxint.h
- Xext/xselinux_label.c
- Xext/xselinux_hooks.c
- Xext/xselinux_ext.c
- Xext/xselinux.h
- Xext/xacestr.h
- Xext/xace.h
- Xext/xace.c

while this is not like the standard `Copyright (C)` lines I think it
still belongs to the license, even if just to make it more clearly
separate from the MIT license above

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2098>
2026-03-16 13:25:53 +01:00
Merlion Spiller
6aa1ba4579 COPYING: add missing paragraph to SGI-B-2.0
all files that this license applies to include the last paragraph:
- glx/xfont.c
- glx/unpack.h
- glx/singlesize.h
- glx/singlesize.c
- glx/singlepixswap.c
- glx/singlepix.c
- glx/single2swap.c
- glx/single2.c
- glx/rensize.c
- glx/renderpixswap.c
- glx/renderpix.c
- glx/render2swap.c
- glx/render2.c
- glx/glxutil.h
- glx/glxdrawable.h
- glx/glxserver.h
- glx/glxcontext.h
- glx/glxscreens.h
- glx/glxscreens.c
- glx/glxcmdsswap.c
- glx/glxext.h
- glx/glxcmds.c
- glx/glxext.c

the paragraph was likely accidentally missed when the license changed
from SGI-B-1.0 to SGI-B-2.0 in ed9aecf851

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2097>
2026-03-16 13:25:53 +01:00
Qiang Yu
2c0c2ec102 glamor: enable dmabuf_capable by default for radeonsi
This is needed by radeonsi to support multi plane modifier when
using modesetting DDX.

xserver reject any multi plane buffer (in DRI3PixmapFromBuffers)
without the dmabuf_capable debug option. It's OK for single plane
buffer as xserver will fallback to DRI3BufferFromPixmap path.
amdgpu DDX does not expose DRI3PixmapFromBuffers, mesa just use
the single plane path anyway, so amdgpu DDX does not have this
problem.

Reviewed-by: Sultan Alsawaf <sultan@kerneltoast.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2091>
2026-03-16 13:23:52 +01:00
Wismill
dc79426c04 xkb: Fix key type without level names in XkbCopyKeymap
A key type that has no level names is legit. Before this commit,
`XkbCopyKeymap` would make such level inconsistent by setting its
number of levels to 0 while keeping its map entries. It suffices
to clear the names array.

Fixed by copying the level count from the source type.

WARNING: this will trigger an error in `XkbGetNames`, which worked
before this commit only by chance.
This is fixed in the next commit (squashed with this one).

------------------------------------------------------------------

xkb: Fix serialization of key type without level names

Before this commit the count of key type level names was wrongly set
in `XkbGetNames`: for key type without names, it was set to the level
count, while it should be 0:
- `XkbComputeGetNamesReplySize()` does not account key type without
  level names;
- `XkbSendNames()` does not write any level entry for key types without
  level names.

This causes a mismatch offset while parsing the response and its
processing would ultimately fail.

Fixed by setting the correct level name count: 0 if there is no level
name, else the number of levels.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2082>
2026-03-16 13:23:16 +01:00
Icenowy Zheng
d0e2967eab modesetting: properly use fb_id of front_bo for reverse PRIME CRTC
When doing reverse PRIME, the buffer being scaned out is still the front
BO.

Properly reuse its fb_id, to prevent adding a FB for the front_bo each
time the fb_id is requested.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2064>
2026-03-16 13:22:51 +01:00
matt335672
f70e79b374 Add docs for some internal methods
Doxygen headers added for XkbGetCoreMap() and XkbSetRepeatKeys()

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1851>
2026-03-16 13:20:45 +01:00
Thomas Zimmermann
ca1c0976dd Add a workaround to accept devices of the kernel's corebootdrm
driver. Makes Xorg work on pre-configured displays with coreboot
and the DRM graphics stack. Review of the corebootdrm driver
happens at [1].

Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/series/159820/ # [1]
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2132>
2026-03-16 13:19:45 +01:00
Thomas Zimmermann
af1459136d xf86: Accept devices with the kernel's vesadrm driver
Add a workaround to accept devices of the kernel's vesadrm driver.
Makes Xorg work on pre-configured displays with VESA and the DRM
graphics stack. Review of the vesadrm driver happens at [1].

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/series/146477/ # 1
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1879>
2026-03-16 13:19:45 +01:00
Thomas Zimmermann
901146fe17 xf86: Accept devices with the kernel's efidrm driver
Add a workaround to accept devices of the kernel's efidrm driver.
Makes Xorg work on pre-configured displays with UEFI and the DRM
graphics stack. Review of the efidrm driver happens at [1].

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/series/146477/ # 1
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1879>
2026-03-16 13:19:45 +01:00
Timo Aaltonen
bd5c2ee289 xf86pciBus.c: use Intel ddx only for pre-gen3 hardware
Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting.

Instead of defaulting to the Intel driver for all Intel hardware, only
default it for older hardware for which it has shown to be better for.

Note that Debian/Fedora and their derivatives, as well as the yocto project
have been carrying this patch for many years:
192254841a
ee515e44b0

so this simply aligns xserver upstream with Linux distributions.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Co-authored-by: Balló György <ballogyor@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1887>
2026-03-16 13:18:42 +01:00
Icenowy Zheng
e2550d065b randr: do full transform when checking SetScreenSize size
When validating the size passed to SetScreenSize, the CRTC mode size
needs to be applied the full CRTC transform, otherwise the check may
bogusly fail.

Do a full transform on the CRTC mode size when checking the
SetScreenSize request size instead of the current code that only
manually handles rotation.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1971>
2026-03-16 13:18:13 +01:00
hongao
f0a679cfb2 randr: clear primary screen's primaryOutput when the output is deleted
This fix use after free when a pluggable gpu screen (such as displaylink)
was set as primary screen and unpluged.

gdb backtrace:
```
 0 OssigHandler (signo=11, sip=0x7fff2e0a50f0, unused=0x7fff2e0a4fc0) at ../../../../os/osinit.c:138
 1 <signal handler called>
 2 rrGetscreenResources (client=0x3195160, query=0) at ../../../../randr/rrscreen.c:577
 3 0x0000000000562bae in ProcRRGetscreenResourcesCurrent (client=0x3195160) at ../../../../randr/rrscreen.c:652
 4 OxOOOOB0000054de63 in ProcRRDispatch (client=0x3195160) at ../../../../randr/randr.c:717
 5 0x00000000004322c6 in Dispatch () at ../../../../dix/dispatch.c:485
 6 0x0900900990443139 in dix_main (argc=12, argv=0x7fff2e0a5f78, envp=0x7fff2e0a5fe0) at ../../../../dix/main.c:276
 7 0X0000000000421d9a in main (argc=12, argv=0x7fff2e0a5f78, envp=0x7fff2e0a5fe0) at ../../../../dix/stubmain.c:34
```

Signed-off-by: hongao <hongao@uniontech.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1553>
2026-03-16 13:16:39 +01:00
Benjamin Valentin
7ffd763439 xf86: check return value of XF86_CRTC_CONFIG_PTR in xf86CompatOutput()
If privates[xf86CrtcConfigPrivateIndex].ptr is NULL, this will cause
a segfault.

Possible fix for https://gitlab.freedesktop.org/xorg/xserver/-/issues/1241

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/835>
2026-03-16 13:14:07 +01:00
Jon Turney
3ac5886879 hw/xwin: Allow DefWindowProc to SetFocus() as needed after WM_ACTIVE
Don't indicate we've processed WM_ACTIVATE, so DefWindowProc can do
not-clearly specified default things with the focus.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-03-16 13:12:29 +01:00
Jon Turney
0decf12c56 hw/xwin: More adjustments to multiwindow mode focus handling
The previous change is not enough, as WM_KILLFOCUS can apparently be
sent to the window losing focus after WM_ACTIVATE has been sent to
the window gaining focus.

Try using WM_SETFOCUS instead, as that has the correct ordering and seems
more logical.

The test "!pWin || !pWin->overrideRedirect" is confusingly written: It's
true if:

(a) pWin is NULL (= X window doesn't exist, shouldn't happen), or
(b) pWin->overrideRedirect is FALSE

i.e. the intended effect is "don't give focus to override redirect windows"

There seem to be some cases where this still isn't quite correct: A
reproduction isn't known, but it seems to be related to minimizing a
maximized Windows window, and having window activation move to a
maximized X window beneath it.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-03-16 13:12:29 +01:00
Jon Turney
0adc6ff90f hw/xwin: Always set the X input focus to none when an X window loses focus
In the multiwindow WM, we need to cancel the X input focus if the
Windows input focus has gone to the desktop, or another application's
window.

We could maybe avoid some unneeded work by not doing this if the
WM_KILLFOCUS wParam is another window owned by us, which is immediately
going to be given the X input focus.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-03-16 13:12:29 +01:00
Jon Turney
3954f766af hw/xwin: Use revert-to-parent X focus mode in multiwindow WM
Use revert-to-parent X focus mode, as recommended in ICCCM 4.1.7

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-03-16 13:12:29 +01:00
Diego Viola
639551d032 treewide: fix typos
Signed-off-by: default avatarDiego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2138>

---------------------------------------------------------------------------

One of the spelling errors was moved to another file and fixed there

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2026-03-16 13:11:07 +01:00
stefan11111
e6a0fa4b0c Treewide: Fix typos
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2134>

----------------------------------------------------------------------------

This commit is the result of `git apply commit.diff --reject`
applied on e8f4522312

67c82078fe does not
apply to Xlibre

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2026-03-16 13:11:07 +01:00
Alan Coopersmith
3783d7eeee xfree86: issue error if too many clocks entries are listed in config
Changes message issued for too many clocks from the confusing:
    "29.0" is not a valid keyword in this section.
to the more obvious:
    More than 128 Clocks defined.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2130>
Fixes: https://github.com/X11Libre/xserver/issues/1407
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1851
Fixes: https://github.com/X11Libre/xserver/pull/1416
2026-03-16 13:08:04 +01:00
Alan Coopersmith
e4d55c4453 ephyr: show that -name & -title take non-optional arguments in usage output
Fixes: f028e245a7 ("Bug #10016: Implement WM_CLASS hints in Xephyr.")
Fixes: e3c65cf1df ("xephyr: Add -title option.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2137>
2026-03-16 13:06:53 +01:00
Alan Coopersmith
6e3afd4be4 ephyr: add -name to Xephyr man page
Fixes: f028e245a7 ("Bug #10016: Implement WM_CLASS hints in Xephyr.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2137>
2026-03-16 13:06:53 +01:00
Alan Coopersmith
bee767c000 ephyr: add -title to Xephyr man page
Fixes: e3c65cf1df ("xephyr: Add -title option.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2137>
2026-03-16 13:06:53 +01:00
Alan Coopersmith
465742c7b4 os: add a generic -verbose option instead of making each server add its own
Replaces Xwayland's server-specific implementation, but leaves Xorg's
since it sets global variables in the xfree86 ddx layer.  Also leaves
Xephyr's differently-spelled "-verbosity" for backwards compatibility.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2131>
2026-03-16 13:06:32 +01:00
Alan Coopersmith
3ee086b897 os: fix sha1 build error with Nettle 4.0
Nettle 2.6 (released in 2013) split the sha.h header into sha1.h & sha2.h,
but left the sha.h header for compatibility until the recent Nettle 4.0
release finally removed it.

Nettle 4.0 also dropped the length argument from the sha1_digest function.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1871
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2133>
2026-03-16 13:02:37 +01:00
Enrico Weigelt, metux IT consult
cb5f2cd67e .github: move run-xserver-build-and-test.sh under ubuntu/ subdir
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-18 11:22:21 +01:00
Enrico Weigelt, metux IT consult
6d6f2b3a98 .github: move some build & test pieces from pipeline to script
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-18 10:52:49 +01:00
Enrico Weigelt, metux IT consult
09fdd4ea55 .github: builder-xserver: change dependency package directory
Using the same one that MPBT is using.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-17 12:45:20 +01:00
Enrico Weigelt, metux IT consult
369f9a8b16 .github: builder-xserver: change meson build dir
Using the same meson build subdirectory that MPBT is using.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-17 11:46:40 +01:00
Enrico Weigelt, metux IT consult
f5295b8d36 .github: update XTS
use commit 6cf94400a09abecd6b86e4eb6441741acecd51f6

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-16 16:43:13 +01:00
Enrico Weigelt, metux IT consult
922c4e2843 .github: update piglit
Use piglit commit 59111996534f875ca88bce51f21fa2e6564895da.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-16 16:19:53 +01:00
Enrico Weigelt, metux IT consult
a208c9e015 drop obsolete .travis.yml
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-16 15:52:43 +01:00
Enrico Weigelt, metux IT consult
51a7ffdc52 drop obsolete .gitlab-ci.yml
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-16 15:52:28 +01:00
Joseph Crowell
8f542381da dri3: return 1.4 version if we can do 1.4
Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-02-16 15:17:26 +01:00
Joseph Crowell
2394c7c1cc dri3: update version check to include 1.1 check
Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-02-16 15:17:26 +01:00
Enrico Weigelt, metux IT consult
126eb37529 kdrive: linux: replace __uid_t and __gid_t by standard types
Fix build on musl.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-16 14:51:39 +01:00
Enrico Weigelt, metux IT consult
e1933ec5a7 meson.build: fix .pc and .m4 install on xorg-sdk-only build
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-14 14:30:39 +01:00
Enrico Weigelt, metux IT consult
1d27e2878a .github: build drivers against xorg-sdk without actual Xserver compile
Use the new xorg-sdk build type instead of building a complete Xserver,
to compile our drivers against.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-13 16:57:14 +01:00
Enrico Weigelt, metux IT consult
af0de5a0f4 xfree86: make xf86Sbus.h private
This header isn't actually included by any drivers (not even the sun* ones),
neither does it have any _X_EXPORT'ed symbols, nor structs that a driver
could use. Not relevant at all for proprietary Nvidia drivers, because their
cards never worked on Sbus.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-13 16:29:01 +01:00
Enrico Weigelt, metux IT consult
1e6c7be1df meson.build: don't compile anything when no DDX is enabled
The practical use case is just installing Xorg SDK headers for driver build,
but not having to actually compile anything.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-13 15:43:34 +01:00
Enrico Weigelt, metux IT consult
921215026f xfree86: ramdac: don't ifdef on HAVE_XORG_CONFIG_H
It's always present, so no need to ifdef on it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-13 14:00:57 +01:00
Enrico Weigelt, metux IT consult
7f8eeb5471 xfree86: sdksyms.sh: don't ifdef on HAVE_XORG_CONFIG_H anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-13 14:00:49 +01:00
Enrico Weigelt, metux IT consult
3c11149ae0 randr: don't ifdef on RANDR_10_INTERFACE anymore
It's always present (and wont go away), so no need to ifdef on it.
Still keeping the symbols, until we're sure no drivers still depending
on it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-13 14:00:41 +01:00