Commit graph

23,146 commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
cedcb83034 os: osdep.h: fix FTBS on musl
https://github.com/X11Libre/xserver/issues/2890

musl doesn't indirectly include errno.h as much as other libc's do.
In general it's a good idea to always explicitly include what's needed,
instead of relying on indirect includes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 11:14:56 +02:00
stefan11111
48b1c8d28a kdrive/fbdev/Xfbdev.man: s/-B/.B/
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-08 10:02:05 +02:00
stefan11111
81264432c1 kdrive: Fix man page suffixes
Fixes: https://github.com/X11Libre/xserver/pull/2842

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-08 10:02:05 +02:00
stefan11111
10f33eb36a modesetting: byte-swap ARGB cursor uploads on big-endian
Port https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2156 to Xlibre

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-08 10:01:28 +02:00
callmetango
50981f161a
README.md: update for one year of XLibre 2026-06-05 12:43:25 -04:00
Enrico Weigelt, metux IT consult
bc81e4159a Xi: Swap property data in ProcXChangeDeviceProperty/ProcXIChangeProperty
Property data (following the request header) also needs to be swapped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-05 16:32:25 +02:00
stefan11111
a8a44914dc kdrive/linux: Bring back the bus mice driver
It's only ~100 loc, so even it noone uses this, it's not that much code.

The author of this is probably Keith Packard, but I couldn't find
a commit adding this driver, so I didn't put him as the commit author.

Reverts: af1f1a05e1 ,
after porting it to meson, C99 struct init, and some C99 fixes

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-05 15:03:59 +02:00
Peter Hutterer
6e0d121c4d xkb: Add bounds check for action data in CheckKeyActions()
CheckKeyActions() validates the per-key action count bytes individually
but does not verify that the computed total action data region falls
within the request buffer before advancing the wire pointer past it.

After the loop, the function calculates the final wire position as
wire + nActs * sizeof(XkbAnyAction), where nActs is the sum of per-key
action counts read from the request. The upstream length validation in
_XkbSetMapCheckLength() uses req->totalActs from the request header,
not the computed nActs. If a crafted request provides a totalActs value
that passes the length check but per-key action counts that sum to a
different nActs, the wire pointer could advance past the actual request
buffer.

The subsequent SetKeyActions() function uses memcpy to read from this
potentially out-of-bounds region, which could leak heap data or cause
a crash.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2208>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-05 15:03:19 +02:00
Peter Hutterer
1f7278bce2 dix/colormap: fix out-of-bounds read in FindColorInRootCmap
The for loop here always iterates size times but the client controls the
starting offset. When the starting pixel is non-zero (e.g., pixel=10 in
a size=256 colormap), the loop reads from pentFirst[10] through
pentFirst[265], reading 10 entries past the end of the array.

Fix this by wrapping around once we reach size, same as FindColor()
already does.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2215>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-05 15:02:03 +02:00
Peter Hutterer
d02bd70171 Xi/xichangehierarchy: reject zero-length hierarchy change entries
No need to spin for a zero-length change. The loop is already bounded to
255 iterations so this just keeps the room slightly cooler.

This is a slight behavior change in that subsequent hierarchy changes
will no longer be accepted (but already-applied changes remain).  But a
client sending zero length hierarchy changes is buggy anyway, so meh.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2200>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-05 14:59:01 +02:00
Peter Hutterer
c7a91b33df os/access: fix off-by-one in hostname character validation range
In siHostnameCheckAddr(), the digit validation range was 0x30-0x3A, but
0x3A is the colon character (':'). The ASCII range for digits 0-9 is
0x30-0x39.

Colons in hostnames violate RFC 2396 section 3.2.2 and we're not parsing
the host:port notation here.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2200>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-05 14:55:38 +02:00
stefan11111
a2ecc417c7 kdrive: Fix KdReleaseAllKeys and drop scancode-based hacks
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-05 13:30:35 +02:00
stefan11111
6934b11118 kdrive: Port KdKeyCodeToKeySym to xkb and update man pages accordingly
Now special key combinations work in all kdrive X servers,
and the special key combinations are documented in the various man pages.

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-05 13:30:35 +02:00
Peter Hutterer
a9575f4b7a os/log: handle NULL string argument in vpnprintf
Since this function is called from signal handlers (e.g. OsSigHandler
processing SIGSEGV/SIGBUS), a NULL %s argument triggers a recursive fault.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2200>

----------------------------------------------------------------------------

Modified to fit Xlibre changes.
See: https://github.com/X11Libre/xserver/pull/2794

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-05 11:11:41 +02:00
Peter Hutterer
fd35d20593 xkb: clamp nMaps to mapWidths buffer size in CheckKeyTypes
CheckKeyTypes computes nMaps = firstType + nTypes from client-controlled
request fields when XkbSetMapResizeTypes is set. This value is used to
index mapWidths[], a stack-allocated CARD8 array of XkbMaxLegalKeyCode + 1
(256) elements. No upper bound is enforced on nMaps.

An attacker can first send SetMap(firstType=0, nTypes=255, ResizeTypes) to
set the server's num_types to 255, then send SetMap(firstType=255,
nTypes=10, ResizeTypes). The firstType > num_types check passes because
255 > 255 is false (the check uses > rather than >=). nMaps is then
computed as 265, and the loop writes mapWidths[255..264], overflowing 9
bytes past the stack buffer into adjacent stack variables (symsPerKey[]).

Fix by rejecting requests where firstType + nTypes would exceed the
mapWidths buffer size (XkbMaxLegalKeyCode + 1).

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30161

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:20:41 +02:00
Mikhail Dmitrichenko
b0a49c2cdd xkb: preserve buffer on realloc failure
_Concat() stored the realloc() result directly in its input pointer, so
an allocation failure could drop the only reference to the original
buffer when callers assigned the return value back to their destination
pointer.

Keep the old pointer until realloc() succeeds, avoiding the leak
reported by static analysis.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2221>
2026-06-03 19:20:12 +02:00
Mikhail Dmitrichenko
1d863e7e58 os: check ospoll allocation failures
ospoll_create() initializes backend-specific state immediately after
allocating the ospoll structure. Check the allocation result for each
backend before dereferencing it and return NULL on failure.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2217>
2026-06-03 19:10:01 +02:00
Michel Dänzer
422d6764e5 dri2: Use booleans for (fake) front buffer tracking in do_get_buffers
This works as intended — the (fake) front buffer needs to be added
only if the client didn't request it in the first place — even if the
client requests the same attachment multiple times. This ensures we
never try to access more than (count + 1) entries of the buffers array.

Fixes: ff6c7764c2 ("DRI2: Implement protocol for DRI2GetBuffersWithFormat")
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
2026-06-03 19:09:51 +02:00
Peter Hutterer
a266fe0e5f sync: restart trigger list iteration in SyncChangeCounter after TriggerFired
This is the equivalent check to miSyncTriggerFence() from
commit f19ab94ba9 ("miext/sync: Fix use-after-free in miSyncTriggerFence()")

When a trigger fires via SyncAwaitTriggerFired, the resulting
FreeResource/FreeAwait call invokes SyncDeleteTriggerFromSyncObject for
every trigger in the same Await group. This unlinks and frees the
corresponding trigger list nodes - potentially including the node pnext
points to.

Fix by restarting iteration from the list head after a trigger fires, since
TriggerFired may have arbitrarily mutated the list. Triggers that have fired
are removed from the list by FreeAwait, so restarting cannot cause infinite
loops.

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30164

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:09:02 +02:00
Peter Hutterer
e8d3b45d64 xkb: reject key types with num_levels exceeding XkbMaxShiftLevel
CheckKeyTypes validates incoming key type definitions from XkbSetMap
requests but does not enforce an upper bound on numLevels. A client can set
numLevels up to 255 on a non-canonical key type, which is stored in the
server's type table.

When ChangeKeyboardMapping later triggers XkbUpdateKeyTypesFromCore, the
function XkbKeyTypesForCoreSymbols computes groupsWidth from num_levels and
uses the XKB_OFFSET(g, l) = (g * groupsWidth) + l macro to index into
tsyms[], a stack-allocated buffer of XkbMaxSymsPerKey (252) entries. With
num_levels=255, groupsWidth=255, and indices reach up to 3*255+254 = 1019,
overflowing the 252-element stack buffer by 767 KeySym-sized entries.

Fix by rejecting numLevels values greater than XkbMaxShiftLevel (63) in
CheckKeyTypes, alongside the existing lower-bound check for numLevels < 1.

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30160

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:08:54 +02:00
Peter Hutterer
409394cea8 glx: fix reversed length check in ChangeDrawableAttributes
The request length validation in __glXDisp_ChangeDrawableAttributes and
__glXDispSwap_ChangeDrawableAttributes uses the wrong comparison direction.
The check tests whether the computed request size is LESS THAN
client->req_len, but should test whether it is GREATER THAN. With the
reversed operator, an undersized request (where numAttribs claims more
attribute pairs than the request actually contains) passes validation.

DoChangeDrawableAttributes then iterates numAttribs attribute pairs starting
from the end of the request header, reading past the actual request data
into adjacent memory. This is an out-of-bounds read that can also cause
an out-of-bounds write when a GLX_EVENT_MASK attribute key is found in the
overread data and its corresponding value is written to pGlxDraw->eventMask.

This patch effectively reverts commit 402b329c3a ("glx: Work around
wrong request lengths sent by mesa"). This was fixed in mesa commit
4324d6fdfbba1 in 2011 (mesa 7.11).

Fixes: 402b329c3a ("glx: Work around wrong request lengths sent by mesa")

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30165

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:08:16 +02:00
Peter Hutterer
0cdd8bbd25 saver: re-fetch screen private after CheckScreenPrivate in CreateSaverWindow
CreateSaverWindow stores pPriv (the ScreenSaverScreenPrivatePtr) in a local
variable via the SetupScreen macro at function entry. When an existing saver
window is being replaced, the function sets pPriv->hasWindow = FALSE and
calls CheckScreenPrivate(). If at this point pPriv->attr is NULL (cleared
by a prior UnsetAttributes call), pPriv->events is NULL, and
pPriv->installedMap is None, then CheckScreenPrivate determines the screen
private is unused, frees it, and sets the screen private pointer to NULL.

The function then continues to dereference the now-freed pPriv on the very
next line (pPriv->attr), resulting in a use-after-free. On glibc 2.34+,
the tcache key at offset 8 within the freed block makes pPriv->attr appear
non-NULL, causing the function to continue operating on garbage data and
eventually crash.

The attack sequence is:
  1. SetAttributes (creates pPriv with pPriv->attr set)
  2. ForceScreenSaver(Active) (creates saver window, pPriv->hasWindow=TRUE)
  3. UnsetAttributes (sets pPriv->attr = NULL)
  4. ForceScreenSaver(Active) (re-enters CreateSaverWindow → UAF)

Fix by re-fetching pPriv from the screen private after CheckScreenPrivate
returns, so the subsequent NULL check correctly detects the freed state.

ScreenSaverFreeAttr has the same pattern, force pPriv to NULL there too
even though it has no real effect.

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30168

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:08:00 +02:00
Peter Hutterer
803fd0b94e dix: increase XLFDMAXFONTNAMELEN to match libXfont2's MAXFONTNAMELEN
XLFDMAXFONTNAMELEN was 256 bytes, but libXfont2 defines MAXFONTNAMELEN
as 1024 and allows font names and alias targets up to that length in
fonts.alias files.

doListFontsAndAliases copies the resolved alias target into a
stack-allocated tmp_pattern[XLFDMAXFONTNAMELEN] and then into
c->current.pattern[XLFDMAXFONTNAMELEN] (defined in LFWIstateRec).
doListFontsWithInfo has the same pattern, copying the resolved name into
c->current.pattern[]. With the old 256-byte limit, a fonts.alias entry
with a target name between 257 and 1023 bytes would overflow both
buffers.

An attacker can exploit this by:
  1. Creating a font directory with a fonts.alias containing an alias
     whose target name exceeds 256 bytes
  2. Using SetFontPath to add the malicious directory
  3. Calling ListFonts with the alias name to trigger alias resolution
  4. The oversized resolved name overflows the 256-byte stack buffer

Increase XLFDMAXFONTNAMELEN from 256 to 1024 to match libXfont2's
MAXFONTNAMELEN, ensuring the server can handle any name the font library
produces.

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30136

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:07:48 +02:00
Peter Hutterer
2a0c937439 sync: fix deletion of counters and fences
Both FreeCounter() and miSyncDestroyFence() iterate over the trigger list
and invoke the CounterDestroyed callback on each trigger.

The CounterDestroyed callback (e.g. SyncAwaitTriggerFired) may call
FreeResource/FreeAwait, which frees the SyncAwaitUnion containing all
SyncAwait structs in the same Await group.

When multiple conditions in a single Await reference the same sync
object (counter or fence), the first callback frees all SyncAwait
structs while subsequent trigger list nodes still reference them. On the
next iteration, reading ptl->next or ptl->pTrigger dereferences freed
memory, leading to a use-after-free.

We need separate fixes for separate issues here to fix this in one go
- use our null-terminated list macro to make sure our next pointer stays
  valid (the code accessed ptl->next after freeing it)
- update the list head before deleting the trigger, eventually this ends
  up being NULL anyway but meanwhile the list head is a valid list
  during CounterDestroyed
- check if we actually do have a trigger before dereferencing the
  callback
- Set all triggers to NULL if they are shared so we don't dereference
  potentially freed memory

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30159 (miSyncDestroyFence), ZDI-CAN-30163 (FreeCounter)

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 17:49:13 +02:00
Peter Hutterer
12b641a6bd glx: fix duplicate tagInfo->vendor = NULL assignment
Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2226>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 17:47:54 +02:00
stefan11111
5dc6aea734 kdrive/fbdev: Fix handling of -dri when it has no path and is not the last arg
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-03 15:38:14 +02:00
stefan11111
d33d840343 glamor/glamor_egl: Export pixmaps directly from GL textures
Some checks failed
Build X servers / drivers-build-ubuntu (video-nouveau:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-nv:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-omap:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-qxl:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-r128:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
With this change, we create EGLImages directly from the GL
texture of the pixmap to be exported, and set the pixmap's image
to the newly created EGLImage.

Before this, we were creating a gbm bo with the same dimensions
as the pixmap. We were then creating a new pixmap with the dimensions
of the old pixmap. We were then exporting the gbm bo as dmabufs, and
importing the dmabufs into an EGLImage. We were then creating a GL
texture from this EGLImage, and we were setting the newly created pixmap's
texture and EGLImage to the newly created ones.

Then we were swapping the texture and image of the newly created pixmap into
the old pixmap, and destroying the newly created pixmap.

DRI3 pixmap exports are a pretty rare operation.
Most of the time, we do pixmap imports.

As such, here is some code for testing this change.
I cannot attest to the quality of the test code, as I have
copied the code from somewhere else and did not write it myself:
```
// compile with:
// gcc dri3_export_demo.c -o dri3_export_demo \
//     -lxcb -lxcb-dri3 -lxcb-present -lxcb-xfixes

int main() {
    xcb_connection_t *conn = xcb_connect(NULL, NULL);
    if (xcb_connection_has_error(conn)) {
        fprintf(stderr, "Failed to connect to X\n");
        return 1;
    }

    const xcb_setup_t *setup = xcb_get_setup(conn);
    xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup);
    xcb_screen_t *screen = iter.data;

    // Create a pixmap
    xcb_pixmap_t pixmap = xcb_generate_id(conn);
    uint16_t width = 256, height = 256;

    xcb_create_pixmap(conn,
                      screen->root_depth,
                      pixmap,
                      screen->root,
                      width,
                      height);

    xcb_flush(conn);

    printf("Created pixmap %u\n", pixmap);
    xcb_generic_error_t *error = NULL;

    // --- Single FD export (fd_from_pixmap) ---
    xcb_dri3_buffer_from_pixmap_cookie_t cookie1 =
        xcb_dri3_buffer_from_pixmap(conn, pixmap);

    //xcb_generic_error_t *error = NULL;
    xcb_dri3_buffer_from_pixmap_reply_t *reply1 =
        xcb_dri3_buffer_from_pixmap_reply(conn, cookie1, &error);

    if (!reply1 || error) {
        fprintf(stderr, "buffer_from_pixmap failed\n");
        free(error);
    } else {
        int fd = xcb_dri3_buffer_from_pixmap_reply_fds(conn, reply1)[0];

        printf("fd_from_pixmap:\n");
        printf("  fd = %d\n", fd);
        printf("  size = %u\n", reply1->size);
        printf("  stride = %u\n", reply1->stride);
        printf("  depth = %u\n", reply1->depth);
        printf("  bpp = %u\n", reply1->bpp);

        close(fd);
        free(reply1);
    }

    // --- Multi-FD export (fds_from_pixmap) ---
    xcb_dri3_buffers_from_pixmap_cookie_t cookie2 =
        xcb_dri3_buffers_from_pixmap(conn, pixmap);

    xcb_dri3_buffers_from_pixmap_reply_t *reply2 =
        xcb_dri3_buffers_from_pixmap_reply(conn, cookie2, &error);

    if (!reply2 || error) {
        fprintf(stderr, "buffers_from_pixmap failed\n");
        free(error);
    } else {
        int nfd = 4;//xcb_dri3_buffers_from_pixmap_reply_fds_length(conn, reply2);
        int *fds = xcb_dri3_buffers_from_pixmap_reply_fds(conn, reply2);

        printf("fds_from_pixmap:\n");
        printf("  num_fds = %d\n", nfd);
        printf("  width = %u height = %u\n", reply2->width, reply2->height);

        for (int i = 0; i < nfd; i++) {
            printf("  fd[%d] = %d\n", i, fds[i]);
            close(fds[i]);
        }

        free(reply2);
    }

    xcb_free_pixmap(conn, pixmap);
    xcb_disconnect(conn);

    return 0;
}
```

See: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2057#note_3442757

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-02 16:02:14 +02:00
stefan11111
570ae6388f kdrive/fbdev: Log the id of the framebuffer device we are using
Some checks failed
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-macos (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / xserver-build-cygwin (push) Has been cancelled
Build X servers / xserver-build-arch (push) Has been cancelled
Build X servers / Check Signed-Off-By (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
check PRs for merge conflicts / notify (push) Has been cancelled
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-01 14:54:59 +02:00
stefan11111
81707e5d7b kdrive/fbdev: Log the screen config even if no arguments were passed to Xfbdev
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-01 14:54:59 +02:00
stefan11111
910d2910eb vfb: Don't call strdup on server arguments
The command-line arguments live long enough so that
we don't need to duplicate them.

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-01 14:54:59 +02:00
stefan11111
9141a94d22 kdrive/fbdev: Don't call strdup on server arguments
The command-line arguments live long enough so that
we don't need to duplicate them.

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-01 14:54:59 +02:00
stefan11111
d2c26a5be0 kdrive/fbdev: Try the /dev/fb symlink first
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-01 14:54:59 +02:00
Aggelos Tselios
7fecda3074 hw: xquartz: Replace xorg-server version string with XLibre Xserver
Some checks failed
Build X servers / drivers-build-ubuntu (video-nouveau:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-nv:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-omap:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-qxl:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-r128:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
XLibre maintains the Xquartz DDX separately from the Xorg development
repository. Users should know which Xserver they are using when they are
shown the "About" window.

Signed-off-by: Aggelos Tselios <aggelostselios777@gmail.com>
2026-05-30 17:19:36 +02:00
stefan11111
6b3703e120 glamor/glamor_egl: Import pixmaps directly from dma bufs
Before this, when we wanted to import pixmaps from dma bufs,
we were importing a gbm bo from dma bufs, exporting the
gbm bo as dmabufs, importing an EGLImageKHR from those
dmabufs, and finally creating a pixmap from the EGLImageKHR.

Now, we just import the image and create a pixmap from it.

See: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2057#note_3442757

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-05-29 13:35:43 +02:00
Sergey Fedorov
83288dedcd xquartz: support legacy CG APIs as a fallback 2026-05-27 14:34:03 +02:00
Sergey Fedorov
0946eb14c5 xquartz: add non-dispatch fallbacks for 10.5
Based on https://github.com/XQuartz/xorg-server/blob/server-1.20-legacy
2026-05-27 14:34:03 +02:00
Sergey Fedorov
bbdcb306d2 xquartz: fix non-portable ObjC syntax 2026-05-27 14:34:03 +02:00
Sergey Fedorov
39734c62e7 xquartz: work around meson bug 2026-05-27 14:34:03 +02:00
Sergey Fedorov
f9c200b155 meson.build: test for possibly unsupported flags
Needed at least for gcc-4.2.
2026-05-27 14:34:03 +02:00
Sergey Fedorov
3f63ca89a7 xquartz: objc_autoreleasePool* only supported with clang and > 10.6 2026-05-27 14:34:03 +02:00
Sergey Fedorov
0c8be31194 xquartz: use asl_log_descriptor where supported 2026-05-27 14:34:03 +02:00
Sergey Fedorov
ef512cc2c5 xquartz/osxcompat.h: compat header 2026-05-27 14:34:03 +02:00
Sergey Fedorov
f80497ee48 xquartz/xpr/xprEvent.c: support build with XPLUGIN_VERSION < 6 2026-05-27 14:34:03 +02:00
Sergey Fedorov
00029349e4 xquartz/applewmExt.h: support build with XPLUGIN_VERSION < 4
0f284f0f42
2026-05-27 14:34:03 +02:00
Sergey Fedorov
0ff32ba373 xquartz/xpr/x-list.h: use __attribute__ if __private_extern__ is not defined 2026-05-27 14:34:03 +02:00
Sergey Fedorov
3f219eda7f xquartz/X11Controller.h: define strong to retain if undefined 2026-05-27 14:34:03 +02:00
stefan11111
bb82387435 glamor: Drop some #ifdef GLAMOR_HAS_GBM's
The newly enabled code doesn't do anything currently without gbm

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-05-27 14:24:32 +02:00
stefan11111
efbfc27155 kdrive/fbdev: Drop ifdefs from screen config
We only save a few bytes per screen by having those `ifdef`s

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-05-27 09:54:57 +02:00
stefan11111
a330e82f6e kdrive/fbdev: Implement -noaccel flag
Similar to `-dumb`, but allows disabling acceleration
for a single screen, as oposed to the whole server

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-05-27 09:54:57 +02:00
John Studnicka
b477959552 lint: Add targeted NOLINT on existing ASM
Some checks failed
Build X servers / drivers-build-ubuntu (video-nouveau:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-nv:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-omap:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-qxl:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-r128:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
Signed-off-by: John Studnicka <contact@zentec.dev>
2026-05-26 12:15:17 +02:00