Commit Graph

21657 Commits

Author SHA1 Message Date
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
358f76f2ad treewide: fix misleading firstScreen variable naming to masterScreen
Follow-up on renaming dixGetFirstScreenPtr() to dixGetMasterScreen():
also rename the target variables for correct technical terminology.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 11:44:05 +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
f419bd3ac3 Xext: xtest: inline SProc*()'s
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 10:01:37 +02:00
Enrico Weigelt, metux IT consult
9705a5d7af xf86bigfont: security: inline SProc*()'s
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 10:01:24 +02:00
Enrico Weigelt, metux IT consult
6627ca7a6e Xext: damage: inline SProc*()'s
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 10:01:11 +02:00
Enrico Weigelt, metux IT consult
79841c8293 dix: XineramaSetCursorPosition() declare and initialize variable in one shot
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 09:51:50 +02:00
Enrico Weigelt, metux IT consult
a6854775b5 composite: ProcCompositeGetOverlayWindow(): declare cs when needed
it's cleaner to declare variables where they're assigned first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 09:51:34 +02:00
Enrico Weigelt, metux IT consult
e16c608d73 xfree86: dri2: ProcDRI2Connect(): 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-12 09:51:23 +02:00
Enrico Weigelt, metux IT consult
dd20d5c0d1 xquartz: appledri: 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-12 09:50:51 +02:00
Enrico Weigelt, metux IT consult
6148bee17d xfree86: dga: ProcXDGASetMode(): 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-12 09:40:04 +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
2b875e18bc Xi: consolidate request handler prototypes
Instead of having huge number of micro-headers, consolidate all the
request handler prototypes in one file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 09:25:29 +02:00
Enrico Weigelt, metux IT consult
31b110cf28 xfree86: dri: ProcXF86DRIGetDeviceInfo() 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-11 16:18:58 +02:00
Enrico Weigelt, metux IT consult
74f93c4022 xfree86: common: move out private definitions from xf86platformBus.h
Private definitions should not pollute public / SDK headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 16:15:14 +02:00
Enrico Weigelt, metux IT consult
850aebf5bc xwin: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:50:02 +02:00
Enrico Weigelt, metux IT consult
c49bcbdcc6 xfree86: dri: ProcXF86DRIGetClientDriverName() fix uninitialized variable
The clientDriverName variable might be left uninitialized when
DRIGetClientDriverName() fails.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:40:28 +02:00
Alan Coopersmith
db07dbf914 modesetting: fix modesetting symbol test when glx is disabled
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-09-11 11:32:07 +02:00
Alan Coopersmith
b641d8e33e modesetting: Fix builds with pciaccess or udev_kms disabled
CI meson-disable-options builds were failing with:
```
../hw/xfree86/drivers/modesetting/driver.c:127:5: error: ‘ms_device_match’
 undeclared here (not in a function)
  127 |     ms_device_match,
      |     ^~~~~~~~~~~~~~~
../hw/xfree86/drivers/modesetting/driver.c: In function ‘ms_get_drm_master_fd’:
../hw/xfree86/drivers/modesetting/driver.c:1179:19: error: variable ‘pEnt’
 set but not used [-Werror=unused-but-set-variable]
 1179 |     EntityInfoPtr pEnt;
      |                   ^~~~
../hw/xfree86/drivers/modesetting/driver.c: At top level:
../hw/xfree86/drivers/modesetting/driver.c:84:13: error: ‘ms_pci_probe’
 used but never defined [-Werror]
   84 | static Bool ms_pci_probe(DriverPtr driver,
      |             ^~~~~~~~~~~~
../hw/xfree86/drivers/modesetting/driver.c:313:1: error: ‘probe_hw_pci’
 defined but not used [-Werror=unused-function]
  313 | probe_hw_pci(const char *dev, struct pci_device *pdev)
      | ^~~~~~~~~~~~
```
Fixes: a72bdf17 ("modesetting: rewrite probing based on fbdev.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-09-11 11:32:07 +02:00
callmetango
d8b7a3e46c xfree86: loader: search module dirs only once
Only specify the top module directories since the loader is recursing
into the subdirectories either way.

Fixes: #991
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-09-11 11:29:39 +02:00
Enrico Weigelt, metux IT consult
2404643489 xnest: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:23:48 +02:00
Enrico Weigelt, metux IT consult
4131dd2950 vfb: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:23:34 +02:00
Enrico Weigelt, metux IT consult
07820e4a7d xfree86: dri: ProcXF86DRIOpenConnection() 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-11 11:23:15 +02:00
Enrico Weigelt, metux IT consult
e2e8e78cd2 xfree86: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:14:19 +02:00
Enrico Weigelt, metux IT consult
c3b443b3b6 xquartz: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:14:07 +02:00
Enrico Weigelt, metux IT consult
7fb1989cec xquartz: replace malloc() by calloc()
It's in general safer to clear out all the memory on allocation,
in order to prevent potential leaks or undefined behaviour on
uninitialized data.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:13:44 +02:00
Enrico Weigelt, metux IT consult
2cb5aac7a3 xfree86: dri: ProcXF86DRIGetClientDriverName() 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-11 11:10:43 +02:00
Enrico Weigelt, metux IT consult
e474b81a45 damage: move the extension under the Xext directory
Tidying up the source tree structure a bit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 17:06:13 +02:00
Enrico Weigelt, metux IT consult
b9b43e92eb xf86bigfont: drop obsolete SProcXF86BigfontQueryVersion()
It's doing nothing but calling ProcXF86BigfontQueryVersion(), so
we can call that function directly in the swapped dispatcher and
get rid of SProcXF86BigfontQueryVersion() entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:45:29 +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
d0a155c824 panoramix: drop unnecessary extern declarations
functions declarations are extern by default, no need to write it
explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:43:29 +02:00
Enrico Weigelt, metux IT consult
5a8da5bdc3 damage: consolidate damageextint.h
* move the stuff only used in .c file there
* drop unnecessary include files

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:42:53 +02:00
Enrico Weigelt, metux IT consult
006f0ec78c Xi: move VPC define into the only source using it
Only used inside listdev.c, so no need to have it within a header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:42:31 +02:00
Enrico Weigelt, metux IT consult
b5210be9eb Xi: helper for private structure retrieval
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:41:47 +02:00
Enrico Weigelt, metux IT consult
c349470433 Xext: geext: drop GEClientPrivateKey
Don't need actually need that extra macro, we can just write
&GEClientPrivateKeyRec in those few places.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:41:29 +02:00
sesankm
3e610c5fc5 xkb: XKBMisc: use C99 style declarations in XKBMisc functions 2025-09-10 13:40:15 +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
c0beda902a Xext: xf86bigfont: use retval of X_SEND_REPLY_SIMPLE()
In ProcXF86BigfontQueryVersion(), return the retval of the
X_SEND_REPLY_SIMPLE() call.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 10:37:56 +02:00
Enrico Weigelt, metux IT consult
cdbf824d70 kdrive: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 10:37:45 +02:00
Enrico Weigelt, metux IT consult
143fafad24 glx: fix wrong swapped encoding in __glXDisp_QueryExtensionsString()
The name string is supposed to be transmitted as-is, not swapped in
4-byte chunks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 10:27:34 +02:00
Enrico Weigelt, metux IT consult
4e842b2382 ci: fix freetype2 URL
savannah doesn't seem to work anymore, so use f.d.o

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 10:14:34 +02:00
RotaryBoot58
8574eecaa5 exa: exaOpReadsDestination(): Updated switch case formatting and reverted the use of tabs for indentation 2025-09-09 16:56:58 +02:00
Enrico Weigelt, metux IT consult
a324351f67 treewide: drop unnecessary includes of Xi/eglobals.h
Dropping include by sources that don't use anything from this header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-09 14:41:10 +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
e3d9f4c3ef xfree86: dga: use canonical loop index in DGAClientStateChange()
Naming all index variables on looping over screens `walkScreenIdx`,
in order to make transition to upcoming generic screen walk macros easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-09 10:01:18 +02:00
stefan11111
7d48a9a41e modesetting: Fix memory leak
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-09 09:46:05 +02:00
sesankm
4c71d77d08 glx: glxcmds.c: use x_rpcbuf_t in DoQueryContext
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-09 09:44:49 +02:00
Enrico Weigelt, metux IT consult
f58b56a79f Xext: dpms: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-08 19:25:24 +02:00