Commit Graph

10152 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
84bfff6672 kdrive: fix missing include to ddx_priv.h
Fix missing prototype for OsVendorInit()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 19:51:11 +01:00
stefan11111
58143b96fd modesetting: don't leak memory for the cursor plane if libdrm is too old
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-12-08 14:23:09 +01:00
stefan11111
5ade87efc7 modesetting: Use don't skip planes that are not on the current crtc
This breaks on some nvidia cards.

Fixes: ed49ae8fe7

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-12-08 14:23:09 +01:00
Enrico Weigelt, metux IT consult
609ea42a62 include: don't install client.h anymore
not included by any drivers, so doesn't need to be in SDK anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-05 19:44:59 +01:00
Enrico Weigelt, metux IT consult
800d37edcb xfree86: common: move enum ActionEvent to private header
Not needed by any driver - only use as parameter to xf86ProcessActionEvent(),
which already is private.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-05 12:30:46 +01:00
Tautvis
64326cc92e Patch 5/5 modesetting: try to get gpu device fd from seatd arbiter
The device node opening with seatd, like with systemd-logind can done during probe
(see get_drm_info in hw/xfree86/os-support/shared/drm_platform.c),
but in case of failure, the modesetting driver tries to open device
node directly (open_hw function in modesetting/driver.c).

This enchanes open_hw function to try use seatd arbiter for opening device node
in as last resort manner.

To make it functional seatd_libseat_open_graphics needs to have _X_EXPORT

Signed-off-by: tautvis <gtautvis gmail com>
2025-12-05 12:29:52 +01:00
Tautvis
10a8565465 Patch 4/5 xfree86: libseat support, wire-up support seatd-libseat.h into Xserver
Add necessary code into Xserver to support libseat (this time enabling
functionality).

Code used from Devuan repository + local changes to make functional in Xlibre

Co-Authored-By: Mark Hindley <mark@hindley.org.uk>
Co-Authored-By: Ralph Ronnquist <rrq@rrq.au>
Signed-off-By: Tautvis <gtautvis@gmail.com>
2025-12-05 12:29:52 +01:00
Tautvis
1ac940c01d Patch 3/5 os-support: add xf86VTKeepTtyIsSet
Add xf86VTKeepTtyIsSet function to export KeepTty state.

When seatd activates, it takes control of current vt (in global sense)!,
this code only activates sesion control code when XServer started
using same vt (for more context see c88a325899 commit ).

Signed-off-By: Tautvis <gtautvis@gmail.com>
2025-12-05 12:29:52 +01:00
Tautvis
8d90cd0060 Patch 2/5 xfree86: libseat support, wireup libseat
Refactor libseat code for Xlibre and add to meson.build:

* update meson for seat-libseat
* refactor code:
  * seatd-libseat.c - add aditional private include headers
  * add cast to libseat_set_log_handler argument 1 for (libseat_log_func),
  for warning silencing
  * make seatd_libseat_init to accept keeptty state as parameter
  * include xf86Events, xf86_priv - make visible xf86VTLeave for seatd code (it
    is neccesary because seatd can force console leave)

Signed-off-By: Tautvis <gtautvis@gmail.com>
2025-12-05 12:29:52 +01:00
Tautvis
6de8136907 Patch 1/5 xfree86: libseat support, the seatd-libseat.{c,h} code
This is initial patch for libseat. Technicaly almost verbatim code (with style changes)
from Devuan xorg server moved to os-support/shared directory as it can support other
oses than linux.

The original repository: https://git.devuan.org/devuan/xorg-server.git
The patch between fc24510f17e89a5bbac1065abab758a4d0c42634 and
6bf62381d0

Co-Authored-By: Mark Hindley <mark@hindley.org.uk>
Co-Authored-By: Ralph Ronnquist <rrq@rrq.au>
Signed-off-By: Tautvis <gtautvis@gmail.com>
2025-12-05 12:29:52 +01:00
Enrico Weigelt, metux IT consult
19ee44b607 treewide: drop including <dix-config.h> from private includes
All .c sources must include <dix-config.h> at the very first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 19:50:44 +01:00
Enrico Weigelt, metux IT consult
2e631d1454 xwin: fix compiler warning on potential buffer read overflow
> ../hw/xwin/InitOutput.c: In function ‘XwinExtensionInit’:
> ../hw/xwin/InitOutput.c:142:5: warning: ‘LoadExtensionList’ reading 12 bytes from a region of size 0 [-Wstringop-overread]
>   142 |     LoadExtensionList(xwinExtensions, ARRAY_SIZE(xwinExtensions), TRUE);
>       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../hw/xwin/InitOutput.c:142:5: note: referencing argument 1 of type ‘const ExtensionModule[0]’
> In file included from ../include/extnsionst.h:53,
>                  from ../randr/randrstr.h:40,
>                  from ../hw/xwin/win.h:174,
>                  from ../hw/xwin/InitOutput.c:35:
> ../include/extension.h:100:23: note: in a call to function ‘LoadExtensionList’
>   100 | extern _X_EXPORT void LoadExtensionList(const ExtensionModule ext[],
>       |                       ^~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 15:10:51 +01:00
Enrico Weigelt, metux IT consult
beb15972d3 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:50:05 +01:00
Enrico Weigelt, metux IT consult
a2304300aa 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:27:01 +01:00
Enrico Weigelt, metux IT consult
f00b684cb1 xfree86: dri2: inline load_swap_reply()
very tiny and only called once, so no need to have a separate function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 12:10:36 +01:00
Enrico Weigelt, metux IT consult
1b9f88aa66 xfree86: dri2: drop unused variable
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 12:10:03 +01:00
Enrico Weigelt, metux IT consult
61fc8dac6a xquartz: consistenly name reply structs "reply" instead of "rep"
Preparation for future use of generic reply assembly macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 12:08:57 +01:00
Enrico Weigelt, metux IT consult
b593cd50ee xfree86: consistenly name reply structs "reply" instead of "rep"
Preparation for future use of generic reply assembly macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 18:58:20 +01:00
Enrico Weigelt, metux IT consult
d877b4830c xwin: drop unused variable
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 11:05:24 +01:00
stefan11111
3f821b291e modesetting: get more values from the fallback cursor probe
The space needed to store these extra values is at worst a few dozen bytes.
In exchange for these, larger cursors glyphs can use a more optimal cursor size.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-12-02 10:14:12 +01:00
Enrico Weigelt, metux IT consult
7d8f084fbf dri: use static struct init on declaration & drop useless assignments
Make the code a bit easier to read by using initialization of the reply
structs, at the point of declaration. Most of them aren't written to later,
just passed into WriteReplyToClient(). Also dropping some useless zero
assignments (struct initializers automatically zero-out unmentioned fields).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-01 14:09:02 +01:00
Branimir Ri\v{c}ko
3b99373a17 Fixed a out of bounds read.
Signed-off-by: Branimir Ri\v{c}ko <rickobranimir@gmail.com>
2025-12-01 11:02:06 +01:00
stefan11111
c01c4e7c72 modesetting: Only close the dmabuf fd if it isn't -1
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-28 18:44:22 +01:00
Icenowy Zheng
03fa63778b modesetting: fix shared pixmap dmabuf fd leakage
After the dmabuf fd exported by another screen is imported to a pixmap,
the pixmap holds a reference for the buffer, thus the FD itself finished
its job and needs to be closed to prevent a stale reference to the
buffer.

Signed-off-by: Icenowy Zheng's avatarIcenowy Zheng <uwu@icenowy.me>
2025-11-28 18:44:22 +01:00
stefan11111
6be7fe9d12 modesetting: print message when reverse prime mode is enabled
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-28 18:44:22 +01:00
Herman Semenoff
fc8f9f4331 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-11-28 10:07:46 +01:00
Enrico Weigelt, metux IT consult
33729b1361 include: windowstr.h: unexport w*() macros
These aren't used by any drivers, so no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 19:54:42 +01:00
Enrico Weigelt, metux IT consult
9b8d7d1eb9 treewide: don't include <region.h> anymore
Nothing in there that we need, include <regionstr.h> instead.
But keeping the file in place, until all external consumer have
been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 19:27:27 +01:00
Enrico Weigelt, metux IT consult
bddf4ae8e8 xfree86: move over xf86vidmode extension to hw/xfree86
This extension is private to the xfree86 DDX, no other one supports it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 14:03:37 +01:00
Enrico Weigelt, metux IT consult
0b3fb18754 xfree86: drop xf86CursorScreenKey macro
Use the actual field directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 13:48:22 +01:00
Enrico Weigelt, metux IT consult
d7b773c174 xfree86: vgaarbiter: drop VGAarbiterScreenKey and VGAarbiterGCKey macros
Use the actual fields directly instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 13:47:05 +01:00
Enrico Weigelt, metux IT consult
92a015504e dix: make BITMAP_SCANLINE_UNIT private
Not used by any external drivers, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 12:05:55 +01:00
stefan11111
3550e1e873 xfree86/{loader,common}: Search all module directory prefixes in LoaderListDir
Fixes: 01c0b7fd38

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-27 11:57:25 +01:00
Enrico Weigelt, metux IT consult
5532917d76 os: move AllowByteSwappedClients setting into DIX
Adding new source and header that's going to host all DIX
settings (set via cmdline or xf86 config file) in the future.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 10:44:23 +01:00
stefan11111
5460be02c9 modesetting: read DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP when parsing async flip capabilities
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-26 10:53:36 +01:00
stefan11111
7b301ee278 modesetting: small formating changes and extra NULL checks
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-26 10:51:48 +01:00
Oleh Nykyforchyn
77830f2284 modesetting: make DevPrivateKeyRec struct static
dixRegisterPrivateKey() assumes that DevPrivateKeyRec struct passed
to it is zero-filled before the first use, otherwise assert() fails.
Therefore these structs are usually static, which assures that they
are initialized to 0. A newly introduced key in the modesetting driver
was not static, and the driver crashed. This should be corrected.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-11-22 13:24:44 +01:00
Enrico Weigelt, metux IT consult
4aa6d3e4fd xfree86: loader: fix NULL warning on LogMessage() call
> ../hw/xfree86/loader/loadmod.c: In function ‘LoaderSetPath’:
> ../hw/xfree86/loader/loadmod.c:230:67: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
>   230 |         LogMessage(X_ERROR, "Failed to store module search path \"%s\" for module %s\n", path, driver);
>       |                                                                   ^~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-21 15:20:27 +01:00
Mike Gelfand
84a2fc014d hw: move include guards up to wrap the whole file
See: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-11-21 15:20:11 +01:00
alex14fr
d655cc145d Add module ABI tag to fix "Xorg -configure" ("No output driver" message).
The driver directory name now includes a version tag, and the configure code has to search in the right directory.

Signed-off-by: alex14fr <alex14fr@gmail.com>
2025-11-21 14:49:11 +01:00
stefan11111
7293fc12fe modesetting: map gbm bo's if possible
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-21 10:17:51 +01:00
Oleh Nykyforchyn
9db422c1ca xfree86: add MatchLayout entry to OutputClass
It is patch 2/2 of a series that provides a convenient way to specify
module search paths on a per-driver basis.

This entry proved to be useful in InputClass, so added it to OutputClass
as well. This allows to configure graphic drivers separately depending
on server layout names.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-11-20 19:29:51 +01:00
Oleh Nykyforchyn
9f25f5d3f1 xfree86: make search paths configurable for certain modules
It is patch 1/2 of a series that provides a convenient way to specify
module search paths on a per-driver basis.

This patch allows to set ModulePath for certain modules, in particular,
GPU drivers.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-11-20 19:29:51 +01:00
Enrico Weigelt, metux IT consult
95499a9525 dix: unexport enableIndirectGLX
Still needs to be _X_EXPORT'ed for internal modules, but
not supposed to be visible to external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 19:25:41 +01:00
Enrico Weigelt, metux IT consult
6a1bdcedd3 dix: unexport DeleteProperty()
Not used by any external driver, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 19:22:35 +01:00
Enrico Weigelt, metux IT consult
416f69eb88 include: misc.h: unexport lowbit() macro
Not used by any drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 19:20:07 +01:00
Enrico Weigelt, metux IT consult
805dec1661 include: drop obsolete hotplug.h
Nobody's including it anymore, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 16:37:03 +01:00
Enrico Weigelt, metux IT consult
062a930f3c kdrive: drop obsolete support for internal server reset
Not used anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 16:35:50 +01:00
Enrico Weigelt, metux IT consult
1749a8bdfd config: unexport config_init() and config_fini()
Those aren't used by any drivers, so no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 14:11:27 +01:00
Enrico Weigelt, metux IT consult
064e5f2ddf os: drop OsCleanup()
Since we're always terminating now, everbody can call UnlockServer()
directly, so we don't need that extra function anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 11:19:02 +01:00