Commit Graph

21322 Commits

Author SHA1 Message Date
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
96129e44bd xkb: ProcXkbGetMap(): use WriteRpcbufToClient()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:26:42 +02:00
Enrico Weigelt, metux IT consult
723f6a55a8 xkb: fix swapping bug in ProcXkbGetKbdByName()
We've been adding the individual sub-packet's payload bytes *after*
the swapping, which is leading to totally wrong sizes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:26:18 +02:00
Enrico Weigelt, metux IT consult
60b28c2568 os: osdep: small helper for safe strlen()
Adding helper safe_strlen() that's also checking for NULL pointer
and returning 0 in this case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 16:15:41 +02:00
Enrico Weigelt, metux IT consult
1d93fbc68e randr: 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
5842bd9c86 dbe: 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
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
0b7194c9bc dix: add X_SEND_REPLY_WITH_RPCBUF() macro
This macro is sending a reply header struct and rpcbuf payload
all in one shot. It also automatically computes the payload lengths
as well as also filling common fields like `type` and `sequenceNumber`

A typical call site looks like this:

>    int ProcFooRequest(ClientPtr client) {
>
>        [ ... ]
>
>        X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
>        return Success;
>    }

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 11:16:23 +02:00
Enrico Weigelt, metux IT consult
3e76baff89 xwin: 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
Enrico Weigelt, metux IT consult
5823fc2b7f xquartz: 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
Enrico Weigelt, metux IT consult
5bde454490 xnest: 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
Enrico Weigelt, metux IT consult
c77d47a3ac xfree86: 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
Enrico Weigelt, metux IT consult
97d72431cf kdrive: 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
Enrico Weigelt, metux IT consult
f2c28743a4 present: 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
Enrico Weigelt, metux IT consult
fb2c085de0 miext: 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
Enrico Weigelt, metux IT consult
6c25d52276 randr: 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
Enrico Weigelt, metux IT consult
17bf4e677e mi: 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
Enrico Weigelt, metux IT consult
6730e673d6 Xi: 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
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
Enrico Weigelt, metux IT consult
e29c0454ce render: 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
Enrico Weigelt, metux IT consult
44ae54e3c6 xfixes: 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
Enrico Weigelt, metux IT consult
d8149d9c9e glx: 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
Enrico Weigelt, metux IT consult
8f39f58f51 dri3: 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
Enrico Weigelt, metux IT consult
840109488a dbe: 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
Enrico Weigelt, metux IT consult
4bb89cdcdf damageext: 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
Enrico Weigelt, metux IT consult
a49f0fd9b2 composite: 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
Enrico Weigelt, metux IT consult
361b576c48 dix: 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
Enrico Weigelt, metux IT consult
fd3eaf69a1 .github: notify on merge conflicts in PRs
Add a pipeline that's checking for and notifying on merge conflicts
within open pull requests. It's triggered whenever one of the baseline
branches (eg. master, maint-*, etc) are pushed.

Unfortunately, we don't have any way for rate limiting within a single
PR yet, so on a day with lots of merges, it could become a bit spammy.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:51:09 +02:00
Enrico Weigelt, metux IT consult
2fddefcf8c dix: use x_rpcbuf_t in ProcListProperties()
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 19:52:07 +02:00
Enrico Weigelt, metux IT consult
5d8f149a57 dix: fix memory clearing in dix_main()
Clearing of screens and gpuscreens pointer list on teardown has been wrong.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 14:27:39 +02:00
Enrico Weigelt, metux IT consult
91bc0ff6b2 dix: use x_rpcbuf_t in ProcGetKeyboardMapping()
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 13:34:26 +02:00
Enrico Weigelt, metux IT consult
eb04c7a1b3 dix: use x_rpcbuf_t in ProcQueryTree()
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 12:58:06 +02:00
Enrico Weigelt, metux IT consult
e93dd75dd8 dix: fix int type mismatch on CURSOR_REC_SIZE and CURSOR_BITS_SIZE
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 12:55:40 +02:00
Enrico Weigelt, metux IT consult
aac7a9330a dix: use x_rpcbuf_t in ProcGetProperty()
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 00:04:10 +02:00
Enrico Weigelt, metux IT consult
8a2dfa1aba dix: macro for computing extra units needed for reply header
Add macro X_REPLY_HEADER_UNITS() for computing how many extra
protocol units are needed for a reply header (for .length field)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 19:17:39 +02:00
Enrico Weigelt, metux IT consult
a95ae61658 dix: rpcbuf: add rpcbuf_write_INT16()
Just a convenience wrapper for writing an INT16.
Technically it's really the same as CARD16, but we still need a typecast
in order to not getting a compiler warning on int signedness mismatch.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 19:00:45 +02:00
Enrico Weigelt, metux IT consult
9b6ff22f1d randr: fix size parameter to WriteToClient()
Size computation needs to be done on the struct actually written.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 16:53:10 +02:00
Enrico Weigelt, metux IT consult
6d6f64da55 Xi: fix size parameter to WriteToClient()
Size computation needs to be done on the struct actually written.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 16:52:47 +02:00
Enrico Weigelt, metux IT consult
4454a26545 randr: use x_rpcbuf_t in ProcRRGetProviderProperty()
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 14:19: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
e62e88fd8b xkb: fix padding in XkbWriteModifierMap()
Fixes: 18fe21fe0e
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 12:44:26 +02:00
Enrico Weigelt, metux IT consult
e07a939765 dix: rpcbuf: add x_rpcbuf_pad() for padding the buffer
New function for padding the buffer to full protocol units granularity:
If the current write position isn't at 4-byte granularity, it reserves
the remaining number of bytes (ie. writing zeros), in order to make the
next write align to 4-byte granularity again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 12:44:26 +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