Commit Graph

432 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
70428787cd render: consolidate byte-swapping in ProcRenderCreateCursor()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:36:18 +02:00
Enrico Weigelt, metux IT consult
24885d9019 render: consolidate byte-swapping in ProcRenderCreateGlyphSet()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:36:06 +02:00
Enrico Weigelt, metux IT consult
fd4f402d12 render: consolidate byte-swapping in ProcRenderQueryPictIndexValues()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:35:51 +02:00
Enrico Weigelt, metux IT consult
f503962970 render: consolidate duplicate Proc* functions
dropping lots of duplicate functions which are doing the same like others.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 15:30:07 +02:00
Enrico Weigelt, metux IT consult
b0ffa7b286 treewide: rename dixGetFirstScreenPtr() to dixGetMasterScreen() for correct semantics
In Xinerama/Panoramix configuration there's one screen that's having special
meaning - it's used for simulating as the frontend for all client operations:
the clients (should) only talk to that screen, while panoramix subsystem is
proxying those operations to all the other screens (with certain changed
applied, eg. coordinate transformations).

Historically, this screen happens to be the first one in the system (some of
it's proc's are hooked up in order to achieve desired behaviour). That's why it
used to be accessed via screenInfo.screens[0] - that already had been encapsulated
into a tiny helper `dixGetFirstScreen()`.

a) the correct terminus technicus for a situation where one device (or SW entity)
   entirely controlling others is a master-slave-relationship: the controlling
   device/entity is `master`, the controlled ones are `slave` (to that specific
   master).

b) the term "first screen" is inacurate and misleading here: what the caller's are
   actually interest in isn't the first entry in the screen array, but the screen
   that's controlling the others. With upcoming refactoring of the Xinerama/Panoramix
   subsystem, this might well be a different array index than 0.

c) the term `default` also wouldn't match: `default` implies there's a real practical
   choice, and such value applies when no explicit choice has been made. But in this
   case, it practically doesn't make sense (except perhaps for debugging purpose)
   for a client to use any different screen.

Therefore fixing the function name to the correct technical terminology.
(for sake of patch readability, renaming corresponding variables is left to
subsequent patches).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 11:44:05 +02:00
Enrico Weigelt, metux IT consult
24d15f9b7b render: consolidate byte-swapping in ProcRenderQueryVersion()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 09:39:53 +02:00
Enrico Weigelt, metux IT consult
6bc438ab5a treewide: use inline helper for accessing first screen
Instead of everybody directly accessing the (internal) screenInfo struct,
let those consumers only interested in first screen use a little helper.

Also caching the value if it's needed several times.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:45:05 +02:00
Enrico Weigelt, metux IT consult
9c6577cfcc render: drop obsolete SProc*()'s
Several of the SProcRender*() functions aren't actually needed, because
they're doing exactly the same as their ProcRender*() counterparts.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:39:42 +02:00
Enrico Weigelt, metux IT consult
87fc0a2521 render: let SProcRender*()'s directly call corresponding ProcRender*()'s.
Since Xinerama stuff doesn't tweak the call tables anymore, there's no need
to use them anymore - instead call the corresponding handlers directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:39:42 +02:00
Enrico Weigelt, metux IT consult
e4aae06a2d render: untwist xinerama part I
In order to consolidate protocol parsing (eg. byte-swapping) and dispatch
(eg. getting rid of the ugly call tables), we first need to untwist the
horribly complicated Xinerama machinery: it's using call tables which are
dynamically tweaked (when Xinerama is switched on/off), and even more call
tables for the byte-swap functions.

Simplifying the code flow by adding trivial demux handlers, which are calling
either into classic/single-mode or xinerama handlers, depending on whether
Xinerama is active.

Follow-up commits can now move the byte-wapping into here and drop the call tables.
After that, the currently duplicated parsing can also be moved in here, and
finally split off the classic/single-mode functions into protocol handling vs.
business logic, so we can finally stop faking requests from Xinerama side into
the classic handlers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:39:23 +02:00
Enrico Weigelt, metux IT consult
eb17b34362 Xinerama: lambda-esque macro for walking Xinerama screens
Move the walking loops on Xinerama screens into lambda-esque macros:
the callers look quite like we've been using lambda functions and
closures, but actually are just fancy macro trickery.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-09 14:12:40 +02:00
Enrico Weigelt, metux IT consult
bdaa1f7a69 render: untwist Xinerama - call orig functions directly
When a xinerama-enabled handler is calling into the plain one, there's
no need to go through extra call table - we can call them directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-08 09:56:51 +02:00
Enrico Weigelt, metux IT consult
ef46dec08d render: ProcRenderAddGlyphs(): move locally used variables into local scope
make the variable's it easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-05 08:49:15 +02:00
Enrico Weigelt, metux IT consult
21976fe20d render: SetPictureFilter() declare and assign pScreenFilter in one shot
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-04 11:06:57 +02:00
Enrico Weigelt, metux IT consult
fe9fcfe98f render: ProcRenderQueryPictFormats(): 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:41 +02:00
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
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
6e2d5d3ddf render: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 14:26:59 +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
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
dbe4339fd7 treewide: replace PICT_a4b4g4r4 by PIXMAN_a4b4g4r4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
5d96eba31b treewide: replace PICT_x4b4g4r4 by PIXMAN_x4b4g4r4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
c2a4f0033c treewide: replace PICT_a4r4g4b4 by PIXMAN_a4r4g4b4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
4295cf6817 treewide: replace PICT_x4r4g4b4 by PIXMAN_x4r4g4b4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
840a4ceabe treewide: replace PICT_a1r5g5b5 by PIXMAN_a1r5g5b5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
889ded74be treewide: replace PICT_a1b5g5r5 by PIXMAN_a1b5g5r5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
a23fdf9d2f treewide: replace PICT_x1b5g5r5 by PIXMAN_x1b5g5r5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
19df33aa7a treewide: replace PICT_b5g6r5 by PIXMAN_b5g6r5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
cadf94d6c8 treewide: replace PICT_a2b10g10r10 by PIXMAN_a2b10g10r10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
1687c9a20f treewide: replace PICT_a2r10g10b10 by PIXMAN_a2r10g10b10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
fea686a1fc treewide: replace PICT_x8b8g8r8 by PIXMAN_x8b8g8r8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
522a2d4280 treewide: replace PICT_x2r10g10b10 by PIXMAN_x2r10g10b10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
aba79cbfca treewide: replace PICT_x2b10g10r10 by PIXMAN_x2b10g10r10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
8cb07602ff treewide: replace PICT_x1r5g5b5 by PIXMAN_x1r5g5b5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
c113bc77ae treewide: replace PICT_a1 by PIXMAN_a1
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
b736739892 treewide: replace PICT_r5g6b5 by PIXMAN_r5g6b5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
3786a77ed3 treewide: replace PICT_b8g8r8x8 by PIXMAN_b8g8r8x8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
7939ec278d treewide: replace PICT_b8g8r8a8 by PIXMAN_b8g8r8a8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
314540a597 treewide: replace PICT_x8r8g8b8 by PIXMAN_x8r8g8b8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
35a43252ca treewide: replace PICT_a8r8g8b8 by PIXMAN_a8r8g8b8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
cd4e80da8d treewide: replace PICT_TYPE_OTHER by PIXMAN_TYPE_OTHER
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
6948c15499 treewide: replace PICT_TYPE_GRAY by PIXMAN_TYPE_GRAY
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
d8a06a2f9f treewide: replace PICT_TYPE_COLOR by PIXMAN_TYPE_COLOR
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
9f4391203f treewide: replace PICT_TYPE_A by PIXMAN_TYPE_A
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
71e2b20fe0 treewide: replace PICT_TYPE_BGRA by PIXMAN_TYPE_BGRA
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
ba06904f10 treewide: replace PICT_TYPE_ABGR by PIXMAN_TYPE_ABGR
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
900c893246 treewide: replace PICT_TYPE_ARGB by PIXMAN_TYPE_ARGB
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00