Commit Graph

22183 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
1786c8c406 test: simple-xinit: fix warning on unused result of write()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 20:01:44 +01:00
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
Alan Coopersmith
2be080c4e3 dix: set errorValue correctly when XID lookup fails in ChangeGCXIDs()
dixLookupResourceByType always overwrites the pointer passed in as the
first arg, so we shouldn't use the union it's in after that to get the
requested XID value to put in the errorValue.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1857
Fixes: 2d7eb4a19b ("Pre-validate ChangeGC XIDs.")
Reported-by: Mouse <mouse@Rodents-Montreal.ORG>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2111>
2025-12-09 17:41:25 +01:00
Enrico Weigelt, metux IT consult
408b3076a7 sdk: install xlibre-server.pc in addition to xorg-server.pc
A little step forward in completely separating our SDK from old
legacy Xorg.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-08 15:15:45 +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
1c0a9399c8 meson.build: move creating conf_data object to toplevel
create it very early, so we're free to move around call sites
between subdirectories. preparation for untwisting the whole
probing logic.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-05 12:19: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
220089822b test: 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 17:41:15 +01:00
Enrico Weigelt, metux IT consult
d2e5ed2a89 Xi: drop SWAPIF macro
Trivial enough for just writing the actual code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 17:29:17 +01:00
Enrico Weigelt, metux IT consult
f5a70d968c include: fix warning on XNFvasprintf() prototype
> ../os/xprintf.c: In function ‘XNFvasprintf’:
> ../os/xprintf.c:84:5: warning: function ‘XNFvasprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
>    84 |     int size = vasprintf(ret, format, va);
>       |     ^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 17:28:58 +01:00
Enrico Weigelt, metux IT consult
dbbbf14a83 Xi: 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 16:28:54 +01:00
Enrico Weigelt, metux IT consult
36503b11b7 dix: 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 16:28:06 +01:00
Enrico Weigelt, metux IT consult
6b189b7a22 xkb: fix printf argument size mismatch warning
> ../xkb/xkb.c:6008:106: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘CARD32’ {aka ‘long unsigned int’} [-Wformat=]
>  6008 |             LogMessage(X_WARNING, "ProcXkbGetKbdByName() childbuf size (%ld) mismatch mrep size (%ld // %d units)\n",
>       |                                                                                                         ~^
>       |                                                                                                          |
>       |                                                                                                          int
>       |                                                                                                         %ld
>  6009 |                        (unsigned long)childbuf.wpos, (unsigned long)mrep.length * 4, mrep.length);
>       |                                                                                      ~~~~~~~~~~~
>       |                                                                                          |
>       |                                                                                          CARD32 {aka long unsigned int}
[...]

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 16:03:28 +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
71b25119f7 os: ResetHosts(): fix warning on potentially unitialized memory
> In function ‘ConvertAddr’,
>    inlined from ‘ResetHosts’ at ../os/access.c:1014:26:
> ../os/access.c:1540:25: warning: ‘saddr’ may be used uninitialized [-Wmaybe-uninitialized]
>  1540 |         if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr)
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../os/access.c: In function ‘ResetHosts’:
> ../os/access.c:908:7: note: ‘saddr’ declared here
>   908 |     } saddr;
>       |       ^~~~~

The union isn't needed at all, we're just using one of the fields anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 15:10:43 +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
01502a4ddd dix: request_priv.h: fix X_REQUEST_REST_COUNT_CARD16()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 14:26:41 +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
d1dd9bc5e6 Xi: ProcXChangeDeviceControl() 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 11:47:41 +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
72eec1a2e0 dri3: 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:02:18 +01:00
Enrico Weigelt, metux IT consult
bfb2bc1919 composite: 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:02:08 +01:00
Enrico Weigelt, metux IT consult
c654da4534 record: fix reply structs
Fixes: 4d4fd5866e
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 18:00:00 +01:00
Enrico Weigelt, metux IT consult
87468931cc dbe: 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 17:34:35 +01:00
Enrico Weigelt, metux IT consult
3d43102e96 present: 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 17:12:42 +01:00
Enrico Weigelt, metux IT consult
f26b31d8f7 randr: 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 17:12:35 +01:00
Enrico Weigelt, metux IT consult
4d4fd5866e record: 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 16:14:06 +01:00
Enrico Weigelt, metux IT consult
cbf814f375 xfixes: 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 16:13:52 +01:00
Enrico Weigelt, metux IT consult
aa8064be86 render: 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 15:16:37 +01:00
Enrico Weigelt, metux IT consult
de60ac5bbe xkb: 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 15:03:11 +01:00
Enrico Weigelt, metux IT consult
1487c7c03f xkb: drop some junk comments
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 14:37:58 +01:00
Enrico Weigelt, metux IT consult
a173278c4f dix: make SwapLongs() inline
a) trade a little bit of code size for speed
   (depending on exact caller, compiler might also optimize a lot)
b) reduce the need for exported, but non-public symbol

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 14:30:02 +01:00
Enrico Weigelt, metux IT consult
090c68e13d Xext: 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 14:29:29 +01:00
Enrico Weigelt, metux IT consult
341c890564 include: tiny indention cleanup
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 14:00:02 +01:00
Enrico Weigelt, metux IT consult
409e721e98 os: merge os/xstrans.c and os/transport.c
Since xtrans is now in-tree and already have been trimmed down
for only things needed by the Xserver, the split between xstrans.c
and transport.c isn't needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 13:15:58 +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
Enrico Weigelt, metux IT consult
6a320e76cb dix: add macros for request handlers and swapping
add some macros for making request handlers and byte swapping easier:

    * X_REQUEST_HEAD_STRUCT(type) and X_REQUEST_HEAD_AT_LEAST(type)
      declare header struct pointers and check size
    * X_REQUEST_FIELD_CARD16(field)
      swaps a CARD16 (word) header field (if neccessary)
    * X_REQUEST_FIELD_CARD32(field)
      swaps a CARD32 (dword) header field (if neccessary)
    * X_REQUEST_REST_CARD16()
      swaps remaining CARD16 array payload (if necessary)
    * X_REQUEST_REST_CARD32()
      swaps remaining CARD32 array payload (if necessary)
    * X_REQUEST_REST_COUNT_CARD16(count)
      check swaps `count` CARD16 payload fields and checks size
    * X_REQUEST_REST_COUNT_CARD32(count)
      check swaps `count` CARD32 payload fields and checks size

How to use them:

    1. put X_REQUEST_HEAD_STRUCT() or X_REQUEST_HEAD_AT_LEAST() ontop of each Proc*()
    2. add X_REQUEST_FIELD_*() et al below, for all fields to be swapped and
       drop the corresponding SProc*()'s
    3. let the dispatchers call Proc*() instead of SProc*()

Notes:

    * the length field is already swapped before request handlers called

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-03 10:58:14 +01:00
Oleh Nykyforchyn
f4115e69eb dix: initialize all screens before proceeding to gc's, root windows etc
Current code walks along all screens and initializes screen resources,
then gc's, stipples, root windows for each of them, hence after
the first screen registering new private keys is no more possible.
This crashes modesetting driver if it is not initialized before others.

This patch makes screen resources for all screen initialize first, hence
all necessary private keys (including of the type PRIVATE_WINDOW) are
initialized before root windows are created.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-12-03 09:24:33 +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