Enrico Weigelt, metux IT consult
578fbe50a1
Xnest: use xcb for creating / destroying pixmaps
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
c0ad499fa7
Xnest: replace XBell() by xcb_bell()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
68d13337d3
Xnest: use xcb for (un)mapping windows
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
b00f49f6b8
Xnest: replace XCreateWindow() by use xcb_create_window()
...
Need to add xcb-aux dependency for that.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
5fc7d95831
Xnest: fetch root visual ID from screen data
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
f4606dc8ab
Xnest: fetch keycode min/max from setup data
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
d856ccb066
Xnest: fetch image metrics from xcb connection setup data
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
10b63d1c03
Xnest: fetch default screen's root window from screen info
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
b160dc0f31
Xnest: add helper for retrieving GC XID on upstream connection
...
Upcoming patches will need to retieve GC's XIDs on the upstream connection.
Moving this out into separate .c file, in order to not creating more
dependencies on Xlib headers, which we wanna get rid of.
For now, looking at the Xlib GC structure, attached to our DDX GCs.
When all users of the Xlib GC have gone (ie. moved all consumers to xcb),
we'll create the GC via xcb directly, thus replacing the Xlib GC struct
by XID - the interface of this helper will remain the same.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
4629933e5f
Xnest: fetch default colormap from xcb screen info
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
9b4e251a60
Xnest: fetch root window depth from screen info
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
edd7788897
Xnest: fetch display size from xcb setup data
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
1b3d6525ed
Xnest: fetch BlackPixel and WhitePixel from xcb setup data
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
67c0162297
Xnest: fetch xcb setup data
...
Fetching the setup data from xcb instead of Xlib, storing in our own struct,
holding all information needed for one particular upstream connection.
For now, there's only one, but future multi-upstream implementation will
change this to an array (and storing pointers to particular upstream in
various places).
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
e561afd4c1
Xnest: use XCB_EVENT_MASK_* defines
...
Use xcb's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
3a85d6db16
Xnest: use XCB*_NONE instead of None
...
Use xcb's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
4c2add66d1
Xnest: use XCB_BACK_PIXMAP_* defines
...
Use xcb's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
e10806b971
xnest: replace ExposureMask by XCB_EVENT_MASK_EXPOSURE
...
Use xcb's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
03c1122225
Xnest: replace NotUseful by XCB_BACKING_STORE_NOT_USEFUL
...
Use xcb's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
0436cf2426
Xnest: use XCB_CONFIG_WINDOW_* defines instead of CW*
...
Use xcb's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
897f761d9b
Xnest: use XCB_CW_* defines instead of CW*
...
Use XCB's defines instead of Xlib's ones.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
a5773bb46d
Xnest: add xcb and x11-xcb as dependency
...
In order to transition to XCB, we need to link xcb, but temporarily
also x11-xcb.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-28 19:56:12 +01:00
Enrico Weigelt, metux IT consult
af86c5cbc2
Xnest: use authorative declarations from X11/XKBlib.h
...
Better use the headers from the library we're linking against,
instead of having our own private declarations.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1842 >
2025-02-28 17:27:05 +00:00
Enrico Weigelt, metux IT consult
cab3856903
xfree86: os-support: fix FTBS when no recent enough libdrm found
...
On Linux, the only supported platform bus backend (*1) is via DRM/DRI.
Trying to build it w/o (recent enough) libdrm fails as it tries to
compile the drm-based implementation, w/o having drm.h available. (*2)
In order to fix this, we need to compile noop-implementation instead.
*1) platform specific code for detecting video devices
*2) https://gitlab.freedesktop.org/xorg/xserver/-/issues/1771
Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1771
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1848 >
2025-02-28 16:15:32 +00:00
Enrico Weigelt, metux IT consult
e2ac461629
xfree86: platform_noop: add missing functions
...
In order to be able to build on Linux w/ platform_noop
(when no recent enough libdrm found), a few more dummy functions
are needed here.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1848 >
2025-02-28 16:15:32 +00:00
Enrico Weigelt, metux IT consult
fe9c911e22
xfree86: xf86helper: fix NULL dereference
...
xf86MatchDevice() can segfault if screensecptr->device is NULL.
Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1767
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1847 >
2025-02-28 16:41:09 +01:00
Enrico Weigelt, metux IT consult
628e94b164
os: let vpnprintf() accept %X
...
Several pieces of the code, as well as drivers are using %X, which
we don't support, so leading to error messages like this:
[2025-02-27 14:28:44] BUG: 'if (f[f_idx])'
[2025-02-27 14:28:44] BUG: ../xserver/os/log.c:538 in vpnprintf()
[2025-02-27 14:28:44] Unsupported printf directive 'X'
[2025-02-27 14:28:44]
[2025-02-27 14:28:44] Backtrace:
[2025-02-27 14:28:44] unw_get_proc_name failed: no unwind info found [-10]
[2025-02-27 14:28:44] 0: /usr/lib/Xorg (?+0x0) [0x5f4d1261bc47]
[2025-02-27 14:28:44] 1: /usr/lib/Xorg (LogVHdrMessageVerb+0x10f) [0x5f4d1261ca3f]
[2025-02-27 14:28:44] 2: /usr/lib/Xorg (LogHdrMessageVerb+0x85) [0x5f4d1261cae5]
[2025-02-27 14:28:44] 3: /usr/lib/Xorg (xf86VDrvMsgVerb+0x54) [0x5f4d12636604]
[2025-02-27 14:28:44] 4: /usr/lib/Xorg (xf86DrvMsg+0x97) [0x5f4d126367d7]
[2025-02-27 14:28:44] 5: /usr/lib/Xorg (xf86PrintEDID+0x545) [0x5f4d12654315]
[2025-02-27 14:28:44] 6: /usr/lib/Xorg (xf86OutputSetEDID+0x1bd) [0x5f4d12657e0d]
In the longer run, we'll have to decide whether we actually want to
implement the upper-case directive or change all callers to lower-case.
But for now it's better to just accept %X and interpret it as lower-case,
in order to fix those error messages. Whether it's printed as upper or
lower case is more or less an aesthetic matter.
Reported-By: guido iodice <guido.iodice@gmail.com >
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1846 >
2025-02-28 12:51:44 +01:00
Enrico Weigelt, metux IT consult
53876f1ef1
randr: fix RRGetCrtcTransform reply length, part 2
...
Mixed up reply vs request. Obviously, the size substracted from reply
struct's one has to be the one of the generic reply, not generic requst :o
Background: the meaning of the length field isn't entirely intuitive.
a) the size is in 4-byte units, instead of bytes (therefore passing through
bytes_to_int32() call)
b) it's not the total packet size, but only the *extra* payload size, ergo:
how much is the packet longer than a xGenericReply = 8 units = 32 bytes.
(min. packet size is 32 bytes -> length = 0)
In order to prevent those kind of coding errors ever happening again, it might
be a good idea putting that into a generic macro.
Fixes: c6f1b8a735
Fixes: 0ca5aaba50
Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1797
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1845 >
2025-02-27 12:18:20 +00:00
Enrico Weigelt, metux IT consult
fe156104cf
Revert "mi: drop obsolete miInitOverlay()"
...
This reverts commit 12ab2e314b .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
41a75f01cc
Revert "mi: drop obsolete miOverlayGetPrivateClips()"
...
This reverts commit 2c21824ee9 .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
ab95b569e1
Revert "mi: drop obsolete miOverlayCollectUnderlayRegions()"
...
This reverts commit a860ce2c9f .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
4cdc184c13
Revert "mi: drop obsolete miOverlayComputeCompositeClip()"
...
This reverts commit bfb69b7316 .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
9d88cc5f11
Revert "mi: drop obsolete miOverlayCopyUnderlay()"
...
This reverts commit be6985948d .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
d4f92a5688
Revert "mi: drop obsolete miOverlaySetRootClip()"
...
This reverts commit 00796cbf8c .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
0463d7aaaa
Revert "mi: drop now obsolete mioverlay.c"
...
This reverts commit 65b738ed60 .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
f1d87a38ae
Revert "mi: drop now obsolete mioverlay.h"
...
This reverts commit 6825f89cd2 .
Requested by Nvidia - their proprietary driver still needs it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843 >
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult
0ca5aaba50
randr: fix RRGetCrtcTransform reply length
...
Reply length field missed to add the payload's size.
Fixes: c6f1b8a735
Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1797
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1844 >
2025-02-26 19:05:41 +01:00
Enrico Weigelt, metux IT consult
a0c1eeea98
xkb: simplify loops in XkbRF_Free()
...
Make the code a bit easier to read by simplifying the loops.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
abfbc76824
xkb: drop obsolete parameter from XkbRF_Free()
...
The freeRules parameter is always set to TRUE, meaning always free the
XkbRF_RulesRec struct. Therefore also no need to clear out fields that
aren't going to be reused again, ever.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
a88b17565b
xkb: maprules: use static struct init instead of memset()
...
Allow the compiler to figure out the most efficient way to do the
struct initialization, and a little improvement on code readability.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
ffd7ca8af2
xkb: maprules: put some loop counters into local scope
...
Prevent from being accidentially removed and making the code a
little bit easier to understand.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
60d37d0158
xkb: make XkbRF_Create() static inline
...
The function is nothing more than a calloc() call, so we can spare
an actual function call here by making it static inline.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
a82fa00835
xkb: unexport XkbRF_RuleRec struct
...
Not used outside xkb, so no need to keep it in public API header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
83c8a90a61
xkb: unexport XkbRF_GroupRec struct
...
Not used outside xkb, so no need to keep it in public API header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
043dc8041c
xkb: unexport XkbRF_RulesRec struct
...
Not used by any drivers, so no need to keep it in public header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
34372cb3da
xkb: unexport XkbRF_Free()
...
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
89475cbed4
xkb: unexport XkbRF_Create()
...
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
c376cd2c3d
xkb: unexport XkbRF_LoadRules()
...
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
d3b328ba4a
xkb: unexport XkbRF_GetComponents()
...
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult
b535fd7a4c
xkb: move XkbRF_* defines into xkb/maprules.c
...
Only used there so no need to keep them in public API header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840 >
2025-02-26 13:43:52 +00:00