1467 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
8ea70e9e78 treewide: use use x_rpcbuf_wsize_units() instead of rpcbuf.wpos
In the request handlers, use x_rpcbuf_wsize_units() for payload length
computation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-19 15:50:54 +02:00
Enrico Weigelt, metux IT consult
bca6d2ddcd vidmode: ProcVidModeGetMonitor(): create reply struct right before send
Move the declaration of the reply struct down to after the payload has
been finally assembled, so we don't need extra payload size compuation
anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
4a57142388 vidmode: ProcVidModeGetDotClocks(): use x_rpcbuf_t for payload assembly
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
df98365a3c vidmode: ProcVidModeGetMonitor(): use x_rpcbuf_t for payload assembly
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
b33244566c vidmode: ProcVidModeGetAllModeLines(): drop length computation
Since the x_rpcbuf already knows how much had been written, there's no
need for extra payload size computation anymore - just pick the number
of written bytes from the x_rpcbuf.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
bf41f83c67 vidmode: fillModeInfoV*(): use x_rpcbuf_t for byte-swapping
use x_rpcbuf_t operations for constructing the reply payload, so we don't
need to do the byte-swapping explicitly anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
954c6e2c29 vidmode: fillModeInfoV*(): use x_rpcbuf_t
Second step of migrating ProcVidModeGetAllModeLines() to x_rpcbuf_t:
Let it's callees also use x_rpcbuf_t operations, instead of raw pointers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
c9bd4cc4df vidmode: ProcVidModeGetAllModeLines(): use x_rpcbuf_t
First step of migration to x_rpcbuf: create a buffer with enough room for
the already calculated payload size and pass the raw buffer pointer to
our callees as we used to do with the calloc()ed one.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
c10baabc89 xres: ProcXResQueryClients(): use x_rpcbuf_t
use x_rpcbuf_t for reply payload assembly and byte-swapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:27:15 +02:00
Enrico Weigelt, metux IT consult
29005e9873 shape: use X_SEND_REPLY_WITH_RPCBUF() macro
Use the new X_SEND_REPLY_WITH_RPCBUF() macro for final reply write out

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 11:16:23 +02:00
Enrico Weigelt, metux IT consult
d81cf93329 Xext: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
stefan11111
828135fd3e dix: Xext: replace bytes_to_int32(pad_to_int32(x)) with bytes_to_int32(x)
bytes_to_int32 already adds padding, no need to compute that too.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-14 12:55:00 +02:00
Enrico Weigelt, metux IT consult
02737a1cd4 panoramiX: XineramaGetImageData(): simplify the loop
take way the extra scope / indention on the `if (nbox)` statement and
use `continue` instead.

Hint: for easier review, one can use `git diff -w` in order to suppress
the indention-only changes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 12:12:33 +02:00
Enrico Weigelt, metux IT consult
03928dea4b panoramiX: don't use FOR_NSCREENS_FORWARD_SKIP() anymore
in preparation of upcoming new iterator macros, phase out
FOR_NSCREENS_FORWARD_SKIP, so we don't need an additional macro
for just the case where first screen is skipped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 12:10:27 +02:00
Enrico Weigelt, metux IT consult
69452c23ae panoramiX: XineramaGetImageData(): replace walk variable i by walkScreenIdx
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
e4081afa65 panoramiX: XineramaGetImageData(): add walkScreen temp variable
Instead of always accessing the global screens array, do it only once
and put it into a walk variable.

Also prepration for upcoming commits which are moving the looping logic
into a generic macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
be425a933c panoramiX: XineramaGetImageData(): scope scratchMem
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
1193e294e7 panoramiX: XineramaGetImageData(): scope sizeNeeded variable
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
03f3388745 panoramiX: XineramaGetImageData(): declarare and init depth in one shot
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
124dee2db0 panoramiX: XineramaGetImageData(): scope ScratchPitch variable
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
79b6f60277 panoramiX: XineramaGetImageData(): scope pBox
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
b9f76047fc panoramiX: XineramaGetImageData(): scope loop variables
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
5e68ea71f6 panoramiX: XineramaGetImageData(): scope temporary dimension variables
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
27f1fcef7f panoramiX: XineramaGetImageData(): scope split pDraw variable usage
Use a separate variable pWalkDraw for inside the loop, as it's got a
different purpose in here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
2f62e660ff panoramiX: XineramaGetImageData(): scope inOut variable
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
dee9b9a5be panoramix: XineramaGetImageData(): scope nbox
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
d9cf1a7a9d panoramiX: XineramaGetImageData(): scope ScreenRegion
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:57:23 +02:00
Enrico Weigelt, metux IT consult
34c3a9c7e2 treewide: fix serverGeneration int type mismatch
The global (exported) serverGeneration field is `unsigned long`, while
many other places copy it and compare it two other integer types, eg.
plain `int` (which is signed). Even if it's unlikely ever reaching such
high number of generations that it will ever make trouble, it's still
a good idea to clean this up and use the same type everywhere.

For clearity, introducing a typedef `x_server_generation_t` which is
used everywhere, instead of raw `unsigned long`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:52:03 +02:00
Enrico Weigelt, metux IT consult
05d88310bd namespace: fix naming in examples, errors and comments
At some places, there's still the word 'contianer' instead of 'namespace'

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:50:13 +02:00
Enrico Weigelt, metux IT consult
e98a3a5ff4 namespace: allow "namespace" config directive instead of "container"
The namespace config still has the "container" directive, which should have
been named "namespace". It's a leftover from the original working draft that
was named "container extension".

For the time being, keep backwards compatibility by allowing both tokens
"container" as well as "namespace" for the same directive. But consider the
old token as deprecated, it shouldn't be used anymore and might go away
in the near future.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-12 18:51:16 +02:00
Enrico Weigelt, metux IT consult
a18524fa5d Xext: shape: fix non-ximerama build
In the non-XINERAMA code path, a parameter was missing.

Fixes: a57db845bbc67a7fe3f90390365420692b16b1ab
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-12 11:10:53 +02:00
Enrico Weigelt, metux IT consult
0fb490d536 Xext: saver: drop duplicate ScreenPtr retrival in SendScreenSaverNotify()
If we've already got the ScreenPtr, there's no need to retrieve it again
via the screen number, which we're getting via the ScreenPtr that we've
already got.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 13:01:54 +02:00
Enrico Weigelt, metux IT consult
5c3ce08b0e Xext: xv: ProcXvListImageFormats(): use x_rpcbuf_t for payload size
Use the payload size from the rpcbuf, but also compare that with our
computation as sanity check and log error on mismatch.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
2d66d11caf Xext: xv: ProcXvListImageFormats(): use x_rpcbuf_t for reply payload assembly
Use x_rpcbuf_t for reply payload assembly and byte-swap.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
8272cc25ea Xext: xv: ProcXvQueryImageAttributes: use x_rpcbuf_t for payload
Use x_rpcbuf_t for payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
b3adbc30d3 Xext: xv: ProcXvQueryPortAttributes(): use payload size of rpcbuf
Instead doing an exrtra loop for our own calculation of the
payload size, just the wpos from rpcbuf.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
29963d878f Xext: xv: ProcXvQueryPortAttributes(): use x_rpcbuf_t for payload assembly
Using x_rpcbuf_t for assembling any byte-swapping the reply payload.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
7368f6f605 Xext: xv: ProcXvQueryPortAttributes(): simplify reply header assembly
In preparation for subsequent refactoring, assembling the reply header
at once, instead of doing it piece by pice.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
ab6c25cbdd Xext: xv: ProcXvQueryAdaptors(): drop extra length computation
The payload length is already known after writing everything to the
buffer, so no need for extra size computation anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
9c203cad57 Xext: xv: ProcXvQueryAdaptors(): linearize control flow
Preparation for subsequent changes: instead of returning early when no
payload to send, move that into a conditional block.
(the WriteRpcbufToClient() call on potentially empty buffer is intentional)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
c54f284f42 Xext: xv: ProcXvQueryAdaptors(): use rpcbuf for reply payload assembly
Collect reply payload in rpcbuf and finally write it out in one block.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
0d99fd2d1c Xext: xv: ProcXvQueryExtension() simplify reply header assembly
As a prepration for upcoming changes, move assembly of the the reply
header further downwards where all values are already known, so we'll
have to touch it only once. Also eliminate the separate write path for
the case where Xv is disabled.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
aef132f847 Xext: xv: ProcXvQueryEncodings(): declare variables where assigned first
For easier understanding the code, declare the variables right where
they're assigned first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
75f2b2334d Xext: xv: ProcXvQueryEncodings(): use payload length from rpcbuf
Skip the extra payload size calculation, use the rpcbuf's wpos instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
90a99141b5 Xext: xv: ProcXvQueryEncodings(): use x_rpcbuf_t for reply payload assembly
Simplify reply payload assembly via x_rpcbuf_t.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-08 13:23:18 +02:00
Enrico Weigelt, metux IT consult
e0748cf74e panoramiX: PanoramiXGetImage(): move down reply struct
Move down reply struct declaration/assignment and byte-swapping to
right before the write-out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 16:49:20 +02:00
Enrico Weigelt, metux IT consult
475d53fb58 panoramix: clean up PanoramiXTranslateCoords() variable declarations
* declare and assign in one shot
* move down reply struct declaration to where it's needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 16:49:20 +02:00
Enrico Weigelt, metux IT consult
aaea461c6f panoramiX: clean up reply struct definitions
* declare and assign them right where they're needed, in one shot
* drop unnecessary assignment and byte-swap of zero values

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 16:49:20 +02:00
Enrico Weigelt, metux IT consult
8a23c1984b Xext: xv: fix redefinition of typedef 'XvPortNotifyPtr'
In file included from ../Xext/xvmc.c:14:
  ../Xext/xvdix_priv.h:31:21: warning: redefinition of typedef 'XvPortNotifyPtr' is a C11 feature [-Wtypedef-redefinition]
     31 | } XvPortNotifyRec, *XvPortNotifyPtr;
        |                     ^
  ../Xext/xvdix.h:73:34: note: previous definition is here
     73 | typedef struct _XvPortNotifyRec *XvPortNotifyPtr;
        |                                  ^
  1 warning generated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 17:12:55 +02:00
Enrico Weigelt, metux IT consult
ffc80b227a Xnamespace: fix wrong const char* authProto
The authProto field always is assigned to dynamically allocated buffer
(strdup()'ed) and needs to be freed sometimes, so cannot be const.

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