Commit Graph

1216 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 48918f28d9 Xext: panoramiX: PanoramiXGetImage() reply payload in one block
Simplify writing reply payload into just one block.
This also makes further simplifications by subsequent patches easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:45 +02:00
Enrico Weigelt, metux IT consult bbfdb50b5c dbe: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:45 +02:00
Enrico Weigelt, metux IT consult dc39130899 Xext: panoramiX: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult a5f44e4c59 Xext: panoramiX: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 587e00e167 Xext: xvmc: enable swapped requests 2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 18331c6d19 Xext: xvmc: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 9ab956a7ef Xext: xvmc: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult c729bfd1f9 Xext: xv: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 2892b49d26 Xext: xv: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 757f6ab8bc Xext: xtest: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult d929424514 Xext: xtest: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult a9f50509bc Xext: selinux: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 105ee0f8ac Xext: selinux: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult a45230afac Xext: xres: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:44 +02:00
Enrico Weigelt, metux IT consult 153361bdc9 Xext: xres: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:43 +02:00
Enrico Weigelt, metux IT consult fcb1bac94c Xext: xf86bigfont: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 9cc70cd9ff Xext: xf86bigfont: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult c133b094ef Xext: xcmisc: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 6f360d77bb Xext: xcmisc: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 0bf0da7b90 Xext: vidmode: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 99e8b56421 Xext: vidmode: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 75328e8356 Xext: sync: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 5cded6356d Xext: sync: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 034791c693 Xext: security: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 35e8a37b17 Xext: security: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 03b8cb506f Xext: geext: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult ff1cb0df89 Xext: geext: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 07ce669504 Xext: shm: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult bac5e1fa2d Xext: shm: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult a7f9bcaf39 Xext: bigreq: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult f906f3afc4 Xext: bigreq: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 87c9317714 Xext: shape: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 7c92bf3937 Xext: shape: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 6f6379ff54 Xext: saver: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 0fde105e38 Xext: saver: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 428855b0df Xext: dpms: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 9614b41afb Xext: dpms: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 1d9c412683 Xext: panoramiX: ProcXineramaQueryScreens(): reply payload in one block
Simplify writing reply payload into just one block.
This also makes further simplifications by subsequent patches easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult b619f19c84 Xext: selinux: allocate reply buffer on stack
Simplify reply buffer in SELinuxSendItemsToClient() by putting it on stack.
No need to go through heap and free it later, if the compiler can do all
the work for us.

This also allows further generalizations of reply sending code by upcoming
commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 8ca913faa2 (submit/cleanup-shm-dispatch) Xext: shm: move client local check into procs
Move extra complexity out of the dispatch functions, so they're
really just switch/case statements calling the actual handler procs.
Preparation for further steps.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult c2760879c2 (submit/cleanup-shm-dispatch) Xext: shm: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 6bd069b343 (submit/cleanup-xv-dispatch) Xext: xv: ProcXvListImageFormats(): write reply payload at once.
Collect up the puzzle piezes of the reply payload into to a temporary struct,
so we can send it as one block. This allows for further simplifications by
subsequent commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 165e48e286 (submit/cleanup-xv-dispatch) Xext: xv: ProcXvQueryAdaptors(): write reply payload at once.
Collect up the puzzle piezes of the reply payload into to a temporary struct,
so we can send it as one block. This allows for further simplifications by
subsequent commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 50813e93c6 (submit/cleanup-xv-dispatch) Xext: xv: ProcDbeGetVisualInfo() collect payload in buffer before writing
The payload lengths is already known, so we can easily collect the data
in a stack buffer and only need one WriteToClient() operation.

This also clears the road for further simplification/unification of the
reply sending code, coming with follow-up commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 014954c3f7 (submit/cleanup-xv-dispatch) Xext: xv: ProcXvQueryAdaptors() use local stack buffer
Simplify sending by collecting in a local scoped buffer, so only one
WriteToClient() call is needed. This also makes further simplifications
by upcoming patches easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 10510cd528 (submit/cleanup-xv-dispatch) Xext: xv: simplify reply byte-swap
The way it's currently done, indirectly via macros calling dedicated
functions, is unnecessarily complicated. Simply inline it, just like
(almost) all the other extensions are doing it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 70f77c510a (submit/cleanup-vidmode-dispatch) Xext: vidmode: untwist ProcVidModeGetAllModeLines() and use stack buffer
The ProcVidModeGetAllModeLines() is a bit complicated, because reply structs
differ depending the active protocol version. In order to make it easier to
understand and allow further simplification of the request/reply marshalling
(see ticket #1701), splitting the two protocol versions into separate functions.

Also collecting the whole payload in a stack buffer (size is already known
anyways), in order to save arbirary number of individual WriteToClient() calls,
but send out the whole reply in one pass, which in turn allows further
simplifications in the sending path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult 0dd817f62c (submit/cleanup-vidmode-dispatch) Xext: vidmode: ProcVidModeGetMonitor(): write reply payload at once.
Collect up the puzzle piezes of the reply payload into to a temporary struct,
so we can send it as one block. This allows for further simplifications by
subsequent commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult cfa82b85b0 (submit/cleanup-vidmode-dispatch) Xext: vidmode: ProcVidModeGetMonitor() simplify swapping/writing
We can simply call SwapLongs() before writing out the CARD32 arrays.
No need using for complicated call back logic.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00
Enrico Weigelt, metux IT consult d93b4614f0 (submit/cleanup-vidmode-dispatch) Xext: vidmode: ProcVidModeModModeLine(): move len variable into branch scope
Semantically these are separate values in each branch any only used there,
so it's a bit more clean to move the declaration into the branches.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00