Commit Graph

9876 Commits

Author SHA1 Message Date
Tautvis
7fa05a8760 modesetting: call xf86_cursors_fini during CloseScreen
Add matching call for xf86_cursors_init to clean memory, as during
initialization it allocates memory (depends, but is something like ~256Kb)
and it leaks when XServer resets.

Signed-off-by: Tautvis <gtautvis@gmail.com>
2025-11-13 16:06:51 +01:00
Enrico Weigelt, metux IT consult
3dbeda9909 xfree86: compat: re-add GEInitEvent() for proprietary nvidia driver
Yet another very internal function that the proprietary Nvidia driver
is using for unknown reasons. NVidia really needs a separate function
for just for some trivial struct initialization and don't manage to
add three simple lines to their code, so we have to make an extra
function for them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-31 16:50:36 +01:00
Enrico Weigelt, metux IT consult
169f912b5b xfree86: compat: re-add TimeCheck() for proprietary nvidia driver
Yet another very internal function that the proprietary Nvidia driver
is using for unknown reasons.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-31 16:50:36 +01:00
Alan Coopersmith
edd022b5ec xfree86: add missing headers to build sun_init.c on Solaris/SPARC
Fixes: 0f715b4 ("xfree86: os-support: move hidden Solaris-specific symbols out of public header")
Fixes: e2fa0d2 ("fix including <sys/mman.h>")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>

Further explanation about this commit by @alanc:

This particular set of `#ifdefs` matches the ones around the code using the fbio ioctls and mmap calls in the `xf86CloseConsole()` code later in the file:
c62cd2feaa/hw/xfree86/os-support/solaris/sun_init.c (L281)
reflecting the lack of /dev/fb style drivers on x86 systems on Solaris.
2025-10-21 13:52:48 +02:00
Alan Coopersmith
73fbf6b645 xfree86: Fix -Wdiscarded-qualifiers warnings in SPARC Sbus probe code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-21 13:52:48 +02:00
Alan Coopersmith
68cb3407d5 xfree86: fix meson build on 64-bit Solaris/SPARC systems
For cpu_family(), meson returns "sparc" for 32-bit sparc,
and "sparc64" for 64-bit sparc, regardless of the OS in use.

For cpu(), meson returns values like "sun4v" on Solaris/SPARC,
and doesn't promise stability of the values, or portability across
OS'es, unlike cpu_family().

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-21 13:52:48 +02:00
Enrico Weigelt, metux IT consult
6f3a4caf97 xfree86: xv: fix missed hooking of WindowDestroy
Forgot to register window destroy hook - that's leading to crash:

    https://github.com/X11Libre/xserver/issues/959

Fixes: b60581e393
Bug: https://github.com/X11Libre/xserver/issues/959
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 17:08:41 +02:00
Enrico Weigelt, metux IT consult
c4f4ad4d93 xfree86: x86emu: drop assert() on uninitialized variable
If assert()s actually enabled, we're having undefined behaviour.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 19:01:11 +02:00
Enrico Weigelt, metux IT consult
1a0b8ac61b xwin: fix missing prototype of parse_file()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 14:44:30 +02:00
Collin
6c6cbbdc57 screen: initialize rootDepth to zero to fix uninitialized-variable warning 2025-08-05 14:44:22 +02:00
Enrico Weigelt, metux IT consult
2423f98886 xfree86: fbdevhw: fix fbdevHWInit() parameter
device name should be const char *.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 14:44:15 +02:00
Enrico Weigelt, metux IT consult
a8fa4cba7a xfree86: i2c: constify I2CBusRec::name
The bus name is always assigned to string literals, thus pointing to
constant data.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 13:26:12 +02:00
Enrico Weigelt, metux IT consult
818001db61 xfree86: fbdevhw: fix fbdevHWProbe() parameter
the device name parameter should be const char *.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 12:57:40 +02:00
Enrico Weigelt, metux IT consult
968500535e 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-08-05 12:31:52 +02:00
Enrico Weigelt, metux IT consult
d8925febf6 xfree86: fix xf86I2CBusInit() prototype
name parameter should be const char *

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 12:30:23 +02:00
Enrico Weigelt, metux IT consult
e9c7aa82e9 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:30:09 +02:00
Enrico Weigelt, metux IT consult
44ec9b0e5b 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-08-05 12:09:39 +02:00
Enrico Weigelt, metux IT consult
0c33925ab0 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-05 11:55:09 +02:00
Enrico Weigelt, metux IT consult
1e214abf9d xwin: fix unused variables in winSetShapeMultiWindow()
Fix warnings on unused variables.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:46:03 +02:00
Enrico Weigelt, metux IT consult
96b0e59066 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-05 11:32:46 +02:00
Enrico Weigelt, metux IT consult
2e0c442567 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-05 11:16:56 +02:00
Enrico Weigelt, metux IT consult
d14679ff29 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-05 11:16:47 +02:00
Joseph Crowell
73db0ed5d4 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-05 11:16:34 +02:00
Enrico Weigelt, metux IT consult
0102f4361f 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:12 +02:00
Enrico Weigelt, metux IT consult
b1393f59aa 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:42 +02:00
Enrico Weigelt, metux IT consult
46c5a87297 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:01:01 +02:00
Enrico Weigelt, metux IT consult
bb1f1752bd 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:41:19 +02:00
Enrico Weigelt, metux IT consult
36125623fd modesetting: fix skipping on empty properties in drmmode_output_set_property()
We actually need to skip the entry if p->atoms is NULL.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:46:57 +02:00
fish4terrisa-MSDSM
c754162a36 modesetting: ignore the drmmode if p->atoms is null
Some display drivers might cause p->atoms to be null if the display is
disabled. This will cause segfault when checking
if p->atoms[0] != property .
Some display drivers owned by qualcomm is known to cause this bug.

Signed-off-by: fish4terrisa-MSDSM <flyingfish.msdsm@gmail.com>
2025-07-11 17:14:07 +02:00
Enrico Weigelt, metux IT consult
dfcfdd67a6 xquartz: drop using HAVE_DIX_CONFIG_H
This symbol is always defined, and the header is always present,
so no need to check for it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-08 17:43:07 +02:00
Enrico Weigelt, metux IT consult
2c50fedc2d xfree86: inputtest: use FatalError() instead of abort()
Directly calling abort() doesn't print a stack trace, nor any useful message.
Instead FatalError() should be used in cases, where there's really no other
way than terminating the Xserver. The FatalError function also tries to make
a smooth shutdown (eg. resetting video mode), so console doesn't end up locked.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-08 15:56:06 +02:00
stefan11111
c4df9ecdc5 kdrive: add documenation for mouse arguments
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-08 13:13:20 +02:00
stefan11111
d0c507d9e7 kdrive: const-qualify KdAddConfig{Keyboard,Pointer}'s argument
The passed name buffer isn't changed by those functions ever
(it would be a bug if they did so), therefore it should be const.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-08 13:13:20 +02:00
stefan11111
836013edca kdrive: move a local variable declaration to the top of the scope
Makes the code more consistent with the rest of the codebase

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-08 13:13:20 +02:00
stefan11111
2884ede393 kdrive: fix incorrect NULL-check
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-08 13:13:20 +02:00
Enrico Weigelt, metux IT consult
c6777fe48e xnest: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c520537
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult
2f46a02217 vfb: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c520537
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult
93013224b4 xquartz: fix incomplete prototype of executable_path()
> ../hw/xquartz/mach-startup/bundle_trampoline.c:53:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> static char *executable_path() {
>                             ^
>                              void
> 1 warning generated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:09:33 +02:00
Enrico Weigelt, metux IT consult
74d5b7bb05 xquartz: drop unused field declarations in request handlers
Silence compiler warning on unused fields, eg.:

> ../hw/xquartz/applewm.c:692:5: warning: unused variable 'stuff' [-Wunused-variable]
>     REQUEST(xAppleWMQueryVersionReq);
>     ^
> ../include/dix.h:65:12: note: expanded from macro 'REQUEST'
>     type * stuff = (type *)client->requestBuffer;
>            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:08:46 +02:00
Enrico Weigelt, metux IT consult
2069db50e7 xfree86: compat: make xf86MsgVerb() a bit less noisier
print the driver bug warning only once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-03 16:55:14 +02:00
Enrico Weigelt, metux IT consult
c24372893b xfree86: compat: consolidate logging
Consolidate the redundant warnings into generic functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:11:28 +02:00
Enrico Weigelt, metux IT consult
28e739e05b xfree86: loadmod: locally scope the errtype variable
In CheckVersion() the errtype variable is used in two separate scopes,
but not globally, so it's cleaner to have it only in the scopes that
are actually using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:03:12 +02:00
stefan11111
3d266528a9 kdrive: ephyr: use c99 struct initialization
For better readability and robustness against future changes, it's
better to use named struct initializers instead of array-like lists.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 16:50:01 +02:00
Enrico Weigelt, metux IT consult
6a3162d623 Xnest: fix analyzer warning on uninitialized DefaultVisual
In xnestOpenScreen(), some compilers/analyzers spitting out a false alarm on
`defaultVisual` field potentially used uninitialized. This can't practically
happen, but not all compilers/analyzers really can see that.

Adding a zero initializer doesn't cost us anything, so silencing that false
alarm is trivial.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 20:30:46 +02:00
notbabaisyou
461411c798 modesetting: allow enabling atomic mode.
The Linux kernel has long had code preventing Xorg from using atomic
modesetting due to various bugs in it's implementation, some of these
issues have since been fixed but some issues remain namely with DPMS
and other smaller things, we should allow users to opt-in by setting
"Option 'Atomic' 'True'"

This shouldn't cause any issues as the feature remains disabled by default.

Co-authored-by: Daniel Abrecht <public@danielabrecht.ch>
Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
2025-06-27 19:23:31 +02:00
notbabaisyou
4afcb1cd7b modesetting: Fix typo.
`modsetCreateScreenResources` -> `modesetCreateScreenResources`

Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
2025-06-27 17:10:33 +02:00
Mike Gelfand
4f7000f620 xquartz: add missing include for XkbSetRulesDflts
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Mike Gelfand
3e89bd7409 xquartz: add missing include for DeliverEvents
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Mike Gelfand
edb020e306 xquartz: depend on libXdmcp (includes osdep.h which includes X11/Xdmcp.h)
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Mike Gelfand
d89b3596f0 xquartz: depend on libX11 (includes X11/Xlib.h)
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00