Commit Graph

21535 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
60dc405def render: ProcRenderQueryPictFormats(): scope pFormat variable
instead of reusing one variable for different things, put it into local
scopes, so things can't ever get mixed up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:33:41 +02:00
Enrico Weigelt, metux IT consult
8237dacffe render: ProcRenderQueryPictFormats(): don't re-use counter variables
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:33:41 +02:00
Enrico Weigelt, metux IT consult
638822b19e render: canonical walkScreenIdx variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreenIdx` for holding current screen index everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:33:29 +02:00
Enrico Weigelt, metux IT consult
31e7112138 randr: canonical walkScreenIdx variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreenIdx` for holding current screen index everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:33:18 +02:00
Enrico Weigelt, metux IT consult
3be2aeba4a pseudoramiX: use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:33:07 +02:00
Enrico Weigelt, metux IT consult
99a776119c present: canonical walkScreenIdx variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreenIdx` for holding current screen index everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:32:55 +02:00
Enrico Weigelt, metux IT consult
44228d264a glx: replace __GLX_SWAP_SHORT() by swaps()
We have an optimized function for this, so use it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:32:38 +02:00
Enrico Weigelt, metux IT consult
cca0a47af7 dri3: proc_dri3_buffers_from_pixmap(): use x_rpcbuf_t
Use x_rpcbuf_t for payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:31:56 +02:00
Enrico Weigelt, metux IT consult
065f8d4d75 dix: unexport internal QueryFont() function
This function is internal to DIX (used for assembling XQueryFont replies
and not used by any drivers (not even proprietary NVidia), and really
shouldn't ever called by them at all. It's been one the many victims of a
really unthoughtful mass export back 17 years ago.

That'S a necessary step for refactoring the RPC reply mechanics.

Since it's never used by any driver at all, we can easily to this change
within the current ABI level.

Fixes: d6cbd4511e
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:31:44 +02:00
Enrico Weigelt, metux IT consult
2aec9a0b73 dix: rpcbuf: add x_rpcbuf_write_CARD64() and x_rpcbuf_write_CARD64s()
Add functions for writing (and byte-swapping) CARD64 values.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:31:30 +02:00
Enrico Weigelt, metux IT consult
7655ee2631 dix: drop unused CopySwap32Write()
Not used anywhere, neither exported, so no need to keep it
around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:29:35 +02:00
Enrico Weigelt, metux IT consult
3107056193 dix: doListFontsWithInfo(): inline SwapFonts() call
As preparation for moving doListFontsWithInfo() (and it's callers) to
x_rpcbuf_t, inline the SwapFonts() call into the caller function.

SwapFonts() has several problems, eg. directly operating on a buffer that's
holding xQueryFontReply struct (which isn't the correct one, just happens to
match) as well as the whole payload.

We first need to get them out of the way, before we can split off the reply
into the (statically declared) header struct and the (x_rpcbuf_t-filled)
payload.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:29:17 +02:00
Enrico Weigelt, metux IT consult
4ca0274f3e dix: cursor: NULL check in ScreenRec->UnrealizeCursor calls
just for being cautious.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:28:58 +02:00
Enrico Weigelt, metux IT consult
8c8cbdd236 dbe: locally scope variables and declare when needed
Use locally scoped variables where possible, and declare variables
where they're needed - instead of all on the top of functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:27:30 +02:00
Enrico Weigelt, metux IT consult
fb07c595b4 damageext: canonical walkScreenIdx variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreenIdx` for holding current screen index everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:27:09 +02:00
Enrico Weigelt, metux IT consult
dcb5bb08ca composite: canonical walkScreenIdx variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreenIdx` for holding current screen index everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 09:26:47 +02:00
Enrico Weigelt, metux IT consult
b4ff756a48 dri3: replace tabs by spaces
Trivial tiny formatting cleanup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 17:33:35 +02:00
Enrico Weigelt, metux IT consult
aa4fb3584c .github: tidy-up-auto: keep less minimum runs
reduce the number of minimum runs to be left to 2.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 15:03:23 +02:00
Enrico Weigelt, metux IT consult
17827b4667 .github: ubuntu: drop xtrans dependency
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 13:33:36 +02:00
Enrico Weigelt, metux IT consult
015fd1c4ee xquartz: dri: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:51:58 +02:00
Enrico Weigelt, metux IT consult
7dcd9c7b1e xkb: xkbEvents: use static struct initialization
Instead of memset()ing all the structs and then assigning (overwriting)
invidual fields one by one, use static init and let the compiler find out
on its own how to do it the best way.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:51:43 +02:00
Enrico Weigelt, metux IT consult
a389034c2d xfree86: dga: ProcXDGAOpenFramebuffer() use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:49:29 +02:00
Enrico Weigelt, metux IT consult
f8ad69698a treewide return code of X_SEND_REPLY_WITH_RPCBUF()
The macro will automatically return BadAlloc if the buffer is broken,
otherwise Success. Thus, we don't need extra prior rpcbuf check.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:48:50 +02:00
Enrico Weigelt, metux IT consult
56cd66d147 render: ProcRenderQueryPictIndexValues(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:09:32 +02:00
Enrico Weigelt, metux IT consult
81f93d19a0 render: ProcRenderQueryFilters(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:08:32 +02:00
Enrico Weigelt, metux IT consult
26a1e5f709 randr: rrGetScreenResources(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:07:43 +02:00
Enrico Weigelt, metux IT consult
cbc4e91f02 randr: rrGetMultiScreenResources(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:07:28 +02:00
Enrico Weigelt, metux IT consult
e9f9391b1d randr: ProcRRXineramaIsActive(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:07:17 +02:00
Enrico Weigelt, metux IT consult
25e71fcb2a randr: ProcRRQueryProviderProperty(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:07:06 +02:00
Enrico Weigelt, metux IT consult
41506c8fae randr: ProcRRListProviderProperties(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:06:54 +02:00
Enrico Weigelt, metux IT consult
86755b09be randr: ProcRRGetScreenInfo(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:06:41 +02:00
Enrico Weigelt, metux IT consult
d0e24582a0 randr: ProcRRGetProviders(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:06:27 +02:00
Enrico Weigelt, metux IT consult
36ef6a448b randr: ProcRRGetProviderInfo(): use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:06:05 +02:00
Enrico Weigelt, metux IT consult
9f8a9f4f8c xfree86: dga: use X_SEND_REPLY_SIMPLE() for simple replies
Use the X_SEND_REPLY_SIMPLE() macro for simple replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 16:56:57 +02:00
Enrico Weigelt, metux IT consult
ea3ef55be1 dix: dixfonts: doListFontsWithInfo(): use X_SEND_REPLY_SIMPLE()
Use X_SEND_REPLY_SIMPLE() for writing out the trivial empty reply.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 15:28:05 +02:00
Enrico Weigelt, metux IT consult
46b4154517 dix: dixfonts: doListFontsAndAliases(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and send it out via
X_SEND_REPLY_WITH_RPCBUF() macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 15:27:41 +02:00
Enrico Weigelt, metux IT consult
d04c60276a dix: devices: ProcGetMotionEvents(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 15:27:21 +02:00
Enrico Weigelt, metux IT consult
48cb1118ee treewide: drop unnecessary pixmap field initialization
The PixmapRec is already calloc()'ed, so no need for additional zero-writes
into individual fields. This also removes some unncessary #ifdefs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 13:31:52 +02:00
Enrico Weigelt, metux IT consult
89b900063e xfree86: DGA: remove obsolete comment
Forgotten to remove an obsolete comment when ancient DGA-1.0 was removed.

Fixes: 4615067264
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 12:49:54 +02:00
Enrico Weigelt, metux IT consult
fbc8463e84 os: xtrans: silence printf format warning on prmsg() call
size_t is unsigned, but might have different sizes depending on CPU arch,
so casting it to unsigned long, so we can safely use %ld.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 11:43:45 +02:00
Enrico Weigelt, metux IT consult
4615067264 xfree86: dga: drop support for old DGA 1.0 protocol
This is a relic from the 90s, giving really unsafe direct framebuffer
acccess. The very few known clients ever using this already been ported
to DGA 2.0 decades ago. The code is heavily tied to 32 bit architectures
anyways, so unlikely to even work on non-acient hardware.

So, without any clients left, there's no need to keep, let alone (try to)
repair that old cruft.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 11:13:48 +02:00
stefan11111
d806890aae Xext: fix comments when assembling xXF86VidModeModeInfo reply
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-01 11:13:13 +02:00
Enrico Weigelt, metux IT consult
2044c1506a xwin: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 10:53:11 +02:00
Enrico Weigelt, metux IT consult
065efcb5d9 Xext: xres: use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 16:11:06 +02:00
Enrico Weigelt, metux IT consult
34a27eacce Xi: ProcXIQueryPointer(): use x_rpcbuf_t
use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 16:10:06 +02:00
Enrico Weigelt, metux IT consult
6efd1a85e8 Xi: ProcXIAllowEvents(): untwist request header handling
The Xi protocol has some pretty unclean design aspect: instead of adding a
new sub-request type, version 2.2 introduced a different request structure
with some extra fields. So depending on which version the client has selected,
we need to operate on separate structs.

In the current implementation, there's a unclean hack by using the extended
structure and only accessing the extra fields when using v2.2 or above.
Even though this works, it's making the code unnecessarily complicated and
blocking the use if canonical request parsing macros (which are coming with
subsequent commits).

Thus, it's time to clean it up and only use the exactly correct structs
in the two different cases. The trick is just branching by version and pick
out the the interesting values from the corresponding structs, so they can
later be used in the (mostly) version independent part.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 16:09:10 +02:00
Enrico Weigelt, metux IT consult
8c90875c3d Xi: ProcXListInputDevices(): use x_rpcbuf_t
use x_rpcbuf_t for reply payload assembly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 16:04:18 +02:00
Enrico Weigelt, metux IT consult
6ba9edc2b8 Xext: selinux: use x_rpcbuf_t for reply assembly
Use x_rpcbuf_t and associated macros for assembling and sending replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 16:03:17 +02:00
Enrico Weigelt, metux IT consult
ae4912f837 dix: drop obsolete Swap32Write()
Not used anywhere, neither exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 15:55:40 +02:00
Enrico Weigelt, metux IT consult
c9ac063793 os: xtrans: rename Writev() methods to Write()
The Writev() methods essentially became Write() now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 15:51:33 +02:00