Commit Graph

1287 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
a18524fa5d Xext: shape: fix non-ximerama build
In the non-XINERAMA code path, a parameter was missing.

Fixes: a57db845bb
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
Enrico Weigelt, metux IT consult
bbabd96e6c meson: rename symbol MITSHM to CONFIG_MITSHM
some bit better naming for config symbols.
Yet leaving the old one defined, until all drivers have kept up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:39:28 +02:00
Enrico Weigelt, metux IT consult
34039b29c6 Xext: xf86bigfont: clean up ifdef zoo on MITSHM
Clean up the ifdef zoo a bit and also add markers on the endif.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:39:28 +02:00
Enrico Weigelt, metux IT consult
2713d7e818 Xnamespace: fix possible memleak
In an OOM error path, we've forgotten an free() call.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:21:10 +02:00
Enrico Weigelt, metux IT consult
f1eed8bc90 Xext: use x_rpcbuf_t instead of struct x_rpcbuf
For consistency, always use the typedef instead of raw struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 17:01:24 +02:00
Enrico Weigelt, metux IT consult
510464d343 Xext: sync: clean up reply struct declarations
Declare them where needed and drop null-initialized fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 16:59:06 +02:00
Enrico Weigelt, metux IT consult
0023226f3b Xext: sync: drop unneeded include of <sys/time.h>
We neither need to guard including <sys/time.h> from mingw, nor do we
need that include here at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-01 13:28:17 +02:00
Enrico Weigelt, metux IT consult
c8c52387c5 xv: inline SWriteListImageFormatsReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvListImageFormats ().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
a3de7f5c57 xv: inline SWriteQueryImageAttributesReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryImageAttributes().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
9f5b2597e0 xv: inline SWriteQueryPortAttributesReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryPortAttributes().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
199e049b95 xv: inline SWriteQueryBestSizeReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryBestSize().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
c744d17e69 xv: inline SWriteGetPortAttributeReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvGetPortAttribute().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
71713fbf50 xv: inline SWriteGrabPortReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvGrabPort().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
25565daa42 xv: inline SWriteImageFormatInfo()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvListImageFormats().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
26b0ad79ed xv: inline SWriteAttributeInfo()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryPortAttributes().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
08d44466a8 xv: inline SWriteFormat()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryAdaptors().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
1adc19e10c xv: inline SWriteEncodingInfo()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryEncodings().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
73ca100659 xv: inline SWriteAdaptorInfo()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryAdaptors().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
3bd75a2fd6 xv: inline SWriteQueryEncodingsReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryEncodings().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
ef8cf84e6d xv: inline SWriteQueryAdaptorsReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryExtension().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
875c29c253 xv: inline SWriteQueryExtensionReply()
Instead of complex macro machinery, just move the conditional swapping
directly into ProcXvQueryExtension().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 16:57:26 +02:00
Enrico Weigelt, metux IT consult
4a073eb318 panoramix: add static protocol struct size asserts
Add compile-time checks on whether sizeof(foo) == SIZEOF(foo),
using new static assert macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:50:21 +02:00
Enrico Weigelt, metux IT consult
237e5f5e1e Xnamespace: fix printf patterns
For printing 32bit integers, we need to use PR*32 macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-31 15:23:05 +02:00
Enrico Weigelt, metux IT consult
5c3790511c Xext: ggext: 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>
2025-07-29 11:45:53 +02:00
Enrico Weigelt, metux IT consult
dcf7890076 Xace: always build xace
Xace callbacks are needed in many places, and the their overhead (when not
actually used) is really minimal. So it doesn't make much sense having
extra complexity for disabling it at build time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-24 10:49:54 +02:00
Enrico Weigelt, metux IT consult
0580a054a4 Xace: drop XaceGetConnectionNumber()
It's just a wrapper around GetClientFd() - we can use this one directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-24 10:49:54 +02:00
Enrico Weigelt, metux IT consult
da58522087 Xace: drop XaceIsLocal()
Just a dumb wrapper to ClientIsLocal() - we can use this one directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-24 10:49:54 +02:00
Enrico Weigelt, metux IT consult
d74767107d panoramiX: PanoramiXGetImage(): write out payload in one block
Collect payload pieces into x_rpcbuf, so it can be written out once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 19:51:24 +02:00
Enrico Weigelt, metux IT consult
81a79e9f8b panoramiX: ProcXineramaQueryScreens(): write out payload in one block
Collect payload pieces into x_rpcbuf, so it can be written out once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 19:51:24 +02:00
Enrico Weigelt, metux IT consult
093286b434 xcmisc: drop SProcXCMiscDispatch()
It's now doing exactly the same as ProcXCMiscDispatch(), so it's not
actually needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 18:37:52 +02:00
Enrico Weigelt, metux IT consult
f1263be6b7 xcmisc: consolidate (S)ProcXCMiscGetXIDList()
Move conditional swapping of request fields into main request handler,
no extra swapped handler needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 18:37:52 +02:00