From b393d5fc024685cafe14265ebe8ac7959f8c4d48 Mon Sep 17 00:00:00 2001 From: Steven Van Dorp Date: Wed, 18 Jun 2025 09:25:47 +0200 Subject: [PATCH 01/82] ephyr: Add -host-grab to set custom grab shortcut Allows for calling Xephyr with `-host-grab [keys]` to customize the keyboard shortcut for grabbing/releasing keyboard and mouse input. Fully backwards compatible: Omitting `-host-grab` defaults to ctrl+shift. `-no-host-grab` acts the same as before. Closes: #134 Signed-off-by: Steven Van Dorp --- hw/kdrive/ephyr/ephyr.c | 245 ++++++++++++++++++++++++--------- hw/kdrive/ephyr/ephyr.h | 8 ++ hw/kdrive/ephyr/ephyrinit.c | 17 ++- hw/kdrive/ephyr/man/Xephyr.man | 25 ++++ 4 files changed, 230 insertions(+), 65 deletions(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 668322f8c..d94eca8b6 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -61,7 +61,12 @@ typedef struct _EphyrInputPrivate { Bool EphyrWantGrayScale = 0; Bool EphyrWantResize = 0; -Bool EphyrWantNoHostGrab = 0; + +static xcb_mod_mask_t EphyrKeybindToggleHostGrabModMask; +static uint32_t EphyrKeybindToggleHostGrabKey; +static char const* EphyrTitleHostGrabKeyComboHint; +static uint8_t EphyrTitleHostGrabKeyComboHintLen; +static Bool EphyrHostGrabSet = FALSE; Bool ephyrInitialize(KdCardInfo * card, EphyrPriv * priv) @@ -649,6 +654,114 @@ ephyrCreateColormap(ColormapPtr pmap) return fbInitializeColormap(pmap); } +Bool +ephyrSetGrabShortcut(char const* const desc) +{ + if (desc == NULL || !strcmp(desc, "NULL")) { + EphyrKeybindToggleHostGrabModMask = 0; + EphyrKeybindToggleHostGrabKey = 0; + EphyrTitleHostGrabKeyComboHint = NULL; + EphyrTitleHostGrabKeyComboHintLen = 0; + } + else { + const uint8_t fixed_bound = 255; + char buf[16]; + uint8_t j = 0; + for (uint8_t i = 0;; ++i) { + assert(i < fixed_bound); + char const c = desc[i]; + if (c == 0 || (j != 0 && c == '+')) { + buf[j] = 0; + if (j == 1) { + EphyrKeybindToggleHostGrabKey = buf[0]; + } + else if (!strcmp(buf, "ctrl")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_CONTROL; + } + else if (!strcmp(buf, "shift")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_SHIFT; + } + else if (!strcmp(buf, "lock")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_LOCK; + } + else if (!strcmp(buf, "mod1")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_1; + } + else if (!strcmp(buf, "mod2")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_2; + } + else if (!strcmp(buf, "mod3")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_3; + } + else if (!strcmp(buf, "mod4")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_4; + } + else if (!strcmp(buf, "mod5")) { + EphyrKeybindToggleHostGrabModMask |= XCB_MOD_MASK_5; + } + else { + ErrorF("ephyr: -host-grab: " + "Unrecognized key: '%s'\n", buf); + return FALSE; + } + if (c == 0) break; + j = 0; + } + else { + buf[j] = c; + ++j; + assert(j < sizeof(buf)); + } + } + + EphyrTitleHostGrabKeyComboHint = desc; + EphyrTitleHostGrabKeyComboHintLen = strlen(desc); + } + + EphyrHostGrabSet = TRUE; + return TRUE; +} + +static void +ephyrPrintGrabShortcut(char* const out, size_t const out_size, + Bool const currently_grabbed) +{ + if ( + ( + EphyrKeybindToggleHostGrabModMask == 0 && + EphyrKeybindToggleHostGrabKey == 0 + ) || ( + EphyrTitleHostGrabKeyComboHint == 0 || + EphyrTitleHostGrabKeyComboHint == 0 + ) + ) { + /* grabbing disabled */ + out[0] = '\0'; + return; + } + + char const* const suffix = currently_grabbed + ? " releases mouse and keyboard)" + : " grabs mouse and keyboard)"; + size_t const suffix_len = strlen(suffix); + + assert(out_size > 1 + EphyrTitleHostGrabKeyComboHintLen + suffix_len + 1); + assert(out != NULL); + + out[0] = '('; + memcpy(out + 1, EphyrTitleHostGrabKeyComboHint, EphyrTitleHostGrabKeyComboHintLen); + + memcpy(out + EphyrTitleHostGrabKeyComboHintLen + 1, suffix, suffix_len + 1); +} + +static void +ephyrUpdateWindowTitle(KdScreenInfo* const screen, Bool const currently_grabbed) +{ + char title_buf[128]; + ephyrPrintGrabShortcut(title_buf, sizeof(title_buf), currently_grabbed); + hostx_set_win_title(screen, title_buf); +} + Bool ephyrInitScreen(ScreenPtr pScreen) { @@ -657,11 +770,10 @@ ephyrInitScreen(ScreenPtr pScreen) EPHYR_LOG("pScreen->myNum:%d\n", pScreen->myNum); hostx_set_screen_number(screen, pScreen->myNum); - if (EphyrWantNoHostGrab) { - hostx_set_win_title(screen, "xephyr"); - } else { - hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); + if (!EphyrHostGrabSet) { + ephyrSetGrabShortcut("ctrl+shift"); } + ephyrUpdateWindowTitle(screen, FALSE); pScreen->CreateColormap = ephyrCreateColormap; #ifdef XV @@ -1019,71 +1131,78 @@ ephyrProcessKeyPress(xcb_generic_event_t *xev) static void ephyrProcessKeyRelease(xcb_generic_event_t *xev) { - xcb_connection_t *conn = hostx_get_xcbconn(); xcb_key_release_event_t *key = (xcb_key_release_event_t *)xev; - static xcb_key_symbols_t *keysyms; - static int grabbed_screen = -1; - int mod1_down = ephyrUpdateGrabModifierState(key->state); + if (EphyrKeybindToggleHostGrabModMask != 0 || + EphyrKeybindToggleHostGrabKey != 0) { - if (!keysyms) - keysyms = xcb_key_symbols_alloc(conn); + xcb_connection_t *conn = hostx_get_xcbconn(); + static xcb_key_symbols_t *keysyms; + static int grabbed_screen = -1; - if (!EphyrWantNoHostGrab && - (((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_L - || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_R) - && (key->state & XCB_MOD_MASK_CONTROL)) || - ((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_L - || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_R) - && (key->state & XCB_MOD_MASK_SHIFT)))) { - KdScreenInfo *screen = screen_from_window(key->event); - assert(screen); - EphyrScrPriv *scrpriv = screen->driver; + if (!keysyms) + keysyms = xcb_key_symbols_alloc(conn); - if (grabbed_screen != -1) { - xcb_ungrab_keyboard(conn, XCB_TIME_CURRENT_TIME); - xcb_ungrab_pointer(conn, XCB_TIME_CURRENT_TIME); - grabbed_screen = -1; - hostx_set_win_title(screen, - "(ctrl+shift grabs mouse and keyboard)"); - } - else if (!mod1_down) { - /* Attempt grab */ - xcb_grab_keyboard_cookie_t kbgrabc = - xcb_grab_keyboard(conn, - TRUE, - scrpriv->win, - XCB_TIME_CURRENT_TIME, - XCB_GRAB_MODE_ASYNC, - XCB_GRAB_MODE_ASYNC); - xcb_grab_keyboard_reply_t *kbgrabr; - xcb_grab_pointer_cookie_t pgrabc = - xcb_grab_pointer(conn, - TRUE, - scrpriv->win, - 0, - XCB_GRAB_MODE_ASYNC, - XCB_GRAB_MODE_ASYNC, - scrpriv->win, - XCB_NONE, - XCB_TIME_CURRENT_TIME); - xcb_grab_pointer_reply_t *pgrabr; - kbgrabr = xcb_grab_keyboard_reply(conn, kbgrabc, NULL); - if (!kbgrabr || kbgrabr->status != XCB_GRAB_STATUS_SUCCESS) { - xcb_discard_reply(conn, pgrabc.sequence); + int const keysym = + xcb_key_symbols_get_keysym(keysyms, key->detail, 0); + + if ( + ( + (key->state & EphyrKeybindToggleHostGrabModMask) == + EphyrKeybindToggleHostGrabModMask + ) && ( + /* NOTE: mod-key keysyms are > 0xfe00. We do this so when the + shortcut is only mod-keys (e.g. ctrl+shift) and the user + releases any other key, input doesn't get grabbed */ + (EphyrKeybindToggleHostGrabKey == 0 && keysym > 0xfe00) || + keysym == EphyrKeybindToggleHostGrabKey + ) + ) { + KdScreenInfo *screen = screen_from_window(key->event); + assert(screen); + EphyrScrPriv *scrpriv = screen->driver; + + if (grabbed_screen != -1) { + xcb_ungrab_keyboard(conn, XCB_TIME_CURRENT_TIME); xcb_ungrab_pointer(conn, XCB_TIME_CURRENT_TIME); - } else { - pgrabr = xcb_grab_pointer_reply(conn, pgrabc, NULL); - if (!pgrabr || pgrabr->status != XCB_GRAB_STATUS_SUCCESS) - { - xcb_ungrab_keyboard(conn, - XCB_TIME_CURRENT_TIME); - } else { - grabbed_screen = scrpriv->mynum; - hostx_set_win_title - (screen, - "(ctrl+shift releases mouse and keyboard)"); + grabbed_screen = -1; + } + else { + /* Attempt grab */ + xcb_grab_keyboard_cookie_t kbgrabc = + xcb_grab_keyboard(conn, + TRUE, + scrpriv->win, + XCB_TIME_CURRENT_TIME, + XCB_GRAB_MODE_ASYNC, + XCB_GRAB_MODE_ASYNC); + xcb_grab_keyboard_reply_t *kbgrabr; + xcb_grab_pointer_cookie_t pgrabc = + xcb_grab_pointer(conn, + TRUE, + scrpriv->win, + 0, + XCB_GRAB_MODE_ASYNC, + XCB_GRAB_MODE_ASYNC, + scrpriv->win, + XCB_NONE, + XCB_TIME_CURRENT_TIME); + xcb_grab_pointer_reply_t *pgrabr; + kbgrabr = xcb_grab_keyboard_reply(conn, kbgrabc, NULL); + if (!kbgrabr || kbgrabr->status != XCB_GRAB_STATUS_SUCCESS) { + xcb_discard_reply(conn, pgrabc.sequence); + xcb_ungrab_pointer(conn, XCB_TIME_CURRENT_TIME); + } else { + pgrabr = xcb_grab_pointer_reply(conn, pgrabc, NULL); + if (!pgrabr || pgrabr->status != XCB_GRAB_STATUS_SUCCESS) + { + xcb_ungrab_keyboard(conn, + XCB_TIME_CURRENT_TIME); + } else { + grabbed_screen = scrpriv->mynum; + } } } + ephyrUpdateWindowTitle(screen, grabbed_screen != -1); } } diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h index 8833de8a9..3633de7ca 100644 --- a/hw/kdrive/ephyr/ephyr.h +++ b/hw/kdrive/ephyr/ephyr.h @@ -167,6 +167,14 @@ Bool Bool ephyrCreateColormap(ColormapPtr pmap); +/** + * @param desc examples: "ctrl+shift", "ctrl+mod1+a", "a", + * NULL (disables host grab) + * @return TRUE if success, otherwise FALSE + */ +Bool + ephyrSetGrabShortcut(char const* const desc); + #ifdef RANDR Bool ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 767fccd0f..ff0d5d0cc 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -38,7 +38,6 @@ extern Window EphyrPreExistingHostWin; extern Bool EphyrWantGrayScale; extern Bool EphyrWantResize; -extern Bool EphyrWantNoHostGrab; extern Bool kdHasPointer; extern Bool kdHasKbd; extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present; @@ -144,6 +143,8 @@ ddxUseMsg(void) ErrorF ("-title [title] set the window title in the WM_NAME property\n"); ErrorF("-no-host-grab Disable grabbing the keyboard and mouse.\n"); + ErrorF + ("-host-grab [keys] set shortcut to grab the keyboard and mouse (default: ctrl+shift)\n"); ErrorF("\n"); } @@ -343,9 +344,21 @@ ddxProcessArgument(int argc, char **argv, int i) } /* end Xnest compat */ else if (!strcmp(argv[i], "-no-host-grab")) { - EphyrWantNoHostGrab = 1; + ephyrSetGrabShortcut(NULL); return 1; } + else if (!strcmp(argv[i], "-host-grab")) { + if (i + 1 >= argc) { + ErrorF( + "ephyr: -host-grab requires an argument e.g. ctrl+shift+x\n"); + exit(1); + } + else if (!ephyrSetGrabShortcut(argv[i + 1])) { + /* specific error message is printed in ephyrSetGrabShortcut */ + exit(1); + } + return 2; + } else if (!strcmp(argv[i], "-sharevts") || !strcmp(argv[i], "-novtswitch")) { return 1; diff --git a/hw/kdrive/ephyr/man/Xephyr.man b/hw/kdrive/ephyr/man/Xephyr.man index 765e43f2d..d9c7b19c0 100644 --- a/hw/kdrive/ephyr/man/Xephyr.man +++ b/hw/kdrive/ephyr/man/Xephyr.man @@ -67,6 +67,31 @@ window. By default, the Xephyr window has a fixed size. .TP 8 .B \-no\-host\-grab Disable grabbing the keyboard and mouse. +.TP 8 +.BI \-host\-grab " keys" +Set the keyboard shortcut for Xephyr to grab keyboard and mouse +input. Possible values for mod-keys are: ctrl, shift, lock, +mod1, mod2, mod3, mod4, mod5. Up to one ascii character (lower-case) can +be used by itself or in conjunction with mod-keys. Keys are concatenated +with +.I +\fP. If omitted, defaults to +.I ctrl+shift\fP. + +Examples: +.RS +.IP \[bu] 2 +.I ctrl+mod1 +.IP \[bu] 2 +.I ctrl+shift++ +(note that the +.I + +at the end is interpreted as the ascii character '+') +.IP \[bu] 2 +.I a +(mod-keys are optional, this will grab/release whenever the +.I a +key is pressed) +.RE .SH "SIGNALS" Send a SIGUSR1 to the server (e.g. pkill \-USR1 Xephyr) to toggle the debugging mode. From 899afa4c1097ed99858754677c37e1792ed3338f Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 18 Jun 2025 08:39:02 +0200 Subject: [PATCH 02/82] os: Check for integer overflow on BigRequest length Check for another possible integer overflow once we get a complete xReq with BigRequest. Related to CVE-2025-49176 Signed-off-by: Olivier Fourdan Suggested-by: Peter Harris Part-of: --- os/io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/io.c b/os/io.c index ba12c7e61..948660996 100644 --- a/os/io.c +++ b/os/io.c @@ -395,6 +395,8 @@ ReadRequestFromClient(ClientPtr client) needed = get_big_req_len(request, client); } client->req_len = needed; + if (needed > MAXINT >> 2) + return -(BadLength); needed <<= 2; } if (gotnow < needed) { From ca5fb14d0532e24a5b335f1aa8dbd43452478dd3 Mon Sep 17 00:00:00 2001 From: rendick Date: Wed, 18 Jun 2025 14:15:13 +0200 Subject: [PATCH 03/82] dix: delete unused PropertyStateRec structure to debloat codebase Removed unused 'PropertyStateRec' structure from dix/property.c Signed-off-by: rendick --- dix/property.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dix/property.c b/dix/property.c index 9b2560d08..58dc652be 100644 --- a/dix/property.c +++ b/dix/property.c @@ -157,11 +157,6 @@ static void deliverPropertyNotifyEvent(WindowPtr pWin, int state, PropertyPtr pProp) { xEvent event; - PropertyStateRec rec = { - .win = pWin, - .prop = pProp, - .state = state - }; UpdateCurrentTimeIf(); event = (xEvent) { .u.property.window = pWin->drawable.id, From fe4bc433a41747dea140ecd2dd72a89a1f2d184e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 19 Jun 2025 11:16:47 +0200 Subject: [PATCH 04/82] sdk: reinstate COMPOSITE symbol Composite extension is always enabled for pretty long time now, but some drivers (eg. xf86-video-intel) still relying on this symbol being set, otherwise assuming to run w/o composite and doing crazy things. Fixes: d708b28adcd7c0a20599be03ee5d7df6f9ce5876 Signed-off-by: Enrico Weigelt, metux IT consult --- include/meson.build | 3 +++ include/xorg-server.h.meson.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/include/meson.build b/include/meson.build index 8dda8c0fd..1e9ed1950 100644 --- a/include/meson.build +++ b/include/meson.build @@ -204,6 +204,9 @@ conf_data.set('TCPCONN', '1') conf_data.set('UNIXCONN', host_machine.system() != 'windows' ? '1' : false) conf_data.set('IPv6', build_ipv6 ? '1' : false) +# some drivers (eg. xf86-video-intel) still relying on this symbol being set +conf_data.set('COMPOSITE', '1') + conf_data.set('DAMAGE', '1') conf_data.set('DBE', '1') conf_data.set('DGA', build_dga ? '1' : false) diff --git a/include/xorg-server.h.meson.in b/include/xorg-server.h.meson.in index 4c0a01c14..1d3096c3c 100644 --- a/include/xorg-server.h.meson.in +++ b/include/xorg-server.h.meson.in @@ -23,6 +23,9 @@ /* Default font path */ #mesondefine COMPILEDDEFAULTFONTPATH +/* Support Composite Extension */ +#mesondefine COMPOSITE + /* Build DPMS extension */ #mesondefine DPMSExtension From 4267785e6fcdbf4d7c161eb8cfc3aafcaf433972 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 19 Jun 2025 03:12:11 +0200 Subject: [PATCH 05/82] xres: fix XResQueryClientIds always returning 0 clients XaceHookClientAccess added in 098008879b3a9d433072a15818d204a88f232d54 has incorrect condition in ConstructClientIds. This fixes #182 Signed-off-by: dec05eba --- Xext/xres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xext/xres.c b/Xext/xres.c index 9c7df9832..1026dffb5 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -516,7 +516,7 @@ ConstructClientIds(ClientPtr client, for (c = 0; c < currentMaxClients; ++c) { if (clients[c] && (XaceHookClientAccess(client, clients[c], DixReadAccess) - != Success)) { + == Success)) { if (!ConstructClientIdValue(client, clients[c], specs[specIdx].mask, ctx)) { return BadAlloc; @@ -527,7 +527,7 @@ ConstructClientIds(ClientPtr client, ClientPtr owner = dixClientForXID(specs[specIdx].client); if (owner && (XaceHookClientAccess(client, owner, DixReadAccess) - != Success)) { + == Success)) { if (!ConstructClientIdValue(client, owner, specs[specIdx].mask, ctx)) { return BadAlloc; From 2ef1e7728ea7debe92cda749c69b66db93f1ca0c Mon Sep 17 00:00:00 2001 From: Steven Van Dorp Date: Thu, 19 Jun 2025 06:40:49 +0200 Subject: [PATCH 06/82] ephyr: fix checking the same expression twice Probably was a copy-paste error. Intention is to check if the string is valid (i.e. not null and length isn't 0). fixes: #179 Signed-off-by: Steven Van Dorp --- hw/kdrive/ephyr/ephyr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index d94eca8b6..9b00ed11f 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -732,7 +732,7 @@ ephyrPrintGrabShortcut(char* const out, size_t const out_size, EphyrKeybindToggleHostGrabKey == 0 ) || ( EphyrTitleHostGrabKeyComboHint == 0 || - EphyrTitleHostGrabKeyComboHint == 0 + EphyrTitleHostGrabKeyComboHintLen == 0 ) ) { /* grabbing disabled */ From 9adf08960edff20f2159607e1a87aa65dfe4d78f Mon Sep 17 00:00:00 2001 From: itz-me-zappex <85901674+itz-me-zappex@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:21:50 +0300 Subject: [PATCH 07/82] README.md: Update info about VT switching and add workaround for NVIDIA. Signed-off-by: itz-me-zappex <85901674+itz-me-zappex@users.noreply.github.com> --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b89950c0..757677bc7 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,17 @@ Upgrade notice When unsure, it's best to be prepared to ssh into your machine from another one or set a timer that's calling `chvt 1` after certain time, so you don't need a cold reboot. + Or, make sure that you have magic `SysRq` key enabled (`Alt+PrtSc`) + via sysctl (`kernel.sysrq=1`), then press following combination depending on keyboard + layout to make kernel regain control over keyboard to make VT switching work: + - QWERTY/AZERTY keyboard layout: `SysRq + R` + - Dvorak/Colemak keyboard layout: `SysRq + P` * Proprietary Nvidia drivers might break: they still haven't managed to do even simple cleanups to catch up with Xorg master for about a year. All attempts to get into direct mail contact have failed. We're trying to - work around this, but cannot give any guarantees. + work around this, but cannot give any guarantees. But you can make it work + by adding `Option "IgnoreABI" "1"` line to `ServerFlags` section in Xorg config. * Most Xorg drivers should run as-is (once recompiled!), with some exceptions. See `.gitlab-ci.yml` for the versions/branches built along with Xlibre. From 5342d0c380d996ce51930a48aef8770eec8e3210 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 20 Jun 2025 01:53:17 +0200 Subject: [PATCH 08/82] xkb: fix XkbGetKbdByName returning incorrect data This is a regression first caused by 182404fde6bcacf5e2f05424fde4073c96c2474e that sends back the old xkb data instead of the new one. This causes a mismatch in the data and size calculations between the XkbComputeGetMapReplySize that is called above that calculates the size of the reply and XkbAssembleMap that sets the data for the reply. Without this fix this error is seen when running setxkbmap fr: "Error loading new keyboard description". Fixes setxkbmap error described in #180 Signed-off-by: dec05eba --- xkb/xkb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index f291600a3..303b5a48e 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -6054,7 +6054,7 @@ ProcXkbGetKbdByName(ClientPtr client) if (reported & (XkbGBN_SymbolsMask | XkbGBN_TypesMask)) { char *buf = payload_walk + sizeof(mrep); - XkbAssembleMap(client, xkb, mrep, buf); + XkbAssembleMap(client, new, mrep, buf); if (client->swapped) { swaps(&mrep.sequenceNumber); From 66547c7971a8a6a60c41b7a3cad34eab5899d6d2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 16:48:51 +0200 Subject: [PATCH 09/82] xfree86: provide xf86EnableGeneralHandler() for Nvidia driver The proprietary NVidia driver want's to call an internal function for reasons unknown to us. Adding a little wrapper for it, that's also printing out some warning message in the log. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86Events.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 442579200..133a73b30 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -343,7 +343,18 @@ xf86UpdateHasVTProperty(Bool hasVT) static void xf86DisableInputHandler(void *handler); static void xf86EnableInputHandler(void *handler); static void xf86DisableGeneralHandler(void *handler); -static void xf86EnableGeneralHandler(void *handler); + +static void _xf86EnableGeneralHandler(void *handler); + +_X_EXPORT /* needs to be exported for Nvidia legacy (470.256.02) */ +void xf86EnableGeneralHandler(void *handler); + +void xf86EnableGeneralHandler(void *handler) { + LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86EnableGeneralHandler() !\n"); + LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); + LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); + _xf86EnableGeneralHandler(handler); +} static void xf86VTLeave(void) @@ -432,7 +443,7 @@ switch_failed: if (ih->is_input) xf86EnableInputHandler(ih); else - xf86EnableGeneralHandler(ih); + _xf86EnableGeneralHandler(ih); } input_unlock(); } @@ -480,7 +491,7 @@ xf86VTEnter(void) if (ih->is_input) xf86EnableInputHandler(ih); else - xf86EnableGeneralHandler(ih); + _xf86EnableGeneralHandler(ih); } #ifdef XSERVER_PLATFORM_BUS /* check for any new output devices */ @@ -664,7 +675,7 @@ static void xf86EnableInputHandler(void *handler) SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih); } -static void xf86EnableGeneralHandler(void *handler) +static void _xf86EnableGeneralHandler(void *handler) { IHPtr ih; From f5777ff1dc612651453a77e73d1ae59e34c76de0 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 14:26:56 +0200 Subject: [PATCH 10/82] xfree86: export xf86IsEntityPrimary() but keep it internal Needed by the int10 module, so has to be in the symbol table. But still not supposed to be used by out-of-tree drivers. Reported-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86Bus.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h index 07ba4b1f1..4c0bc19ab 100644 --- a/hw/xfree86/common/xf86Bus.h +++ b/hw/xfree86/common/xf86Bus.h @@ -75,7 +75,10 @@ extern int pciSlotClaimed; Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func); Bool xf86DriverHasEntities(DriverPtr drvp); void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex); + +_X_EXPORT /* only for internal int10 module - not supposed to be used by OOT drivers */ Bool xf86IsEntityPrimary(int entityIndex); + ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); Bool xf86BusConfig(void); From 711359b75cdb30f0f471aa3e7161a9722cbb43bf Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 14:39:09 +0200 Subject: [PATCH 11/82] xfree86: export xf86FindScreenForEntity() but keep it internal Needed by the int10 module, so has to be in the symbol table. But still not supposed to be used by out-of-tree drivers. Reported-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86Bus.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h index 4c0bc19ab..5072cb9ec 100644 --- a/hw/xfree86/common/xf86Bus.h +++ b/hw/xfree86/common/xf86Bus.h @@ -79,6 +79,7 @@ void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex); _X_EXPORT /* only for internal int10 module - not supposed to be used by OOT drivers */ Bool xf86IsEntityPrimary(int entityIndex); +_X_EXPORT /* only for internal int10 module - not supposed to be used by OOT drivers */ ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); Bool xf86BusConfig(void); From 905329940aaf4aeee8a73b586eb39e5c4ea23fa2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 14:42:51 +0200 Subject: [PATCH 12/82] xfree86: export OsReleaseSignals() but keep it internal Needed by the int10 module, so has to be in the symbol table. But still not supposed to be used by out-of-tree drivers. Reported-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- os/osdep.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/osdep.h b/os/osdep.h index 5a8117d78..dfbfc4873 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -174,7 +174,10 @@ void OsCleanup(Bool); void OsVendorFatalError(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); void OsVendorInit(void); void OsBlockSignals(void); + +_X_EXPORT /* needed by the int10 module, but should not be used by OOT drivers */ void OsReleaseSignals(void); + void OsResetSignals(void); void OsAbort(void) _X_NORETURN; void AbortServer(void) _X_NORETURN; From 13595b1801fe8c7373c3f58f3b11732ca8e02245 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 14:44:26 +0200 Subject: [PATCH 13/82] xfree86: export OsBlockSignals() but keep it internal Needed by the int10 module, so has to be in the symbol table. But still not supposed to be used by out-of-tree drivers. Reported-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- os/osdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/osdep.h b/os/osdep.h index dfbfc4873..ff41f2482 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -173,6 +173,8 @@ void OsInit(void); void OsCleanup(Bool); void OsVendorFatalError(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); void OsVendorInit(void); + +_X_EXPORT /* needed by the int10 module, but should not be used by OOT drivers */ void OsBlockSignals(void); _X_EXPORT /* needed by the int10 module, but should not be used by OOT drivers */ From e523724d5e09b9dcbb2c98c68bbcd00a42d4bd3c Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 14:50:24 +0200 Subject: [PATCH 14/82] xfree86: export xf86ModeStatusToString() but keep it internal Needed by the int10 module, so has to be in the symbol table. But still not supposed to be used by out-of-tree drivers. Reported-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86_priv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/common/xf86_priv.h b/hw/xfree86/common/xf86_priv.h index d3b8e7cb4..36c0633fe 100644 --- a/hw/xfree86/common/xf86_priv.h +++ b/hw/xfree86/common/xf86_priv.h @@ -79,7 +79,9 @@ Bool xf86LoadModules(const char **list, void **optlist); Bool xf86HasTTYs(void); /* xf86Mode.c */ +_X_EXPORT /* only for int10 module, not supposed to be used by OOT modules */ const char * xf86ModeStatusToString(ModeStatus status); + ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags); /* xf86DefaultModes (auto-generated) */ From fca07a761cf60a11554beb0c79eeabab3a5a3a7e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 14:58:03 +0200 Subject: [PATCH 15/82] xfree86: export xf86FlipPixels() but keep it internal Needed by the int10 module, so has to be in the symbol table. But still not supposed to be used by out-of-tree drivers. Reported-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86_priv.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/common/xf86_priv.h b/hw/xfree86/common/xf86_priv.h index 36c0633fe..be01c40f9 100644 --- a/hw/xfree86/common/xf86_priv.h +++ b/hw/xfree86/common/xf86_priv.h @@ -33,7 +33,10 @@ extern char *xf86PointerName; extern char *xf86KeyboardName; extern rgb xf86Weight; + +_X_EXPORT /* only for in-tree vgahw module, not supposed to be used by OOT modules */ extern Bool xf86FlipPixels; + extern Gamma xf86Gamma; extern const char *xf86ModulePath; From ebc0c6263fd7c05190aa5bca2d5593060e481cd5 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 20 Jun 2025 19:16:37 +0200 Subject: [PATCH 16/82] README.md: add driver release tags Since Alan Coopersmith (Sun/Oracle) currently attempting to sneak in subtle incompatibilities between Xlibre and Xorg drivers, it's time to set some ad hoc release tags of all the unreleased stuff, which are prefixed "xlibre-" and document them in the readme. Signed-off-by: Enrico Weigelt, metux IT consult --- README.md | 111 +++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 757677bc7..441a18cd3 100644 --- a/README.md +++ b/README.md @@ -60,61 +60,62 @@ Driver repositories Since Redhat had deleted and banned all X11Libre repositories from freedesktop.org, the driver repositories are now moved to GitHub: -| Driver | Git repository | -| --- | --- | -| xf86-input-elographics: | https://github.com/X11Libre/xf86-input-elographics | -| xf86-input-evdev: | https://github.com/X11Libre/xf86-input-evdev | -| xf86-input-void: | https://github.com/X11Libre/xf86-input-void | -| xf86-input-joystick: | https://github.com/X11Libre/xf86-input-joystick | -| xf86-input-keyboard: | https://github.com/X11Libre/xf86-input-keyboard | -| xf86-input-libinput: | https://github.com/X11Libre/xf86-input-libinput | -| xf86-input-mouse: | https://github.com/X11Libre/xf86-input-mouse | -| xf86-input-synaptics: | https://github.com/X11Libre/xf86-input-synaptics | -| xf86-input-vmmouse: | https://github.com/X11Libre/xf86-input-vmmouse | -| xf86-video-amdgpu: | https://github.com/X11Libre/xf86-video-amdgpu | -| xf86-video-apm: | https://github.com/X11Libre/xf86-video-apm | -| xf86-video-ark: | https://github.com/X11Libre/xf86-video-ark | -| xf86-video-ast: | https://github.com/X11Libre/xf86-video-ast | -| xf86-video-ati: | https://github.com/X11Libre/xf86-video-ati | -| xf86-video-chips: | https://github.com/X11Libre/xf86-video-chips | -| xf86-video-cirrus: | https://github.com/X11Libre/xf86-video-cirrus | -| xf86-video-dummy: | https://github.com/X11Libre/xf86-video-dummy | -| xf86-video-fbdev: | https://github.com/X11Libre/xf86-video-fbdev | -| xf86-video-freedreno: | https://github.com/X11Libre/xf86-video-freedreno | -| xf86-video-geode: | https://github.com/X11Libre/xf86-video-geode | -| xf86-video-i128: | https://github.com/X11Libre/xf86-video-i128 | -| xf86-video-i740: | https://github.com/X11Libre/xf86-video-i740 | -| xf86-video-intel: | https://github.com/X11Libre/xf86-video-intel | -| xf86-video-mach64: | https://github.com/X11Libre/xf86-video-mach64 | -| xf86-video-mga: | https://github.com/X11Libre/xf86-video-mga | -| xf86-video-neomagic: | https://github.com/X11Libre/xf86-video-neomagic | -| xf86-video-nested: | https://github.com/X11Libre/xf86-video-nested | -| xf86-video-nouveau: | https://github.com/X11Libre/xf86-video-nouveau | -| xf86-video-nv: | https://github.com/X11Libre/xf86-video-nv | -| xf86-video-omap: | https://github.com/X11Libre/xf86-video-omap | -| xf86-video-qxl: | https://github.com/X11Libre/xf86-video-qxl | -| xf86-video-r128: | https://github.com/X11Libre/xf86-video-r128 | -| xf86-video-rendition: | https://github.com/X11Libre/xf86-video-rendition | -| xf86-video-s3virge: | https://github.com/X11Libre/xf86-video-s3virge | -| xf86-video-savage: | https://github.com/X11Libre/xf86-video-savage | -| xf86-video-siliconmotion: | https://github.com/X11Libre/xf86-video-siliconmotion | -| xf86-video-sis: | https://github.com/X11Libre/xf86-video-sis | -| xf86-video-sisusb: | https://github.com/X11Libre/xf86-video-sisusb | -| xf86-video-suncg14: | https://github.com/X11Libre/xf86-video-suncg14 | -| xf86-video-suncg3: | https://github.com/X11Libre/xf86-video-suncg3 | -| xf86-video-suncg6: | https://github.com/X11Libre/xf86-video-suncg6 | -| xf86-video-sunffb: | https://github.com/X11Libre/xf86-video-sunffb | -| xf86-video-sunleo: | https://github.com/X11Libre/xf86-video-sunleo | -| xf86-video-suntcx: | https://github.com/X11Libre/xf86-video-suntcx | -| xf86-video-tdfx: | https://github.com/X11Libre/xf86-video-tdfx | -| xf86-video-trident: | https://github.com/X11Libre/xf86-video-trident | -| xf86-video-vbox: | https://github.com/X11Libre/xf86-video-vbox | -| xf86-video-v4l: | https://github.com/X11Libre/xf86-video-v4l | -| xf86-video-vesa: | https://github.com/X11Libre/xf86-video-vesa | -| xf86-video-vmware: | https://github.com/X11Libre/xf86-video-vmware | -| xf86-video-voodoo: | https://github.com/X11Libre/xf86-video-voodoo | -| xf86-video-wsfb: | https://github.com/X11Libre/xf86-video-wsfb | -| xf86-video-xgi: | https://github.com/X11Libre/xf86-video-xgi | +| Driver | Git repository | Release tag | +| --- | --- | --- | +| xf86-input-elographics: | https://github.com/X11Libre/xf86-input-elographics | xlibre-xf86-input-elographics-1.4.4.1 | +| xf86-input-evdev: | https://github.com/X11Libre/xf86-input-evdev | xlibre-xf86-input-evdev-2.11.0.1 | +| xf86-input-void: | https://github.com/X11Libre/xf86-input-void | xlibre-xf86-input-void-1.4.2.1 | +| xf86-input-joystick: | https://github.com/X11Libre/xf86-input-joystick | xlibre-xf86-input-joystick-1.6.4.1 | +| xf86-input-keyboard: | https://github.com/X11Libre/xf86-input-keyboard | xlibre-xf86-input-keyboard-2.1.0.1 | +| xf86-input-libinput: | https://github.com/X11Libre/xf86-input-libinput | xlibre-xf86-input-libinput-1.5.0.1 | +| xf86-input-mouse: | https://github.com/X11Libre/xf86-input-mouse | xlibre-xf86-input-mouse-1.9.5.1 | +| xf86-input-synaptics: | https://github.com/X11Libre/xf86-input-synaptics | xlibre-xf86-input-synaptics-1.10.0.1 | +| xf86-input-vmmouse: | https://github.com/X11Libre/xf86-input-vmmouse | xlibre-xf86-input-vmmouse-13.2.0.1 | +| xf86-input-wacom: | https://github.com/X11Libre/xf86-input-wacom | xlibre-xf86-input-wacom-1.2.3.1 | +| xf86-video-amdgpu: | https://github.com/X11Libre/xf86-video-amdgpu | xlibre-xf86-video-amdgpu-23.0.0.1 | +| xf86-video-apm: | https://github.com/X11Libre/xf86-video-apm | xlibre-xf86-video-apm-1.3.0.1 | +| xf86-video-ark: | https://github.com/X11Libre/xf86-video-ark | xfree-xf86-video-ark-0.7.6.1 | +| xf86-video-ast: | https://github.com/X11Libre/xf86-video-ast | xlibre-xf86-video-ast-1.2.0 | +| xf86-video-ati: | https://github.com/X11Libre/xf86-video-ati | xfree-xf86-video-ati-22.0.0.1 | +| xf86-video-chips: | https://github.com/X11Libre/xf86-video-chips | xlibre-xf86-video-chips-1.5.0.1 | +| xf86-video-cirrus: | https://github.com/X11Libre/xf86-video-cirrus | xlibre-xf86-video-cirrus-1.6.0.1 | +| xf86-video-dummy: | https://github.com/X11Libre/xf86-video-dummy | xlibre-xf86-video-dummy-0.4.1.1 | +| xf86-video-fbdev: | https://github.com/X11Libre/xf86-video-fbdev | xlibre-xf86-video-fbdev-0.5.1.1 | +| xf86-video-freedreno: | https://github.com/X11Libre/xf86-video-freedreno | xlibre-xf86-video-freedreno-1.4.0.1 | +| xf86-video-geode: | https://github.com/X11Libre/xf86-video-geode | xlibre-xf86-video-geode-2.18.1.1 | +| xf86-video-i128: | https://github.com/X11Libre/xf86-video-i128 | xlibre-xf86-video-i128-1.4.1.1 | +| xf86-video-i740: | https://github.com/X11Libre/xf86-video-i740 | xlibre-xf86-video-i740-1.4.0.1 | +| xf86-video-intel: | https://github.com/X11Libre/xf86-video-intel | xlibre-xf86-video-intel-3.0.0.1 | +| xf86-video-mach64: | https://github.com/X11Libre/xf86-video-mach64 | xlibre-xf86-video-mach64-6.10.0.1 | +| xf86-video-mga: | https://github.com/X11Libre/xf86-video-mga | xlibre-xf86-video-mga-2.1.0.1 | +| xf86-video-neomagic: | https://github.com/X11Libre/xf86-video-neomagic | xlibre-xf86-video-neomagic-1.3.1.1 | +| xf86-video-nested: | https://github.com/X11Libre/xf86-video-nested | xlibre-xf86-video-nested-1.0.0.1 | +| xf86-video-nouveau: | https://github.com/X11Libre/xf86-video-nouveau | xlibre-xf86-video-nouveau-1.0.18.1 | +| xf86-video-nv: | https://github.com/X11Libre/xf86-video-nv | xlibre-xf86-video-nv-2.1.23.1 | +| xf86-video-omap: | https://github.com/X11Libre/xf86-video-omap | xlibre-xf86-video-omap-0.4.5.1 | +| xf86-video-qxl: | https://github.com/X11Libre/xf86-video-qxl | xlibre-xf86-video-qxl-0.1.6.1 | +| xf86-video-r128: | https://github.com/X11Libre/xf86-video-r128 | xlibre-xf86-video-r128-6.13.0.1 | +| xf86-video-rendition: | https://github.com/X11Libre/xf86-video-rendition | xlibre-xf86-video-rendition-4.2.7.1 | +| xf86-video-s3virge: | https://github.com/X11Libre/xf86-video-s3virge | xlibre-xf86-video-s3virge-1.11.1.1 | +| xf86-video-savage: | https://github.com/X11Libre/xf86-video-savage | xlibre-xf86-video-savage-2.4.1.1 | +| xf86-video-siliconmotion: | https://github.com/X11Libre/xf86-video-siliconmotion | xlibre-xf86-video-siliconmotion-1.7.10.1 | +| xf86-video-sis: | https://github.com/X11Libre/xf86-video-sis | xlibre-xf86-video-sis-0.12.0.1 | +| xf86-video-sisusb: | https://github.com/X11Libre/xf86-video-sisusb | xlibre-xf86-video-sisusb-0.9.7.1 | +| xf86-video-suncg14: | https://github.com/X11Libre/xf86-video-suncg14 | xlibre-xf86-video-suncg14-1.2.0 | +| xf86-video-suncg3: | https://github.com/X11Libre/xf86-video-suncg3 | xlibre-xf86-video-suncg3-1.1.3.0 | +| xf86-video-suncg6: | https://github.com/X11Libre/xf86-video-suncg6 | xlibre-xf86-video-suncg6-1.1.3.1 | +| xf86-video-sunffb: | https://github.com/X11Libre/xf86-video-sunffb | xlibre-xf86-video-sunffb-1.2.3.1 | +| xf86-video-sunleo: | https://github.com/X11Libre/xf86-video-sunleo | xlibre-xf86-video-sunleo-1.2.3.1 | +| xf86-video-suntcx: | https://github.com/X11Libre/xf86-video-suntcx | xlibre-xf86-video-suntcx-1.1.3.1 | +| xf86-video-tdfx: | https://github.com/X11Libre/xf86-video-tdfx | xlibre-xf86-video-tdfx-1.5.0.1 | +| xf86-video-trident: | https://github.com/X11Libre/xf86-video-trident | xlibre-xf86-video-trident-1.4.0.1 | +| xf86-video-vbox: | https://github.com/X11Libre/xf86-video-vbox | xlibre-xf86-video-vbox-1.0.1.1 | +| xf86-video-v4l: | https://github.com/X11Libre/xf86-video-v4l | xlibre-xf86-video-v4l-0.3.0.1 | +| xf86-video-vesa: | https://github.com/X11Libre/xf86-video-vesa | xlibre-xf86-video-vesa-2.6.0.1 | +| xf86-video-vmware: | https://github.com/X11Libre/xf86-video-vmware | xlibre-xf86-video-vmware-13.4.0.1 | +| xf86-video-voodoo: | https://github.com/X11Libre/xf86-video-voodoo | xlibre-xf86-video-voodoo-1.2.6.1 | +| xf86-video-wsfb: | https://github.com/X11Libre/xf86-video-wsfb | xlibre-xf86-video-wsfb-0.4.1.1 | +| xf86-video-xgi: | https://github.com/X11Libre/xf86-video-xgi | xlibre-xf86-video-xgi-1.6.1.1 | Contact From 40dc3b6419a5c72242c28724f1f78ff39a726af6 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Sat, 21 Jun 2025 11:47:41 +0200 Subject: [PATCH 17/82] Xlibre release 25.0.0.0 Summer solstice 2025. Initial release of Xlibre Xserver. Signed-off-by: Enrico Weigelt, metux IT consult --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ce694e622..e9e7aa267 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project('xserver', 'c', 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '21.1.99.1', + version: '25.0.0.0', meson_version: '>= 0.58.0', ) release_date = '2021-07-05' From 3f5e4b1d976d8d31a29b56a9e0408602683befab Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 23 Jun 2025 11:09:45 +0200 Subject: [PATCH 18/82] xfree86: provide xf86DisableGeneralHandler() for Nvidia driver The proprietary NVidia driver want's to call an internal function for reasons unknown to us. Adding a little wrapper for it, that's also printing out some warning message in the log. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86Events.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 133a73b30..d8d05e30a 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -342,20 +342,32 @@ xf86UpdateHasVTProperty(Bool hasVT) static void xf86DisableInputHandler(void *handler); static void xf86EnableInputHandler(void *handler); -static void xf86DisableGeneralHandler(void *handler); static void _xf86EnableGeneralHandler(void *handler); +static void _xf86DisableGeneralHandler(void *handler); _X_EXPORT /* needs to be exported for Nvidia legacy (470.256.02) */ void xf86EnableGeneralHandler(void *handler); +_X_EXPORT /* needs to be exported for Nvidia legacy (470.256.02) */ +void xf86DisableGeneralHandler(void *handler); + void xf86EnableGeneralHandler(void *handler) { LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86EnableGeneralHandler() !\n"); LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); + LogMessageVerb(X_WARNING, 0, "https://forums.developer.nvidia.com/c/gpu-graphics/linux/148\n"); LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); _xf86EnableGeneralHandler(handler); } +void xf86DisableGeneralHandler(void *handler) { + LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86DisableGeneralHandler() !\n"); + LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); + LogMessageVerb(X_WARNING, 0, "https://forums.developer.nvidia.com/c/gpu-graphics/linux/148\n"); + LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); + _xf86DisableGeneralHandler(handler); +} + static void xf86VTLeave(void) { @@ -383,7 +395,7 @@ xf86VTLeave(void) if (ih->is_input) xf86DisableInputHandler(ih); else - xf86DisableGeneralHandler(ih); + _xf86DisableGeneralHandler(ih); } for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86DisableInputDeviceForVTSwitch(pInfo); @@ -649,7 +661,7 @@ static void xf86DisableInputHandler(void *handler) RemoveNotifyFd(ih->fd); } -static void xf86DisableGeneralHandler(void *handler) +static void _xf86DisableGeneralHandler(void *handler) { IHPtr ih; From 0746e6841a2ad3202deaa89dcd01100a4f1df88b Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Mon, 23 Jun 2025 14:27:10 +0300 Subject: [PATCH 19/82] xfree86: compat: fix Ones for compilers where __builtin_popcountl is missing Signed-off-by: stefan11111 --- hw/xfree86/compat/ones.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/xfree86/compat/ones.c b/hw/xfree86/compat/ones.c index 7e2dce864..37f724a2f 100644 --- a/hw/xfree86/compat/ones.c +++ b/hw/xfree86/compat/ones.c @@ -27,7 +27,6 @@ Ones(unsigned long mask) y = (mask >> 1) & 033333333333; y = mask - y - ((y >> 1) & 033333333333); - /* x & 077 == x % 077 */ - return (((y + (y >> 3)) & 030707070707) & 077); + return (((y + (y >> 3)) & 030707070707) % 077); #endif } From 4e1515f793b8313023bfea6ce59fe55b65199c03 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 23 Jun 2025 15:42:47 +0200 Subject: [PATCH 20/82] meson.build: fix release date variable Signed-off-by: Enrico Weigelt, metux IT consult --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e9e7aa267..ef4519236 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('xserver', 'c', version: '25.0.0.0', meson_version: '>= 0.58.0', ) -release_date = '2021-07-05' +release_date = '2025-06-21' add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) cc = meson.get_compiler('c') From 604582d179609500d8337b57fe5c1c95544c0d05 Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Sat, 7 Jun 2025 09:05:09 +0300 Subject: [PATCH 21/82] glx: fix correct sizeof GL unsigned int Signed-off-by: Herman Semenov --- glx/rensize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glx/rensize.c b/glx/rensize.c index 821c6b3fb..f48182210 100644 --- a/glx/rensize.c +++ b/glx/rensize.c @@ -347,7 +347,7 @@ __glXTypeSize(GLenum enm) case GL_INT: return sizeof(GLint); case GL_UNSIGNED_INT: - return sizeof(GLint); + return sizeof(GLuint); case GL_FLOAT: return sizeof(GLfloat); case GL_DOUBLE: From f7516e6234e91269e2c526c089670ca3b8742cfe Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 23 Jun 2025 16:43:28 +0200 Subject: [PATCH 22/82] meson_options: fix mailing list address The meson_options allow setting some `builder` mail address, and default was still pointing to old, dead xorg. Signed-off-by: Enrico Weigelt, metux IT consult --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 26172f147..ef49ffff8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,7 +14,7 @@ option('xquartz', type: 'combo', choices: ['true', 'false', 'auto'], value: 'aut description: 'Enable Xquartz X server') -option('builder_addr', type: 'string', description: 'Builder address', value: 'xorg@lists.freedesktop.org') +option('builder_addr', type: 'string', description: 'Builder address', value: 'xlibre@freelists.org') option('builder_string', type: 'string', description: 'Additional builder string') option('log_dir', type: 'string') From 828f9a1b7feb94a29fe8a566e3833d6bff2e6513 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 23 Jun 2025 16:49:06 +0200 Subject: [PATCH 23/82] xfree86: man: fix git URL fix the git URL to point to Xlibre repository. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/man/Xorg.man | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man index 440a65d3b..f526d300f 100644 --- a/hw/xfree86/man/Xorg.man +++ b/hw/xfree86/man/Xorg.man @@ -656,11 +656,7 @@ Orest Zborowski \fIorestz@eskimo.com\fP .fi .RE .PP -Xorg source is available from the FTP server -\fI\fP, and from the X.Org -server \fI\fP. Documentation and other -information can be found from the X.Org web site -\fI\fP. +Xlibre source is available via git \fI\fP. .SH LEGAL .B Xorg From ada105a5d22cb8c1a3382d73b4f3992b34213548 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 23 Jun 2025 16:55:43 +0200 Subject: [PATCH 24/82] xorg-server.pc.in: fix source URL Source URL in .pc input was still linking to old dead xorg. Signed-off-by: Enrico Weigelt, metux IT consult --- xorg-server.pc.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xorg-server.pc.in b/xorg-server.pc.in index ffa639e3d..6fc6d1a95 100644 --- a/xorg-server.pc.in +++ b/xorg-server.pc.in @@ -13,8 +13,8 @@ abi_xinput=@abi_xinput@ abi_extension=@abi_extension@ Name: xorg-server -Description: Modular X.Org X Server -URL: https://gitlab.freedesktop.org/xorg/xserver/ +Description: Modular XLibre X Server +URL: https://github.com/X11Libre/xserver/ Version: @PACKAGE_VERSION@ Requires.private: @SDK_REQUIRED_MODULES@ Cflags: -I${sdkdir} @symbol_visibility@ From e91cfc890feee2861ebbfdfcaffd9cd8a5db754e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 24 Jun 2025 12:52:35 +0200 Subject: [PATCH 25/82] randr: fix memleak in provider property update If a device property is going to be updated, but failing due the new value being too big, the buffer isn't freed. Also compacting the logic for this into small inline function. Fixes: 948630fa428d8e0111c29a882c45b4c8bee5a796 Signed-off-by: Enrico Weigelt, metux IT consult --- randr/rrproviderproperty.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c index 82174fc3a..dfaf95667 100644 --- a/randr/rrproviderproperty.c +++ b/randr/rrproviderproperty.c @@ -119,6 +119,12 @@ RRDeleteProviderProperty(RRProviderPtr provider, Atom property) } } +/* shortcut for cleaning up property when failed to add */ +static inline void cleanupProperty(RRPropertyPtr prop, Bool added) { + if ((prop != NULL) && added) + RRDestroyProviderProperty(prop); +} + int RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, int format, int mode, unsigned long len, @@ -166,13 +172,14 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, if (mode == PropModeReplace || len > 0) { void *new_data = NULL, *old_data = NULL; - if (total_len > MAXINT / size_in_bytes) + if (total_len > MAXINT / size_in_bytes) { + cleanupProperty(prop, add); return BadValue; + } total_size = total_len * size_in_bytes; new_value.data = calloc(1, total_size); if (!new_value.data && total_size) { - if (add) - RRDestroyProviderProperty(prop); + cleanupProperty(prop, add); return BadAlloc; } new_value.size = len; @@ -204,8 +211,7 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, if (pending && pScrPriv->rrProviderSetProperty && !pScrPriv->rrProviderSetProperty(provider->pScreen, provider, prop->propertyName, &new_value)) { - if (add) - RRDestroyProviderProperty(prop); + cleanupProperty(prop, add); free(new_value.data); return BadValue; } @@ -292,8 +298,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property, * ranges must have even number of values */ if (range && (num_values & 1)) { - if (add) - RRDestroyProviderProperty(prop); + cleanupProperty(prop, add); return BadMatch; } @@ -301,8 +306,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property, if (num_values) { new_values = calloc(num_values, sizeof(INT32)); if (!new_values) { - if (add) - RRDestroyProviderProperty(prop); + cleanupProperty(prop, add); return BadAlloc; } memcpy(new_values, values, num_values * sizeof(INT32)); From f5ea9069e147ca67a2a4081c06b6d0f56c1e4f3b Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 24 Jun 2025 17:46:26 +0200 Subject: [PATCH 26/82] release 25.0.0.1 minor bugfix release Signed-off-by: Enrico Weigelt, metux IT consult --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ef4519236..2a5500635 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project('xserver', 'c', 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '25.0.0.0', + version: '25.0.0.1', meson_version: '>= 0.58.0', ) release_date = '2025-06-21' From 3079488484cc23121c64576a2553b4b3a7ec34c4 Mon Sep 17 00:00:00 2001 From: b-aaz <85005689+b-aaz@users.noreply.github.com> Date: Sat, 21 Jun 2025 20:26:57 +0000 Subject: [PATCH 27/82] dix: generate-atoms: Changed BASH to POSIX SH for portability. BASH is not preinstalled on many systems. Also added -r and IFS= to the read command. Signed-off-by; b-aaz --- dix/generate-atoms | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dix/generate-atoms b/dix/generate-atoms index 48152d148..f1c2a79ba 100755 --- a/dix/generate-atoms +++ b/dix/generate-atoms @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # SPDX-License-Identifier: MIT OR X11 # # Copyright © 2024 Enrico Weigelt, metux IT consult @@ -7,10 +7,10 @@ INPUT="$1" OUTPUT="$2" do_line() { - local name="$1" + name="$1" [ "$2" != "@" ] && return 0 echo " if (MakeAtom(\"$name\", ${#name}, 1) != XA_$name)" - echo " FatalError(\"adding builtin atom\");" + echo " FatalError(\"Adding builtin atom\");" } cat > "$OUTPUT" << __END__ @@ -35,6 +35,6 @@ MakePredeclaredAtoms(void) { __END__ -( grep '@' < "$INPUT" ) | ( while read l ; do do_line $l ; done ) >> "$OUTPUT" +( grep '@' < "$INPUT" ) | ( while IFS= read -r l ; do do_line $l ; done ) >> "$OUTPUT" echo "}" >> "$OUTPUT" From 3e1c2d545682aee34329f071d9d791b335bdbf95 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sat, 14 Dec 2024 01:07:31 +0800 Subject: [PATCH 28/82] glamor: Fix dual blend on GLES3 The EXT_blend_func_extended extension on ESSL always requires explicit request to allow two FS out variables because of limitations of the ESSL language, which is mentioned as the No.6 issue of the extension's specification. Fix this by adding the extension request. The original behavior on GLES3 is slightly against the specification of GL_EXT_blend_func_extended extension, however Mesa and older version of PowerVR closed drivers will just ignore this issue. Newest PowerVR closed driver will bail out on this problem, so it deems a fix now. Fixes: ee107cd4911e ("glamor: support GLES3 shaders") Signed-off-by: Icenowy Zheng Part-of: --- glamor/glamor_composite_glyphs.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c index faf8409c3..8e15a349e 100644 --- a/glamor/glamor_composite_glyphs.c +++ b/glamor/glamor_composite_glyphs.c @@ -185,6 +185,24 @@ glamor_glyph_add(struct glamor_glyph_atlas *atlas, DrawablePtr glyph_draw) return TRUE; } +static const glamor_facet glamor_facet_composite_glyphs_es300 = { + .name = "composite_glyphs", + .version = 130, + .fs_extensions = ("#extension GL_EXT_blend_func_extended : enable\n"), + .vs_vars = ("in vec4 primitive;\n" + "in vec2 source;\n" + "out vec2 glyph_pos;\n"), + .vs_exec = (" vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n" + GLAMOR_POS(gl_Position, (primitive.xy + pos)) + " glyph_pos = (source + pos) * ATLAS_DIM_INV;\n"), + .fs_vars = ("in vec2 glyph_pos;\n" + "out vec4 color0;\n" + "out vec4 color1;\n"), + .fs_exec = (" vec4 mask = texture(atlas, glyph_pos);\n"), + .source_name = "source", + .locations = glamor_program_location_atlas, +}; + static const glamor_facet glamor_facet_composite_glyphs_130 = { .name = "composite_glyphs", .version = 130, @@ -464,7 +482,9 @@ glamor_composite_glyphs(CARD8 op, if (glamor_glsl_has_ints(glamor_priv)) prog = glamor_setup_program_render(op, src, glyph_pict, dst, glyphs_program, - &glamor_facet_composite_glyphs_130, + glamor_priv->is_gles ? + &glamor_facet_composite_glyphs_es300 : + &glamor_facet_composite_glyphs_130, glamor_priv->glyph_defines); else prog = glamor_setup_program_render(op, src, glyph_pict, dst, From 705d1ce6795a110231e9e02f05f869ff32b9098f Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 14:42:09 +0100 Subject: [PATCH 29/82] .github: export MACHINE the right way Otherwise, paths constructed on "build xserver sdk" step aren't valid. Signed-off-by: Mike Gelfand --- .github/workflows/build-xserver.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml index d1d8d2bc1..c7cdda103 100644 --- a/.github/workflows/build-xserver.yml +++ b/.github/workflows/build-xserver.yml @@ -20,7 +20,8 @@ jobs: - name: prepare build environment run: | - export MACHINE=`gcc -dumpmachine` + MACHINE=`gcc -dumpmachine` + echo "MACHINE=$MACHINE" >> "$GITHUB_ENV" echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" sudo chown root /bin/tar && sudo chmod u+s /bin/tar @@ -78,7 +79,8 @@ jobs: - name: prepare build environment run: | - export MACHINE=`gcc -dumpmachine` + MACHINE=`gcc -dumpmachine` + echo "MACHINE=$MACHINE" >> "$GITHUB_ENV" echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" sudo chown root /bin/tar && sudo chmod u+s /bin/tar From bc8518f8f8357b7958c6d9979e6206490febc3e1 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 13:58:15 +0100 Subject: [PATCH 30/82] .github: drop sudo for prerequisites builds Files aren't being installed into privileged directories as part of the build but instead into $X11_PREFIX which resides in current user's home directory. Change the cache key to avoid reusing old cache entries, which would lead to permission errors. Signed-off-by: Mike Gelfand --- .github/workflows/build-xserver.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml index c7cdda103..2a83db818 100644 --- a/.github/workflows/build-xserver.yml +++ b/.github/workflows/build-xserver.yml @@ -42,11 +42,11 @@ jobs: ${{ env.X11_PREFIX }} ${{ env.X11_BUILD_DIR }}/xts ${{ env.X11_BUILD_DIR }}/piglit - key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} - restore-keys: ${{ runner.os }}-x11-deps- + key: ${{ runner.name }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} + restore-keys: ${{ runner.name }}-x11-deps- - name: generic prereq - run: sudo .github/scripts/install-prereq.sh + run: .github/scripts/install-prereq.sh - name: build run: .gitlab-ci/meson-build.sh @@ -101,11 +101,11 @@ jobs: ${{ env.X11_PREFIX }} ${{ env.X11_BUILD_DIR }}/xts ${{ env.X11_BUILD_DIR }}/piglit - key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} - restore-keys: ${{ runner.os }}-x11-deps- + key: ${{ runner.name }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} + restore-keys: ${{ runner.name }}-x11-deps- - name: generic prereq - run: sudo .github/scripts/install-prereq.sh + run: .github/scripts/install-prereq.sh - name: build xserver sdk run: | From 5e98d8c571f66233649fce71c3625b044f23f5e3 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 13:49:10 +0100 Subject: [PATCH 31/82] .gitlab-ci: only look for files when validating man pages Build directory may sometimes contain directories ending with a period and a digit, e.g. in my case * ./meson-private/cmake_xshmfence/CMakeFiles/4.0.3 * ./meson-private/__CMake_compiler_info__/CMakeFiles/4.0.3 Since man pages are files, filter out the rest. Signed-off-by: Mike Gelfand --- .gitlab-ci/manpages-check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci/manpages-check b/.gitlab-ci/manpages-check index cf2b15349..5d189e7db 100755 --- a/.gitlab-ci/manpages-check +++ b/.gitlab-ci/manpages-check @@ -1,6 +1,6 @@ #!/bin/sh -find build/ -regex ".*\.[1-9]$" -exec grep -E \ +find build/ -type f -regex ".*\.[1-9]$" -exec grep -E \ @vendorversion@\|\ @xorgversion@\|\ @xservername@\|\ From 5ed2865bdd386120e3f29797a153574c97db724e Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 14:16:43 +0100 Subject: [PATCH 32/82] .github: don't override env vars set externally Helpful for CI builds where we could be setting different paths on different runners (due to OS or something else). Signed-off-by: Mike Gelfand --- .github/scripts/conf.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/conf.sh b/.github/scripts/conf.sh index fd6fb5320..7a0576b7f 100644 --- a/.github/scripts/conf.sh +++ b/.github/scripts/conf.sh @@ -1,6 +1,8 @@ -export X11_PREFIX=/home/runner/x11 +export X11_PREFIX="${X11_PREFIX:-$HOME/x11}" +export X11_BUILD_DIR="${X11_BUILD_DIR:-$HOME/build-deps}" +export DRV_BUILD_DIR="${DRV_BUILD_DIR:-$HOME/build-drivers}" + +export FDO_CI_CONCURRENT=`nproc` + export PATH="$X11_PREFIX/bin:$PATH" export PKG_CONFIG_PATH="$X11_PREFIX/lib/x86_64-linux-gnu/pkgconfig:$X11_PREFIX/lib/pkgconfig:$X11_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH" -export FDO_CI_CONCURRENT=`nproc` -export X11_BUILD_DIR=/home/runner/build-deps -export DRV_BUILD_DIR=/home/runner/build-drivers From 87c8520ba369fb7dd28de40152331e00fe118b4b Mon Sep 17 00:00:00 2001 From: callmetango Date: Thu, 26 Jun 2025 18:40:30 +0000 Subject: [PATCH 33/82] .github: Add new issue forms Add the following forms for issue creation: * Bug report * Feature request * Code cleanup * Documentation update * Organizational task * add issue type selection page on "New Issue" call * mention Github Discussions and the mailing list where appropriate Fixes #257 Signed-off-by: callmetango --- .github/ISSUE_TEMPLATE/01-bug-report.yml | 66 +++++++++++++++++++ .github/ISSUE_TEMPLATE/02-feature-request.yml | 49 ++++++++++++++ .github/ISSUE_TEMPLATE/03-code-cleanup.yml | 50 ++++++++++++++ .github/ISSUE_TEMPLATE/04-doc-update.yml | 39 +++++++++++ .github/ISSUE_TEMPLATE/05-org-task.yml | 44 +++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 8 +++ 6 files changed, 256 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/01-bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/02-feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/03-code-cleanup.yml create mode 100644 .github/ISSUE_TEMPLATE/04-doc-update.yml create mode 100644 .github/ISSUE_TEMPLATE/05-org-task.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/01-bug-report.yml b/.github/ISSUE_TEMPLATE/01-bug-report.yml new file mode 100644 index 000000000..890e9568e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01-bug-report.yml @@ -0,0 +1,66 @@ +name: 🐞 Bug report +description: Create a report to help us improve + +labels: [bug, needs-triage] +#type: bug + +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to help everyone identify and fix the bug. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions). + - type: dropdown + id: affected-version + attributes: + label: Select the version + options: + - 25.0.0.0 + - 25.0.0.1 + - Git master branch + - other or don't know + default: 1 + validations: + required: true + - type: textarea + id: description + attributes: + label: Describe your issue + placeholder: When I did X then Y happened. + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + placeholder: | + 1. Start ... + 2. Do this + 3. Do that + validations: + required: true + - type: textarea + id: expected + attributes: + label: What did you expect? + placeholder: I expected this to happen. + - type: textarea + id: environment + attributes: + label: Additional Information + description: Additional information you want to provide such as logs, system info, environment, screenshots, etc. + placeholder: | + Add any other context about the bug here. + - type: checkboxes + id: checks + attributes: + label: Extra fields + options: + - label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues) + required: true + - label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md) + required: true + - label: I'd like to work on this issue + - type: markdown + attributes: + value: | + Thanks for reporting this issue! We will get back to you as soon as possible. diff --git a/.github/ISSUE_TEMPLATE/02-feature-request.yml b/.github/ISSUE_TEMPLATE/02-feature-request.yml new file mode 100644 index 000000000..f9fa434e7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02-feature-request.yml @@ -0,0 +1,49 @@ +name: ✨ Feature request +description: Suggest a feature for this software +labels: [enhancement, needs-triage] + +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to properly describe the new software feature you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions). + - type: textarea + id: description + attributes: + label: "Describe the feature" + placeholder: A thing in X that allows to do Y. + validations: + required: true + - type: textarea + id: rationale + attributes: + label: "It should be implemented because" + placeholder: Doing Y is needed for Z. + validations: + required: true + - type: textarea + id: alternative + attributes: + label: "What are the alternatives?" + placeholder: We could do A or B instead. + - type: textarea + id: context + attributes: + label: Additional context + description: Additional information you want to provide such as references to related issues or protocols, the implications on existing use cases, etc. + placeholder: | + Add any other context about the feature request here. + - type: checkboxes + id: checks + attributes: + label: Extra fields + options: + - label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues) + required: true + - label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md) + required: true + - label: I'd like to work on this issue + - type: markdown + attributes: + value: | + Thanks for your suggestion! Let's see together if it can be implemented. diff --git a/.github/ISSUE_TEMPLATE/03-code-cleanup.yml b/.github/ISSUE_TEMPLATE/03-code-cleanup.yml new file mode 100644 index 000000000..2c419e857 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03-code-cleanup.yml @@ -0,0 +1,50 @@ +name: 🔧 Code cleanup +description: Level up the source code +labels: [code-cleanup, needs-triage] +#type: codecleanup + +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to properly describe the code cleanup you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions). + - type: textarea + id: description + attributes: + label: "Describe the cleanup" + placeholder: C in X needs to be changed into D. + validations: + required: true + - type: textarea + id: rationale + attributes: + label: "It should be done because" + placeholder: Having D is needed for E. + validations: + required: true + - type: textarea + id: alternative + attributes: + label: "What are the alternatives?" + placeholder: We could do A or B instead. + - type: textarea + id: context + attributes: + label: Additional context + description: Additional information you want to provide such as implications on existing code, how to ensure API/ABI stability, which tests are needed or to be run, related issues, etc. + placeholder: | + Add any other context about the cleanup here. + - type: checkboxes + id: checks + attributes: + label: Extra fields + options: + - label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues) + required: true + - label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md) + required: true + - label: I'd like to work on this issue + - type: markdown + attributes: + value: | + Thanks for looking at the source code! Let's see together how it can be improved. diff --git a/.github/ISSUE_TEMPLATE/04-doc-update.yml b/.github/ISSUE_TEMPLATE/04-doc-update.yml new file mode 100644 index 000000000..5d20ca6b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/04-doc-update.yml @@ -0,0 +1,39 @@ +name: 🔖 Documentation update +description: Make your mark for better documentation + +labels: [documentation, needs-triage] +#type: docchange + +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to help others understand our software. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions). + - type: textarea + id: description + attributes: + label: Describe the update + placeholder: These things need to be better documented. + validations: + required: true + - type: textarea + id: environment + attributes: + label: Additional Information + description: Additional information you want to provide such as tickets related to changes in the software, affected files, screenshots, etc. + placeholder: | + Add any other context about the update here. + - type: checkboxes + id: checks + attributes: + label: Extra fields + options: + - label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues) + required: true + - label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md) + required: true + - label: I'd like to work on this issue + - type: markdown + attributes: + value: | + Thanks for requesting this update! We will get back to you as soon as possible. diff --git a/.github/ISSUE_TEMPLATE/05-org-task.yml b/.github/ISSUE_TEMPLATE/05-org-task.yml new file mode 100644 index 000000000..049b03baf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/05-org-task.yml @@ -0,0 +1,44 @@ +name: ✅ Organizational task +description: Create a task for project organization + +labels: [needs-triage, organization] +#type: task + +body: + - type: markdown + attributes: + value: | + Please fill out the sections below to get organizational things done. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions). + - type: textarea + id: description + attributes: + label: Describe the task + placeholder: These things need to be done. + validations: + required: true + - type: textarea + id: rationale + attributes: + label: "It should be done because" + placeholder: Doing Y is needed for Z. + - type: textarea + id: environment + attributes: + label: Additional Information + description: Additional information you want to provide such as the context for bigger tasks, the implicatons on existing workflows, related issues, etc. + placeholder: | + Add any other context about the task here. + - type: checkboxes + id: checks + attributes: + label: Extra fields + options: + - label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues) + required: true + - label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md) + required: true + - label: I'd like to work on this issue + - type: markdown + attributes: + value: | + Thanks for adding this task! We will get back to you as soon as possible. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..5d1b3a851 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: XLibre Community Support + url: https://github.com/orgs/X11Libre/discussions + about: Please ask and answer questions here. + - name: Mailing List + url: https://www.freelists.org/list/xlibre + about: You can join the discussions on our mailing list. From b5d569a884c9c6749f3cf90eee913cc43d9e3cc9 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:14 +0100 Subject: [PATCH 34/82] xext: add/fix include guards where missing/broken Signed-off-by: Mike Gelfand --- Xext/geext_priv.h | 2 ++ Xext/panoramiXh.h | 6 +++++- Xext/xvdisp.h | 5 +++++ Xext/xvdix_priv.h | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Xext/geext_priv.h b/Xext/geext_priv.h index 5774c7528..95aeb812d 100644 --- a/Xext/geext_priv.h +++ b/Xext/geext_priv.h @@ -2,7 +2,9 @@ * * Copyright © 2024 Enrico Weigelt, metux IT consult */ + #ifndef _XORG_GEEXT_PRIV_H +#define _XORG_GEEXT_PRIV_H #include diff --git a/Xext/panoramiXh.h b/Xext/panoramiXh.h index 2762a59ac..d92da7fd3 100644 --- a/Xext/panoramiXh.h +++ b/Xext/panoramiXh.h @@ -1,8 +1,10 @@ - /* * Server dispatcher function replacements */ +#ifndef XSERVER_PANORAMIXH_H +#define XSERVER_PANORAMIXH_H + extern int PanoramiXCreateWindow(ClientPtr client); extern int PanoramiXChangeWindowAttributes(ClientPtr client); extern int PanoramiXDestroyWindow(ClientPtr client); @@ -71,3 +73,5 @@ extern int connBlockScreenStart; extern xConnSetupPrefix connSetupPrefix; extern int (*SavedProcVector[256]) (ClientPtr client); + +#endif /* XSERVER_PANORAMIXH_H */ diff --git a/Xext/xvdisp.h b/Xext/xvdisp.h index 944959c99..55d21091f 100644 --- a/Xext/xvdisp.h +++ b/Xext/xvdisp.h @@ -1,2 +1,7 @@ +#ifndef XSERVER_XVDISP_H +#define XSERVER_XVDISP_H + extern void XineramifyXv(void); extern int xvUseXinerama; + +#endif /* XSERVER_XVDISP_H */ diff --git a/Xext/xvdix_priv.h b/Xext/xvdix_priv.h index d1ddb68f2..a64a5625a 100644 --- a/Xext/xvdix_priv.h +++ b/Xext/xvdix_priv.h @@ -2,7 +2,9 @@ * * Copyright © 2024 Enrico Weigelt, metux IT consult */ + #ifndef _XORG_XVDIX_PRIV_H +#define _XORG_XVDIX_PRIV_H #include From 7fbd8db7a4a4212e9aba5fc503fe8f3cf0e5adfd Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:19 +0100 Subject: [PATCH 35/82] config: add/fix include guards where missing/broken Signed-off-by: Mike Gelfand --- config/config-backends.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/config-backends.h b/config/config-backends.h index 5f07557b7..cb09ef5be 100644 --- a/config/config-backends.h +++ b/config/config-backends.h @@ -23,6 +23,9 @@ * Author: Daniel Stone */ +#ifndef XSERVER_CONFIG_BACKENDS_H +#define XSERVER_CONFIG_BACKENDS_H + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -44,3 +47,5 @@ void config_hal_fini(void); int config_wscons_init(void); void config_wscons_fini(void); #endif + +#endif /* XSERVER_CONFIG_BACKENDS_H */ From 166d1b5e6b9a052f31cfd57a8b461983a7d24a56 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:19 +0100 Subject: [PATCH 36/82] fb: add/fix include guards where missing/broken Skipped headers designed for multiple or non-trivial inclusion: * fb/fbbits.h Signed-off-by: Mike Gelfand --- fb/wfbrename.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fb/wfbrename.h b/fb/wfbrename.h index c7ac73ea0..531ab4172 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -1,3 +1,6 @@ +#ifndef XSERVER_WFBRENAME_H +#define XSERVER_WFBRENAME_H + #define fbAddTraps wfbAddTraps #define fbAddTriangles wfbAddTriangles #define fbAllocatePrivates wfbAllocatePrivates @@ -118,3 +121,5 @@ #define fbWinPrivateKeyRec wfbWinPrivateKeyRec #define free_pixman_pict wfb_free_pixman_pict #define image_from_pict wfb_image_from_pict + +#endif /* XSERVER_WFBRENAME_H */ From c06a2a3ed7d7e2004faf4e1ae22864c716087a63 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:19 +0100 Subject: [PATCH 37/82] hw: add/fix include guards where missing/broken Skipped headers designed for multiple or non-trivial inclusion: * hw/xfree86/dri2/pci_ids/i810_pci_ids.h * hw/xfree86/dri2/pci_ids/i915_pci_ids.h * hw/xfree86/dri2/pci_ids/i965_pci_ids.h * hw/xfree86/dri2/pci_ids/r200_pci_ids.h * hw/xfree86/dri2/pci_ids/r300_pci_ids.h * hw/xfree86/dri2/pci_ids/r600_pci_ids.h * hw/xfree86/dri2/pci_ids/radeon_pci_ids.h * hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h * hw/xfree86/dri2/pci_ids/virtio_gpu_pci_ids.h * hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h Signed-off-by: Mike Gelfand --- hw/kdrive/ephyr/ephyr_glamor.h | 5 +++++ hw/xfree86/common/xf86VGAarbiterPriv.h | 5 +++++ hw/xfree86/dri2/dri2int.h | 5 +++++ hw/xfree86/drivers/modesetting/driver.h | 5 +++++ hw/xfree86/int10/vbeModes.h | 1 + hw/xfree86/parser/configProcs.h | 5 +++++ hw/xquartz/NSUserDefaults+XQuartzDefaults.h | 5 +++++ hw/xquartz/xpr/driWrap.h | 2 ++ hw/xwin/glx/winpriv.h | 5 +++++ hw/xwin/winauth.h | 5 +++++ hw/xwin/winlayouts.h | 5 +++++ hw/xwin/winmonitors.h | 5 +++++ 12 files changed, 53 insertions(+) diff --git a/hw/kdrive/ephyr/ephyr_glamor.h b/hw/kdrive/ephyr/ephyr_glamor.h index fc4a80d9f..6c80aabde 100644 --- a/hw/kdrive/ephyr/ephyr_glamor.h +++ b/hw/kdrive/ephyr/ephyr_glamor.h @@ -21,6 +21,9 @@ * IN THE SOFTWARE. */ +#ifndef XSERVER_KDRIVE_EPHYR_GLAMOR_H +#define XSERVER_KDRIVE_EPHYR_GLAMOR_H + #include #include "dix-config.h" @@ -63,3 +66,5 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, } #endif /* !GLAMOR */ + +#endif /* XSERVER_KDRIVE_EPHYR_GLAMOR_H */ diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h index e4ca3450c..03c907bba 100644 --- a/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -24,6 +24,9 @@ * */ +#ifndef XSERVER_XFREE86_XF86VGAARBITERPRIV_H +#define XSERVER_XFREE86_XF86VGAARBITERPRIV_H + #ifdef HAVE_XORG_CONFIG_H #include #endif @@ -273,3 +276,5 @@ static void VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, static void VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects); + +#endif /* XSERVER_XFREE86_XF86VGAARBITERPRIV_H */ diff --git a/hw/xfree86/dri2/dri2int.h b/hw/xfree86/dri2/dri2int.h index 7f53eba45..4bb272616 100644 --- a/hw/xfree86/dri2/dri2int.h +++ b/hw/xfree86/dri2/dri2int.h @@ -23,4 +23,9 @@ * Author: Daniel Stone */ +#ifndef XSERVER_XFREE86_DRI2INT_H +#define XSERVER_XFREE86_DRI2INT_H + extern Bool DRI2ModuleSetup(void); + +#endif /* XSERVER_XFREE86_DRI2INT_H */ diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 62b0db0cc..43114b4ae 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -29,6 +29,9 @@ * Aaron Plattner */ +#ifndef XSERVER_XFREE86_DRIVER_H +#define XSERVER_XFREE86_DRIVER_H + #include #include #include @@ -261,3 +264,5 @@ void ms_drain_drm_events(ScreenPtr screen); Bool ms_window_has_variable_refresh(modesettingPtr ms, WindowPtr win); void ms_present_set_screen_vrr(ScrnInfoPtr scrn, Bool vrr_enabled); Bool ms_tearfree_is_active_on_crtc(xf86CrtcPtr crtc); + +#endif /* XSERVER_XFREE86_DRIVER_H */ diff --git a/hw/xfree86/int10/vbeModes.h b/hw/xfree86/int10/vbeModes.h index ee0257c15..8ad5ea9c2 100644 --- a/hw/xfree86/int10/vbeModes.h +++ b/hw/xfree86/int10/vbeModes.h @@ -29,6 +29,7 @@ */ #ifndef _VBE_MODES_H +#define _VBE_MODES_H /* * This is intended to be stored in the DisplayModeRec's private area. diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h index 93e3e6706..ef71c4d5a 100644 --- a/hw/xfree86/parser/configProcs.h +++ b/hw/xfree86/parser/configProcs.h @@ -29,6 +29,9 @@ /* exported functions are/were used by the X Server */ +#ifndef XSERVER_XFREE86_CONFIGPROCS_H +#define XSERVER_XFREE86_CONFIGPROCS_H + #include /* Device.c */ @@ -146,3 +149,5 @@ xf86freeExtensions(XF86ConfExtensionsPtr ptr); void ErrorF(const char *f, ...); #endif + +#endif /* XSERVER_XFREE86_CONFIGPROCS_H */ diff --git a/hw/xquartz/NSUserDefaults+XQuartzDefaults.h b/hw/xquartz/NSUserDefaults+XQuartzDefaults.h index 2f180b241..c0d1b6e96 100644 --- a/hw/xquartz/NSUserDefaults+XQuartzDefaults.h +++ b/hw/xquartz/NSUserDefaults+XQuartzDefaults.h @@ -6,6 +6,9 @@ // Copyright (c) 2021 Apple Inc. All rights reserved. // +#ifndef XSERVER_XQUARTZ_NSUSERDEFAULTS_XQUARTZDEFAULTS_H +#define XSERVER_XQUARTZ_NSUSERDEFAULTS_XQUARTZDEFAULTS_H + #import extern NSString * const XQuartzPrefKeyAppsMenu; @@ -47,3 +50,5 @@ extern NSString * const XQuartzPrefKeySyncPrimaryOnSelect; + (NSUserDefaults *)xquartzDefaults; @end + +#endif /* XSERVER_XQUARTZ_NSUSERDEFAULTS_XQUARTZDEFAULTS_H */ diff --git a/hw/xquartz/xpr/driWrap.h b/hw/xquartz/xpr/driWrap.h index 1bc34ee9e..c00452d9c 100644 --- a/hw/xquartz/xpr/driWrap.h +++ b/hw/xquartz/xpr/driWrap.h @@ -28,6 +28,8 @@ */ #ifndef DRIWRAP_H +#define DRIWRAP_H + #include "scrnintstr.h" Bool diff --git a/hw/xwin/glx/winpriv.h b/hw/xwin/glx/winpriv.h index 6f695a971..dfa21bcc2 100644 --- a/hw/xwin/glx/winpriv.h +++ b/hw/xwin/glx/winpriv.h @@ -4,9 +4,14 @@ * Authors: Alexander Gottwald */ +#ifndef XSERVER_XWIN_WINPRIV_H +#define XSERVER_XWIN_WINPRIV_H + #include #include HWND winGetWindowInfo(WindowPtr pWin); Bool winCheckScreenAiglxIsSupported(ScreenPtr pScreen); void winSetScreenAiglxIsActive(ScreenPtr pScreen); + +#endif /* XSERVER_XWIN_WINPRIV_H */ diff --git a/hw/xwin/winauth.h b/hw/xwin/winauth.h index 97cfe52a1..9cde26864 100644 --- a/hw/xwin/winauth.h +++ b/hw/xwin/winauth.h @@ -19,8 +19,13 @@ * IN THE SOFTWARE. */ +#ifndef XSERVER_XWIN_WINAUTH_H +#define XSERVER_XWIN_WINAUTH_H + #include #include // for BOOL BOOL winGenerateAuthorization(void); xcb_auth_info_t * winGetXcbAuthInfo(void); + +#endif /* XSERVER_XWIN_WINAUTH_H */ diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h index 904410a2d..f2bfd49df 100644 --- a/hw/xwin/winlayouts.h +++ b/hw/xwin/winlayouts.h @@ -27,6 +27,9 @@ * XKB settings. */ +#ifndef XSERVER_XWIN_WINLAYOUTS_H +#define XSERVER_XWIN_WINLAYOUTS_H + typedef struct { unsigned int winlayout; int winkbtype; @@ -98,3 +101,5 @@ WinKBLayoutRec winKBLayouts[] = { See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx for a listing of input locale (keyboard layout) codes */ + +#endif /* XSERVER_XWIN_WINLAYOUTS_H */ diff --git a/hw/xwin/winmonitors.h b/hw/xwin/winmonitors.h index 5fe3ecd52..87805ba1e 100644 --- a/hw/xwin/winmonitors.h +++ b/hw/xwin/winmonitors.h @@ -27,6 +27,9 @@ from The Open Group. */ +#ifndef XSERVER_XWIN_WINMONITORS_H +#define XSERVER_XWIN_WINMONITORS_H + /* data returned for monitor information */ struct GetMonitorInfoData { int requestedMonitor; @@ -41,3 +44,5 @@ struct GetMonitorInfoData { }; Bool QueryMonitor(int i, struct GetMonitorInfoData *data); + +#endif /* XSERVER_XWIN_WINMONITORS_H */ From f5e00916aabbe189b1d683b57c908b6d895da27f Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:19 +0100 Subject: [PATCH 38/82] include: add/fix include guards where missing/broken Signed-off-by: Mike Gelfand --- include/dix-config-apple-verbatim.h | 5 +++++ include/xwin-config.h.meson.in | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/include/dix-config-apple-verbatim.h b/include/dix-config-apple-verbatim.h index f429d200e..52106dbec 100644 --- a/include/dix-config-apple-verbatim.h +++ b/include/dix-config-apple-verbatim.h @@ -1,8 +1,13 @@ /* Do not include this file directly. It is included at the end of */ +#ifndef XSERVER_CONFIG_APPLE_VERBATIM_H +#define XSERVER_CONFIG_APPLE_VERBATIM_H + /* Correctly set _XSERVER64 for OSX fat binaries */ #if defined(__LP64__) && !defined(_XSERVER64) #define _XSERVER64 1 #elif !defined(__LP64__) && defined(_XSERVER64) #undef _XSERVER64 #endif + +#endif /* XSERVER_CONFIG_APPLE_VERBATIM_H */ diff --git a/include/xwin-config.h.meson.in b/include/xwin-config.h.meson.in index bf2a696d6..1066fd525 100644 --- a/include/xwin-config.h.meson.in +++ b/include/xwin-config.h.meson.in @@ -4,6 +4,10 @@ * This file has all defines used in the xwin ddx * */ + +#ifndef XSERVER_XWIN_CONFIG_H +#define XSERVER_XWIN_CONFIG_H + #include /* Winsock networking */ @@ -17,3 +21,5 @@ /* Whether we should re-locate the root to where the executable lives */ #mesondefine RELOCATE_PROJECTROOT + +#endif /* XSERVER_XWIN_CONFIG_H */ From 32b26ccf9e66dfb2c5342d57ca52d93a9292e9bc Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:19 +0100 Subject: [PATCH 39/82] mi: add/fix include guards where missing/broken Signed-off-by: Mike Gelfand --- mi/miline.h | 2 +- mi/mipoly.h | 5 +++++ mi/misprite.h | 21 +++++++++++++-------- mi/miwideline.h | 5 +++++ mi/mizerarc.h | 5 +++++ 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/mi/miline.h b/mi/miline.h index 7ef3b015a..c40e4a98e 100644 --- a/mi/miline.h +++ b/mi/miline.h @@ -1,4 +1,3 @@ - /* Copyright 1994, 1998 The Open Group @@ -26,6 +25,7 @@ in this Software without prior written authorization from The Open Group. */ #ifndef MILINE_H +#define MILINE_H #include "screenint.h" #include "privates.h" diff --git a/mi/mipoly.h b/mi/mipoly.h index 10632f232..b947d20ce 100644 --- a/mi/mipoly.h +++ b/mi/mipoly.h @@ -78,6 +78,9 @@ from The Open Group. * drawn (as with the even-odd rule). */ +#ifndef XSERVER_MIPOLY_H +#define XSERVER_MIPOLY_H + /* * for the winding number rule */ @@ -172,3 +175,5 @@ typedef struct _ScanLineListBlock { pAET = pAET->next; \ } \ } + +#endif /* XSERVER_MIPOLY_H */ diff --git a/mi/misprite.h b/mi/misprite.h index aa67f3229..db0dce25f 100644 --- a/mi/misprite.h +++ b/mi/misprite.h @@ -1,11 +1,3 @@ -/* - * misprite.h - * - * software-sprite/sprite drawing interface spec - * - * mi versions of these routines exist. - */ - /* Copyright 1989, 1998 The Open Group @@ -31,6 +23,17 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* + * misprite.h + * + * software-sprite/sprite drawing interface spec + * + * mi versions of these routines exist. + */ + +#ifndef XSERVER_MISPRITE_H +#define XSERVER_MISPRITE_H + Bool miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs); Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); @@ -44,3 +47,5 @@ Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h); Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); + +#endif /* XSERVER_MISPRITE_H */ diff --git a/mi/miwideline.h b/mi/miwideline.h index 88bc3d6c8..39a2727e4 100644 --- a/mi/miwideline.h +++ b/mi/miwideline.h @@ -28,6 +28,9 @@ from The Open Group. /* Author: Keith Packard, MIT X Consortium */ +#ifndef XSERVER_MIWIDELINE_H +#define XSERVER_MIWIDELINE_H + #include "mifpoly.h" /* for ICEIL */ /* @@ -91,3 +94,5 @@ typedef struct _LineFace { ValidateGC (pDrawable, pGC); \ } \ } + +#endif /* XSERVER_MIWIDELINE_H */ diff --git a/mi/mizerarc.h b/mi/mizerarc.h index 165e281ed..945efe088 100644 --- a/mi/mizerarc.h +++ b/mi/mizerarc.h @@ -24,6 +24,9 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ +#ifndef XSERVER_MIZERARC_H +#define XSERVER_MIZERARC_H + typedef struct { int x; int y; @@ -122,3 +125,5 @@ extern _X_EXPORT Bool miZeroArcSetup(xArc * /*arc */ , miZeroArcRec * /*info */ , Bool /*ok360 */ ); + +#endif /* XSERVER_MIZERARC_H */ From 565309bb3382f35f2768a6df10eb263b591606e3 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:19 +0100 Subject: [PATCH 40/82] miext: add/fix include guards where missing/broken Skipped headers designed for multiple or non-trivial inclusion: * miext/shadow/shrotpack.h * miext/shadow/shrotpackYX.h Signed-off-by: Mike Gelfand --- miext/shadow/c2p_core.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/miext/shadow/c2p_core.h b/miext/shadow/c2p_core.h index d0db2b5f3..6babd61af 100644 --- a/miext/shadow/c2p_core.h +++ b/miext/shadow/c2p_core.h @@ -27,6 +27,9 @@ * DEALINGS IN THE SOFTWARE. */ +#ifndef XSERVER_C2P_CORE_H +#define XSERVER_C2P_CORE_H + #include "os/bug_priv.h" /* @@ -186,3 +189,5 @@ static inline void transp2x(CARD32 d[], unsigned int n) _transp(d, 1, 0, n, mask); return; } + +#endif /* XSERVER_C2P_CORE_H */ From c4ca14eff06cdeb9f3a9372571d7387d73a100b2 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:20 +0100 Subject: [PATCH 41/82] pseudoramix: add/fix include guards where missing/broken Signed-off-by: Mike Gelfand --- pseudoramiX/pseudoramiX.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pseudoramiX/pseudoramiX.h b/pseudoramiX/pseudoramiX.h index 5393062ee..e7b255336 100644 --- a/pseudoramiX/pseudoramiX.h +++ b/pseudoramiX/pseudoramiX.h @@ -2,7 +2,12 @@ * Minimal implementation of PanoramiX/Xinerama */ +#ifndef XSERVER_PSEUDORAMIX_H +#define XSERVER_PSEUDORAMIX_H + void PseudoramiXAddScreen(int x, int y, int w, int h); void PseudoramiXResetScreens(void); + +#endif /* XSERVER_PSEUDORAMIX_H */ From 26f56735c5ffcc91dba83fc5763c5e2fb19b01d1 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 24 Jun 2025 22:50:20 +0100 Subject: [PATCH 42/82] record: add/fix include guards where missing/broken Signed-off-by: Mike Gelfand --- record/set.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/record/set.h b/record/set.h index 74ddda75b..82a8e9ce5 100644 --- a/record/set.h +++ b/record/set.h @@ -51,6 +51,9 @@ from The Open Group. The following types and functions/macros define the ADT. */ +#ifndef XSERVER_SET_H +#define XSERVER_SET_H + /* an interval of set members */ typedef struct { CARD16 first; @@ -133,3 +136,5 @@ int RecordSetMemoryRequirements(RecordSetInterval * /*pIntervals */ , process interval; } */ + +#endif /* XSERVER_SET_H */ From 6a10d96761530603c4e6ea54d225a15ccaa9e669 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 26 Jun 2025 14:45:33 +0200 Subject: [PATCH 43/82] rootless: fix missing include of dix/screen_hooks_priv.h We're using XorgScreenWindowPositionParamRec here, so need to include that header. Signed-off-by: Enrico Weigelt, metux IT consult --- miext/rootless/rootlessWindow.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h index 8a030939b..00e95b8a0 100644 --- a/miext/rootless/rootlessWindow.h +++ b/miext/rootless/rootlessWindow.h @@ -34,6 +34,8 @@ #ifndef _ROOTLESSWINDOW_H #define _ROOTLESSWINDOW_H +#include "dix/screen_hooks_priv.h" + #include "rootlessCommon.h" Bool RootlessCreateWindow(WindowPtr pWin); From d89b3596f04e9f040f57e0e81920b85813570aba Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 12:36:41 +0100 Subject: [PATCH 44/82] xquartz: depend on libX11 (includes X11/Xlib.h) Signed-off-by: Mike Gelfand --- hw/xquartz/mach-startup/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xquartz/mach-startup/meson.build b/hw/xquartz/mach-startup/meson.build index 2f7694252..8b5afd980 100644 --- a/hw/xquartz/mach-startup/meson.build +++ b/hw/xquartz/mach-startup/meson.build @@ -62,7 +62,7 @@ x11_bin = executable('X11.bin', mach_startup[3], # mach_startupUser.c ], link_with: x11_bin_libs, - dependencies: [xproto_dep, x11_bin_deps, mach_startup_dep], + dependencies: [xproto_dep, x11_dep, x11_bin_deps, mach_startup_dep], include_directories: [inc, '..', top_dir_inc], c_args: xquartz_defs, link_args: ['-Objc'], From edb020e306018123f1a7c359d80d28b1af81955d Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 12:40:36 +0100 Subject: [PATCH 45/82] xquartz: depend on libXdmcp (includes osdep.h which includes X11/Xdmcp.h) Signed-off-by: Mike Gelfand --- hw/xquartz/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xquartz/meson.build b/hw/xquartz/meson.build index 83e79eae8..d8dd7cd98 100644 --- a/hw/xquartz/meson.build +++ b/hw/xquartz/meson.build @@ -76,7 +76,7 @@ libXquartz = static_library('Xquartz', c_args: libxquartz_defs, objc_args: libxquartz_defs, include_directories: [inc, '../../pseudoramiX', '../../miext/rootless', top_dir_inc], - dependencies: [xproto_dep, pixman_dep], + dependencies: [xproto_dep, xdmcp_dep, pixman_dep], link_with: [libxserver_pseudoramix, libxserver_miext_rootless], ) From 3e89bd7409d1ee7e0a66a1ab28458ed40161d7f0 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 12:43:18 +0100 Subject: [PATCH 46/82] xquartz: add missing include for `DeliverEvents` Signed-off-by: Mike Gelfand --- hw/xquartz/quartz.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 794d648dd..da30f1f08 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -33,6 +33,8 @@ #include +#include "dix/dix_priv.h" + #include "quartzRandR.h" #include "inputstr.h" #include "quartz.h" From 4f7000f62044c2b30c948144105a7ed0b62c711a Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 26 Jun 2025 12:44:24 +0100 Subject: [PATCH 47/82] xquartz: add missing include for `XkbSetRulesDflts` Signed-off-by: Mike Gelfand --- hw/xquartz/darwin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 296757118..74d889606 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -38,6 +38,7 @@ #include "os/ddx_priv.h" #include "os/log_priv.h" #include "os/osdep.h" +#include "xkb/xkbsrv_priv.h" #include "os.h" #include "servermd.h" From f40afc89832d1faf19beb4d394956208a98462cc Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Wed, 25 Jun 2025 02:32:00 +0100 Subject: [PATCH 48/82] .github: .gitlab-ci: add macos (xquartz) build job Signed-off-by: Mike Gelfand --- .github/scripts/conf.sh | 7 +++- .github/scripts/install-prereq.sh | 7 ++++ .github/scripts/macos/install-pkg.sh | 38 ++++++++++++++++++ .github/scripts/util.sh | 13 ++++++- .github/workflows/build-xserver.yml | 58 ++++++++++++++++++++++++++++ .gitlab-ci/check-ddx-build.sh | 1 + 6 files changed, 121 insertions(+), 3 deletions(-) create mode 100755 .github/scripts/macos/install-pkg.sh diff --git a/.github/scripts/conf.sh b/.github/scripts/conf.sh index 7a0576b7f..7cdab25d2 100644 --- a/.github/scripts/conf.sh +++ b/.github/scripts/conf.sh @@ -1,8 +1,13 @@ +export X11_OS=`uname -s` + export X11_PREFIX="${X11_PREFIX:-$HOME/x11}" export X11_BUILD_DIR="${X11_BUILD_DIR:-$HOME/build-deps}" export DRV_BUILD_DIR="${DRV_BUILD_DIR:-$HOME/build-drivers}" -export FDO_CI_CONCURRENT=`nproc` +case "$X11_OS" in +Darwin) export FDO_CI_CONCURRENT=`sysctl -n hw.logicalcpu` ;; +Linux) export FDO_CI_CONCURRENT=`nproc` ;; +esac export PATH="$X11_PREFIX/bin:$PATH" export PKG_CONFIG_PATH="$X11_PREFIX/lib/x86_64-linux-gnu/pkgconfig:$X11_PREFIX/lib/pkgconfig:$X11_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH" diff --git a/.github/scripts/install-prereq.sh b/.github/scripts/install-prereq.sh index e201126a1..2bdbeb65a 100755 --- a/.github/scripts/install-prereq.sh +++ b/.github/scripts/install-prereq.sh @@ -8,10 +8,13 @@ mkdir -p $X11_BUILD_DIR cd $X11_BUILD_DIR build_meson rendercheck https://gitlab.freedesktop.org/xorg/test/rendercheck rendercheck-1.6 +if [ "$X11_OS" = "Linux" ]; then build_meson drm https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.121 \ -Domap=enabled +fi build_meson libxcvt https://gitlab.freedesktop.org/xorg/lib/libxcvt libxcvt-0.1.0 build_ac xorgproto https://gitlab.freedesktop.org/xorg/proto/xorgproto xorgproto-2024.1 +if [ "$X11_OS" = "Linux" ]; then build_meson wayland https://gitlab.freedesktop.org/wayland/wayland 1.21.0 \ -Dtests=false -Ddocumentation=false -Ddtd_validation=false build_meson wayland-protocols https://gitlab.freedesktop.org/wayland/wayland-protocols 1.38 @@ -19,6 +22,10 @@ build_meson libdecor https://gitlab.freedesktop.org/libdecor/libdecor -D{demo,install_demo}=false build_meson libei https://gitlab.freedesktop.org/libinput/libei 1.0.0 \ -Dtests=disabled -Ddocumentation=[] -Dliboeffis=enabled +fi +if [ "$X11_OS" = "Darwin" ]; then +build_ac xset https://gitlab.freedesktop.org/xorg/app/xset xset-1.2.5 +fi build_ac_xts xts https://gitlab.freedesktop.org/xorg/test/xts master # dbbfa96c036e596346147081cbceda136e7c86c1 clone_source piglit https://gitlab.freedesktop.org/mesa/piglit main # 265896c86f90cb72e8f218ba6a3617fca8b9a1e3 diff --git a/.github/scripts/macos/install-pkg.sh b/.github/scripts/macos/install-pkg.sh new file mode 100755 index 000000000..56d2ef236 --- /dev/null +++ b/.github/scripts/macos/install-pkg.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +brew update + +brew install \ + autoconf \ + automake \ + bdftopcf \ + libapplewm \ + libtool \ + libx11 \ + libxau \ + libxaw \ + libxcb \ + libxdmcp \ + libxext \ + libxfixes \ + libxfont2 \ + libxkbfile \ + libxi \ + libxmu \ + libxrender \ + libxt \ + libxtst \ + meson \ + mkfontscale \ + pkgconf \ + pixman \ + util-macros \ + xdpyinfo \ + xkbcomp \ + xkeyboard-config \ + xtrans + +pip3 install --break-system-packages \ + mako diff --git a/.github/scripts/util.sh b/.github/scripts/util.sh index 43bccfd24..29e87ff3d 100644 --- a/.github/scripts/util.sh +++ b/.github/scripts/util.sh @@ -82,8 +82,17 @@ build_ac_xts() { clone_source "$pkgname" "$url" "$ref" ( cd $pkgname - CFLAGS=-fcommon ./autogen.sh --prefix=$X11_PREFIX - xvfb-run make -j${FDO_CI_CONCURRENT:-4} install + CFLAGS='-fcommon' + if [ "$X11_OS" = "Darwin" ]; then + sed -E -i~ 's|(\[XTS\], \[)|\1xt xmu xaw7 |' configure.ac + sed -E -i~ -e 's|(XTextProperty)[[:space:]]+(text_prop_good)|\1 *\2|' -e 's|(style_good),[[:space:]]*&(text_prop_good)|\1,\2|' -e 's|text_prop_good\.|text_prop_good->|' xts5/Xlib14/X{mb,wc}TextListToTextProperty.m + CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + if cc -Werror=unknown-warning-option -Wincompatible-function-pointer-types -c -xc -o /dev/null /dev/null 2>/dev/null; then + CFLAGS="$CFLAGS -Wno-error=incompatible-function-pointer-types" + fi + fi + ./autogen.sh --prefix=$X11_PREFIX CFLAGS="$CFLAGS" + make -j${FDO_CI_CONCURRENT:-4} install ) touch $X11_PREFIX/$pkgname.DONE fi diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml index 2a83db818..417db1bfd 100644 --- a/.github/workflows/build-xserver.yml +++ b/.github/workflows/build-xserver.yml @@ -119,3 +119,61 @@ jobs: - name: compile drivers run: .github/scripts/compile-drivers.sh + + xserver-build-macos: + env: + MESON_ARGS: -Dprefix=/tmp -Dglx=false -Dxnest=false + X11_PREFIX: /Users/runner/x11 + X11_BUILD_DIR: /Users/runner/build-deps + runs-on: macos-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: prepare build environment + run: | + echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" + + - name: homebrew cache + uses: actions/cache@v4 + with: + path: /Users/runner/Library/Caches/Homebrew + key: ${{ runner.os }}-homebrew-cache-${{ hashFiles('.github/scripts/macos/install-pkg.sh') }} + restore-keys: ${{ runner.os }}-homebrew-cache- + + - name: pkg install + run: .github/scripts/macos/install-pkg.sh + + - name: X11 prereq cache + uses: actions/cache@v4 + with: + path: | + ${{ env.X11_PREFIX }} + ${{ env.X11_BUILD_DIR }}/xts + ${{ env.X11_BUILD_DIR }}/piglit + key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} + restore-keys: ${{ runner.os }}-x11-deps- + + - name: generic prereq + run: .github/scripts/install-prereq.sh + + - name: build + run: .gitlab-ci/meson-build.sh + + - name: tests (may fail) + continue-on-error: true + run: meson test -C "${{ env.MESON_BUILDDIR }}" --print-errorlogs -j1 || true + env: + XTEST_DIR: ${{ env.X11_BUILD_DIR }}/xts + PIGLIT_DIR: ${{ env.X11_BUILD_DIR }}/piglit + + - name: archive build logs + uses: actions/upload-artifact@v4 + with: + name: build-logs-macos + path: | + build/meson-logs/* + - name: ddx build check + run: .gitlab-ci/check-ddx-build.sh + - name: manpage check + run: .gitlab-ci/manpages-check diff --git a/.gitlab-ci/check-ddx-build.sh b/.gitlab-ci/check-ddx-build.sh index 3b3a65f38..6361571ff 100755 --- a/.gitlab-ci/check-ddx-build.sh +++ b/.gitlab-ci/check-ddx-build.sh @@ -19,6 +19,7 @@ fi [[ "$BUILD_XEPHYR" == true ]] && check_executable "hw/kdrive/ephyr/Xephyr" [[ "$BUILD_XNEST" == true ]] && check_executable "hw/xnest/Xnest" [[ "$BUILD_XORG" == true ]] && check_executable "hw/xfree86/Xorg" +[[ "$BUILD_XQUARTZ" == true ]] && check_executable "hw/xquartz/mach-startup/Xquartz" [[ "$BUILD_XVFB" == true ]] && check_executable "hw/vfb/Xvfb" exit 0 From 9ab598e2b2c5647a9d0d043f1f1c2c6d6ab2fb8b Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Fri, 27 Jun 2025 14:41:14 +0100 Subject: [PATCH 49/82] .github: add comments explaning the reasons behind xts patching Signed-off-by: Mike Gelfand --- .github/scripts/util.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/scripts/util.sh b/.github/scripts/util.sh index 29e87ff3d..cd74de195 100644 --- a/.github/scripts/util.sh +++ b/.github/scripts/util.sh @@ -84,9 +84,20 @@ build_ac_xts() { cd $pkgname CFLAGS='-fcommon' if [ "$X11_OS" = "Darwin" ]; then + # xts5/include/XtTest.h includes => needs xt + # xts5/src/libXtaw/*.c include and => need xmu and xaw7 sed -E -i~ 's|(\[XTS\], \[)|\1xt xmu xaw7 |' configure.ac + # xts5/Xlib14/X{mb,wc}TextListToTextProperty.m define a function accepting `XTextProperty` but call it passing + #`XTextProperty*`; since the parameter is seemingly meant for output, accept it as pointer sed -E -i~ -e 's|(XTextProperty)[[:space:]]+(text_prop_good)|\1 *\2|' -e 's|(style_good),[[:space:]]*&(text_prop_good)|\1,\2|' -e 's|text_prop_good\.|text_prop_good->|' xts5/Xlib14/X{mb,wc}TextListToTextProperty.m + # xts5/Xlib*/*.m forward-declare `strcpy()` which is incompatible with _FORTIFY_SOURCE > 0 where `strcpy` is + # a macro; set _FORTIFY_SOURCE to 0 as we don't care much about security in this test code CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + # declarations for `XtAppSetError{,Msg}Handler()` in (libXt) make it hard to write warning- + # free code: they want a noreturn-annotated handler as input but return old handler without noreturn annotation, + # so e.g. `XtAppSetErrorHandler(XtAppSetErrorHandler(NULL))` (similar to xts5/Xt13/XtAppSetError*Handler.m) + # doesn't compile complaining about incompatible function pointers, at least with Apple Clang 16 (not sure why + # it treats this warning as error by default though) if cc -Werror=unknown-warning-option -Wincompatible-function-pointer-types -c -xc -o /dev/null /dev/null 2>/dev/null; then CFLAGS="$CFLAGS -Wno-error=incompatible-function-pointer-types" fi From 8f50b8cc191f0d51525e6754fc5287f1348308b2 Mon Sep 17 00:00:00 2001 From: notbabaisyou Date: Thu, 26 Jun 2025 18:57:01 +0200 Subject: [PATCH 50/82] Xext: Fix typo in xace.h `modsetting` -> `modesetting` Signed-off-by: notbabaisyou --- Xext/xace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/xace.h b/Xext/xace.h index b9c81accf..db1dd750e 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -78,7 +78,7 @@ int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr *ppProp, Mask access_mode); int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel, Mask access_mode); -/* needs to be exported for in-tree modsetting, but not part of public API */ +/* needs to be exported for in-tree modesetting, but not part of public API */ _X_EXPORT int XaceHookResourceAccess(ClientPtr client, XID id, RESTYPE rtype, void *res, RESTYPE ptype, void *parent, Mask access_mode); From 4afcb1cd7b91ad3ea729683d5b93db7186616cef Mon Sep 17 00:00:00 2001 From: notbabaisyou Date: Thu, 26 Jun 2025 18:57:35 +0200 Subject: [PATCH 51/82] modesetting: Fix typo. `modsetCreateScreenResources` -> `modesetCreateScreenResources` Signed-off-by: notbabaisyou --- hw/xfree86/drivers/modesetting/driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 43783c4b1..7c8d779dc 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -1631,7 +1631,7 @@ msStopFlippingPixmapTracking(DrawablePtr src, } static Bool -modsetCreateScreenResources(ScreenPtr pScreen) +modesetCreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); @@ -1941,7 +1941,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) return FALSE; } - pScreen->CreateScreenResources = modsetCreateScreenResources; + pScreen->CreateScreenResources = modesetCreateScreenResources; xf86SetBlackWhitePixels(pScreen); From 25c002c54b58a81518f7cac6ab6dffa52e53ee56 Mon Sep 17 00:00:00 2001 From: Bastiaan Quast Date: Sat, 21 Jun 2025 11:23:30 -0600 Subject: [PATCH 52/82] CONTRIBUTION.md: "MR" / "MRs" -> pull request(s) --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5640ebf4e..dd351c31b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,9 +10,9 @@ Keep in mind that history is also a piece of documentation. 3. Once release is out, bugfixes should be submitted separately, against - the affected release branch(es) as well as master (so multiple MRs) + the affected release branch(es) as well as master (so multiple pull requests) 4. If new functions or types are introduced, these should be documented in-code, so we can generate docs directly from the code :) -5. Use MR tags if you can - if we need some more, just ask. +5. Use pull request tags if you can - if we need some more, just ask. From 461411c798c263f70daa96f7136614dfefda6adc Mon Sep 17 00:00:00 2001 From: notbabaisyou Date: Sun, 15 Jun 2025 20:15:37 +0200 Subject: [PATCH 53/82] 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 Signed-off-by: notbabaisyou --- hw/xfree86/drivers/modesetting/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 7c8d779dc..d509f4400 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -1306,7 +1306,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->atomic_modeset_capable = (ret == 0); if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_ATOMIC, FALSE)) { - ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); + ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 2); ms->atomic_modeset = (ret == 0); if (!ms->atomic_modeset) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Atomic modesetting not supported\n"); From 7fb4ba10f257a6efce4123f2ad744920e3d23c3f Mon Sep 17 00:00:00 2001 From: notbabaisyou Date: Tue, 24 Jun 2025 22:29:48 +0200 Subject: [PATCH 54/82] glamor: Enable dmabuf_capable for Zink This lets Zink take advantage of DRM modifiers on GPUs letting it properly handle tiled buffers. Signed-off-by: notbabaisyou --- glamor/glamor_egl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 11ba189a8..88c3737f2 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -1192,6 +1192,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) "dmabuf_capable"); else if (strstr((const char *)renderer, "Intel")) glamor_egl->dmabuf_capable = TRUE; + else if (strstr((const char *)renderer, "zink")) + glamor_egl->dmabuf_capable = TRUE; else glamor_egl->dmabuf_capable = FALSE; } From 949e4e4fa0b813b094f5c1744368f5c15e216426 Mon Sep 17 00:00:00 2001 From: Collin Date: Thu, 26 Jun 2025 22:24:51 -0500 Subject: [PATCH 55/82] Update build-xserver.yml to have correct permissions to resolve CodeQL alert https://github.com/HaplessIdiot/xserver/security/code-scanning/16 Adds permissions to build in read only to support ubuntu package standards. --- .github/workflows/build-xserver.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml index 417db1bfd..d86ebb379 100644 --- a/.github/workflows/build-xserver.yml +++ b/.github/workflows/build-xserver.yml @@ -1,5 +1,8 @@ name: Build X servers +permissions: + contents: read + env: MESON_BUILDDIR: "build" X11_PREFIX: /home/runner/x11 From d441e4783ee7ad8f9e81e9ad7d332eadc98391b3 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 30 Jun 2025 12:37:35 +0200 Subject: [PATCH 56/82] .github: 01-bug-report: use 25.0.0.X instead of listing all minor releases Listing all patchlevels in the ticket form would quickly explode it. Users are expected to always run the latest patchlevel (4th digit), because they're only receiving urgent bug and security fixes, not getting anything new, that could break other things. Signed-off-by: Enrico Weigelt, metux IT consult --- .github/ISSUE_TEMPLATE/01-bug-report.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01-bug-report.yml b/.github/ISSUE_TEMPLATE/01-bug-report.yml index 890e9568e..2f9159f78 100644 --- a/.github/ISSUE_TEMPLATE/01-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/01-bug-report.yml @@ -14,8 +14,7 @@ body: attributes: label: Select the version options: - - 25.0.0.0 - - 25.0.0.1 + - 25.0.0.X - Git master branch - other or don't know default: 1 From d08631bef1f4d4d8617e19af7b5c579f45b91686 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 30 Jun 2025 12:44:10 +0200 Subject: [PATCH 57/82] minor release 25.0.0.2 minor bugfix release. Signed-off-by: Enrico Weigelt, metux IT consult --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 2a5500635..433bfaf8a 100644 --- a/meson.build +++ b/meson.build @@ -3,10 +3,10 @@ project('xserver', 'c', 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '25.0.0.1', + version: '25.0.0.2', meson_version: '>= 0.58.0', ) -release_date = '2025-06-21' +release_date = '2025-06-30' add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) cc = meson.get_compiler('c') From ccf9787bd65823163e3dde6bc2f4554d16d6d6bc Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 30 Jun 2025 16:04:42 +0200 Subject: [PATCH 58/82] .github: add building mouse driver xf86-input-mouse is now supported Linux again, so add it to the build. Signed-off-by: Enrico Weigelt, metux IT consult --- .github/scripts/compile-drivers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/compile-drivers.sh b/.github/scripts/compile-drivers.sh index 7145042d3..a68076e38 100755 --- a/.github/scripts/compile-drivers.sh +++ b/.github/scripts/compile-drivers.sh @@ -14,6 +14,7 @@ cd $DRV_BUILD_DIR build_drv_ac xf86-input-elographics $X11L_DRV_GIT/xf86-input-elographics master build_drv_ac xf86-input-evdev $X11L_DRV_GIT/xf86-input-evdev master build_drv_ac xf86-input-libinput $X11L_DRV_GIT/xf86-input-libinput master +build_drv_ac xf86-input-mouse $X11L_DRV_GIT/xf86-input-mouse master build_drv_ac xf86-input-synaptics $X11L_DRV_GIT/xf86-input-synaptics master build_drv_ac xf86-video-amdgpu $X11L_DRV_GIT/xf86-video-amdgpu xf86-video-amdgpu-23.0.0 From 6a3162d623c87f2429620443ec8ca2f3e7c6c487 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 30 Jun 2025 13:44:22 +0200 Subject: [PATCH 59/82] 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 --- hw/xnest/Screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index 25a7ccae8..7bf522a55 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -164,7 +164,7 @@ Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) { unsigned long valuemask; - VisualID defaultVisual; + VisualID defaultVisual = 0; int rootDepth; miPointerScreenPtr PointPriv; From 6c2f17a5e02198a0fd0cbc62dc07c9360b64b53f Mon Sep 17 00:00:00 2001 From: Tautvis Date: Tue, 1 Jul 2025 13:23:20 +0200 Subject: [PATCH 60/82] xf86vidmode: fix result copying in ProcVidModeGetMonitor() The monitor values (vendor and model) accidentally had been copied at the start of the payload, instead of being appended after the previously copied data, and also moving the wrong pointer, thus corrupting the reply and causing some clients to hang. Signed-off-by: Tautvis Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/vidmode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Xext/vidmode.c b/Xext/vidmode.c index f9bbf9830..a192cff29 100644 --- a/Xext/vidmode.c +++ b/Xext/vidmode.c @@ -1280,7 +1280,7 @@ ProcVidModeGetMonitor(ClientPtr client) + nHsync + nVrefresh + nVendorItems + nModelItems }; - const int buflen = nHsync * nVrefresh + nVendorItems + nModelItems; + const int buflen = nHsync + nVrefresh + nVendorItems + nModelItems; CARD32 *sendbuf = calloc(buflen, sizeof(CARD32)); if (!sendbuf) @@ -1302,22 +1302,22 @@ ProcVidModeGetMonitor(ClientPtr client) bufwalk++; } - memcpy(sendbuf, + memcpy(bufwalk, pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0).ptr, vendorLength); - sendbuf += nVendorItems; + bufwalk += nVendorItems; - memcpy(sendbuf, + memcpy(bufwalk, pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0).ptr, modelLength); - sendbuf += nModelItems; + bufwalk += nModelItems; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), &rep); + WriteToClient(client, sizeof(xXF86VidModeGetMonitorReply), &rep); WriteToClient(client, buflen * sizeof(CARD32), sendbuf); free(sendbuf); From 3d266528a977de931f58a2f8d309e968bbc7a211 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Mon, 30 Jun 2025 13:44:54 +0300 Subject: [PATCH 61/82] 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 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/kdrive/ephyr/ephyr.c | 26 ++++++++++++-------------- hw/kdrive/ephyr/ephyrinit.c | 26 +++++++++++--------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 9b00ed11f..cdc22cecf 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -1435,12 +1435,11 @@ MouseFini(KdPointerInfo * pi) } KdPointerDriver EphyrMouseDriver = { - "ephyr", - MouseInit, - MouseEnable, - MouseDisable, - MouseFini, - NULL, + .name = "ephyr", + .Init = MouseInit, + .Enable = MouseEnable, + .Disable = MouseDisable, + .Fini = MouseFini, }; /* Keyboard */ @@ -1509,12 +1508,11 @@ EphyrKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration) } KdKeyboardDriver EphyrKeyboardDriver = { - "ephyr", - EphyrKeyboardInit, - EphyrKeyboardEnable, - EphyrKeyboardLeds, - EphyrKeyboardBell, - EphyrKeyboardDisable, - EphyrKeyboardFini, - NULL, + .name = "ephyr", + .Init = EphyrKeyboardInit, + .Enable = EphyrKeyboardEnable, + .Leds = EphyrKeyboardLeds, + .Bell = EphyrKeyboardBell, + .Disable = EphyrKeyboardDisable, + .Fini = EphyrKeyboardFini, }; diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index ff0d5d0cc..fd5e73f82 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -390,23 +390,19 @@ OsVendorInit(void) } KdCardFuncs ephyrFuncs = { - ephyrCardInit, /* cardinit */ - ephyrScreenInitialize, /* scrinit */ - ephyrInitScreen, /* initScreen */ - ephyrFinishInitScreen, /* finishInitScreen */ - ephyrCreateResources, /* createRes */ - ephyrScreenFini, /* scrfini */ - ephyrCardFini, /* cardfini */ + .cardinit = ephyrCardInit, + .scrinit = ephyrScreenInitialize, + .initScreen = ephyrInitScreen, + .finishInitScreen = ephyrFinishInitScreen, + .createRes = ephyrCreateResources, - 0, /* initCursor */ + .scrfini = ephyrScreenFini, + .cardfini = ephyrCardFini, - 0, /* initAccel */ - 0, /* enableAccel */ - 0, /* disableAccel */ - 0, /* finiAccel */ + /* no cursor or accel funcs here */ - ephyrGetColors, /* getColors */ - ephyrPutColors, /* putColors */ + .getColors = ephyrGetColors, + .putColors = ephyrPutColors, - ephyrCloseScreen, /* closeScreen */ + .closeScreen = ephyrCloseScreen, }; From a4c3c9da4d2f0333f75637bb94cb103495ee1754 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 1 Jul 2025 12:36:44 +0200 Subject: [PATCH 62/82] xf86bigfont: fix compiler warning on unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > ../Xext/xf86bigfont.c: In function ‘SProcXF86BigfontQueryVersion’: > ../include/dix.h:65:12: warning: unused variable ‘stuff’ [-Wunused-variable] > 65 | type * stuff = (type *)client->requestBuffer; Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xf86bigfont.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 13ad79a98..fb62c463c 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -647,7 +647,6 @@ ProcXF86BigfontDispatch(ClientPtr client) static int _X_COLD SProcXF86BigfontQueryVersion(ClientPtr client) { - REQUEST(xXF86BigfontQueryVersionReq); return ProcXF86BigfontQueryVersion(client); } From 28e739e05b2725b7ddfec9e4515c85b221b7a636 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 1 Jul 2025 12:42:18 +0200 Subject: [PATCH 63/82] 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 --- hw/xfree86/loader/loadmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index be9335dd5..2cdf91fd2 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -417,7 +417,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, { int vercode[4]; long ver = data->xf86version; - MessageType errtype; LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n", data->modname ? data->modname : "UNKNOWN!", @@ -458,6 +457,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, vermaj = GET_ABI_MAJOR(ver); vermin = GET_ABI_MINOR(ver); if (abimaj != vermaj) { + MessageType errtype; if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) errtype = X_WARNING; else @@ -469,6 +469,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, return FALSE; } else if (abimin > vermin) { + MessageType errtype; if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) errtype = X_WARNING; else From c24372893bc69cec93cabb72d44cb4e5658f789f Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 26 Jun 2025 13:04:02 +0200 Subject: [PATCH 64/82] xfree86: compat: consolidate logging Consolidate the redundant warnings into generic functions. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/compat/README | 4 ++++ hw/xfree86/compat/clientexception.c | 9 +++------ hw/xfree86/compat/log.c | 10 ++++------ hw/xfree86/compat/meson.build | 1 + hw/xfree86/compat/nvidiabug.c | 31 +++++++++++++++++++++++++++++ hw/xfree86/compat/xf86_compat.h | 12 +++++++++++ 6 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 hw/xfree86/compat/nvidiabug.c create mode 100644 hw/xfree86/compat/xf86_compat.h diff --git a/hw/xfree86/compat/README b/hw/xfree86/compat/README index 19af90339..fd8c3b0f7 100644 --- a/hw/xfree86/compat/README +++ b/hw/xfree86/compat/README @@ -1 +1,5 @@ special compat code for legacy drivers, namely Nvidia proprietary + +NVidia is lacking behind for at least a year and don't actually clean up +their spaghetti code. That's why we need to keep several special compat +functions to emulate prehistoric behaviour. diff --git a/hw/xfree86/compat/clientexception.c b/hw/xfree86/compat/clientexception.c index 6005f22c4..cabde3ff2 100644 --- a/hw/xfree86/compat/clientexception.c +++ b/hw/xfree86/compat/clientexception.c @@ -4,6 +4,8 @@ #include "dix/dix_priv.h" +#include "xf86_compat.h" + /* * this is specifically for NVidia proprietary driver: they're again lagging * behind a year, doing at least some minimal cleanup of their code base. @@ -13,12 +15,7 @@ _X_EXPORT void MarkClientException(ClientPtr pClient); void MarkClientException(ClientPtr pClient) { - LogMessageVerb(X_WARNING, 0, "Bogus driver calling DIX-internal function MarkClientException() !\n"); - LogMessageVerb(X_WARNING, 0, "External drivers really should never ever call this function.\n"); - LogMessageVerb(X_WARNING, 0, "Nor should they ever DIX-internal fields like ClientRec->noClientException\n"); - LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); - LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); - LogMessageVerb(X_WARNING, 0, "And just don't buy Nvidia hardware, ever.\n"); + xf86NVidiaBugInternalFunc("MarkClientException()"); dixMarkClientException(pClient); } diff --git a/hw/xfree86/compat/log.c b/hw/xfree86/compat/log.c index 97f238071..64014e205 100644 --- a/hw/xfree86/compat/log.c +++ b/hw/xfree86/compat/log.c @@ -4,6 +4,8 @@ #include "include/os.h" +#include "xf86_compat.h" + #undef xf86Msg #undef xf86MsgVerb @@ -17,9 +19,7 @@ _X_EXPORT void xf86Msg(MessageType type, const char *format, ...) void xf86Msg(MessageType type, const char *format, ...) { - LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86Msg() !\n"); - LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); - LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); + xf86NVidiaBugInternalFunc("xf86Msg()"); va_list ap; @@ -39,9 +39,7 @@ _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...) void xf86MsgVerb(MessageType type, int verb, const char *format, ...) { - LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86MsgVerb() !\n"); - LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); - LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); + xf86NVidiaBugInternalFunc("xf86MsgVerb()"); va_list ap; va_start(ap, format); diff --git a/hw/xfree86/compat/meson.build b/hw/xfree86/compat/meson.build index d863ab2d8..b3835efdc 100644 --- a/hw/xfree86/compat/meson.build +++ b/hw/xfree86/compat/meson.build @@ -1,6 +1,7 @@ srcs_xorg_compat = [ 'clientexception.c', 'log.c', + 'nvidiabug.c', 'ones.c', 'xf86Helper.c', ] diff --git a/hw/xfree86/compat/nvidiabug.c b/hw/xfree86/compat/nvidiabug.c new file mode 100644 index 000000000..7c2c138fc --- /dev/null +++ b/hw/xfree86/compat/nvidiabug.c @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + */ +#include + +#include "include/os.h" + +#include "xf86_compat.h" + +void xf86NVidiaBug(void) +{ + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] file a bug report to driver vendor or use a free Xlibre driver.\n"); + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] Proprietary drivers are inherently unstable, they just can't be done right.\n"); + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] For NVidia report here: https://forums.developer.nvidia.com/c/gpu-graphics/linux/148\n"); + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] And better don't buy NVidia HW until they've fixed their mess.\n"); +} + +void xf86NVidiaBugInternalFunc(const char* name) +{ + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] calling internal function: %s\n", name); + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] this function is not supposed to be by drivers ever\n"); + xf86NVidiaBug(); +} + +void xf86NVidiaBugObsoleteFunc(const char* name) +{ + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] calling obsolete function: %s\n", name); + LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] this function is not supposed to be by drivers ever\n"); + xf86NVidiaBug(); +} diff --git a/hw/xfree86/compat/xf86_compat.h b/hw/xfree86/compat/xf86_compat.h new file mode 100644 index 000000000..34c46e819 --- /dev/null +++ b/hw/xfree86/compat/xf86_compat.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + */ +#ifndef __XFREE86_COMPAT_XF86_COMPAT_H +#define __XFREE86_COMPAT_XF86_COMPAT_H + +void xf86NVidiaBug(void); +void xf86NVidiaBugInternalFunc(const char* name); +void xf86NVidiaBugObsoleteFunc(const char* name); + +#endif /* __XFREE86_COMPAT_XF86_COMPAT_H */ From 4036b8c163379b8edd9b29c4e260953effd626bf Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 30 Jun 2025 10:10:32 +0200 Subject: [PATCH 65/82] os: log: vpnprintf(): ignore reverse justification modifier The only caller is libinput, and we don't really need it, just silencing bug message. Signed-off-by: Enrico Weigelt, metux IT consult --- os/log.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os/log.c b/os/log.c index 60837b10d..c0ff0ee93 100644 --- a/os/log.c +++ b/os/log.c @@ -410,6 +410,10 @@ vpnprintf(char *string, int size_in, const char *f, va_list args) f_idx++; + /* silently ignore reverse justification */ + if (f[f_idx] == '-') + f_idx++; + /* silently swallow minimum field width */ if (f[f_idx] == '*') { f_idx++; From 56650ba8734ef30e3f5dbf37195823c6c0201433 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 2 Jul 2025 14:24:10 +0200 Subject: [PATCH 66/82] dix: add screen hook for post-close In contrast to the already existing ScreenClose hook, this one is called *after* the driver's CloseScreen() proc. That's required for some extensions (eg. damage) where drivers still need to call in inside of their CloseScreen procs. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/screen.c | 1 + dix/screen_hooks.c | 3 +++ dix/screen_hooks_priv.h | 31 +++++++++++++++++++++++++++++++ include/scrnintstr.h | 4 ++++ 4 files changed, 39 insertions(+) diff --git a/dix/screen.c b/dix/screen.c index 3c3b715a7..fe39a275c 100644 --- a/dix/screen.c +++ b/dix/screen.c @@ -23,6 +23,7 @@ void dixFreeScreen(ScreenPtr pScreen) DeleteCallbackList(&pScreen->hookWindowDestroy); DeleteCallbackList(&pScreen->hookWindowPosition); DeleteCallbackList(&pScreen->hookClose); + DeleteCallbackList(&pScreen->hookPostClose); DeleteCallbackList(&pScreen->hookPixmapDestroy); free(pScreen); } diff --git a/dix/screen_hooks.c b/dix/screen_hooks.c index 1c96fa211..d3c0ab435 100644 --- a/dix/screen_hooks.c +++ b/dix/screen_hooks.c @@ -28,6 +28,7 @@ DECLARE_HOOK_PROC(WindowDestroy, hookWindowDestroy, XorgScreenWindowDestroyProcPtr); DECLARE_HOOK_PROC(WindowPosition, hookWindowPosition, XorgScreenWindowPositionProcPtr); DECLARE_HOOK_PROC(Close, hookClose, XorgScreenCloseProcPtr); +DECLARE_HOOK_PROC(PostClose, hookPostClose, XorgScreenCloseProcPtr); DECLARE_HOOK_PROC(PixmapDestroy, hookPixmapDestroy, XorgScreenPixmapDestroyProcPtr); DECLARE_HOOK_PROC(PostCreateResources, hookPostCreateResources, XorgScreenPostCreateResourcesProcPtr); @@ -71,6 +72,8 @@ void dixScreenRaiseClose(ScreenPtr pScreen) { if (pScreen->CloseScreen) pScreen->CloseScreen(pScreen); + + CallCallbacks(&pScreen->hookPostClose, NULL); } void dixScreenRaisePixmapDestroy(PixmapPtr pPixmap) diff --git a/dix/screen_hooks_priv.h b/dix/screen_hooks_priv.h index 01e4d8d9b..3ab6bfdda 100644 --- a/dix/screen_hooks_priv.h +++ b/dix/screen_hooks_priv.h @@ -147,6 +147,37 @@ _X_EXPORT void dixScreenUnhookClose(ScreenPtr pScreen, XorgScreenCloseProcPtr func); +/** + * @brief register a screen post close notify hook on the given screen + * + * @param pScreen pointer to the screen to register the notify hook into + * @param func pointer to the hook function + * + * In contrast to Close hook, it's called *after* the driver's CloseScreen() + * proc had been called. + * + * When registration fails, the server aborts. + **/ +void dixScreenHookPostClose(ScreenPtr pScreen, + XorgScreenCloseProcPtr func); + +/** + * @brief unregister a screen close notify hook on the given screen + * + * @param pScreen pointer to the screen to unregister the hook from + * @param func pointer to the hook function + * @param arg opaque pointer passed to the destructor + * + * @see dixScreenHookPostClose + * + * Unregister a screen close notify hook registered via @ref dixScreenHookPostClose + * + * In contrast to Close hook, it's called *after* the driver's CloseScreen() + * proc had been called. + **/ +void dixScreenUnhookPostClose(ScreenPtr pScreen, + XorgScreenCloseProcPtr func); + /* prototype of pixmap destroy notification handler */ typedef void (*XorgScreenPixmapDestroyProcPtr)(CallbackListPtr *pcbl, ScreenPtr pScreen, diff --git a/include/scrnintstr.h b/include/scrnintstr.h index d1f99840f..71ef762ea 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -696,6 +696,10 @@ typedef struct _Screen { CallbackListPtr hookPostCreateResources; SetWindowVRRModeProcPtr SetWindowVRRMode; + + /* additional screen post-close notify hooks (replaces wrapping CloseScreen) + should NOT be touched outside of DIX core */ + CallbackListPtr hookPostClose; } ScreenRec; static inline RegionPtr From 96be335fd351f55b16a0148d8d63178dce65dedb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 2 Jul 2025 14:35:01 +0200 Subject: [PATCH 67/82] miext: damage: use dixScreenHookPostClose() instead of dixScreenHookClose() Some drivers need to call into damage from within their CloseScreen proc, so damage teardown needs to be done after that, instead of before. Signed-off-by: Enrico Weigelt, metux IT consult --- miext/damage/damage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 56f24d756..4d146efaf 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1569,7 +1569,7 @@ damageWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWindow) static void damageCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused) { - dixScreenUnhookClose(pScreen, damageCloseScreen); + dixScreenUnhookPostClose(pScreen, damageCloseScreen); dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy); dixScreenUnhookPixmapDestroy(pScreen, damagePixmapDestroy); @@ -1667,7 +1667,7 @@ DamageSetup(ScreenPtr pScreen) pScrPriv->internalLevel = 0; pScrPriv->pScreenDamage = 0; - dixScreenHookClose(pScreen, damageCloseScreen); + dixScreenHookPostClose(pScreen, damageCloseScreen); dixScreenHookWindowDestroy(pScreen, damageWindowDestroy); dixScreenHookPixmapDestroy(pScreen, damagePixmapDestroy); From 6851e178161b72dcc19438fc2bfa2ab58eb591f1 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Tue, 1 Jul 2025 20:44:27 +0300 Subject: [PATCH 68/82] meson.build: meson_options.txt: add build option to disable building tests These tests take a long time to build and link, especially with lto. Signed-off-by: stefan11111 --- meson.build | 3 ++- meson_options.txt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 433bfaf8a..84a631f39 100644 --- a/meson.build +++ b/meson.build @@ -777,7 +777,8 @@ endif subdir('hw') -if host_machine.system() != 'windows' +build_tests = get_option('tests') and host_machine.system() != 'windows' +if build_tests subdir('test') endif diff --git a/meson_options.txt b/meson_options.txt index ef49ffff8..4b30777ff 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -110,6 +110,8 @@ option('sha1', type: 'combo', choices: ['libc', 'CommonCrypto', 'CryptoAPI', 'li description: 'SHA1 implementation') option('xf86-input-inputtest', type: 'boolean', value: true, description: 'Test input driver support on Xorg') +option('tests', type: 'boolean', value: true, + description: 'Build tests for the X server on platforms that support it') option('dri1', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)') option('dri2', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)') From 5d7be80305f7147ec0ba87594b8b69635fa0cabe Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 2 Jul 2025 17:44:12 +0200 Subject: [PATCH 69/82] minor release 25.0.0.3 minor bugfix release. Signed-off-by: Enrico Weigelt, metux IT consult --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 84a631f39..8131d239d 100644 --- a/meson.build +++ b/meson.build @@ -3,10 +3,10 @@ project('xserver', 'c', 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '25.0.0.2', + version: '25.0.0.3', meson_version: '>= 0.58.0', ) -release_date = '2025-06-30' +release_date = '2025-07-02' add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) cc = meson.get_compiler('c') From 7c64a06ba4c1d98dac0f18f49b1c2bf923de77c1 Mon Sep 17 00:00:00 2001 From: dasha_uwu Date: Sat, 14 Jun 2025 10:06:20 +0500 Subject: [PATCH 70/82] treewide: remove "lib" prefix in static_library names (meson) this was producing static libraries named "liblibsomething.a" Signed-off-by: dasha_uwu --- Xext/meson.build | 4 ++-- Xext/namespace/meson.build | 2 +- Xi/meson.build | 4 ++-- composite/meson.build | 2 +- config/meson.build | 2 +- damageext/meson.build | 2 +- dbe/meson.build | 2 +- dix/meson.build | 4 ++-- dri3/meson.build | 2 +- exa/meson.build | 2 +- fb/meson.build | 4 ++-- glx/meson.build | 4 ++-- mi/meson.build | 2 +- miext/damage/meson.build | 2 +- miext/rootless/meson.build | 2 +- miext/shadow/meson.build | 2 +- miext/sync/meson.build | 2 +- os/meson.build | 4 ++-- present/meson.build | 2 +- pseudoramiX/meson.build | 2 +- randr/meson.build | 2 +- record/meson.build | 2 +- render/meson.build | 2 +- xfixes/meson.build | 2 +- xkb/meson.build | 4 ++-- 25 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Xext/meson.build b/Xext/meson.build index 9902bf4be..2294902e6 100644 --- a/Xext/meson.build +++ b/Xext/meson.build @@ -58,13 +58,13 @@ if build_xv hdrs_xext += ['xvdix.h', 'xvmcext.h'] endif -libxserver_xext = static_library('libxserver_xext', +libxserver_xext = static_library('xserver_xext', srcs_xext, include_directories: inc, dependencies: common_dep, ) -libxserver_xext_vidmode = static_library('libxserver_xext_vidmode', +libxserver_xext_vidmode = static_library('xserver_xext_vidmode', 'vidmode.c', include_directories: inc, dependencies: common_dep, diff --git a/Xext/namespace/meson.build b/Xext/namespace/meson.build index ad9fb029c..708fd74a2 100644 --- a/Xext/namespace/meson.build +++ b/Xext/namespace/meson.build @@ -1,5 +1,5 @@ libxserver_namespace = static_library( - 'libxserver_namespace', + 'xserver_namespace', [ 'config.c', 'hook-client.c', diff --git a/Xi/meson.build b/Xi/meson.build index 717bb28e1..ec48e3d3b 100644 --- a/Xi/meson.build +++ b/Xi/meson.build @@ -53,14 +53,14 @@ srcs_xi = [ 'xiwarppointer.c', ] -libxserver_xi = static_library('libxserver_xi', +libxserver_xi = static_library('xserver_xi', srcs_xi, include_directories: inc, dependencies: common_dep, ) srcs_xi_stubs = ['stubs.c'] -libxserver_xi_stubs = static_library('libxserver_xi_stubs', +libxserver_xi_stubs = static_library('xserver_xi_stubs', srcs_xi_stubs, include_directories: inc, dependencies: common_dep, diff --git a/composite/meson.build b/composite/meson.build index 4f3303e20..af059714b 100644 --- a/composite/meson.build +++ b/composite/meson.build @@ -10,7 +10,7 @@ hdrs_composite = [ 'compositeext.h', ] -libxserver_composite = static_library('libxserver_composite', +libxserver_composite = static_library('xserver_composite', srcs_composite, include_directories: inc, dependencies: common_dep, diff --git a/config/meson.build b/config/meson.build index db7c49346..15f21a053 100644 --- a/config/meson.build +++ b/config/meson.build @@ -28,7 +28,7 @@ if build_xorg install_dir: join_paths(get_option('datadir'), 'X11/xorg.conf.d')) endif -libxserver_config = static_library('libxserver_config', +libxserver_config = static_library('xserver_config', srcs_config, include_directories: inc, dependencies: config_dep, diff --git a/damageext/meson.build b/damageext/meson.build index 688771d58..b13e0cee7 100644 --- a/damageext/meson.build +++ b/damageext/meson.build @@ -2,7 +2,7 @@ srcs_damageext = [ 'damageext.c', ] -libxserver_damageext = static_library('libxserver_damageext', +libxserver_damageext = static_library('xserver_damageext', srcs_damageext, include_directories: inc, dependencies: common_dep, diff --git a/dbe/meson.build b/dbe/meson.build index e10bde199..80bd4e252 100644 --- a/dbe/meson.build +++ b/dbe/meson.build @@ -3,7 +3,7 @@ srcs_dbe = [ 'midbe.c', ] -libxserver_dbe = static_library('libxserver_dbe', +libxserver_dbe = static_library('xserver_dbe', srcs_dbe, include_directories: inc, dependencies: common_dep, diff --git a/dix/meson.build b/dix/meson.build index 7d02841a7..6281ed956 100644 --- a/dix/meson.build +++ b/dix/meson.build @@ -57,13 +57,13 @@ endif dtrace_dep = declare_dependency(sources: [dtrace_src, dtrace_hdr]) -libxserver_dix = static_library('libxserver_dix', +libxserver_dix = static_library('xserver_dix', [ srcs_dix, builtinatoms_src ], include_directories: inc, dependencies: [ dtrace_dep, common_dep, ] ) -libxserver_main = static_library('libxserver_main', +libxserver_main = static_library('xserver_main', 'stubmain.c', include_directories: inc, dependencies: common_dep, diff --git a/dri3/meson.build b/dri3/meson.build index 91bd68d87..6b959f49f 100644 --- a/dri3/meson.build +++ b/dri3/meson.build @@ -10,7 +10,7 @@ hdrs_dri3 = [ libxserver_dri3 = [] if build_dri3 - libxserver_dri3 = static_library('libxserver_dri3', + libxserver_dri3 = static_library('xserver_dri3', srcs_dri3, include_directories: inc, dependencies: [ common_dep, libdrm_dep ], diff --git a/exa/meson.build b/exa/meson.build index 832363d27..784ecae8d 100644 --- a/exa/meson.build +++ b/exa/meson.build @@ -12,7 +12,7 @@ srcs_exa = [ 'exa_unaccel.c', ] -libxserver_exa = static_library('libxserver_exa', +libxserver_exa = static_library('xserver_exa', srcs_exa, include_directories: inc, dependencies: common_dep, diff --git a/fb/meson.build b/fb/meson.build index e4e311ff4..b31275a24 100644 --- a/fb/meson.build +++ b/fb/meson.build @@ -37,7 +37,7 @@ hdrs_fb = [ 'wfbrename.h' ] -libxserver_fb = static_library('libxserver_fb', +libxserver_fb = static_library('xserver_fb', srcs_fb, include_directories: inc, dependencies: common_dep, @@ -46,7 +46,7 @@ libxserver_fb = static_library('libxserver_fb', wfb_args = '-DFB_ACCESS_WRAPPER' -libxserver_wfb = static_library('libxserver_wfb', +libxserver_wfb = static_library('xserver_wfb', srcs_fb, c_args: wfb_args, include_directories: inc, diff --git a/glx/meson.build b/glx/meson.build index 2ec00ce22..3a14bd27c 100644 --- a/glx/meson.build +++ b/glx/meson.build @@ -32,7 +32,7 @@ srcs_glx = [ libxserver_glx = [] if build_glx - libxserver_glx = static_library('libxserver_glx', + libxserver_glx = static_library('xserver_glx', srcs_glx, include_directories: inc, dependencies: [ @@ -68,7 +68,7 @@ hdrs_vnd = [ libglxvnd = [] if build_glx - libglxvnd = static_library('libglxvnd', + libglxvnd = static_library('glxvnd', srcs_vnd, include_directories: inc, dependencies: [ diff --git a/mi/meson.build b/mi/meson.build index cccdb06eb..cde465a9b 100644 --- a/mi/meson.build +++ b/mi/meson.build @@ -40,7 +40,7 @@ hdrs_mi = [ 'mizerarc.h', ] -libxserver_mi = static_library('libxserver_mi', +libxserver_mi = static_library('xserver_mi', srcs_mi, include_directories: inc, dependencies: [ diff --git a/miext/damage/meson.build b/miext/damage/meson.build index c7ec10938..7daebb675 100644 --- a/miext/damage/meson.build +++ b/miext/damage/meson.build @@ -7,7 +7,7 @@ hdrs_miext_damage = [ 'damagestr.h', ] -libxserver_miext_damage = static_library('libxserver_miext_damage', +libxserver_miext_damage = static_library('xserver_miext_damage', srcs_miext_damage, include_directories: inc, dependencies: common_dep, diff --git a/miext/rootless/meson.build b/miext/rootless/meson.build index 66b9f06cf..f37aa1320 100644 --- a/miext/rootless/meson.build +++ b/miext/rootless/meson.build @@ -6,7 +6,7 @@ srcs_miext_rootless = [ 'rootlessWindow.c', ] -libxserver_miext_rootless = static_library('libxserver_miext_rootless', +libxserver_miext_rootless = static_library('xserver_miext_rootless', srcs_miext_rootless, include_directories: inc, dependencies: common_dep, diff --git a/miext/shadow/meson.build b/miext/shadow/meson.build index f91accd69..8e2f0a9c1 100644 --- a/miext/shadow/meson.build +++ b/miext/shadow/meson.build @@ -29,7 +29,7 @@ hdrs_miext_shadow = [ 'shadow.h', ] -libxserver_miext_shadow = static_library('libxserver_miext_shadow', +libxserver_miext_shadow = static_library('xserver_miext_shadow', srcs_miext_shadow, include_directories: inc, dependencies: common_dep, diff --git a/miext/sync/meson.build b/miext/sync/meson.build index 78716e441..1c959d60b 100644 --- a/miext/sync/meson.build +++ b/miext/sync/meson.build @@ -14,7 +14,7 @@ if build_dri3 srcs_miext_sync += 'misyncshm.c' endif -libxserver_miext_sync = static_library('libxserver_miext_sync', +libxserver_miext_sync = static_library('xserver_miext_sync', srcs_miext_sync, include_directories: inc, dependencies: [ diff --git a/os/meson.build b/os/meson.build index 9c8412d76..20a411c2b 100644 --- a/os/meson.build +++ b/os/meson.build @@ -79,7 +79,7 @@ endif libxlibc = [] if srcs_libc.length() > 0 - libxlibc = static_library('libxlibc', + libxlibc = static_library('xlibc', srcs_libc, include_directories: inc, dependencies: [ @@ -92,7 +92,7 @@ if enable_input_thread os_dep += cc.find_library('pthread') endif -libxserver_os = static_library('libxserver_os', +libxserver_os = static_library('xserver_os', srcs_os, include_directories: inc, dependencies: [ diff --git a/present/meson.build b/present/meson.build index df8d40b02..3422ef77a 100644 --- a/present/meson.build +++ b/present/meson.build @@ -15,7 +15,7 @@ hdrs_present = [ 'present.h', ] -libxserver_present = static_library('libxserver_present', +libxserver_present = static_library('xserver_present', srcs_present, include_directories: inc, dependencies: [ diff --git a/pseudoramiX/meson.build b/pseudoramiX/meson.build index c3d932529..e131dc213 100644 --- a/pseudoramiX/meson.build +++ b/pseudoramiX/meson.build @@ -1,4 +1,4 @@ -libxserver_pseudoramix = static_library('libxserver_pseudoramiX', +libxserver_pseudoramix = static_library('xserver_pseudoramiX', 'pseudoramiX.c', include_directories: inc, dependencies: common_dep, diff --git a/randr/meson.build b/randr/meson.build index 9bd751bf2..385a7295a 100644 --- a/randr/meson.build +++ b/randr/meson.build @@ -25,7 +25,7 @@ if build_xinerama srcs_randr += 'rrxinerama.c' endif -libxserver_randr = static_library('libxserver_randr', +libxserver_randr = static_library('xserver_randr', srcs_randr, include_directories: inc, dependencies: common_dep, diff --git a/record/meson.build b/record/meson.build index 1c0b5d2ca..06ca2b5ee 100644 --- a/record/meson.build +++ b/record/meson.build @@ -3,7 +3,7 @@ srcs_record = [ 'set.c', ] -libxserver_record = static_library('libxserver_record', +libxserver_record = static_library('xserver_record', srcs_record, include_directories: inc, dependencies: common_dep, diff --git a/render/meson.build b/render/meson.build index b95b082b3..b091d30c6 100644 --- a/render/meson.build +++ b/render/meson.build @@ -19,7 +19,7 @@ hdrs_render = [ 'picturestr.h', ] -libxserver_render = static_library('libxserver_render', +libxserver_render = static_library('xserver_render', srcs_render, include_directories: inc, dependencies: common_dep, diff --git a/xfixes/meson.build b/xfixes/meson.build index 0e97d477b..26a7af0b0 100644 --- a/xfixes/meson.build +++ b/xfixes/meson.build @@ -7,7 +7,7 @@ srcs_xfixes = [ 'xfixes.c', ] -libxserver_xfixes = static_library('libxserver_xfixes', +libxserver_xfixes = static_library('xserver_xfixes', srcs_xfixes, include_directories: inc, dependencies: common_dep, diff --git a/xkb/meson.build b/xkb/meson.build index c21868c2b..918a1be28 100644 --- a/xkb/meson.build +++ b/xkb/meson.build @@ -23,7 +23,7 @@ srcs_xkb = [ 'XKBMAlloc.c', ] -libxserver_xkb = static_library('libxserver_xkb', +libxserver_xkb = static_library('xserver_xkb', srcs_xkb, include_directories: inc, dependencies: common_dep, @@ -35,7 +35,7 @@ srcs_xkb_stubs = [ 'ddxVT.c', ] -libxserver_xkb_stubs = static_library('libxserver_xkb_stubs', +libxserver_xkb_stubs = static_library('xserver_xkb_stubs', srcs_xkb_stubs, include_directories: inc, dependencies: common_dep, From 5b810bac5e2e91f444dddd83214dec363e16261a Mon Sep 17 00:00:00 2001 From: Nathan Kidd Date: Wed, 7 Aug 2024 18:17:32 -0400 Subject: [PATCH 71/82] glx: Fix out-of-bounds reads from negative return The callers of these functions were casting -1 to unsigned and then using 4GB indexes. By returning 0 we match all the other size functions. GLX size functions return -1 to indicate error, but GL size functions return 0. Signed-off-by: Nathan Kidd Part-of: --- glx/singlesize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glx/singlesize.c b/glx/singlesize.c index 344ffef7f..d2db6945a 100644 --- a/glx/singlesize.c +++ b/glx/singlesize.c @@ -105,7 +105,7 @@ __glGetMap_size(GLenum target, GLenum query) } break; } - return -1; + return 0; } GLint @@ -164,7 +164,7 @@ __glGetPixelMap_size(GLenum map) query = GL_PIXEL_MAP_A_TO_A_SIZE; break; default: - return -1; + return 0; } glGetIntegerv(query, &size); return size; From 7ca8b37ab13ec5698e6cf22ffc6d1374d91b52d6 Mon Sep 17 00:00:00 2001 From: Nathan Kidd Date: Mon, 12 Aug 2024 18:05:58 -0400 Subject: [PATCH 72/82] glx: Don't blindly write 8 bytes in GLX single replies Previously we leaked stack when invalid enum parameters were specified and caused __glGet*_size functions to return a 0 size. Further, we read out-of-bounds (and leaked) when the input data was less than 8 bytes (__glXDispSwap_GetFramebufferAttachmentParameteriv and __glXDisp_GetRenderbufferParameteriv). Now we only write a single element in the reply padding, and only when there is a single element. This is what the Mesa client-side libGL expects, and restores original GLX server behaviour, matching both pre-public (1996) SGI GLX and XFree86 4. The main risk of this change is if we have any error in element count or size; previously it may not have mattered but now it does. There are no piglit result changes from this modification using either mesa libGLX or NVIDIA libGLX. For performance considerations, an extra conditional and variable-length memcpy has no meaningful impact on the indirect rendering pipeline cost. There is still the possiblity to leak if our size checks allow an enum that the GL implemention does not. Guarding against that requires zero-initializing all temp storage, which wants re-evaluation of the blind 200-byte buffers used for many calls and thus is a much bigger change. Signed-off-by: Nathan Kidd Part-of: --- glx/indirect_util.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/glx/indirect_util.c b/glx/indirect_util.c index 83579c529..140b3b21f 100644 --- a/glx/indirect_util.c +++ b/glx/indirect_util.c @@ -128,13 +128,10 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements, .retval = retval, }; - /* It is faster on almost always every architecture to just copy the 8 - * bytes, even when not necessary, than check to see of the value of - * elements requires it. Copying the data when not needed will do no - * harm. - */ - - (void) memcpy(&reply.pad3, data, 8); + /* Single element goes in reply padding; don't leak uninitialized data. */ + if (elements == 1) { + (void) memcpy(&reply.pad3, data, element_size); + } WriteToClient(client, sizeof(xGLXSingleReply), &reply); if (reply_ints != 0) { @@ -176,13 +173,10 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, .retval = bswap_32(retval), }; - /* It is faster on almost always every architecture to just copy the 8 - * bytes, even when not necessary, than check to see of the value of - * elements requires it. Copying the data when not needed will do no - * harm. - */ - - (void) memcpy(&reply.pad3, data, 8); + /* Single element goes in reply padding; don't leak uninitialized data. */ + if (elements == 1) { + (void) memcpy(&reply.pad3, data, element_size); + } WriteToClient(client, sizeof(xGLXSingleReply), &reply); if (reply_ints != 0) { From 2069db50e7f465b7116602e4e118fcb5863c87be Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 3 Jul 2025 14:07:30 +0200 Subject: [PATCH 73/82] xfree86: compat: make xf86MsgVerb() a bit less noisier print the driver bug warning only once. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/compat/log.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/compat/log.c b/hw/xfree86/compat/log.c index 64014e205..061821efd 100644 --- a/hw/xfree86/compat/log.c +++ b/hw/xfree86/compat/log.c @@ -39,7 +39,12 @@ _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...) void xf86MsgVerb(MessageType type, int verb, const char *format, ...) { - xf86NVidiaBugInternalFunc("xf86MsgVerb()"); + static char reportxf86MsgVerb = 1; + + if (reportxf86MsgVerb) { + xf86NVidiaBugInternalFunc("xf86MsgVerb()"); + reportxf86MsgVerb = 0; + } va_list ap; va_start(ap, format); From 160ab343eaebd2a42f8f508a39cb5ad97e36204e Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Wed, 2 Jul 2025 21:44:53 +0300 Subject: [PATCH 74/82] mi: move miPointerCloseScreen to hookPostClose Signed-off-by: stefan11111 --- mi/mipointer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mi/mipointer.c b/mi/mipointer.c index 7d51f8659..ff0db9f6b 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -141,7 +141,7 @@ miPointerInitialize(ScreenPtr pScreen, pScreenPriv->screenFuncs = screenFuncs; pScreenPriv->waitForUpdate = waitForUpdate; pScreenPriv->showTransparent = FALSE; - dixScreenHookClose(pScreen, miPointerCloseScreen); + dixScreenHookPostClose(pScreen, miPointerCloseScreen); dixSetPrivate(&pScreen->devPrivates, miPointerScreenKey, pScreenPriv); /* * set up screen cursor method table @@ -169,7 +169,7 @@ static void miPointerCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void { SetupScreen(pScreen); - dixScreenUnhookClose(pScreen, miPointerCloseScreen); + dixScreenUnhookPostClose(pScreen, miPointerCloseScreen); free((void *) pScreenPriv); dixSetPrivate(&pScreen->devPrivates, miPointerScreenKey, NULL); FreeEventList(mipointermove_events, GetMaximumEventsNum()); From 74d5b7bb0558a3a2ab14a3570d17b2ea1e91949d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 4 Jul 2025 15:04:51 +0200 Subject: [PATCH 75/82] 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 --- hw/xquartz/applewm.c | 1 - hw/xquartz/xpr/appledri.c | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 41ae6f280..096f7fc7b 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -690,7 +690,6 @@ SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to) static int SProcAppleWMQueryVersion(register ClientPtr client) { - REQUEST(xAppleWMQueryVersionReq); return ProcAppleWMQueryVersion(client); } diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c index c01ee9bf7..7810df86a 100644 --- a/hw/xquartz/xpr/appledri.c +++ b/hw/xquartz/xpr/appledri.c @@ -394,7 +394,6 @@ SNotifyEvent(xAppleDRINotifyEvent *from, static int SProcAppleDRIQueryVersion(register ClientPtr client) { - REQUEST(xAppleDRIQueryVersionReq); return ProcAppleDRIQueryVersion(client); } From 93013224b4e7671fc33ce04b5b53f1ac3ca728c2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 4 Jul 2025 15:46:50 +0200 Subject: [PATCH 76/82] 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 --- hw/xquartz/mach-startup/bundle_trampoline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xquartz/mach-startup/bundle_trampoline.c b/hw/xquartz/mach-startup/bundle_trampoline.c index f8611269b..9c58f3ee8 100644 --- a/hw/xquartz/mach-startup/bundle_trampoline.c +++ b/hw/xquartz/mach-startup/bundle_trampoline.c @@ -50,7 +50,7 @@ * needs and simply execs the startup script which then execs the main binary. */ -static char *executable_path() { +static char *executable_path(void) { uint32_t bufsize = PATH_MAX; char *buf = calloc(1, bufsize); From 2f46a02217813034e71df8e268119e3406eda4df Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 4 Jul 2025 15:31:53 +0200 Subject: [PATCH 77/82] vfb: drop unused DarwinHandleGUI() Obsolete since 17 years now, probably just forgotten to clean up. Fixes: ef1c52053755fa14b4ca98b22c506f73f5f4a4b7 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/vfb/InitOutput.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index cd3b2e0a8..6a7ca7c55 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -259,13 +259,6 @@ ddxGiveUp(enum ExitCode error) } } -#ifdef __APPLE__ -void -DarwinHandleGUI(int argc, char *argv[]) -{ -} -#endif - void OsVendorInit(void) { From c6777fe48e6ba6fe884fca27f3f20e944dc7cdd4 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 4 Jul 2025 15:33:18 +0200 Subject: [PATCH 78/82] xnest: drop unused DarwinHandleGUI() Obsolete since 17 years now, probably just forgotten to clean up. Fixes: ef1c52053755fa14b4ca98b22c506f73f5f4a4b7 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/Init.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index 8f88c1edd..1eb49b645 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -154,13 +154,6 @@ ddxGiveUp(enum ExitCode error) xnestCloseDisplay(); } -#ifdef __APPLE__ -void -DarwinHandleGUI(int argc, char *argv[]) -{ -} -#endif - void OsVendorInit(void) { From d338bf6e6860f1ae57a131454dcf4640e8064b08 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 4 Jul 2025 15:01:30 +0200 Subject: [PATCH 79/82] namespace: drop unused winIsRoot() Not used in this file, so no need to keep it around anymore. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/namespace/hook-windowproperty.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Xext/namespace/hook-windowproperty.c b/Xext/namespace/hook-windowproperty.c index f427c634f..afd478369 100644 --- a/Xext/namespace/hook-windowproperty.c +++ b/Xext/namespace/hook-windowproperty.c @@ -11,14 +11,6 @@ #include "namespace.h" #include "hooks.h" -static inline Bool winIsRoot(WindowPtr pWin) { - if (!pWin) - return FALSE; - if (pWin->drawable.pScreen->root == pWin) - return TRUE; - return FALSE; -} - void hookWindowProperty(CallbackListPtr *pcbl, void *unused, void *calldata) { XNS_HOOK_HEAD(PropertyFilterParam); From fc9bd6b1757dc29ea50aaa56c3a0e27e06831324 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 4 Jul 2025 17:26:48 +0200 Subject: [PATCH 80/82] minor release 25.0.0.4 Signed-off-by: Enrico Weigelt, metux IT consult --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 8131d239d..1b901c65b 100644 --- a/meson.build +++ b/meson.build @@ -3,10 +3,10 @@ project('xserver', 'c', 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '25.0.0.3', + version: '25.0.0.4', meson_version: '>= 0.58.0', ) -release_date = '2025-07-02' +release_date = '2025-07-04' add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) cc = meson.get_compiler('c') From a46fd9f16e288b98231d4d13be4d838b789b973d Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Mon, 30 Jun 2025 13:50:11 +0300 Subject: [PATCH 81/82] kdrive: add KdOsInit Kdrive X servers used to do the OS-speciffic init part using KdOsInit. This was changed in modern Xorg because Xephyr is the only kdrive X server there, so there was no need to keep this generic. Since we want to eventually add Xfbdev, we need to add this back. Signed-off-by: stefan11111 --- hw/kdrive/src/kdrive.c | 21 +++++++++++++++++++++ hw/kdrive/src/kdrive.h | 15 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 36bda4153..4637bb6be 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -91,6 +91,14 @@ const char *kdGlobalXkbLayout = NULL; const char *kdGlobalXkbVariant = NULL; const char *kdGlobalXkbOptions = NULL; + +/* + * Carry arguments from InitOutput through driver initialization + * to KdScreenInit + */ + +KdOsFuncs *kdOsFuncs = NULL; + void KdDisableScreen(ScreenPtr pScreen) { @@ -517,6 +525,19 @@ KdProcessArgument(int argc, char **argv, int i) return 0; } +void +KdOsInit(KdOsFuncs * pOsFuncs) +{ + kdOsFuncs = pOsFuncs; + if (pOsFuncs) { + if (serverGeneration == 1) { + KdDoSwitchCmd("start"); + if (pOsFuncs->Init) + (*pOsFuncs->Init) (); + } + } +} + static Bool KdAllocatePrivates(ScreenPtr pScreen) { diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index a4b7576d0..7ce181f42 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -278,6 +278,16 @@ int KdAddConfigKeyboard(char *pointer); int KdAddKeyboard(KdKeyboardInfo * ki); void KdRemoveKeyboard(KdKeyboardInfo * ki); +typedef struct _KdOsFuncs { + int (*Init) (void); /* Only called when the X server is started, when serverGeneration == 1 */ + void (*Enable) (void); + Bool (*SpecialKey) (KeySym); + void (*Disable) (void); + void (*Fini) (void); + void (*pollEvents) (void); + void (*Bell) (int, int, int); +} KdOsFuncs; + typedef struct _KdPointerMatrix { int matrix[2][3]; } KdPointerMatrix; @@ -289,6 +299,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec; extern Bool kdEmulateMiddleButton; extern Bool kdDisableZaphod; +extern KdOsFuncs *kdOsFuncs; + #define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey)) #define KdSetScreenPriv(pScreen,v) \ @@ -345,6 +357,9 @@ void int KdProcessArgument(int argc, char **argv, int i); +void + KdOsInit(KdOsFuncs * pOsFuncs); + void KdOsAddInputDrivers(void); From d403cbd25c0e2f902eb8b7b3fae1faaa129646c8 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Mon, 30 Jun 2025 14:16:23 +0300 Subject: [PATCH 82/82] kdrive: ephyr: initialize OS specific callback vectors These will be used by subsequent commits for generic Kdrive functions calling back into the OS specific parts Signed-off-by: stefan11111 --- hw/kdrive/ephyr/ephyrinit.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index fd5e73f82..f65cef052 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -370,6 +370,23 @@ ddxProcessArgument(int argc, char **argv, int i) return KdProcessArgument(argc, argv, i); } +static int +EphyrInit(void) +{ + /* + * make sure at least one screen + * has been added to the system. + */ + if (!KdCardInfoLast()) { + processScreenArg("640x480", NULL); + } + return hostx_init(); +} + +KdOsFuncs EphyrOsFuncs = { + .Init = EphyrInit, +}; + void OsVendorInit(void) { @@ -381,12 +398,7 @@ OsVendorInit(void) if (hostx_want_host_cursor()) ephyrFuncs.initCursor = &ephyrCursorInit; - if (serverGeneration == 1) { - if (!KdCardInfoLast()) { - processScreenArg("640x480", NULL); - } - hostx_init(); - } + KdOsInit(&EphyrOsFuncs); } KdCardFuncs ephyrFuncs = {