Enrico Weigelt, metux IT consult
a9bdabe3da
( !1601 ) Xext: xres: ProcXResQueryClientIds() collect reply in one buffer
...
In order to allow simplifying the reply send path, collect the reply
fragments into one buffer, instead of arbitrary number of WriteToClient()
calls. This also makes it much easier for potentially new purely packet-based
transports which (eg. binder) that would need their own stream parsing logic.
This xres function is an exceptionally hard case, since payload is constructed
step by step, and it's size only known when finished. The current way of the
fragment handling still has lots of room for improvement (eg. using very small
number of allocations), but leaving this for later exercise.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
476e6e7a6e
( !1601 ) Xext: xres: ProcXResQueryClientResources() simplify payload write out
...
Collect the few bits in a local array, so one WriteToClient() call is
sufficient. That's also easing further simplifications in upcoming commits.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
5a5400dc61
( !1601 ) Xext: xres: ProcXResQueryClientResources(): put temporary int array on stack
...
Simplify allocaton by putting the small temporary int array onto stack.
This also allows further simplifications by upcoming commits.
The upper bound is determined by the number of resource types registered
in the server - this can only be increased by writing new extensions.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
35466ec93e
( !1601 ) Xext: xres: ProcXResQueryClients() simplify payload write out
...
Collect the few bits in a local array, so one WriteToClient() call is
sufficient. That's also easing further simplifications in upcoming commits.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
493f9789c4
( !1601 ) Xext: xres: ProcXResQueryClients() put temporary int array on stack
...
Simplify allocaton by putting the small temporary int array onto stack.
This also allows further simplifications by upcoming commits.
Note: there's an upper bound by compile time defines (theoretically, can
be increased by special cmdline args, that virtually nobody ever using).
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
6bd50b720b
( !1601 ) Xext: xres: sort includes
...
Bring #include's into some logical order.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
17d18080bf
( !1601 ) Xext: xres: use static initialization
...
* use static initialization where applicable
* drop unneeded setting of zero values
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
ae14529ec4
( !1600 ) Xext: xf86bigfont: drop unncessary zero assignments
...
When using static struct initialization, fields not explicitly
stated are automatically zero.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
7c1ba7c4da
( !1714 ) Xext: xv: use PixmapDestroy hook
...
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
1447045d63
( !1714 ) Xext: shm: use PixmapDestroy hook
...
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
7ba27e4e75
( !1714 ) xvmc: use CloseScreen hook
...
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
414f93fb8c
( !1714 ) xv: use CloseScreen hook
...
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
447bf786ca
( !1714 ) Xext: shm: use CloseScreen hook
...
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
f9643a6bee
( !1714 ) xv: use window destructor hook
...
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult
747b520b56
( !1711 ) Xext: shm: use dixDestroyPixmap() instead of direct driver call
...
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.
See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:20 +01:00
Enrico Weigelt, metux IT consult
4041b38684
( !1711 ) Xext: saver: use dixDestroyPixmap() instead of direct driver call
...
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.
See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
2025-02-11 11:36:20 +01:00
Enrico Weigelt, metux IT consult
356e18dcc6
os: move out extension disable flags to corresponing extensions
...
The OS abstraction isn't really the right place for those flags,
they are're probably better off in their corresponding extensions.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1519 >
2025-02-07 12:00:53 +01:00
Enrico Weigelt, metux IT consult
8539f35818
Revert "xv: unexport XvScreenRec and XvScreenPtr"
...
This reverts commit 58a2fb8b6f .
Needed by xf86-video-intel driver. Didn't get noticed, because we don't
have this driver in our CI yet.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1772 >
2025-02-07 10:08:41 +01:00
Enrico Weigelt, metux IT consult
37dd2897d4
Xext: saver: consolidate (non-)xinerama versions
...
We can make it a bit simpler by doing the request header
checking only once.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591 >
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult
8236ef3b56
Xext: saver: use explicit switch/case for dispatching
...
It's more robust / easier understandable programming style to use explicit
switch statements, case'ing on the constants defined in the protocol header,
instead of implicitly via a some opaque call table. It's also done this
way in the other extensions, so making the code a bit more consistent.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591 >
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult
40469a9d51
Xext: saver: skip unneeded zero init and zero-swapping
...
When using struct initializers, all fields not set explicitly are zero.
Also no need to swap fields that are known to be zero.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591 >
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult
fdb8c8ea41
Xext: saver: fix missing swap in QueryVersion reply
...
The `majorVersion` and `minorVersion` fields are CARD16, thus need to be swapped.
OTOH, the lengths field is zero anyways, so no need to swap it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591 >
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult
a33639f975
xvmc: move over protocol version defines into xvmc.c
...
These are exclusively used in one source file, so no need to keep them
in a global header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1693 >
2025-02-06 23:29:10 +00:00
Enrico Weigelt, metux IT consult
ef62929f58
treewide: NULL-protect ScreenRec->DestroyPixmap() calls
...
Right now, we're assuming that even when deep nesting involved, the proc
vector is always set to a valid function. One the one hand it requires
extra dummy procs in some cases, OTOH it's making upcoming refactoring
of the code flow unnecessarily complex.
The big plot (of subsequent commits) is splitting out the extension's
(and possibly subsystem's) special logic out of the wrapping chain and
let them be executed independently from the DDX/drivers - when applicable
even only when the pixmap is really destroyed (not just unref'ed).
(At some later point, it might even become be actually a valid situation
that DestroyPixmap vector really being NULL.)
See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754
See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1755
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1709 >
2025-02-06 23:02:06 +00:00
Enrico Weigelt, metux IT consult
dc9a998b96
Xext: xv: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
753e6c44ba
Xext: xtest: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
0c87f9b1da
Xext: xcmisc: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
9a3daf908c
Xext: vidmode: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
3bb15b3e04
Xext: sync: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
c8c42490b7
Xext: shm: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
a7bdfdb3b5
Xext: shape: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
07131dccc5
Xext: saver: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult
515992b046
Xext: panoramiX: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult
98dbd817f6
Xext: dpms: drop now obsolete swap procs
...
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult
54d4dd619c
Xext: xv: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult
69982abf7b
Xext: xtest: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult
8a5d2a1335
Xext: selinux: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
8b57516414
Xext: xres: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
776efd3cfc
Xext: xf86bigfont: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
405a227c73
Xext: xcmisc: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
65cb5e5575
Xext: vidmode: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
bf6d132df6
Xext: sync: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
75544f1f58
Xext: shm: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
a105c1f7a9
Xext: shape: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
cd413baa4b
Xext: security: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
b52f5f9693
Xext: saver: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
23a8d9be71
Xext: panoramiX: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
fb40f65ee0
Xext: dpms: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult
4f56025812
Xext: bigreq: drop swapping request length fields
...
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult
44c063d93d
Xext: xtest: fix length checking with bigreq
...
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net >
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639 >
2025-02-06 22:28:48 +00:00