Commit Graph

1258 Commits

Author SHA1 Message Date
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
Enrico Weigelt, metux IT consult
8ec51b64e8 xcmisc: consolidate (S)ProcXCMiscGetVersion()
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
Enrico Weigelt, metux IT consult
f50b238fe1 xcmisc: ProcXCMiscGetXIDList(): declare variables where used first
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 18:37:52 +02:00
Enrico Weigelt, metux IT consult
f8fd9f7287 xcmisc: ProcXCMiscGetXIDRange(): declare variables where used
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 18:37:52 +02:00
Enrico Weigelt, metux IT consult
7539bdb829 xcmisc: ProcXCMiscGetXIDList(): use x_rpcbuf for payload assembly
Use x_rpcbuf for reply payload assembly, instead of pre-counting and
pre-allocating buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 18:37:52 +02:00
Enrico Weigelt, metux IT consult
75a6b756f1 Xext: shape: ProcShapeQueryExtents(): consolidate reply struct assembly
Consolidate reply struct assembly into one big struct initializer,
no more later assignments. Preparation for more upcoming consolidations
via generic macros for simple byteswapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 16:43:01 +02:00
Enrico Weigelt, metux IT consult
1ddfce3ae6 Xext: shape: ProcShapeQueryExtents(): scope and separate variables
declare variables right where they're needed, don't reuse variables
for several things and scope only short-lived ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 16:43:01 +02:00
Enrico Weigelt, metux IT consult
ac319a136b Xext: shape: ProcShapeGetRectangles(): use x_rpcbuf_t
Use x_rpcbuf_t for assembling reply payload and byte-swapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 16:43:01 +02:00
Enrico Weigelt, metux IT consult
b847ecb9a3 Xext: shape: consolidate reply struct declarations
a) always declare and initialize in one step
b) drop unncessary zero-values

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 16:43:01 +02:00
Enrico Weigelt, metux IT consult
ef420e43be Xext: use dixAddAtom()
Use the new helper for creating atoms on demand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 12:24:27 +02:00
Enrico Weigelt, metux IT consult
e3547224a8 Xext: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
89f22ea07e bigreq: declare reply struct where needed
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:31 +02:00
Enrico Weigelt, metux IT consult
030745a0e7 dix: move inpututils.h and rename it to inpututil_privs.h
it's a private header, thus should not be in public include directory.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
352fb8ad85 vidmode: fix ProcVidModeGetDotClocks() reply size computation
A clock entry is 32 bits instead of 8 bits long.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 01:59:17 +02:00
Enrico Weigelt, metux IT consult
d338bf6e68 namespace: drop unused winIsRoot()
Not used in this file, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:11:54 +02:00
dasha_uwu
7c64a06ba4 treewide: remove "lib" prefix in static_library names (meson)
this was producing static libraries named "liblibsomething.a"

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-07-03 12:01:52 +02:00
Enrico Weigelt, metux IT consult
a4c3c9da4d xf86bigfont: fix compiler warning on unused variable
> ../Xext/xf86bigfont.c: In function ‘SProcXF86BigfontQueryVersion’:
> ../include/dix.h:65:12: warning: unused variable ‘stuff’ [-Wunused-variable]
>   65 |     type * stuff = (type *)client->requestBuffer;

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:01:07 +02:00
Tautvis
6c2f17a5e0 xf86vidmode: fix result copying in ProcVidModeGetMonitor()
The monitor values (vendor and model) accidentally had been copied
at the start of the payload, instead of being appended after the
previously copied data, and also moving the wrong pointer, thus
corrupting the reply and causing some clients to hang.

Signed-off-by: Tautvis <gtautvis@gmail.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 15:58:44 +02:00
notbabaisyou
8f50b8cc19 Xext: Fix typo in xace.h
`modsetting` -> `modesetting`

Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
2025-06-27 17:10:33 +02:00
Mike Gelfand
b5d569a884 xext: add/fix include guards where missing/broken
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
dec05eba
4267785e6f xres: fix XResQueryClientIds always returning 0 clients
XaceHookClientAccess added in 098008879b
has incorrect condition in ConstructClientIds.

This fixes #182

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-19 11:29:24 +02:00
dasha_uwu
8ebab6ca3e panoramix: export PanoramiXTranslateVisualID for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu
a776156b54 treewide: preemptively revert !1714 where it affects ABI compatibility
this adds dummy pointers in place of removed fields in some structs, only for
SDK headers, to preserve ABI
some of these fix segfaults for nvidia driver, some are preemptive

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu
e73bb5d01b geext: export GERegisterExtension for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dec05eba
f397039d65 xres/xkb/xvmc/modesetting: Fix incorrect pointer data size usage
* xled change tested with `xset led named "Scroll Lock"`
* modesetting change tested with `xrandr --output DP-1 --gamma 0.5:0.5:0.5`.
  Without this fix that command does nothing
* xvmc change tested with `mpv --vo=xv video.mp4`

Of the currently reported issues this fixes #104

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 13:01:24 +02:00
Enrico Weigelt, metux IT consult
5fbb2ae1df Xext: xf86bigfont: fix FTBS on wrong packet length variable.
The `buflength` variable doesn't exist anymore, it's `rlength`.
And even if the reply struct might have the same size as XGenericReply,
it's cleaner to let the compiler compute it explicitly, just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult
c76f0d1d96 Xext: xf86bigfont: fix typo in ProcXF86BigfontQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult
9d7b9691b0 Xext: xf86bigfont: fix missing includes
It seems xf86bigfont hasn't been compile-tested for long time,
some includes were missing.

Note that fontstruct.h needs to come before libxfont2.h, because X11
headers tend to be not self-consistent :(

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult
7f49d4644f panoramix: export XRC_DRAWABLE for Nvidia legacy
Yet another temporary re-export for Nvidia's proprietary driver.
This symbol really shouldn't be used at all by drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult
a353ffddd0 Xnamespace: add support for multiple auth tokens per namespace
Support having more than one auth token per namespace, so separate tokens
can be handed out to clients that are still landing in the same namespace.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00