Commit Graph

9897 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
1f66f6076b xfree86: ddc: add xf86Monitor_gtf_supported()
replacement for GTF_SUPPORTED() macro that's not a good API isolation
at all. Drivers should use that function instead for checking whether
the monitor supports GTF.

Should be backported to older releases, too - so drivers don't need
extra per-Xserver-version tweaks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-02-03 09:57:05 +01:00
Enrico Weigelt, metux IT consult
5acf9d4069 xfree86: add exported xf86GetConsoleFd()
This functions is designed for some legacy keyboard drivers
(eg. xf86-input-keyboard) that need to get the fd to the console
device, so they don't need to directly access xf86Info field anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-14 11:15:41 +01:00
Enrico Weigelt, metux IT consult
9599e0849e xfree86: add macros for declaring XF86ModuleData fields
XF86_MODULE_DATA_INPUT() creates XF86ModuleData field for input driver,
while XF86_MODULE_DATA_VIDEO creating one for a video driver.

These are filled with given values, _X_EXPORT'ed and properly named so
the module loader can find them. Also creating the associated
XF86ModuleVersionInfo field and link them into the XF86ModuleData.

Example:

    XF86_MODULE_DATA_INPUT(
        egalax,
        eGalaxPlug,
        eGalaxUnplug,
        "egalax",
        PACKAGE_VERSION_MAJOR,
        PACKAGE_VERSION_MINOR,
        PACKAGE_VERSION_PATCHLEVEL);

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-07 20:39:02 +01:00
Enrico Weigelt, metux IT consult
8c185f1379 xfree86: xf86Module.h: macro for declaring video driver module version
Reduce the effort of declaring/filling an video driver's module version
struct to short statement like this:

    XF86_MODULE_VERSION_VIDEO("ati",
                              PACKAGE_VERSION_MAJOR,
                              PACKAGE_VERSION_MINOR,
                              PACKAGE_VERSION_PATCHLEVEL);

This will create a properly filled XF86ModuleVersionInfo structure
named `modInfo`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-07 20:26:17 +01:00
Enrico Weigelt, metux IT consult
84d631bc6d xfree86: xf86Module.h: macro for declaring input driver module version
Reduce the effort of declaring/filling an input driver's module version
struct to short statement like this:

    XF86_MODULE_VERSION_INPUT("egalax",
                              PACKAGE_VERSION_MAJOR,
                              PACKAGE_VERSION_MINOR,
                              PACKAGE_VERSION_PATCHLEVEL);

This will create a properly filled XF86ModuleVersionInfo structure
named `modInfo`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-07 19:55:20 +01:00
Enrico Weigelt, metux IT consult
f93fb63e1b stop defining _XF86DRI_SERVER_
This once was needed on including xf86driproto.h, but these day
have gone now for aeons.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-05 14:42:09 +01:00
Enrico Weigelt, metux IT consult
424383ddf6 xfree86: compat: fix DragonFly build
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-23 20:40:37 +01:00
Enrico Weigelt, metux IT consult
3cb5fc8f81 xfree86: loader: add subdirs for input and video drivers
in the future, input and video drivers should reside in separate
sub-directories. still supporting the old dirs until ABI 26.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-19 17:50:16 +01:00
Enrico Weigelt, metux IT consult
c9dde4ef01 mingw32: fix winsock2.h include
winsock2.h needs to be included before windows.h

> /usr/share/mingw-w64/include/winsock2.h:15:2: error: #warning Please include winsock2.h before windows.h [-Werror=cpp]
>    15 | #warning Please include winsock2.h before windows.h
>       |  ^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-19 12:37:12 +01:00
b-aaz
70c113eb89 arm_video.c: Fixed xf86_os_support.h's #include.
The 'h' in the file suffixed was mistakenly removed, fixed it.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2025-12-19 12:22:27 +01:00
Herman Semenoff
83b0ce7275 xfree86: fix infinite boot when parsing incorrect BusID section Device
This change checks if there is a colon after the bus name. If there is none, *retID will point to the final null character of the original string.
2025-12-16 15:54:03 +01:00
Enrico Weigelt, metux IT consult
adc2653824 kdrive: ephyr: add noreturn attribute to ephyrProcessErrorEvent()
>  ../hw/kdrive/ephyr/ephyr.c:977:1: warning: function 'ephyrProcessErrorEvent' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
>    977 | {
>        | ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-11 15:05:01 +01:00
Enrico Weigelt, metux IT consult
041df2b777 xfree86: fix include of xf86VGAarbiter_priv.h
Needs to be included also in non-pciaccess case, so the dummy
functions are declared.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-11 15:04:52 +01:00
Enrico Weigelt, metux IT consult
c2d60070ad xfree86: silence warnings on SYSCALL() macro
> ../hw/xfree86/os-support/shared/posix_tty.c:366:38: warning: while loop has empty body [-Wempty-body]
>    366 |     SYSCALL(r = read(fd, buf, count));
>        |                                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-11 15:04:34 +01:00
Enrico Weigelt, metux IT consult
4500f0022e xwin: silence warning on missing prototype for OsVendorFatalError()
Just need to include ddx_priv.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 14:49:54 +01:00
Enrico Weigelt, metux IT consult
a25afba845 xwin: silence const char* assignment warnings
the target struct type defines char* fields, but we're sure they'll
never be written into, so just add typecast for silencing the warning.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 14:49:41 +01:00
Branimir Ri\v{c}ko
90f05e76c4 Fixed a out of bounds read.
Signed-off-by: Branimir Ri\v{c}ko <rickobranimir@gmail.com>
2025-12-01 11:02:14 +01:00
stefan11111
6d7a820a45 xfree86: loader: warn when implicitly ignoring abi mismatch
for the nvidia proprietary DDX driver

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-19 13:33:32 +01:00
stefan11111
8522803f8c xfree86: loader: simplify setting IgnoreABI option
IgnoreABI option is kept in a single bit of an unsigned long variable
LoaderOptions that has no other use.

This patch replaces it with a variable named LoaderIgnoreAbi
and a proc for setting it.

Inspired by b61b35a0b3

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-19 13:33:32 +01:00
stefan11111
3df2ae1c9e 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.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-19 13:33:32 +01:00
stefan11111
7f575ddc99 modesetting: Fix leak when disabling hw cursor
Backport from https://github.com/X11Libre/xserver/pull/1370

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-14 12:30:12 +01:00
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