Compare commits

..

1919 Commits

Author SHA1 Message Date
stefan11111 d403cbd25c kdrive: ephyr: initialize OS specific callback vectors
These will be used by subsequent commits for generic Kdrive
functions calling back into the OS specific parts

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-04 19:36:04 +02:00
stefan11111 a46fd9f16e kdrive: add KdOsInit
Kdrive X servers used to do the OS-speciffic init part using KdOsInit.
This was changed in modern Xorg because Xephyr is the only kdrive
X server there, so there was no need to keep this generic.
Since we want to eventually add Xfbdev, we need to add this back.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-04 19:36:04 +02:00
Enrico Weigelt, metux IT consult fc9bd6b175 minor release 25.0.0.4
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:26:48 +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
Enrico Weigelt, metux IT consult c6777fe48e xnest: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c520537
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult 2f46a02217 vfb: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c520537
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult 93013224b4 xquartz: fix incomplete prototype of executable_path()
> ../hw/xquartz/mach-startup/bundle_trampoline.c:53:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> static char *executable_path() {
>                             ^
>                              void
> 1 warning generated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:09:33 +02:00
Enrico Weigelt, metux IT consult 74d5b7bb05 xquartz: drop unused field declarations in request handlers
Silence compiler warning on unused fields, eg.:

> ../hw/xquartz/applewm.c:692:5: warning: unused variable 'stuff' [-Wunused-variable]
>     REQUEST(xAppleWMQueryVersionReq);
>     ^
> ../include/dix.h:65:12: note: expanded from macro 'REQUEST'
>     type * stuff = (type *)client->requestBuffer;
>            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:08:46 +02:00
stefan11111 160ab343ea mi: move miPointerCloseScreen to hookPostClose
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-03 18:46:58 +02:00
Enrico Weigelt, metux IT consult 2069db50e7 xfree86: compat: make xf86MsgVerb() a bit less noisier
print the driver bug warning only once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-03 16:55:14 +02:00
Nathan Kidd 7ca8b37ab1 glx: Don't blindly write 8 bytes in GLX single replies
Previously we leaked stack when invalid enum parameters were
specified and caused __glGet*_size functions to return a 0 size.

Further, we read out-of-bounds (and leaked) when the input data was less
than 8 bytes (__glXDispSwap_GetFramebufferAttachmentParameteriv and
__glXDisp_GetRenderbufferParameteriv).

Now we only write a single element in the reply padding, and only when there
is a single element. This is what the Mesa client-side libGL expects, and
restores original GLX server behaviour, matching both pre-public (1996) SGI GLX
and XFree86 4.

The main risk of this change is if we have any error in element count or size;
previously it may not have mattered but now it does.

There are no piglit result changes from this modification using either mesa
libGLX or NVIDIA libGLX.

For performance considerations, an extra conditional and variable-length
memcpy has no meaningful impact on the indirect rendering pipeline cost.

There is still the possiblity to leak if our size checks allow an enum that
the GL implemention does not. Guarding against that requires zero-initializing
all temp storage, which wants re-evaluation of the blind 200-byte buffers
used for many calls and thus is a much bigger change.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-03 16:43:18 +02:00
Nathan Kidd 5b810bac5e glx: Fix out-of-bounds reads from negative return
The callers of these functions were casting -1 to unsigned and then
using 4GB indexes. By returning 0 we match all the other size functions.

GLX size functions return -1 to indicate error, but GL size functions return 0.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-03 16:43:18 +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 5d7be80305 minor release 25.0.0.3
minor bugfix release.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-02 17:44:12 +02:00
stefan11111 6851e17816 meson.build: meson_options.txt: add build option to disable building tests
These tests take a long time to build and link, especially with lto.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-02 17:40:10 +02:00
Enrico Weigelt, metux IT consult 96be335fd3 miext: damage: use dixScreenHookPostClose() instead of dixScreenHookClose()
Some drivers need to call into damage from within their CloseScreen proc,
so damage teardown needs to be done after that, instead of before.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-02 15:41:37 +02:00
Enrico Weigelt, metux IT consult 56650ba873 dix: add screen hook for post-close
In contrast to the already existing ScreenClose hook, this one is
called *after* the driver's CloseScreen() proc. That's required for
some extensions (eg. damage) where drivers still need to call in
inside of their CloseScreen procs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-02 15:41:37 +02:00
Enrico Weigelt, metux IT consult 4036b8c163 os: log: vpnprintf(): ignore reverse justification modifier
The only caller is libinput, and we don't really need it, just silencing
bug message.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:15:56 +02:00
Enrico Weigelt, metux IT consult c24372893b xfree86: compat: consolidate logging
Consolidate the redundant warnings into generic functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:11:28 +02:00
Enrico Weigelt, metux IT consult 28e739e05b xfree86: loadmod: locally scope the errtype variable
In CheckVersion() the errtype variable is used in two separate scopes,
but not globally, so it's cleaner to have it only in the scopes that
are actually using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:03:12 +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
stefan11111 3d266528a9 kdrive: ephyr: use c99 struct initialization
For better readability and robustness against future changes, it's
better to use named struct initializers instead of array-like lists.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 16:50:01 +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
Enrico Weigelt, metux IT consult 6a3162d623 Xnest: fix analyzer warning on uninitialized `DefaultVisual`
In xnestOpenScreen(), some compilers/analyzers spitting out a false alarm on
`defaultVisual` field potentially used uninitialized. This can't practically
happen, but not all compilers/analyzers really can see that.

Adding a zero initializer doesn't cost us anything, so silencing that false
alarm is trivial.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 20:30:46 +02:00
Enrico Weigelt, metux IT consult ccf9787bd6 .github: add building mouse driver
xf86-input-mouse is now supported Linux again, so add it to the build.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 19:22:01 +02:00
Enrico Weigelt, metux IT consult d08631bef1 minor release 25.0.0.2
minor bugfix release.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 12:44:45 +02:00
Enrico Weigelt, metux IT consult d441e4783e .github: 01-bug-report: use 25.0.0.X instead of listing all minor releases
Listing all patchlevels in the ticket form would quickly explode it.

Users are expected to always run the latest patchlevel (4th digit), because
they're only receiving urgent bug and security fixes, not getting anything new,
that could break other things.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 12:38:51 +02:00
Collin 949e4e4fa0 Update build-xserver.yml to have correct permissions to resolve CodeQL alert
https://github.com/HaplessIdiot/xserver/security/code-scanning/16 Adds permissions to build in read only to support ubuntu package standards.
2025-06-30 12:25:18 +02:00
notbabaisyou 7fb4ba10f2 glamor: Enable dmabuf_capable for Zink
This lets Zink take advantage of DRM modifiers on GPUs letting it properly handle tiled buffers.

Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
2025-06-27 19:23:43 +02:00
notbabaisyou 461411c798 modesetting: allow enabling atomic mode.
The Linux kernel has long had code preventing Xorg from using atomic
modesetting due to various bugs in it's implementation, some of these
issues have since been fixed but some issues remain namely with DPMS
and other smaller things, we should allow users to opt-in by setting
"Option 'Atomic' 'True'"

This shouldn't cause any issues as the feature remains disabled by default.

Co-authored-by: Daniel Abrecht <public@danielabrecht.ch>
Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
2025-06-27 19:23:31 +02:00
Bastiaan Quast 25c002c54b CONTRIBUTION.md: "MR" / "MRs" -> pull request(s) 2025-06-27 19:22:18 +02:00
notbabaisyou 4afcb1cd7b modesetting: Fix typo.
`modsetCreateScreenResources` -> `modesetCreateScreenResources`

Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
2025-06-27 17:10:33 +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 9ab598e2b2 .github: add comments explaning the reasons behind xts patching
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 17:07:42 +02:00
Mike Gelfand f40afc8983 .github: .gitlab-ci: add macos (xquartz) build job
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 17:07:42 +02:00
Mike Gelfand 4f7000f620 xquartz: add missing include for `XkbSetRulesDflts`
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Mike Gelfand 3e89bd7409 xquartz: add missing include for `DeliverEvents`
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Mike Gelfand edb020e306 xquartz: depend on libXdmcp (includes osdep.h which includes X11/Xdmcp.h)
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Mike Gelfand d89b3596f0 xquartz: depend on libX11 (includes X11/Xlib.h)
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 14:30:27 +02:00
Enrico Weigelt, metux IT consult 6a10d96761 rootless: fix missing include of dix/screen_hooks_priv.h
We're using XorgScreenWindowPositionParamRec here, so need to include
that header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-27 13:59:13 +02:00
Mike Gelfand 26f56735c5 record: add/fix include guards where missing/broken
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand c4ca14eff0 pseudoramix: add/fix include guards where missing/broken
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand 565309bb33 miext: add/fix include guards where missing/broken
Skipped headers designed for multiple or non-trivial inclusion:
* miext/shadow/shrotpack.h
* miext/shadow/shrotpackYX.h

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand 32b26ccf9e mi: add/fix include guards where missing/broken
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand f5e00916aa include: add/fix include guards where missing/broken
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand c06a2a3ed7 hw: add/fix include guards where missing/broken
Skipped headers designed for multiple or non-trivial inclusion:
* hw/xfree86/dri2/pci_ids/i810_pci_ids.h
* hw/xfree86/dri2/pci_ids/i915_pci_ids.h
* hw/xfree86/dri2/pci_ids/i965_pci_ids.h
* hw/xfree86/dri2/pci_ids/r200_pci_ids.h
* hw/xfree86/dri2/pci_ids/r300_pci_ids.h
* hw/xfree86/dri2/pci_ids/r600_pci_ids.h
* hw/xfree86/dri2/pci_ids/radeon_pci_ids.h
* hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h
* hw/xfree86/dri2/pci_ids/virtio_gpu_pci_ids.h
* hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand 166d1b5e6b fb: add/fix include guards where missing/broken
Skipped headers designed for multiple or non-trivial inclusion:
* fb/fbbits.h

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +02:00
Mike Gelfand 7fbd8db7a4 config: add/fix include guards where missing/broken
Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:58:05 +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
callmetango 87c8520ba3 .github: Add new issue forms
Add the following forms for issue creation:

* Bug report
* Feature request
* Code cleanup
* Documentation update
* Organizational task

* add issue type selection page on "New Issue" call
* mention Github Discussions and the mailing list where appropriate

Fixes #257

Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-06-27 13:56:00 +02:00
Mike Gelfand 5ed2865bdd .github: don't override env vars set externally
Helpful for CI builds where we could be setting different paths on
different runners (due to OS or something else).

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:45:11 +02:00
Mike Gelfand 5e98d8c571 .gitlab-ci: only look for files when validating man pages
Build directory may sometimes contain directories ending with a period
and a digit, e.g. in my case

* ./meson-private/cmake_xshmfence/CMakeFiles/4.0.3
* ./meson-private/__CMake_compiler_info__/CMakeFiles/4.0.3

Since man pages are files, filter out the rest.

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:35:34 +02:00
Mike Gelfand bc8518f8f8 .github: drop sudo for prerequisites builds
Files aren't being installed into privileged directories as part of the
build but instead into $X11_PREFIX which resides in current user's home
directory.

Change the cache key to avoid reusing old cache entries, which would
lead to permission errors.

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:34:40 +02:00
Mike Gelfand 705d1ce679 .github: export MACHINE the right way
Otherwise, paths constructed on "build xserver sdk" step aren't valid.

Signed-off-by: Mike Gelfand <mikedld@mikedld.com>
2025-06-27 13:13:54 +02:00
Icenowy Zheng 3e1c2d5456 glamor: Fix dual blend on GLES3
The EXT_blend_func_extended extension on ESSL always requires explicit
request to allow two FS out variables because of limitations of the ESSL
language, which is mentioned as the No.6 issue of the extension's
specification.

Fix this by adding the extension request.

The original behavior on GLES3 is slightly against the specification of
GL_EXT_blend_func_extended extension, however Mesa and older version of
PowerVR closed drivers will just ignore this issue. Newest PowerVR
closed driver will bail out on this problem, so it deems a fix now.

Fixes: ee107cd491 ("glamor: support GLES3 shaders")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1750>
2025-06-26 15:30:56 +02:00
b-aaz 3079488484 dix: generate-atoms: Changed BASH to POSIX SH for portability.
BASH is not preinstalled on many systems.
Also added -r and IFS= to the read command.

Signed-off-by; b-aaz <b-aazbsd.proton.me>
2025-06-25 10:53:36 +02:00
Enrico Weigelt, metux IT consult f5ea9069e1 release 25.0.0.1
minor bugfix release

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-24 17:46:26 +02:00
Enrico Weigelt, metux IT consult e91cfc890f randr: fix memleak in provider property update
If a device property is going to be updated, but failing due
the new value being too big, the buffer isn't freed.

Also compacting the logic for this into small inline function.

Fixes: 948630fa42
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-24 16:06:38 +02:00
Enrico Weigelt, metux IT consult ada105a5d2 xorg-server.pc.in: fix source URL
Source URL in .pc input was still linking to old dead xorg.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-23 16:55:43 +02:00
Enrico Weigelt, metux IT consult 828f9a1b7f xfree86: man: fix git URL
fix the git URL to point to Xlibre repository.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-23 16:50:19 +02:00
Enrico Weigelt, metux IT consult f7516e6234 meson_options: fix mailing list address
The meson_options allow setting some `builder` mail address, and default
was still pointing to old, dead xorg.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-23 16:50:19 +02:00
Herman Semenov 604582d179 glx: fix correct sizeof GL unsigned int
Signed-off-by: Herman Semenov <GermanAizek@yandex.ru>
2025-06-23 16:18:47 +02:00
Enrico Weigelt, metux IT consult 4e1515f793 meson.build: fix release date variable
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-23 15:42:47 +02:00
stefan11111 0746e6841a xfree86: compat: fix Ones for compilers where __builtin_popcountl is missing
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-06-23 14:14:48 +02:00
Enrico Weigelt, metux IT consult 3f5e4b1d97 xfree86: provide xf86DisableGeneralHandler() for Nvidia driver
The proprietary NVidia driver want's to call an internal function for reasons
unknown to us. Adding a little wrapper for it, that's also printing out some
warning message in the log.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-23 11:09:45 +02:00
Enrico Weigelt, metux IT consult 40dc3b6419 Xlibre release 25.0.0.0
Summer solstice 2025.
Initial release of Xlibre Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-21 11:51:45 +02:00
Enrico Weigelt, metux IT consult ebc0c6263f README.md: add driver release tags
Since Alan Coopersmith (Sun/Oracle) currently attempting to sneak in subtle
incompatibilities between Xlibre and Xorg drivers, it's time to set some
ad hoc release tags of all the unreleased stuff, which are prefixed "xlibre-"
and document them in the readme.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 19:24:24 +02:00
Enrico Weigelt, metux IT consult fca07a761c xfree86: export xf86FlipPixels() but keep it internal
Needed by the int10 module, so has to be in the symbol table.
But still not supposed to be used by out-of-tree drivers.

Reported-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:36:29 +02:00
Enrico Weigelt, metux IT consult e523724d5e xfree86: export xf86ModeStatusToString() but keep it internal
Needed by the int10 module, so has to be in the symbol table.
But still not supposed to be used by out-of-tree drivers.

Reported-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:36:29 +02:00
Enrico Weigelt, metux IT consult 13595b1801 xfree86: export OsBlockSignals() but keep it internal
Needed by the int10 module, so has to be in the symbol table.
But still not supposed to be used by out-of-tree drivers.

Reported-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:36:29 +02:00
Enrico Weigelt, metux IT consult 905329940a xfree86: export OsReleaseSignals() but keep it internal
Needed by the int10 module, so has to be in the symbol table.
But still not supposed to be used by out-of-tree drivers.

Reported-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:36:29 +02:00
Enrico Weigelt, metux IT consult 711359b75c xfree86: export xf86FindScreenForEntity() but keep it internal
Needed by the int10 module, so has to be in the symbol table.
But still not supposed to be used by out-of-tree drivers.

Reported-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:36:29 +02:00
Enrico Weigelt, metux IT consult f5777ff1dc xfree86: export xf86IsEntityPrimary() but keep it internal
Needed by the int10 module, so has to be in the symbol table.
But still not supposed to be used by out-of-tree drivers.

Reported-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:36:29 +02:00
Enrico Weigelt, metux IT consult 66547c7971 xfree86: provide xf86EnableGeneralHandler() for Nvidia driver
The proprietary NVidia driver want's to call an internal function for reasons
unknown to us. Adding a little wrapper for it, that's also printing out some
warning message in the log.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:35:59 +02:00
dec05eba 5342d0c380 xkb: fix XkbGetKbdByName returning incorrect data
This is a regression first caused by 182404fde6
that sends back the old xkb data instead of the new one.
This causes a mismatch in the data and size calculations between the
XkbComputeGetMapReplySize that is called above that calculates the size
of the reply and XkbAssembleMap that sets the data for the reply.

Without this fix this error is seen when running setxkbmap fr:
"Error loading new keyboard description".

Fixes setxkbmap error described in #180

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-20 10:17:10 +02:00
itz-me-zappex 9adf08960e README.md: Update info about VT switching and add workaround for NVIDIA.
Signed-off-by: itz-me-zappex <85901674+itz-me-zappex@users.noreply.github.com>
2025-06-19 16:32:04 +02:00
Steven Van Dorp 2ef1e7728e ephyr: fix checking the same expression twice
Probably was a copy-paste error.
Intention is to check if the string is valid
(i.e. not null and length isn't 0).

fixes: #179

Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-19 13:57:57 +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
Enrico Weigelt, metux IT consult fe4bc433a4 sdk: reinstate COMPOSITE symbol
Composite extension is always enabled for pretty long time now, but some
drivers (eg. xf86-video-intel) still relying on this symbol being set,
otherwise assuming to run w/o composite and doing crazy things.

Fixes: d708b28adc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-19 11:21:31 +02:00
rendick ca5fb14d05 dix: delete unused PropertyStateRec structure to debloat codebase
Removed unused 'PropertyStateRec' structure from dix/property.c

Signed-off-by: rendick <rendick123@proton.me>
2025-06-18 21:26:40 +02:00
Olivier Fourdan 899afa4c10 os: Check for integer overflow on BigRequest length
Check for another possible integer overflow once we get a complete xReq
with BigRequest.

Related to CVE-2025-49176

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Suggested-by: Peter Harris <pharris2@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2028>
2025-06-18 17:51:36 +02:00
Steven Van Dorp b393d5fc02 ephyr: Add -host-grab to set custom grab shortcut
Allows for calling Xephyr with `-host-grab [keys]` to customize the
keyboard shortcut for grabbing/releasing keyboard and mouse input.
Fully backwards compatible:
Omitting `-host-grab` defaults to ctrl+shift.
`-no-host-grab` acts the same as before.

Closes: #134

Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-18 13:23:58 +02:00
Duje Mihanović 61accf16e2 Revert "xfree86: unexport xf86PostButtonEventM()"
This reverts commit e16424212e.

The xf86-input-wacom driver requires this function.

Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
2025-06-17 20:47:17 +02:00
Enrico Weigelt, metux IT consult f5d4657d0d meson.build: add deprecation warning on HAL
When HAL is enabled, print out a warning that it's deprecated and
might be removed soon.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:41:48 +02:00
Enrico Weigelt, metux IT consult 99992bc2f6 meson_options: set default for HAL integration to false
This should be a deliberate decision of the user/distro. Just the presense
of some of its libraries in the build environment doesn't automatically
mean the user/distro actually wants it to be used.

HAL is pretty much obsolete, so we're considering to drop it entirely.
Anybody who's still needs it should call out loud now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:41:48 +02:00
Enrico Weigelt, metux IT consult dba86284c8 meson_options: set default value for systemd support to false
a) the automatic detection logic is broken: it automatically enables it
   when kms+udev enabled and dbus is found.
b) it should be a deliberate decision whether to enable it or not,
   eg. just having (pieces of) systemd libraries present on the build
   machine doesn't automatically mean the user/distro actually wants
   it to be used.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:41:48 +02:00
Enrico Weigelt, metux IT consult 49f5056b45 .github: run pipeline on pull requests
Also run the pipeline on pull requests, so nothing utterly broken
can easily slip in.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:33:00 +02:00
Enrico Weigelt, metux IT consult 36a24ef23c .github: drop -Dxwayland=false
Xwayland had been dropped, so no need to switch it off explicitly
anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:33:00 +02:00
Olivier Fourdan 923837e2c9 xfree86: Check for RandR provider functions
Changing XRandR provider properties if the driver has set no provider
function such as the modesetting driver will cause a NULL pointer
dereference and a crash of the Xorg server.

Related to CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan 948630fa42 randr: Check for overflow in RRChangeProviderProperty()
A client might send a request causing an integer overflow when computing
the total size to allocate in RRChangeProviderProperty().

To avoid the issue, check that total length in bytes won't exceed the
maximum integer value.

CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan da5f8d197f record: Check for overflow in RecordSanityCheckRegisterClients()
The RecordSanityCheckRegisterClients() checks for the request length,
but does not check for integer overflow.

A client might send a very large value for either the number of clients
or the number of protocol ranges that will cause an integer overflow in
the request length computation, defeating the check for request length.

To avoid the issue, explicitly check the number of clients against the
limit of clients (which is much lower than an maximum integer value) and
the number of protocol ranges (multiplied by the record length) do not
exceed the maximum integer value.

This way, we ensure that the final computation for the request length
will not overflow the maximum integer limit.

CVE-2025-49179

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan 0d6af5a542 os: Account for bytes to ignore when sharing input buffer
When reading requests from the clients, the input buffer might be shared
and used between different clients.

If a given client sends a full request with non-zero bytes to ignore,
the bytes to ignore may still be non-zero even though the request is
full, in which case the buffer could be shared with another client who's
request will not be processed because of those bytes to ignore, leading
to a possible hang of the other client request.

To avoid the issue, make sure we have zero bytes to ignore left in the
input request when sharing the input buffer with another client.

CVE-2025-49178

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan a1e44d3c4f xfixes: Check request length for SetClientDisconnectMode
The handler of XFixesSetClientDisconnectMode does not check the client
request length.

A client could send a shorter request and read data from a former
request.

Fix the issue by checking the request size matches.

CVE-2025-49177

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Fixes: e167299f6 - xfixes: Add ClientDisconnectMode
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan 3151e489e4 os: Do not overflow the integer size with BigRequest
The BigRequest extension allows requests larger than the 16-bit length
limit.

It uses integers for the request length and checks for the size not to
exceed the maxBigRequestSize limit, but does so after translating the
length to integer by multiplying the given size in bytes by 4.

In doing so, it might overflow the integer size limit before actually
checking for the overflow, defeating the purpose of the test.

To avoid the issue, make sure to check that the request size does not
overflow the maxBigRequestSize limit prior to any conversion.

The caller Dispatch() function however expects the return value to be in
bytes, so we cannot just return the converted value in case of error, as
that would also overflow the integer size.

To preserve the existing API, we use a negative value for the X11 error
code BadLength as the function only return positive values, 0 or -1 and
update the caller Dispatch() function to take that case into account to
return the error code to the offending client.

CVE-2025-49176

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Enrico Weigelt, metux IT consult c430c829d5 render: fix CVE-2025-49175
Protect against clients sending a series of zero cursors.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:01:25 +02:00
dasha_uwu b418203339 README.md: fix drivers list
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-17 19:57:24 +02:00
Enrico Weigelt, metux IT consult fd02fc0b04 .github: workflow for building Xservers and some drivers
Add a github workflow that builds the Xservers on Linux and also
runs build-test of several common drivers against xorg sdk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 19:45:34 +02:00
Enrico Weigelt, metux IT consult 4939439952 dix: drop PropertyStateCallback
This callback only had been added for Xwayland, which is gone now,
so we don't need it anymore. For property filtering (eg. security
extensions), we have PropertyFilterCallback.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 12:51:36 +02:00
Enrico Weigelt, metux IT consult c8b81fdbc5 drop Xwayland
It always had it's own lifecycle (not been part of Xorg releases),
doesn't make sense to maintain a competing implementation that we
won't use anyways.

Once that's gone, we can also drop few things in core/dix that had
been added just for xwayland only.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 12:51:36 +02:00
Hermann Semenov d042e5a667 os: fix missing NULL check for vpnprintf()
Protect from NULL parameter to %s directive.

See also: https://github.com/X11Libre/xserver/issues/36

Signed-off-by: Herman Semenov <GermanAizek@yandex.ru>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-16 20:28:01 +02:00
stefan11111 fa7cc111e7 xfree86: compat: add missing symbols needed by the proprietary nvidia drivers
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-06-16 20:07:18 +02:00
Michael Bear a43c9d8719 README.md: Link to parent project
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
Michael Bear 7d5bc27184 README.md: Capitalize GitHub (noun) in README.md
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
Michael Bear 1166015703 README.md: Add "to" for "to be prepared"
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
Michael Bear 8b06efa654 README.md: Grammar an >> a
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
AnasSaeed1 b63868ba23 Fix typo in README.md 2025-06-16 15:19:54 +02:00
dasha_uwu 69cc9b1cd3 change vendor string to XLibre
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:38:33 +02:00
dasha_uwu cacdcc5b2e dix: export DeliverEvents for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 27f1094116 randr: export RRGetOutputProperty for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +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 3db3ca9889 dix: export TryClientEvents 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 1489474583 dix: remove unused NAMESPACE private type
in struct _Screen (include/scrnintstr.h) there is a PRIVATE_LAST-sized array,
having another private increases PRIVATE_LAST, the array increases in size,
moving everything below it down. this breaks ABI for nvidia driver

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 545f6ca8b7 randr: fix BUG_RETURN_VAL check
nvidia driver can call with numOutputs == 0 and outputs == NULL which is valid

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 45de44f092 os: export SetCriticalOutputPending for nvidia
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
dasha_uwu 1fe4d2d4ca randr: export RROutputSetSubpixelOrder for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 3c20d33e2c randr: export RRCrtcSetTransformSupport for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
Steven Van Dorp 9acf6a4b63 ephyr: explicitly zero-initialize ephyrCursorScreen
Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-14 17:28:13 +02:00
Steven Van Dorp c5f63fa138 ephyr: fix possible segfault if eyphrCursorScreen is 0
Fixes: #38

Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-14 17:28:13 +02:00
rendick cd2e185838 Xnest: implement a defined initialization order in BoxRec
Signed-off-by: rendick <rendick123@proton.me>
2025-06-13 19:15:41 +02:00
cat a0f4a5585d Rebrand 'X.Org X Server' to 'XLibre X Server'
Signed-off-by: cat <cat@plan9.rocks>
2025-06-13 19:08:11 +02:00
dec05eba 2f66431927 xi: Fix build on arch linux (cast between struct and union gcc error)
Fixes this build error on arch linux:

../Xi/exevents.c:1394:26: error: array subscript ‘InternalEvent {aka union _InternalEvent}[0]’ is partly outside array bounds of ‘DeviceEvent[1]’ {aka ‘struct _DeviceEvent[1]’} [-Werror=array-bounds=]
 1394 |                 evtype = GetXI2Type(ev->any.type);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
../Xi/exevents.c: In function ‘DeliverEmulatedMotionEvent’:
../Xi/exevents.c:1571:17: note: object ‘motion’ of size 432
 1571 |     DeviceEvent motion;
      |

which happens because of change in build options compared to master and gcc 15.1 in arch. I think this warning (and error) is a bug in gcc.

gcc 15.1 doesn't like when struct DeviceEvent is cast to union InternalEvent.
InternalEvent has a union any type and DeviceEvent type and these have to have a matching structure (for the header part).
When the InternalEvent is used in RetrieveTouchDeliveryData function it access the any field, which accessed the data defined previously in the device_event fields.
This change matches how its done in touch.c TouchEmitTouchEnd for example and it's "more correct",
since we are no longer casting from a smaller struct (DeviceEvent) to a larger struct (InternalEvent) when calling RetrieveTouchDeliveryData.

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 19:08:17 +02:00
dec05eba 8c3c20f3fe xnest/os: Fix incorrect power of two operator
2^16 is 2 xor 16 which equals 18, not 2 to the power of 16 which is 65536

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 13:27:25 +02:00
EXtremeExploit 904f87c0b5 Add Contribution Guidelines
The guidelines come from metux's heads up mail:
https://www.freelists.org/post/xlibre/Heads-up-branch-changes-and-MR-policies

Signed-off-by: EXtremeExploit <pedro.montes.alcalde@gmail.com>
2025-06-13 13:03:26 +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
Samq64 fea8b78358 README.md: typo and grammar fixes
Signed-off-by: Samq64 <81489795+Samq64@users.noreply.github.com>
2025-06-12 18:49:19 +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 301a5bde1b os: fix missing include of Xext/xf86bigfontsrv.h
We're calling XF86BigfontCleanup() from AbortServer(), so we need
it's prototype.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Thomas Debesse 15af8318f5 README.md: fix video drivers being mistakenly named as input drivers 2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 3a74f817de README.md: formatting contact list as table
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
catfromplan9 a2aae2b1e2 Add matrix room to README.md 2025-06-12 17:21:48 +02:00
Felipe Contreras 36db4b129d xkb: fix regression in GetDeviceInfo
This fixes a regression in 5499a2999 (xkb: let SendDeviceLedFBs() fill buffer instead of writing directly, 2024-07-16).

We need to write the whole buffer, and the updated length has to take
into consideration that `sz` now contains `led_len` so we need to
subtract that or properly calculate the remaining size.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 9f936bced3 COPYING: add myself
I believe I have contributed enough to be mentioned here ;-)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 2b955d7086 README.md: update driver repo URLs
Since Redhat deleted everything related to Xlibre from freedesktop.org,
the driver repos had to be moved to github.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult d1a32d32ed README.md: update due recent events of Redhat's censorship
Add update on recent censorship by Redhat employees on freedesktop.org.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult f98bee5e2e dix: add RootWindowFinalizeCallback() to symbol table for legacy Nvidia.
Nvidia has a strange habit of messing with really internal stuff,
so need to add it to the executable's symbol table.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 92126ff496 dix: add AllocColormap() to symbol table for internal wfb module
As long as the wfb module is still a separate shared object, this
function needs to be in the symbol table.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult a75a587370 xfree86: mark xf86configptr exported for Nvidia legacy
Nvidia has a strange habit of messing with really internal stuff,
so need to add it to the executable's symbol table.

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 269012b827 Xnamespace: add some documentation
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
Enrico Weigelt, metux IT consult f790bae8dc Xnamespace: initial config loader
This loads the configuration (simple text file) passed via command line.
For now just supporting static configuration, that's loaded on server
startup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 9c4b4e54d1 Xnamespace: property access hook
Filter property access. Right now just allowed inside same namespace,
or when caller is in root namespace.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 21e890e5fc Xnamespace: whitelist access to some server resources
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 8df9373199 Xnamespace: whitelist some XI operations
Whitelisting some XI operations in various hooks.

Note that some additional filtering needs to be done in send or
receive hook in order to prevent clients to receive possibly sensible
input data from the root window.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 0a90e70a01 Xnamespace: filter access on other clients
Restrict access to other clients within same namespace.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult e92d6ad8e4 Xnamespace: filter client-to-client message sending
Filter message sending by clients. Only sending within the same
namespace is allowed (except for clients in a NS with superpowers,
e.g. root)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 5a2903901a Xnamespace: filter server access
Whitelisting several server access calls that are safe, rejecting the rest.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult e293308ef7 Xnamespace: filter device access
Filter device access, whitelist several commonly used operations that
should be safe (eg. query keyboard layout).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 7afdba1952 Xnamespace: whitelist access to namespace virtual root window
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult fdba5d405d Xnamespace: whitelist certain operations on (real) root window
CreateWindow() needs access to root window, in order to create
top level windows. Whitelisting this operation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult df56b26ed4 Xnamespace: whitelist resource access for serverClient
The server itself is allowed to access anything w/o restrictions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult eaa08af7d1 Xnamespace: whitelist resource access within same namespace
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 86dd87d46c Xnamespace: filter transparency
Silently drop transparency flag if namespace isn't allowed to use it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 14008eb698 Xnamespace: filter extension access
Whitelist several extension calls that are safe. Also allow namespaces
to be configured for unrestricted access.

TBD: doesn't actually reject yet

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 81faed9c8c Xnamespace: filter raw mouse motion and keyboard access
Only namespaces with allowMouseOption flag enabled can receive
raw mouse motion events. Raw key press events are always blocked.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult cb1baec84a Xnamespace: isolate root window property access
Redirecting access to root window properties to the per-namespace
virtual root windows. This isolates a lot of communication via root
window, e.g. the cut buffers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 159183c8a0 Xnamespace: create per-namespace fake root windows
For each namespace creating a fake (invisible) root window, which can be
used for storing per-namespace properties (eg. cut buffers), etc.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 5901cb001d Xnamespace: add selection isolation
Selection names (as seen by the client) are internally prefixed with the
namespace ID, so each client can only access those within it's namespace.

If a client within namespace "foo" want's to operate on "PRIMARY",
it actually will be doing so on "<foo>PRIMARY", w/o ever noticing it.
Events will sent back to the client still pointing to "PRIMARY".

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 0698743fde Xnamespace: assign incoming clients to namespaces
The association is done by matching client's and namespace's
authentication token.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 9f8ef921ad Xnamespace: add basic namespace config structures
Adding data structure and initial data for namespace configuration.

Built-in namespaces are ROOT and ANONYMOUS.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 4379f7cc87 Xnamespace: namespace extension skeleton
Add tiny skeleton for the namespace extension. Disabled by default,
can be enabled via +extension arg, but doesn't actually do something yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult c3f042de23 Xi: allow hooks to silently ignore SelectEvents request
When looking up the window to select on and security hook returns
BadAccess, the request is just silently ignored, instead of rejected.

This way, security hook can prevent untrusted clients to listen on
arbitrary windows, without the client even noticing. The client won't
get this BadAccess error, but instead thinking everything's fine,
just not getting the actual events.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 349d13961d include: list.h: add duplicate checking add/append functions
Simplify cases where callers need to check whether an entry already is
in a list before adding / appending.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 536c3c7765 include: list.h: add xorg_list_present()
This function walks through the list and checks whether an entry is already
present. This check sometimes is neccessary, since trying to add an entry
twice has catastrophic consequences: iteration will become endless loop.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 9461072ab4 include: list.h: allow zero-initialization of struct xorg_list
Up until now, xorg_list's always need to be explicitly initialized by
calling xorg_list_init(), otherwise next access attempt will segfault.
This is adding extra complexity and risk of subtle bugs.

Adding some extra NULL check are trivial and their cost is so tiny
that it's even hard to practically measure.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 74766ee6bd include: list.h: document things that must not be done
Add some warnings that list entries must not be added twice.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult fc428a78a2 include: list.h: fix inline docs for xorg_list_append()
The docs stated it's prepending, while it's actually appending.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 473b8a0e38 dix: helper for checking whether window ID belongs to a root window
This helper checks whether a given XID belongs to some screen's
root window. It does so by looking up the window and comparing that
with the window's screen's root window pointer. The resource lookup
is intentionally being on behalf of the serverClient, so the fired
XACE hook doesn't treat it as an actual client's request.

It's explicitly designed for being used by callback handlers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 950cfb2bdc dix: helper for retrieving client owning a XID
Add a little helper that's looking up the ClientPtr to the client
of the owner of given XID. The lookup is solely done on the ID space,
the actual resource doesn't even need to exist.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 16215b98d2 dix: add selection filtering hooks
Add hooks for filtering and fully rewrite rewrite selection requests
and events (what existing XACE hooks cannot do), e.g. for supporting
separate selection name spaces.

The hook can change individual fields in the parameter struct, so
operation continues with these changed values (eg. replace the original
selection name atom by a different one). It's also possible to stop
operations completely (with given result code) - in that case the
hook needs to take care of the remaining work to do (eg. sending events)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult e6467895f9 dix: add dixAllocServerXID()
Adding a separate function for allocating server-client's XIDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 4919a089df dix: refine docs on DeliverDeviceEvents()
Adding a bit more explaination on how events are passed upwards.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 8d89be2964 dix: hook for intercepting window property calls
This hook allows extensions to intercept client requests for changing
window attributes. It can either change the parameters or skip the
entire call (eg. handle all itself) so just the hook provided result
code is returned to the client.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 43dd9e5f43 dix: clean up MakeWindowOptional() calls and add alloc fault checks
a) no need to checking for win->optional == NULL before calling
   MakeWindowOptional(), because it checks itself
   (except some cases where it's presence has it's own semantics,
   or prevent unnecessary allocations)
b) lots of call sites didn't check for allocation failure.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 8966b04224 dix: unexport MakeWindowOptional()
Really internal, should not be used 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 c092df17a8 dix: registry: add LookupDixAccessName()
Helper for converting Xace access masks to human-readable text.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult c4632a40dc dix: add callback for post root window init
Allow extensions to catch in right after a screen's root window has
been finally initialized

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 7b801906c5 mi: mark miWindowExposures() and miExpandDirectColors() exported
These are used by the in-tree libwfb.so module. As long as this an shared
object, instead of being directly linked into the executable, these symbols
need to be in the executable's symbol table. Nevertheless, they're not making
them part of the public SDK/module ABI, unless there's a really hard reason.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 2ce40f23b8 meson_options: disable Xwayland by default
Xwayland is a separate project/team and has it's own releases, so it's better
trying to to intefer with them and disable it by default.

It still can be easily enabled via meson arguments, and it's still enabled
in the CI. Let distros and operators decide on their own whether they want it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 41c039948f randr: re-export RRTransformSetFilter() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult ec7a89a92c randr: re-export RRClientKnowsRates() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 15bb2bbb37 randr: re-export RRProviderSetCapabilities() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult da3791e9ce randr: re-export RRProviderCreate() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 90c1f3b2a8 randr: re-export RRCrtcDetachScanoutPixmap() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 5f91adf017 randr: re-export RRCrtcGetTransform() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 49c6431695 xfree86: add per major-version driver/module subdirectories
Modules are now placed into a sub-directory by major Xserver release,
so we have less hassle with trying to load drivers w/ incompatible ABI.

The legacy directories are still searched (after the versioned ones)
for backwards compat with badly maintained proprietary drivers (Nvidia).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult a58dba71bd Revert "(!1991) xfree86: xf86Option: unexport xf86MarkOptionUsedByName()"
Reverting commit 63c8a689c3 on request by Nvidia
(proprietary driver)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 2ec00762f4 randr: re-export RRCrtcGetScanoutSize() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 1a534e204b randr: re-export RROutputSetNonDesktop() for Nvidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs this function for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 9696a151dd randr: re-export some resource type fields for NVidia legacy
NVidia's proprietary driver does it's own randr implementation (why ?)
and needs those fields for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult f25bf57cc2 xfree86: compat: re-export MarkClientException() for horryibly maintained Nvidia
NVidia yet again doing crazy shit in their proprietary drivers:

This is an DIX-*internal* function for triggering client teardown when
connection broke or somehow lack of resources to accept new connections.
Video drivers have no business with that whatsoever - having them messing
with client client connections is just insane.

But still trying to be kind with Nvidia victims, thus adding a little wrapper
function under the old name. It spills out a log warning calling users to file
bug reports their driver vendor.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 0b9a2fc6b0 dix: rename MarkClientException() to dixMarkClientException()
DIX functions should have proper naming.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 6a3b60cfe7 xfree86: increase ABI versions
Since *a lot* has changed since last Xserver release, need to increase
the ABI version.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 1c0d2410ea dix: fix guards in dix/window_priv.h
Renaming the guard define to _XSERVER_DIX_WINDOW_PRIV_H

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 2075d875ed README.md: add upgrade notice
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult c8a776f662 xfree86: compat: re-add xf86Msg() for badly maintained drivers.
NVidia yet again lagging behind a year with trivial cleanups,
even though they're informed about this function being deprecated
and dropped.

It spills out a log warning calling users to file bug reports their
driver vendor.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult d674029f1f Revert "(!1987) glamor: unexport GLAMOR_CREATE_PIXMAP_* defines"
This reverts commit 85267d38ac.

These are needed by the RDP module (www.xrdp.org).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 3d21a15f54 xfree86: fix possible buffer overflow in xf86PrintBanner()
There's chance of buffer overflow happending due lack of zero-termination
of printed string. Making sure the buffer is always propertly terminated.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1821

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 329b7c8631 xfree86: xf86Priv.h: unexport xf86HasTTYs()
Not used by any external 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 806748ddd4 xfree86: xf86Priv.h: unexport xf86CallDriverProbe()
Not used by any external 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 86b05c5fae xfree86: xf86Priv.h: unexport xf86LoadModules()
Not used by any external 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 2af74d6985 xfree86: xf86Priv.h: unexport xf86CloseLog()
Not used by any external 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 bb89c30942 xfree86: xf86Priv.h: unexport xf86LogInit()
Not used by any external 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 7b4f951670 xfree86: xf86Priv.h: unexport xf86PMConfirmEventToOs field
Not used by any external 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 5112ab6537 xfree86: xf86Priv.h: unexport xf86PMGetEventFromOs field
Not used by any external 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 b4daa83ef2 xfree86: xf86Priv.h: unexport xf86HandlePMEvents()
Not used by any external 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 9f87f854ea xfree86: xf86Priv.h: unexport xf86Wakeup()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8ec5445ff0 xfree86: xf86Priv.h: unexport DoShowOptions()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 77ec0be813 xfree86: xf86Priv.h: unexport DoConfigure()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 2890d16aab xfree86: xf86Priv.h: unexport xf86PathIsSafe()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 2172796323 xfree86: xf86Priv.h: unexport xf86RemoveDevFromEntity()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 42092e98c5 xfree86: xf86Priv.h: unexport xf86ClearEntityListForScreen()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8894397c07 xfree86: xf86Priv.h: unexport xf86PostProbe()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c22caf754b xfree86: xf86Priv.h: unexport xf86BusConfig()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 3bda517f9b xfree86: xf86Priv.h: unexport xf86DefaultModes field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult dc632a43d1 xfree86: xf86Priv.h: drop DEFAULT_VERBOSE and DEFAULT_LOG_VERBOSE defines
Not used by any external drivers, so we can use their values directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult ee512c3cc2 xfree86: xf86Priv.h: unexport xf86LogVerbose field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult ea5509a95f xfree86: xf86Priv.h: unexport xf86Verbose field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 88f7ba963e xfree86: xf86Priv.h: unexport xf86VisualNames field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 7f5ff374b6 xfree86: xf86Priv.h: unexport xf86Initialising field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 734c4a6462 xfree86: xf86Priv.h: unexport xf86Resetting field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8a0ec43575 xfree86: xf86Priv.h: unexport xf86NumDrivers field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult a4e81a4e09 xfree86: xf86Priv.h: xf86LogFileWasOpened fields
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 134f5b4665 xfree86: xf86Priv.h: xf86LogFileFrom field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 61c5d14cf5 xfree86: xf86Priv.h: xf86LogFile field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 4081e13245 xfree86: xf86Priv.h: unexport xf86ModPathFrom
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 712dc3d368 xfree86: xf86Priv.h: unexport xf86ModulePath field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 48e1f66730 xfree86: xf86Priv.h: unexport xf86Gamma field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c3f9b81144 xfree86: xf86Priv.h: unexport xf86FlipPixels()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult d3ebfeeebd xfree86: xf86Priv.h: unexport xf86Weight field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 266816acf6 xfree86: xf86Priv.h: unexport xf86KeyboardName field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 14dc3a612c xfree86: xf86Priv.h: unexport xf86PointerName field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 6224e4588c xfree86: xf86Priv.h: unexport xf86ScreenName field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c42f5ff3a0 xfree86: xf86Priv.h: unexport xf86LayoutName field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c0ade6f8e7 xfree86: xf86Priv.h: unexport xf86acpiDisableFlag field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult dcf6026928 xfree86: xf86Priv.h: unexport xf86xkbdirFlag field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult cbfa63ddd9 xfree86: xf86Priv.h: unexport xf86silkenMouseDisableFlag field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 663030e9d0 xfree86: xf86Priv.h: unexport xf86bsDisableFlag field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8ab1c6ea46 xfree86: xf86Priv.h: unexport xf86bsEnableFlag field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5c76b3cdd7 xfree86: xf86Priv.h: drop unused xf86sFlag field
Not actually used, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult f7b6160be1 xfree86: xf86Priv.h: unexport xf86fpFlag field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult eef150e6a5 xfree86: xf86Priv.h: unexport xf86VidModeAllowNonLocal field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 11ff819b19 xfree86: xf86Priv.h: unexport xf86VidModeDisabled field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult b280c5b85c xfree86: xf86Priv.h: unexport xf86AutoBindGPUDisabled field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 57c023693b xfree86: xf86Priv.h: unexport xf86AllowMouseOpenFail field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 836170c291 xfree86: xf86Priv.h: unexport xf86ConfigDir field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5ff825d55c xfree86: xf86Priv.h: unexport xf86ConfigFile field
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 27c65bc678 xfree86: xf86.h: unexport xf86ExtensionInit()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 7eec3cf58f xfree86: xf86.h: unexport xf86RandRInit()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult d9cdde7ff9 xfree86: xf86.h: unexport xf86CheckModeForDriver()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult da32a8b91a xfree86: xf86.h: unexport xf86ModeStatusToString()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 6812f6c40a xfree86: xf86.h: unexport xf86DeleteScreen()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 4b5a654f9a xfree86: xf86.h: unexport xf86DeleteDriver()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8ab84103fd xfree86: xf86.h: unexport xf86EnableInputDeviceForVTSwitch()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 32597da0ce xfree86: xf86.h: unexport xf86VTEnter()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult fdc4140855 xfree86: xf86.h: unexport xf86VTOwner()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 889c73cf1f xfree86: xf86.h: unexport xf86ProcessActionEvent()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult b488330e3b xfree86: xf86.h: unexport xf86SetConsoleHandler()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 4f689d3dec xfree86: xf86.h: unexport xf86InitOrigins()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8f199fa4c9 xfree86: xf86.h: unexport xf86ZoomViewport()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5554c7127b xfree86: xf86.h: unexport xf86InitViewport()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5851400c31 xfree86: xf86.h: unexport xf86LockZoom()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 1fbddfd8b1 xfree86: xf86.h: unexport xf86FindScreenForEntity()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult cdea9dc133 xfree86: xf86.h: unexport xf86IsEntityPrimary()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 6b26542e38 xfree86: xf86.h: unexport xf86RemoveEntityFromScreen()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8ad347869c xfree86: xf86.h: unexport xf86DriverHasEntities()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 117ed67130 xfree86: xf86.h: unexport xf86ComparePciBusString()
Not used by any external drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8abc8785f3 xfree86: xf86.h: unexport pciSlotClaimed field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5720dd6c0d xfree86: xf86.h: unexport platformSlotClaimed field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult fd9a447dc8 xfree86: xf86.h: unexport sbusSlotClaimed field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 119c0efeb4 xfree86: xf86.h: unexport fbSlotClaimed field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 819df143d4 xfree86: xf86.h: unexport xf86ProbeIgnorePrimary field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult bc4a02ae20 xfree86: xf86.h: unexport xf86DoConfigurePass1 field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult ea1ee4e5b1 xfree86: xf86.h: unexport xf86DoConfigure()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult edf87483ca xfree86: xf86.h: make xf86VTLeave() static
Only used locally in xf86Events.c

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult f905c7ea5b xfree86: xf86.h: make xf86ShowClockRanges() static
Only used locally inside xf86Mode.c.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 9e0aa45717 xfree86: xf86.h: make xf86AddPixFormat() static
Only used locally inside xf86Helper.c.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 4e07f3c1e0 xfree86: xf86.h: make xf86DisableInputDeviceForVTSwitch() static
Only used locally inside xf86Events.c

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 281e12426f xfree86: xf86.h: make xf86EnableGeneralHandler() static
Only used inside xf86Events.c

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 361d60fde6 xfree86: xf86.h: make xf86DisableGeneralHandler() static
Only used internally inside of xf86Events.c

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 2eb37f8adb xfree86: xf86.h: make xf86EnableInputHandler() static
Only used locally inside xf86Events.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 53c0e4a7a4 xfree86: xf86.h: make xf86DisableInputHandler() static
Only used locally inside xf86Events.c.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult e2f78e688a xfree86: xf86.h: make xf86DoShowOptions field static
Only used inside xf86Init, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 83ed3e12c4 xfree86: xf86.h: drop xf86GetVidModeEnabled()
Not used externally, and not actually necessary - we can use the
xf86Info.vidModeEnabled field directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult be1bdf864b xfree86: xf86.h: drop xf86GetVidModeAllowNonLocal()
Not used externally, and not actually necessary - we can use the
xf86Info.vidModeAllowNonLocal field directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult b7d4f00545 xfree86: xf86.h: drop xf86GetFlipPixels()
Not used externally, and not actually necessary - we can use the
xf86FlipPixels field directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 921298139b xfree86: xf86.h: drop unused xf86UpdateDesktopDimensions()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 43f36d9ce3 xfree86: xf86.h: drop unused xf86RandRSetNewVirtualAndDimensions()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 643b707f2f xfree86: xf86.h: drop unused xf86GetRotation()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 585025c395 xfree86: xf86.h: drop unused xf86IsScreenPrimary()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 3b02813ba9 xfree86: xf86.h: drop unused xf86FindXvOptions()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 3f7bfaf3ea xfree86: xf86.h: drop unused xf86GetModInDevEnabled()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 70640c195c xfree86: xf86.h: drop unused xf86GetModInDevAllowNonLocal()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 7ecaeb7beb xfree86: xf86.h: drop unused xf86ServerIsResetting()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 490e9eb19c xfree86: xf86.h: drop unused xf86GetWeight()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 872afc6396 xfree86: xf86.h: drop unused xf86GetDepth()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult ec35a0510c xfree86: xf86.h: drop unused xf86PrintBacktrace()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult ac886f1501 xfree86: xf86.h: drop unused xf86RemoveInputHandler()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c965e1f09f xfree86: xf86.h: drop unused xf86AddInputHandler()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5e842bf764 xfree86: xf86.h: drop unused xf86GetFbInfoForScreen()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult a6579faa43 xfree86: xf86.h: drop BOOLTOSTRING
Not used anywhere, so no need to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult d31d3178bf xfree86: xf86.h: drop XF86FLIP_PIXELS
Not used anywhere, so no need to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 149f52dc9c xfree86: xf86.h: unexport xf86ConfigDRI field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 224bcf234d xfree86: xf86Config: drop unused xf86DRI2Enabled()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 34529d788f xfree86: xf86Config: consolidate xf86configptr declarations
Instead of having several separate exern declarations in various
source files, using one central one xf86Config.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult af29902c5c xfree86: xf86Config: unexport xf86configptr
Not used by any external drivers, and this header isn't even installed
in the SDK, so no need to keep this field exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5387f9d7f1 Update README.md for Xlibre
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult d51814d4bd os: move xdm function vector types from osdep.h to xdmcp.h
These are only needed in xdmcp.h, so move them there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult d5dc80aebe xkb: unexport XkbRF_VarDefsRec struct
No used outside of xkb, so no need to keep it in public API header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult e0dd3c9c45 it's time to add a CoC (code of conduct)
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 59a3df5645 xwin: fix NULL parameter in printf arguments
> ../hw/xwin/winprefs.c:625:9: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
>  625 |         ErrorF("LoadPreferences: %s not found\n", path);
>      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult deee51a5ff mi: miInitVisuals: clean up variable declarations
The code is easier to understand when variables are declared where they're
used for the first time, scoped to where they're needed and not reused
for separate things.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c90974c00d xnest: add pixmap depths to global depth list
Right now, we're only registering the depths of our visuals, which are
mirroring upstream's visuals. But forgotten to register the pixmap depths
that don't have an assiocated visual.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 9ab29c305f ci: add driver: xf86-video-xgi (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult f4d1506617 ci: add driver: xf86-video-voodoo (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult e6fda5ab4a ci: add driver: xf86-video-vbox (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 6c7dbe354c ci: add driver: xf86-video-v4l (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult ee385a06d6 ci: add driver: xf86-video-trident (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult be4ce6f9f5 ci: add driver: xf86-video-tdfx (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 0c0f53bce5 ci: add driver: xf86-video-suntcx (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 1a2afa634b ci: add driver: xf86-video-sunleo (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult a06d1cf49b ci: add driver: xf86-video-sunffb (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult fdc942136b ci: add driver: xf86-video-suncg6 (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 57881b4ff0 ci: add driver: xf86-video-suncg3 (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 2d9c542e79 ci: add driver: xf86-video-suncg14 (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 7359ee67c4 ci: add driver: xf86-video-sisusb (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 95533705ca ci: add driver: xf86-video-sis (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult b0dcbd2028 ci: add driver: xf86-video-siliconmotion (incubate)
Need to use Xlibre incubate branch, since upstream lacks vital bugfixes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 6aad3239c9 ci: add driver: xf86-video-savage (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 54249a85bf ci: add driver: xf86-video-s3virge (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 0d0e4c4f2e ci: add driver: xf86-video-rendition (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 05e54ca0c5 ci: add driver: xf86-video-r128 (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 827b928063 ci: add driver: xf86-video-nv (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 5838cc46b5 ci: add driver: xf86-video-nouveau (1.0.18)
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult c984cf9167 ci: add driver: xf86-video-neomagic (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 02c512f5a7 ci: add driver: xf86-video-mga (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 8d678306db ci: add driver: xf86-video-mach (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult d4c63196c0 ci: add driver: xf86-video-i740 (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 34401b8e2e ci: add driver: xf86-video-i128 (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult fd7ddc827d ci: add driver: xf86-video-fbdev (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult 65991538da ci: add driver: xf86-video-dummy (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult df5ed7aa04 ci: add driver: xf86-video-cirrus (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult a6fce4f215 ci: add driver: xf86-video-chips (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult c1b67a3521 ci: add driver: xf86-video-ast (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 0f990006cf ci: add driver: xf86-video-ark (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult e282eda3dc ci: add driver: xf86-video-apm (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 004f1c44dd ci: add driver: xf86-input-void (master)
Last release is too old.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult c3eacdc42a ci: add driver: xf86-input-vmmouse (master)
Needs bugfixes not released yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 21a0e5bcea ci: add driver: xf86-input-joystick (master)
Add building the joystick input driver.
Needs bugfixes not released yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 36ad9e4793 ci: add driver: xf86-input-elographics (1.4.4)
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 55459f835c ci: always build with drivers
Make sure drivers are always build-tested.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 50e4305c32 ci: driver update: xf86-video-vesa (master)
No release yet, so we have to use a specific commit (latest master).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 41a798ecdb ci: driver update: xf86-video-vmware (master)
No release yet, so we have to use a specific commit (latest master).
Desperately need some bug fixes not in last release yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 52a695e2f4 ci: driver update: xf86-video-ati (master)
No release yet, so we have to use a specific commit (latest master).
Desperately need some bug fixes not in last release yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 8f6b7ef4f7 ci: driver update: xf86-video-amdgpu (master)
No release yet, so we have to use a specific commit (latest master).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 88c1eba7b3 ci: driver update: xf86-input-synaptics-1.10.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 749ab9c9d2 ci: driver update: xf86-input-libinput-1.5.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult f956eba9ee ci: driver update: xf86-input-evdev-2.11.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 8936571a57 ci: use xlibre branch of xf86-video-qxl
Desperately need some bug fixes, that aren't in upstream yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 80f379ed1e ci: use xlibre branch for xf86-video-intel driver
It's needs a bunch of fixes that still aren't upstreamed yet.
Intel driver team seems to be in sleeping beauty's coma :o

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 6b813d16a2 ci: update libdrm to 2.4.121
Needed for newer version of amdgpu driver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 4f70b1bed5 ci: drop useless `check-commits` stage
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 14e0b1715b dix: unexport ResizeVisualArray()
Not used by any drivers, and shouldn't be used by them.
Needs to _X_EXPORT'ed, as long as glx is a separate module.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult b04aeed760 Xi: unexport AssignTypeAndName()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 5c0cbd0f92 os: drop own implementation of strcasecmp() and strncasecmp()
These are POSIX standard since 2001, so shouldn't be needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 8f957c4e60 pseudoramiX: fix warning from unused REQUEST() macro calls
In the SProc*()s, lots of REQUEST() macro calls aren't needed and causing
warnings on unused variables:

    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXQueryVersion’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:408:5: note: in expansion of macro ‘REQUEST’
      408 |     REQUEST(xPanoramiXQueryVersionReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXGetState’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:419:5: note: in expansion of macro ‘REQUEST’
      419 |     REQUEST(xPanoramiXGetStateReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXGetScreenCount’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:430:5: note: in expansion of macro ‘REQUEST’
      430 |     REQUEST(xPanoramiXGetScreenCountReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXGetScreenSize’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:441:5: note: in expansion of macro ‘REQUEST’
      441 |     REQUEST(xPanoramiXGetScreenSizeReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXIsActive’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:452:5: note: in expansion of macro ‘REQUEST’
      452 |     REQUEST(xXineramaIsActiveReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXQueryScreens’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:463:5: note: in expansion of macro ‘REQUEST’
      463 |     REQUEST(xXineramaQueryScreensReq);
          |     ^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 22d73b0f64 xfree86: man: add -syslogverbse flag
Document the newly added -syslogverbose command line flag.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 625c657a4c os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult e8d8047fd9 os: helper for parsing an counting-flag or value-flag option
Parses an option that may either be used for setting an integer value or
given one or multiple times (without argument) to increase an value

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 945edb0186 meson.build: move writing conf_data into tail of main meson file
This allows us to do further probing in the included meson files:
Individual subdirectories (eg. DDXes, extensions, OS layer, ...)
can now probe things that are only relevant to them - no need to fill
the already too fat includes/meson.build with even more things.

Preparation for upcoming commits that'll make us of that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 90442a3577 os: log: drop obsolete LogSetParameter()
The variables that can be set via this function are all now being
accessed directly. Not callers left, so drop it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 2a32187a38 os: directly set log file sync flag, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a
simple bool variable. Setting the sync flag really is nothing more than just
writing some value into a variable, so it's trivial to just to do that, instead
of having an unncessarily complex "universal setter" for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 09a95d82de os: directly set log file verbosity level, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a
simple int variable. Setting verbosity level really is nothing more than just
writing some value into a variable, so it's trivial to just to do that, instead
of having an unncessarily complex "universal setter" for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult ae7c32abf6 os: directly set console verbosity level, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a
simple int variable. Setting verbosity level really is nothing more than just
writing some value into a variable, so it's trivial to just to do that, instead
of having an unncessarily complex "universal setter" for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 7c51bcb093 os: unexport internal logging functions
Lots of logging functions, especially init and teardown aren't called
by any drivers/modules, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 9a82f5c30b drop remains of cygwin support
Cygwin support doesn't seem to be used anymore, so it can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 9741f0a256 move systemd-logind.h to hw/xfree86/os-support/linux
systemd is linux specific and the actual implementation is under the
os-support layer of xfree86 ddx. Thus no need to keep it in global
include directory, putting it onto the linux specific os-support instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult c29bda1c51 xfree86: parser: rename STRING for fixing name conflict
Resolve name conflict with Sun's <sys/kbd.h> by renaming STRING enum
value to XF86_TOKEN_STRING.

This way, don't need the special #undef hack anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 4bc4ad19aa meson.build: fix missing dependencies in xorg-server.pc
xorg-server.pc missed a few dependencies, so consumers might not
get them and break build.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult f3faa4c84d os: fix link failure on Illumos
On SunOS, the BSD socket API as well as hostname lookups isn't
implemented in libc, but separate libraries. We need to link them
explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 1708c689a8 os: fix FTBS on Illumos due missing symbols
Several feature defines need to be set before including system headers,
otherwise build breaks:

> /usr/include/X11/Xtrans/Xtranssock.c: In function '_XSERVTransSocketRead':
> /usr/include/X11/Xtrans/Xtranssock.c:2161:14: error: 'struct msghdr' has no member named 'msg_control'
>  2161 |             .msg_control = cmsgbuf.buf,
>       |              ^~~~~~~~~~~
> /usr/include/X11/Xtrans/Xtranssock.c:2162:14: error: 'struct msghdr' has no member named 'msg_controllen'
>  2162 |             .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int))
>       |              ^~~~~~~~~~~~~~
>
> ../os/access.c:339:14: error: implicit declaration of function 'asprintf'; did you mean 'Xasprintf'? [-Werror=implicit-function-declaration]
>   339 |     length = asprintf(addr, "%s%c%s", type, delimiter, value);
>       |              ^~~~~~~~
>       |              Xasprintf

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult da7197d5d2 dix: move over private defintions from selection.h to private header
Move over private definitions to a new private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 1f4cae4942 dix: unexport selection functions
No driver needs them, so no reason to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult a13a1e9264 dix: don't install selection.h anymore
This file isn't included by any driver - not even indirectly, and hard
to imagine any driver ever needs it, so no need to keep it installed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 26328f81a9 xfree86: vidmode: unexport noXFree86VidModeExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult dac14b887e xfree86: dga: unexport noXFree86DGAExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 6b2e379cc7 xfree86: dri2: unexport noXFree86DRI2Extension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult a42072e663 xfree86: dri: unexport noXFree86DRIExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 3c028a8cc0 miext: move over extinit_priv.h from include
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult b6c72bc9f5 treewide: clean up remaining consumers of extinit.h
Several sources including it without need. For consistency, those who still
need someting from there should include exitinit_priv.h (which also pulls
in extinit.h)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 6db12450fe Xext: xf86bigfont: unexport noXFree86BigfontExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 592d8fe8f5 Xext: security: unexport noSecurityExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 76cdf2f838 Xext: saver: unexport noScreenSaverExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 0ccb78b096 present: unexport present_extension_init()
It's not called by drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ec7719dceb xtest: unexport noTestExtensions field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 42548766f6 damage: hand in request struct into doDamageCreate() and PanoramiXDamageCreate()
Saves us a little bit of duplicate request checking.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5b4696368a damage: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 579ece670b damage: don't block requests when version not requested yet
The original intention was negotiating versions before any further requests
can be processed, so requests that might become incompatible in future versions
still can be dispatched correctly. But practically that's never been the case:
there's just one major version, and it's unlikely that a new *major* version
(that might be incompatible with the current one, using same request codes for
different things) will come in the forseeable future.

So this extra logic isn't practically needed and just complicates dispatching.
Dropping it clears the road for further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5e56e15191 damage: untwist Xinerma handling
The diffenciation between Xinerama and single screen version is by tweaking
call vectors unncessarily complicated: it the only reason why these are
needed in the first place. Finally, it's just about one function, so it's
much easier just branching off in ProcDamageCreate() in case of Xinerama
is enabled.

This also clears the road for further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 659b1dfa00 damage: minor code formatting cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a79dd9b264 Xext: shm: move client local check into procs
Move extra complexity out of the dispatch functions, so they're
really just switch/case statements calling the actual handler procs.
Preparation for further steps.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult c67b05e653 Xext: shm: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 850da1ad5f xace: export XaceRegisterCallback() and XaceDeleteCallback()
Allow drivers to use Xace as a clean way for retrieving property updates.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 45eb1a0af3 modesetting: use new VRR mode signaling DDX/driver API
Instead of highjacking core request handlers, use the recently introduced
DDX/driver API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 580f88464d dix: add generic Xinerama capable VRR infrastructure
We don't have a standard protocol for enabling VRR yet, but some time ago an
ad-hoc had been made in the amdgpu driver (later also copied to modsetting),
which works by client setting the _VARIABLE_REFRESH window property.

The way it's currently done - driver is highjacking the X_ChangeProperty and
X_DeleteProperty request handlers - is pretty fragile, and is also a violation
of layers: drivers never should be twisted with core protocol details. (And in
the future, this should be done by some suitable extension).

Another problem is Xinerama: when it's enabled, this only works on the first
screen - the others won't ever see this signal, no matter on which one(s) the
Window is physically placed (for the wire protocol, all windows are on screen 0,
unless the client explicitly creates them on another one)

This commit adds a generic Screen proc for telling the DDX, whether the VRR mode
shall be changed (for now, it's only DISABLED and ENABLED). Drivers can hook into
here in order to receive this signal, w/o having to highjack any core request
handlers. Catching the property change is now entirely done in the DIX.

The (non-standard) status qou of (ab)using window properties is kept, but it's
now also easy to add a new signaling mechanism, in case a standard is agreed on.

Yet a quite naive implementation (eg. not acting on moving windows between screens),
but enough to fix the most pressing problems supporting extra screens in general,
as well as stopping the highjacking of core request handlers by drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 8124a0dc68 dix: don't refuse creating windows with different color depths and w/o border
XServer refuses the create windows with different color depth than the parent's,
just in the special case that neither border pixmap nor border pixel is given,
even if the screen supports it. (that's also one of the reasons why Xnest fails
to run with different color depths than the default one)

it really doesn't make sense to deny this, while it's allowed when having a
border color or pixmap set.

Fixes: ded6147b - R6.6 is the Xorg base-line
Closes:https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1644
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e439636c39 Xnest: dont use VLA
Replace VLA usage by calloc()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5038b4e413 Xnest: use xcb_window_t instead of Window
Since we're now using xcb for upstream X11 connection, it's cleaner to
use it's type for the window IDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5913906151 Xnest: dont link Xlib anymore
Now that we completely ported from Xlib to XCB, we can finally stop
importing Xlib :)

FIN.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 9969258e44 Xnest: use XCB for upstream connection
Now that no Xlib operations (besides opening and closing connection)
aren't used anymore, we can move over the last pieces and use XCB
instead of Xlib for connecting the upstream Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 4716ee9981 Xnest: use XCB for event loop
Now that no X11 calls are being done via Xlib anymore, we're free to
also move over event receiving, leaving Xlib pretty much unused.

Also need to add a simple event queue mechanism, because we've go a
screen operation (see xnestBitBlitHelper) that needs to collect up
certain events for it's return value.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 8c701832ea Xnest: drop xnestWindowExposures micro-optimization
xnestWindowExposures() is a micro-optimization for the specific case that
a newly created window receives exposure events (from our upstream server)
inside the region we're already exposing on our own (miWindowExposures()):
it peeks the Xlib event queue for all expose events, checks whether their
areas are inside our exposure region and requeue's those that aren't.

Unfortunately, this depends on Xlib's internal queue mechamism, thus standing
in the way of moving to XCB (which doesn't have that).

Removing this doens't seem to make any practical difference, even with
demanding applications like GIMP. The only cost is potentially having some
initial window content painted twice, *if* the application really draws
something complicated right after creating the window.

*If* there'll really be a demand for such an optimization some day, it can
be reimplemented without any message queue: just redirecting all expose events
into recording them in a region, which is flushed out later. But for now,
there really doesn't seem to be any practical need for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 1f4cbdb448 Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 988cc9e496 Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5f5e6f110a Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 84be220cd4 Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 43b225c28c Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2ed4c16b36 Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 115a7ceb23 Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ae22721ae7 Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2956ea0f7d Xnest: use new lookup table for visuals and cmaps mappings
Use the visuals lookup table introduced by previous commit for
looking up local vs upstream visuals and their colormaps.
Replacing the the old Xlib visuals table.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6977718454 Xnest: screen: record visuals and cmaps in separate table
Record the associations between host's and our visuals as well their
corresponding cmaps in a global table, which's used later for lookups.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 822b82d831 Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6b5a8e001c Xnest: screen move assigment between depths and visual assignment to own function
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult c44225d17d Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult de13460b05 Xnest: replace XGetWindowAttributes() by xcb_get_geometry()
Use xcb function instead of Xlib, and also spare one additional
(unused) request.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 146538a475 Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 4a014637a4 Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3157b2e1dc Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 949bdc209c Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult b708a86d46 Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2b3a1c27c9 Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 170124c148 Xnest: add own copy of fixed xcb_xkb_get_kbd_by_name()
This is a temporary measure, until xcbproto / libxcb is fixed:
keep an own copy of the fixed xcb_xkb_get_kbd_by_name(), renamed
as xcb_xkb_get_kbd_by_name_1().

Once xcbproto/libxcb is fixed (and new xcb release is out), this
commit can be reverted.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e5eec08f33 Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 261d22a444 Xnest: replace XSelectInput() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 415594fd67 Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a05b912d06 Xnest: fetch supported pixmap formats from xcb setup data
There's even no need to keep our own copies, since we can ask XCB's
copy any time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e172253272 Xnest: fetch allowed screen depths from xcb screen info
There's even no need to keep our own copies, since we can ask XCB's
copy any time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 07829c18f8 Xnest: Pixmap: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 0836bd402f Xnest: GC: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult d3d0ffe0cf Xnest: replace XDestroyWindow() by xnest_destroy_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 91371e3233 Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 83c65b3ed8 Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult c79c0dca06 Xnest: replace XDefineCursor() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a7dc2b9524 Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2305e35144 Xnest: replace XFreeCursor() by xcb_free_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 7bfb3fe432 Xnest: replace XStoreColors() by xcb_store_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult c9c52faa16 Xnest: replace XQueryColors() by xcb_query_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2880d18bda Xnest: replace XSetWindowColormap() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 43e1cc6856 Xnest: replace XSetWMColormapWindows() by xcb_icccm_set_wm_colormap_windows_checked()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6b14e213a3 Xnest: use XIDs directly, instead of Xlib's GC
Now that no Xlib drawing functions used anymore, we can finally switch over
to using GC XID's directly, instead of Xlib's GC struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult c263e6220b Xnest: GC: set stipple filling via xcb_change_gc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 284eff8e96 Xnest: replace XSetClipMask() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 9997ad9ab1 Xnest: replace XSetClipRectangles() by xnset_set_clip_rectangles()
Use XCB for setting clip rectangles.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3dda537e83 Xnest: replace XSetDashes() by xnest_set_dashes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ebbaf44e9f Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e71cf9c53a Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 1ecba263ea Xnest: replace XChangePointerControl() by xcb_change_pointer_control
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2f2209005e Xnest: replace XChangeWindowAttributes() by xcb_aux_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5b5bd8bbb7 Xnest: replace XDrawImageString() by xcb_image_text_8()
Replace XDrawImageString() by xcb_image_text_8(), as well as their 16-bit
counterparts.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult d1d10dc245 Xnest: replace XDrawString[8|16]() by xcb_poly_text_[8|16]()
Replace XDrawString8() by xcb_poly_text_8(), as well as XDrawString16()
by xcb_poly_text_16(). Some care needs to be taken to prepend the xTextElt
header before sending the request out.

GC operation handlers don't need to care about poly-strings or length
above 254, as this is already handled by their caller, doPolyText().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 63627a9b9b Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ef71a7ac7e Xnest: directly pass ClearArea request to upstream server
Instead of going through mi machinery, just pass the ClearArea
request to the upstream window.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3df9aebbb1 Xnest: replace XFillArcs() by xcb_poly_fill_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6ee20d26da Xnest: replace XFillPolygon() by xcb_fill_poly()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 7400d749c3 Xnest: replace XCopyPlane() by xcb_copy_plane()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2552808327 Xnest: replace XCopyArea() by xcb_copy_area()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a4027ec00e Xnest: replace XDrawArcs() by xcb_poly_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 63929e61c9 Xnest: replace XDrawRectangles() by xcb_poly_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult df6b75fa45 Xnest: replace XDrawSegments() by xcb_poly_segment()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 1656f12827 Xnest: replace XDrawLines() by xcb_poly_line()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult bae1243049 Xnest: replace XDrawPoints() by xcb_poly_point()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 911ef9c365 Xnest: replace XCreateColormap() / XFreeColormap() by xcb
Use xcb_create_colormap() and XFreeColormap() instead of XCreateColormap()
and XFreeColormap().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult edd0d03e0b Xnest: use xcb instead of XShapeCombineRegion() and XShapeCombineMask()
Using xcb_shape_rectangles() and xcb_shape_mask() instead of Xlib's
XShapeCombineRegion() and XShapeCombineMask().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult dbf6a04f8f Xnest: use xcb_put_image() for PutImage requests
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6684b2b2af Xnest: use xcb_put_image() for creating cursors
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3ab0bec860 Xnest: replace XCreatePixmapCursor() by xcb_create_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6252a4991f Xnest: replace XConfigureWindow() calls by xcb_configure_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e39ebbab54 Xnest: use xcb for creating / destroying pixmaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 43b73eb527 Xnest: replace XBell() by xcb_bell()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 245c23cc30 Xnest: use xcb for (un)mapping windows
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 646ced96b1 Xnest: replace XCreateWindow() by use xcb_create_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 04c6cc145e Xnest: fetch root visual ID from screen data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult c68ba314db Xnest: fetch keycode min/max from setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult f312058776 Xnest: fetch image metrics from xcb connection setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 8e41541568 Xnest: fetch default screen's root window from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 013374b8c1 Xnest: add helper for retrieving GC XID on upstream connection
Upcoming patches will need to retieve GC's XIDs on the upstream connection.
Moving this out into separate .c file, in order to not creating more
dependencies on Xlib headers, which we wanna get rid of.

For now, looking at the Xlib GC structure, attached to our DDX GCs.
When all users of the Xlib GC have gone (ie. moved all consumers to xcb),
we'll create the GC via xcb directly, thus replacing the Xlib GC struct
by XID - the interface of this helper will remain the same.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 9a91f519c3 Xnest: fetch default colormap from xcb screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e308ef648a Xnest: fetch root window depth from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ba26d6bd90 Xnest: fetch display size from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2ec930fc4a Xnest: fetch BlackPixel and WhitePixel from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 467ee9eba7 Xnest: fetch xcb setup data
Fetching the setup data from xcb instead of Xlib, storing in our own struct,
holding all information needed for one particular upstream connection.
For now, there's only one, but future multi-upstream implementation will
change this to an array (and storing pointers to particular upstream in
various places).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 9df6c7a542 Xnest: use XCB_EVENT_MASK_* defines
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult b00f66ca53 Xnest: use XCB*_NONE instead of None
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 60db30f517 Xnest: use XCB_BACK_PIXMAP_* defines
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 66d01cdc82 xnest: replace ExposureMask by XCB_EVENT_MASK_EXPOSURE
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3bcd8695eb Xnest: replace NotUseful by XCB_BACKING_STORE_NOT_USEFUL
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a65e44f91a Xnest: use XCB_CONFIG_WINDOW_* defines instead of CW*
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a24178f25f Xnest: use XCB_CW_* defines instead of CW*
Use XCB's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 20a9ed60f0 Xnest: add xcb and x11-xcb as dependency
In order to transition to XCB, we need to link xcb, but temporarily
also x11-xcb.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 638efbc06c Xext: xf86bigfont: drop unncessary zero assignments
When using static struct initialization, fields not explicitly
stated are automatically zero.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a88b71ef58 ci: enable xv and xvmc
Needed for the xf86-video-intel driver, so we should build-test it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult dd20a392be xfree86: common: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 7d3e56722c os: log: consolidate OS specific fsync() call into helper
Instead of having lots of #ifdef's, consolidating the conditionally
compiled fsync() call into a tiny inline helper.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 917d8dc207 os: log: drop now meaningless XLOG_FLUSH option
Since we're not indirectly writing via FILE anymore, this option has
become meaningless: it meant flushing out our in-process buffer to
the kernel, but we're now doing direct write() calls anyways.

xf86 still accepts the "flush" config file flag for backwards compatibility,
but it hasn't any practical meaning anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 11fc023a72 os: log via fd instead of FILE
Instead of maintaining both the logfile fd, as well as ANSI FILE pointer,
simplify it to just a fd.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 081f7a53e0 xkb: unexport XkbCopyControls()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult acbb361ccd xkb: unexport XkbDeviceApplyKeymap()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 15ba7a5f01 xkb: unexport XkbSendNewKeyboardNotify()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 45a830aa25 xkb: unexport XkbApplyVirtualModChanges()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5447558c6d xkb: unexport XkbApplyCompatMapToKey()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult b3d105a78b xkb: unexport XkbKeyTypesForCoreSymbols()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 37703270f4 xkb: unexport XkbChangeTypesOfKey()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 0ed5337be4 xkb: unexport XkbFreeInfo()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2b5817c651 xkb: unexport XkbChangeKeycodeRange()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6923c2acbe xkb: unexport XkbConvertCase()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult fb7ef7ac92 xkb: unexport XkbLookupNamedGeometry()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ff031fdb0c xkb: unexport XkbDisableComputedAutoRepeats()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3b30c23631 xkb: unexport XkbEnableDisableControls()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 72c4e97d74 xkb: unexport XkbProcessKeyboardEvent()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a741e50dd1 xkb: unexport XkbHandleActions()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3d2d776e8c xkb: unexport XkbHandleBell()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 7d53fa177b xkb: unexport XkbStateChangedFlags()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult b6f03c3ea1 xkb: unexport XkbCheckIndicatorMaps()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 6df734062e xkb: unexport XkbCheckSecondaryEffects()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3f653ca885 xkb: unexport XkbComputeDerivedState()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult b85b204987 xkb: unexport XkbIndicatorsToUpdate()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2281204668 xkb: unexport XkbUpdateAllDeviceIndicators()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ad06ced35d xkb: unexport XkbUpdateIndicators()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5cfe8cb09a xkb: unexport XkbSetIndicators()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a7ff657894 xkb: unexport XkbUpdateActions()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 9758438368 xkb: unexport XkbUpdateDescActions()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 4b4102ca29 xkb: unexport XkbResizeKeyActions()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3a468a9b8d xkb: unexport XkbResizeKeySyms()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult ed902e05b7 xkb: unexport XkbAdjustGroup()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 76da7c7bb2 xkb: unexport XkbVirtualModsToReal()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 75e0b1994b xkb: unexport XkbMaskForVMask()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult f2630429a5 xkb: unexport XkbSetActionKeyMods()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult f7e6bbead4 xkb: unexport XkbFreeComponentNames()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 94c65f958f xkb: unexport XkbResizeKeyType()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult f0748c22df xkb: unexport XkbCopyKeyTypes()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 7564ed0195 xkb: unexport XkbAllocControls()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 179e899252 xkb: unexport XkbAllocNames()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 4f0ddea222 xkb: unexport XkbAllocCompatMap()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 26b765243b xkb: unexport XkbAllocIndicatorMaps()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 7561198496 xkb: unexport XkbAllocKeyboard()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 25f7acbfa9 xkb: unexport XkbFreeNames()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult df6068c662 xkb: unexport XkbFreeCompatMap()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult d0cb2aabf8 xkb: unexport XkbSetExtension
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 67c1a51217 xkb: unexport XkbInitPrivates()
This isn't supposed to be called by drivers, so unexport it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult d87ca999d2 xkb: unexport XkbProcessArguments()
Neither used by any drivers, nor makes sense doing so, thus no need
to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 5348ca40db xkb: unexport XkbUseMsg()
Not used by any drivers, and wouldn't even make sense doing so,
thus no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult e70aeae0eb xkb: unexport XkbDDX*() functions
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 2eb90fc722 xkb: unexport led functions
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 969ed42208 xkb: unexport server/client map alloc/free funtions
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult b7d10e3e8d xkb: unexport keymap compile functions
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult d7b7a8b4f7 xkb: unexport XkbSrvLedInfo functions
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 691b51cfb8 xkb: unexport _XkbLookup*() functions
Not used by any drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3bd240cdee xkb: unexport notification sender functions
These aren't used by any drivers, so no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 827277821b xkb: unexport rules management functions
These aren't called by any driver, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3029236cf3 xkb: unexport key latch functions
These aren't used by drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult d16cd74129 xkb: unexport DDX entry points
These functions are entry points of the DDX (or stubs thereof), not supposed
to be called by any drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult fd7cf62ccc xkb: unexport client resource functions
These aren't used by any drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 97b98c18c3 xkb: unexport AccessX* functions
These aren't used by any drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult 3970fa674b xkb: unexport internal variables
These aren't used by any drivers/modules, and it doesn't seem make much
sense doing so, thus no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult a07e572665 xkb: unexport XKBDEVICEINFO() and xkbDevicePrivateKeyRec
These aren't used by any drivers/modules, so no need to keep 'em exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult db9f82ce2a xkb: move XkbFilterEvents() into private header
No need to keep non-exported functions in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult adf2ca2907 xkb: move event mask defines int private header
These are only used inside xkb internally, no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 1ed2685712 xkb: move *WRAP*() macros into private header
These are only used inside xkb internally, so no need to keep them
in a public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult cfcf686484 xkb: move _XkbErrCode*() macros into private header
These are only used internally in xkb, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 4638d865f7 xkb: move _XkbLibError macro into private header
It's only used internally in xkb.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 2d22dea09b xkb: move _XkbStateNotifyInProgress define into private header
It's only used in xkb internally.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 89cf70a31f xkb: move _XkbClient* flags into private header
These are only used by xkb internally.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult ed6fb03363 xkb: move XkbSLI_IsDefault() and XkbSLI_HasOwnState() into private header
These macros aren't used by any drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult e4f93dd59a xkb: move XkbSetCause* macros into private header.
These aren't used by any drivers/modules, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult c4c2150423 xkb: move _BEEP_* defines into private header
These are only used inside xkb, not by any drivers, so no need to
keep them in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 5db15367cf xkb: xkbsrv_priv.h: make includes self contained
Make sure everything it needs is explicitly included, so we don't need
to rely on some specific include order.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult c0dd33aee2 os: unexport xstrtokenize()
Not used by any external drivers/modules, so no need to keep it public.
Since modesetting is using it, still needs _X_EXPORT, as long as it's
a module.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 9ef5fc9a29 Xext: vidmode: untwist ProcVidModeGetAllModeLines() and use stack buffer
The ProcVidModeGetAllModeLines() is a bit complicated, because reply structs
differ depending the active protocol version. In order to make it easier to
understand and allow further simplification of the request/reply marshalling
(see ticket #1701), splitting the two protocol versions into separate functions.

Also collecting the whole payload in a stack buffer (size is already known
anyways), in order to save arbirary number of individual WriteToClient() calls,
but send out the whole reply in one pass, which in turn allows further
simplifications in the sending path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 285610b283 Xext: vidmode: ProcVidModeSetGammaRamp() simplify payload write out
WriteToClient() already checks for zero-length buffer and does nothing
in that case. So we can make the code a bit easier to read and also
allow further simplification of reply submission by upcoming commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 9b661813f1 Xext: vidmode: ProcVidModeSetGammaRamp() clean up length computation
Make computation of reply length a bit easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 5c12c7ad53 Xext: vidmode: ProcVidModeSetGammaRamp() declare variables where needed
Make the code a bit easier to understand by declaring the variables
where they're first used instead of at the very top of the function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 92ba36008e Xext: vidmode: ProcVidModeGetMonitor(): write reply payload at once.
Collect up the puzzle piezes of the reply payload into to a temporary buffer,
so we can send it as one block. This allows for further simplifications by
subsequent commits, as well as packet based transports and message based
compression.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 09588278e3 Xext: vidmode: ProcVidModeGetMonitor() simplify swapping/writing
We can simply call SwapLongs() before writing out the CARD32 arrays.
No need using for complicated call back logic.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult b82ac7b08f Xext: vidmode: ProcVidModeModModeLine(): move len variable into branch scope
Semantically these are separate values in each branch any only used there,
so it's a bit more clean to move the declaration into the branches.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult d1719bd3e5 Xext: vidmode: drop unnecessary if (client->swapped)
The WriteSwappedDataToClient() already checks whether client is swapped
and directly calls WriteToClient() if it's not.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 877b18d458 Xext: vidmode: simplify reply struct initialization
Coherently moving all reply struct decls and assignments into static
initialization right at declaration, just before it is getting byte-
swapped and sent out. Zero-assignments can be dropped here, since the
compiler automatically initializes all other fields to zero.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult de636d491b Xext: vidmode: tidy up multi-version request control flow, part 3
Some requests using different structs dependending on which protocol version
(v1 vs. v2) had been selected. That's is handled by coverting v1 structs into v2,
before proceeding with the actual handling.

The code flow of this is very complex and hard to understand. Cleaning this up
in several smaller steps, that are easier to digest.

This part moves the request payload structs (or pointers to them) into the
per-version branches. Within each branch following our usual scheme for
extension request handlers (eg. using the REQUEST*() macros and having a
pointer named `stuff` to the current request struct)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult ad26a0595e Xext: vidmode: tidy up multi-version request control flow, part 2
Some requests using different structs dependending on which protocol version
(v1 vs. v2) had been selected. That's is handled by coverting v1 structs into v2,
before proceeding with the actual handling.

The code flow of this is very complex and hard to understand. Cleaning this up
in several smaller steps, that are easier to digest.

This part is splitting the huge request handlers into upper and lower half,
where the upper is doing the version check and converting v1 requests into v2,
while the lower one is doing the actual request processing, operating on the
struct pointer passed in from the upper one, instead of the client struct's
request buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult f7280e51db Xext: vidmode: tidy up multi-version request control flow, part 1
Some requests using different structs dependending on which protocol version
(v1 vs. v2) had been selected. That's is handled by coverting v1 structs into v2,
before proceeding with the actual handling.

The code flow of this is very complex and hard to understand. Cleaning this up
in several smaller steps, that are easier to digest.

This moving the request size check into the if-version-X branches, to make it
some bit easier to undertand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 4137323e87 Xext: vidmode: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult aa9a93461d Xext: xres: ProcXResQueryClientIds() collect reply in one buffer
In order to allow simplifying the reply send path, collect the reply
fragments into one buffer, instead of arbitrary number of WriteToClient()
calls. This also makes it much easier for potentially new purely packet-based
transports which (eg. binder) that would need their own stream parsing logic.

This xres function is an exceptionally hard case, since payload is constructed
step by step, and it's size only known when finished. The current way of the
fragment handling still has lots of room for improvement (eg. using very small
number of allocations), but leaving this for later exercise.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 155540afa1 Xext: xres: ProcXResQueryClientResources() simplify payload write out
Collect the few bits in a local array, so one WriteToClient() call is
sufficient. That's also easing further simplifications in upcoming commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 3af9346edb Xext: xres: ProcXResQueryClients() simplify payload write out
Collect the few bits in a local array, so one WriteToClient() call is
sufficient. That's also easing further simplifications in upcoming commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 647d5a81ec Xext: xres: drop duplicate include
Drop duplicated #include <string.h>.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult d37ce05b94 Xext: xres: use static initialization and scoped ars
* use static initialization where applicable
* drop unneeded setting of zero values
* use scoped variables

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 6e1236dd10 dri3: simplify dispatcher
The dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 31ea61cd80 dri3: consolidate reply buffers
Allocate reply buffers on stack and put multiple fragments into one buffer,
in order to make it easier doing write out by generic macros, in subsequent
commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult ea78435fdd dri3: use static reply struct init on declaration
Make the code a bit easier to read by using initialization of the reply
structs, at the point of declaration. Most of them aren't written to later,
just passed into WriteReplyToClient(). Also dropping some useless zero
assignments (struct initializers automatically zero-out unmentioned fields).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult fbeee675fc xfixes: XFixesSelectCursorInput() use calloc()
In general safer coding practise to always use calloc() instead of risking
forgetting to zero-out some fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 5c09c89903 xfixes: canonicalize reply structures
Canonicalize all reply structs onto stack allocation and static
initialization, like already done in most other extension. So make
the code easier to understand and allow further simplifications by
subsequent commits (we can then use generic macros for doing the
actual sending, as well as byteorder swapping, size computation, etc),
Also gaining a little bit efficiency by skipping some heap allocations.

Dynamically sized payload buffers (where the upper bound isn't known),
are still allocated on heap.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 7a2a5bd692 xfixes: simplify dispatcher
The dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 4bfa7ba6f0 xfixes: untwist Xinerama handling
The current way of switching between Xinerama and single-screen handlers
is quite complicated and needs call vector tables that are changed on
the fly, which in turn makes dispatching more complicated.

Reworking this into a simple and straight code flow, where individual request
procs just look at a flag to decide whether to call the Xinerama or single
screen version.

This isn't just much easier to understand (and debug), but also removes the need
or the call vectors, thus allowing further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult f57131165a xkb: xkbgeom.h: drop stale forward declarations
There're lots of forward declarations for functions that don't exist
at all (possibly have been removed, but forgotten their prototypes).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult c931472ec3 xkb: drop unused XkbFreeGeomOverlayKeys()
Not called anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 4c939ad14e xkb: xkbgeom.h: drop unused XkbSetKey(Shape|Color) macros
Not used anywhere, so no need to keep them any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 003f2907be xkb: xkbgeom.h: drop unused XkbSetLogoDoodad(Color|Shape) macros
Not used anywhere, so no need to keep them any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 90f1acdbb2 xkb: xkbgeom.h: drop some unused XkbSetIndicatorDoodad*() macros
These macros aren't used anywhere:

* XkbSetIndicatorDoodadOnColor()
* XkbSetIndicatorDoodadOffColor()
* XkbSetIndicatorDoodadShape()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult c71f4a3f8c xkb: xkbgeom: drop unused XkbSetTextDoodadColor() macro
Not used anywhere, so no need to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 928618e46e xkb: xkbgeom: drop unused XkbSetShapeDoodad(Color|Shape) macros
These aren't used anywhere, so no need to keep them any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 029ee28a26 xkb: xkbgeom.h: drop unused XkbBounds(Width|Height) macros
These aren't used anywhere, so no need to keep them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 0f0016d247 xkb: xkbgeom: need to include <X11/Xdefs.h>
Using the type "Bool", which is defined in Xdefs.h, therefore this
header should be include, so we don't need to rely on it being
included indirectly by somebody else.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult ab7e808fe8 xkb: xkbgeom.h: drop #define's on function names
There's no use in redefining function names via preprocessor this
funny ways. Perhaps there once was back when that header used to
live outside the server tree, but that's decades ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 7e120f0f03 composite: simplify dispatcher
The dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 0bf08776c8 composite: untwist Xinerama handling
The current way of switching between Xinerama and single-screen handlers
is quite complicated and needs call vector tables that are changed on
the fly, which in turn makes dispatching more complicated.

Reworking this into a simple and straight code flow, where individual request
procs just look at a flag to decide whether to call the Xinerama or single
screen version.

This isn't just much easier to understand (and debug), but also removes the need
or the call vectors, thus allowing further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult ec4443f070 Xext: xvmc: skip reply payload assembly when no data to send
Instead of trying to calloc() zero-size blocks when there's no actual payload
to send, skip the whole part. This also helps reducing analyzer noise.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult e03b163b9b Xext: xvmc: simplify reply struct initialization
* use static initialization where possible
* put the lists into one one block, so they can be written in one pass
* simplify size computations

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 49a5292516 Xext: xvmc: use locally scoped counter variables
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult e462688554 Xext: xvmc: simplify dispatcher
The dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 091c818213 test: Xi: make sure client swapped flag is reset
Some test cases are recycling the ClientRec between swapped/unwapped runs.
Make sure the Client's swapped flag is always reset in those cases.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 1dbd46b21b Xi: use static reply struct init on declaration
Make the code a bit easier to read by using initialization of the reply
structs, at the point of declaration. Most of them aren't written to later,
just passed into WriteReplyToClient(). Also dropping some useless zero
assignments (struct initializers automatically zero-out unmentioned fields).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 8d47dc3b57 Xi: simplify dispatcher
The dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 7b40cc9718 xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once
Instead of dozens of little WriteToClient() calls, collect the sub-replies in
a buffer and send the whole reply out at once. This also allows more upcoming
simplifications in the send path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 9b3959214d xkb: split XkbSendGeometry()
This function is a funny beast: it assembles and writes out an xkbGetGeometryReply,
called in two different cases, ProcXkbGetGeometry() as well as ProcXkbGetKbdByName().
In the latter case the whole reply is contained in another one. That's the reason
why it's payload size is computed separately - the caller must know that in order
to set up the container's reply size correctly.

As preparation for upcoming simplifications of the reply send path, splitting off
this function into pieces: XkbAssembleGeometry() just assembles the reply payload,
while it's callers now responsible for preparing the request header and writing
out both pieces.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult b8d35928a4 xkb: split XkbSendIndicatorMap()
This function is a funny beast: it assembles and writes out an xkbGetIndicatorMapReply,
called in two different cases, ProcXkbGetIndicatorMap() as well as ProcXkbGetKbdByName().
In the latter case the whole reply is contained in another one. That's the reason
why it's payload size is computed separately - the caller must know that in order
to set up the container's reply size correctly.

As preparation for upcoming simplifications of the reply send path, splitting off
this function into pieces: XkbAssembleIndicatorMap() just assembles the reply payload,
while it's callers now responsible for preparing the request header and writing
out both pieces.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult d90335b8f1 xkb: split XkbSendCompatMap()
This function is a funny beast: it assembles and writes out an xkbGetCompatMapReply,
called in two different cases, ProcXkbGetCompatMap() as well as ProcXkbGetKbdByName().
In the latter case the whole reply is contained in another one. That's the reason
why it's payload size is computed separately - the caller must know that in order
to set up the container's reply size correctly.

As preparation for upcoming simplifications of the reply send path, splitting off
this function into pieces: XkbAssembleCompatMap() just assembles the reply payload,
while it's callers now responsible for preparing the request header and writing
out both pieces.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 182404fde6 xkb: split XkbSendMap()
This function is a funny beast: it assembles and writes out an xkbGetMapReply,
called in two different cases, ProcXkbGetMap() as well as ProcXkbGetKbdByName().
In the latter case the whole reply is contained in another one. That's the reason
why it's payload size is computed separately - the caller must know that in order
to set up the container's reply size correctly.

As preparation for upcoming simplifications of the reply send path, splitting off
this function into pieces: XkbAssembleMap() just assembles the reply payload,
while it's callers now responsible for preparing the request header and writing
out both pieces.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult e6f2b3721b xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
For easier reading, move th sub-reply structs down to where they're used
first and use static initialization for the common fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 5de54750ec xkb: ProcXkbGetKbdByName() simplify reply struct initialization
Move down the declaration of the reply struct, right before swapping and sending
and use static initialization.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 5316da3795 xkb: XkbSendGeometry(): pass in struct as value instead of pointer
The function doesn't need to pass anything back via this pointer, it's
the last consumer of this struct. Make understanding the code a bit easier
and clear the road for further simplifications by passing the struct as
value instead of pointer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 449e8ea192 xkb: XkbSendNames(): move common code into a helper macro
A little bit of simplification by putting repeated statements into macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult b3e91dea97 xkb: XkbSendNames(): pass in struct as value instead of pointer
The function doesn't need to pass anything back via this pointer, it's
the last consumer of this struct. Make understanding the code a bit easier
and clear the road for further simplifications by passing the struct as
value instead of pointer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 580b0b7aff xkb: let SendDeviceLedFBs() fill buffer instead of writing directly
Make the code flow a bit easier to understand and allow further simplification
by now just having to write out one additional payload as one block.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult bc22eb32ee xkb: ProcXkbGetDeviceInfo(): consolidate buffers to reduce writes
Putting both payload pieces into one buffer, so it can be written out
with only one call.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 031b93642b xkb: CheckDeviceLedFBs(): untwist parameters
It's hard to see which fields of the xkbGetDeviceInfoReply struct it's
reading or writing, and that complicates further simplifications of the
caller. So instead let the caller pass in the relevant fields and do the
modifications on the reply structs on its own.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult cf739f7fd5 xkb: XkbSendIndicatorMap(): little simplification
A bit simplification in code flow.
The extra length check (did we write as much as intended?) isn't necessary,
since the buffer size is computed by the very same data before this
function is called.

Hint: the size computation must be done before calling this one, because
the reply might be encapsulated in another one (xkbGetKbdByName).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 800025954e xkb: XkbSendIndicatorMap() pass in reply struct as value instead of pointer
It's not passing back any data via that pointer and actually the last
consumer of it. Changing it to value instead of pointer clears the
road for further simplifications by subsequent patches.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult f3176bae97 xkb: XkbSendCompatMap(): little cleanup and simplification
Make it a bit simpler and easier to read.

calloc() and WriteToClient() can handle zero lengths very well.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult d1555edcc2 xkb: XkbSendCompatMap(): pass xkbGetCompatMapReply as value instead of pointer
It's not passing back any data via that pointer and actually the last
consumer of it. Changing it to value instead of pointer clears the
road for further simplifications by subsequent patches.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 73fd170987 xkb: XkbSendMap(): some little variable decl cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 724e92f83a xkb: XkbSendMap() pass in reply struct as value instead of pointer
It's not passing back any data via that pointer and actually the last
consumer of it. Changing it to value instead of pointer clears the
road for further simplifications by subsequent patches.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 6895238e24 xkb: XkbWriteVirtualModMap(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 0d00e1bd23 xkb: XkbWriteModifierMap(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 9200709ce2 xkb: XkbWriteExplicit(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 0670cd5a6a xkb: XkbWriteKeyBehaviors(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult b0f6b461ff xkb: XkbWriteKeyActions(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 2ca5e4c560 xkb: XkbWriteKeyTypes(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult c9a5209c5c xkb: XkbWriteKeySyms(): only pass in the needed data
We don't need the whole struct here, especially do we not wanna change it.
Therefore only pass in what's really needed, so it gets easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 67987d9086 xkb: SProcXkbSelectEvents(): simplify swapping
The swapping logic isn't entirely trivial to understand and can be
simplified.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 41ae87912b xkb: simplify reply struct initialization
Use static initializaton as much as possible and drop unnecessary
or duplicate zero assignments.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 0180cf39f3 os.h: drop obsolete xallocarray()
This macro isn't used anywhere (also not in drivers), so no need
to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult e479496802 panoramix: protect against allocaton failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 62ac324b10 xwayland: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult b596d329ec xwayland: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult d38514d2a2 xnest: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 09af7f6a5b xnest: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult f203f3f1f1 xfree86: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 901132b766 xfree86: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult b32cd8c759 xvfb: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult f0257bfe93 xvfb: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 5a003a7663 kdrive: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 11f9b11757 xkb: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:44 +02:00
Enrico Weigelt, metux IT consult 445f83668b xkb: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f55e01f5d8 xfixes: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 037a595ad7 render: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 953f0a68dc record: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 7b24948dbf record: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f25921f5fb randr: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult a8f0e2801e os: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 9a1c502865 miext: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult bdcf8d200f mi: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 7752d8450d glamor: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e25852fd53 fb: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult b3ef1fbbd3 exa: protect from allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 8e80caa6f7 exa: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e025b8c805 dix: protect from allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult ba4fb2588e dix: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e23e409597 dbe: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult eb5ebae908 xi: protect from allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult a222349c43 xi: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 01d6efb414 xext: xres: protect from allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult dda64fcadf xext: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 3d60cfbb68 os: move LIMITCLIENTS define into private header
Not used by any external modules, and an implementation
detail anyways, so no need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult fe847bc559 include: misc: drop unused defines
USE_BACKGROUND_PIXEL and USE_BORDER_PIXEL aren't used anywhere,
neither in Xserver nor any drivers, so can be dropped now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult ed1c203a46 xwin: drop redundant declaration of winValidateArgs()
../hw/xwin/InitOutput.c:89:2: warning: redundant redeclaration of ‘winValidateArgs’ [-Wredundant-decls]
   89 |  winValidateArgs(void);
      |  ^~~~~~~~~~~~~~~

In file included from ../hw/xwin/InitOutput.c:35:
../hw/xwin/win.h:1008:1: note: previous declaration of ‘winValidateArgs’ was here

 1008 | winValidateArgs(void);
      | ^~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult eb710e0e45 xfixes: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult c7ff7b220d render: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e6292bb8ae mi: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult dc1cd19ec9 record: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult fcfdf3bb31 damageext: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult fb38ed0917 composite: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult b40bd07adb Xi: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 535a110c60 Xext: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 9e4e6cf309 dix: clean up including panoramix headers
* use their actual path instead of relying this to be in compiler's
  include path list.
* no need to do it only conditionally, no #ifdef needed

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 21d040a439 (1832) mi: micmap: drop unused miInitVisualsProcPtr type
It's last users gone about 15 years ago with commit
a715de7f11, so no need
to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 539ed037b4 mi: move StaticGrayMask and GrayScaleMask into micmap.c
micmap.c is the only consumer of these, so move them into there,
instead of maintaining them in the public API w/o any practical need.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 5ef99b0a2d mi: move MIN_TRUE_DEPTH define into micmap.c
This .c file is the only consumer of that define, so move it
there instead of carrying it around in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f244180eba mi: make SetInstalledmiColormap() a static inline function
Add some type safety by converting the macro into static inline function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 4be15a7207 mi: unexport GetInstalledmiColormap and make it static inline function
Not used by any external drivers, so no need to keep it public.
Also add some type-safety by implementing it as static inline function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 7497cc08f6 dix: make MasksPerDetailMask define private
It's only ever used inside dix/grabs.c, no outside users,
no no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 97da5f97ba dix: move SHAREDCOLOR struct declaration out of public header
Not used by any external module/driver, so no need to keep it in
public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 662dc6e9f3 dix: move SHCO struct declaration out of public header
Not used by any external module/driver, so no need to keep it in
public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 52cf7135f2 dix: move Entry (struct _CMEntry) declaration out of public header
Not used by any external module/driver, so no need to keep it in
public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult adc27c5220 dix: move ColormapRec declaration out of public header
Not used by any external module/driver, so no need to keep it in
public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f0bf6919ca mi: micmap.h: clean up include statements
* not using anything from colormapst.h
* but several other includes have been missing (consumers had to
  include them separately before that file)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 988252cfdd xquartz: drop unused includes of colormapst.h
Not referring to any type from that file, so no actual need
to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d37b385bd5 xnest: drop not needed include of colormapst.h
We don't need anything from this file here, so no need to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d1c547d2eb xfree86: drop unused imports of colormapst.h
Drop a several includes of colormapst where we don't actually
need something from that file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 752921d706 glx: drop unused include of colormapst.h
We don't need anything from this file, so no need to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d73778cd55 exa: drop unused import of colormapst.h
We don't need anything from that file, so no need to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult bb602e12ce dix: drop unneeded include of colormapst.h and colormap.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult a527589819 composite: drop obsolete including of colormapst.h
All relevant things are now in dix/colormap_priv.h, so no need
to include colormapst.h anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 0ba4dab2b1 Xext: drop obsolete including of colormapst.h
All relevant things are now in dix/colormap_priv.h, so no need
to include colormapst.h anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f4d03dc779 render: drop obsolete including of colormapst.h
All relevant things are now in dix/colormap_priv.h, so no need
to include colormapst.h anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult a15d8d25de Xext: xv: more obvious size computations in ProcXvQueryImageAttributes()
Formulate the buffer/field size computations a bit more verbose in
ProcXvQueryImageAttributes(), so they're easier to understand on
reading the code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult dfdb3d3722 Xext: xv: use int32_t in ProcXvQueryImageAttributes()
Make sure it's really a 32bit integer, since we're hard-casting since
we're relying on the buffer being made of 32bit integers (and treating
it like CARD32's). If we encounter an arch, where int isn't 32bits,
the compiler should shout out loud now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult cf68881ab6 Xext: xv: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult bee797a348 Xext: xv: untwist Xinerama handling
The current way of switching between Xinerama and single-screen handlers
is quite complicated and needs call vector tables that are changed on
the fly, which in turn makes dispatching more complicated.

Reworking this into a simple and straight code flow, where individual request
procs just look at a flag to decide whether to call the Xinerama or single
screen version.

This isn't just much easier to understand (and debug), but also removes the need
or the call vectors, thus allowing further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 1fb8493498 Xext: xv: use static struct initialization on declaration
A little bit of code simplification by using static initialization
of struct right at the point of declaration. Also dropping a few now
unneccessary zero assignments.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 9aab3ed713 include/resource.sh: drop unused INVALID define
Nowhere used, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 62b86f2b13 dix: make LEGAL_NEW_RESOURCE() macro private
Not used by any external driver, so no need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 2cc1ae4d20 dix: make DDXTouchPointInfoRec private
This type isn't used by any external drivers, so no need to
keep it in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult ead7cd4369 dix: use calloc() in _dixAllocateScreenObjectWithPrivates()
We're clearing the whole object size anyways, so we can directly
use calloc() instead of malloc() plus memset().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 4ac10378e1 dix: unexport and rename CreateWindow()
a) an internal function that's not used by any drivers
b) conflicting with function/define of same name on win32

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 9903f2bf40 damage: fix resource access flag on destroy
When destroying a resource, the lookup needs to be done with
DixDestroyAccess (instead of DixWriteAccess) flag - otherwise
xace hooks can't properly differenciate what's happening.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Fixes: 6c46645cfc
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 86cf2c5ce3 Xi: use fixed define for extenion base opcode
Several places outside Xi (eg. dix, security hooks, ...) need to know the
actual XI base opcode. This formerly had been done by a global variable,
which is filled on XI init. This has some drawbacks, eg. requires that
XI really is initialized before anybody else attempting to access this
variable - changes in extension init order could be dangerous.

Since extension opcodes are now (compile-time) fixed for all known
extensions (including XI), this isn't needed anymore. We can really
rely on the XI extension always having the same opcode base. So we
can drop that variable entirely and use the corresponding define instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult c6eaca88cd dix: reserve fixed extension opcodes for known extensions
Assign fixed opcodes for known (in-tree) extensions and add
defines for them. Other places (eg. security extensions) that
need to know those opcodes now can directly use those defines
not having to look them up at runtime.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 4560d9a3fe dix: add support for reserved extension slots
In order to allow extensions being registered at fixed opcodes,
there need to be a reserved slot range. Thus `NumExtensions` needs
to start out with the upper ceiling of the reserved slot space.
Thus it cannot tell whether the array already had been allocated,
and some slots now may be NULL, so we need some extra checks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d536bd7f66 dix: AddExtension: simplify error return path
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 9149af91d2 dix: simplify extension query
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult be5a20d580 Xace: remove remains of XACE_CORE_DISPATCH
There's no actual caller of this hook - removed almost a decade ago
(see commit 6cb34816af), but some remains
had been forgotten to clean up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult bf5638ae7a xwin: drop unused variable WindowsDRIReqCode
This variable is assigned once, but never used.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 3a7a954f6c Xquartz: drop unused variable DRIReqCode
This variable is assigned once, but never used.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult b997d6e0d8 xfree86: dri: drop unused variable DRIReqCode
This variable is assigned once, but never used.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 35cfefa682 XI: drop now obsolete SReplyIDispatch()
nothing else to do for it anymore, since all previous callers now have been
migrated to do the byte-swapping directly, so it can be dropped entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult a4d8e1a231 XI: directly write out X_XIGetFocus reply
Write out the X_XIGetFocus reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult bd8e1dc6b8 XI: directly write out X_XIGetSelectedEvents reply
Write out the X_XIGetSelectedEvents reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d61c357891 XI: directly write out X_XIGetProperty reply
Write out the X_XIGetProperty reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 77cfdf5dbf XI: directly write out X_XIListProperties reply
Write out the X_XIListProperties reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 957e04d2a3 XI: directly write out X_XIPassiveGrabDevice reply
Write out the X_XIPassiveGrabDevice reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 7c5482d568 XI: directly write out X_XIGrabDevice reply
Write out the X_XIGrabDevice reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 5bf2f662cc XI: directly write out X_XIQueryDevice reply
Write out the X_XIQueryDevice  reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 34b0377bc7 XI: directly write out X_XIQueryVersion reply
Write out the X_XIQueryVersion reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e916ae88bc XI: directly write out X_XIGetClientPointer reply
Write out the X_XIGetClientPointer reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f95fa10d6d XI: directly write out X_XIQueryPointer reply
Write out the X_XIQueryPointer reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 3cded3300b XI: directly write out X_GetDeviceProperty reply
Write out the X_GetDeviceProperty reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d14277ccbc XI: directly write out X_ListDeviceProperties reply
Write out the X_ListDeviceProperties reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult b573dfb6e4 XI: directly write out X_ChangeDeviceControl reply
Write out the X_ChangeDeviceControl reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult ffb75fee3f XI: directly write out X_GetDeviceControl reply
Write out the X_GetDeviceControl reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 3ff2fd4d32 XI: directly write out X_SetDeviceValuators reply
Write out the X_SetDeviceValuators reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 3695324145 XI: directly write out X_QueryDeviceState reply
Write out the X_QueryDeviceState reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 13cc0cdf09 XI: directly write out X_SetDeviceButtonMapping reply
Write out the X_SetDeviceButtonMapping reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult f43b2fdc87 XI: directly write out X_GetDeviceButtonMapping reply
Write out the X_GetDeviceButtonMapping reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult c37c82e3f2 XI: directly write out X_SetDeviceModifierMapping reply
Write out X_SetDeviceModifierMapping the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 37c5d6bff2 XI: directly write out X_GetDeviceModifierMapping reply
Write out X_GetDeviceModifierMapping the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 7f36272a3d XI: directly write out X_GetDeviceKeyMapping reply
Write out X_GetDeviceKeyMapping the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e226b1396a XI: directly write out X_GetFeedbackControl reply
Write out X_GetFeedbackControl the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult dc950a7d52 XI: directly write out X_GetDeviceFocus reply
Write out X_GetDeviceFocus the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 96e6a517c9 XI: directly write out X_GrabDevice reply
Write out X_GrabDevice the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult d4bd6bad8d XI: directly write out X_GetDeviceMotionEvents reply
Write out X_GetDeviceMotionEvents the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 52456a6e27 Xi: declare variables where needed in ProcXGetDeviceMotionEvents()
Improve code readability by moving variable declarations to where
they're actually needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult e6df411cf5 XI: drop extra temp variable in ProcXGetDeviceMotionEvents()
The value is only checked once, so no need to copy it to a temporary
variable first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 9ae97d7487 XI: use SwapLongs() in ProcXGetDeviceMotionEvents()
We already have a standard function for swapping 32 bit ints,
so let's use this one instead of rolling our own loop.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult d082992690 XI: directly write out X_GetDeviceDontPropagateList reply
Write out X_GetDeviceDontPropagateList the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult c1d828910a XI: directly write out X_GetSelectedExtensionEvents reply
Write out X_GetSelectedExtensionEvents the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 00a19a11d5 XI: directly write out X_SetDeviceMode reply
Write out X_SetDeviceMode the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult baac2944f6 XI: directly write out X_OpenDevice reply
Write out X_OpenDevice the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 4c27b09c53 XI: directly write out X_ListInputDevices reply
Write out X_ListInputDevices the reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult be45dd2d06 XI: directly write out X_GetExtensionVersion reply
Write out the X_GetExtensionVersion reply directly (and do the swapping
within the request handler) instead of going through separate callback
that's having demux the replies again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 62863427a3 XI: canonicalize reply struct declarations and naming
* name all of them "rep", as throughout most of the Xserver codebase
* always declare them where initialized

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 7ea43bd5e9 dix: let change_modmap() return BadValue instead of -1
The function returns X result codes, but -1 isn't a valid value here.
Therefore all callers explicitly translate -1 to BadValue, so we can return
that directly instead of -1.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 8e0a533eb7 present: simplify dispatching
Using simple case statements with actual opcode define's instead
of call vector arrays where the exact order matters.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 5e43aed54c xfixes: write out GetCursorName reply directly
The request handler already does byte-swapping on its own, and
there's no extra reply-swap handler for it, so no need to call
into callbacks here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult fab90591bd xwin: fix int size mismatch
> ../hw/xwin/winshadgdi.c: In function ‘winBltExposedWindowRegionShadowGDI’:
> ../hw/xwin/winshadgdi.c:866:78: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘DWORD’ {aka ‘long unsigned int’} [-Wformat=]
>   866 |             ErrorF("winBltExposedWindowRegionShadowGDI - BitBlt failed: 0x%08x\n",
>       |                                                                           ~~~^
>       |                                                                              |
>       |                                                                              unsigned int
>       |                                                                           %08lx
>   867 |                    GetLastError());
>       |                    ~~~~~~~~~~~~~~
>       |                    |
>       |                    DWORD {aka long unsigned int}

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult bd258cf1a2 xwin: fix name clash between Xserver and Windows headers
> ../hw/xwin/winscrinit.c: In function ‘winFinishScreenInitFB’:
> ../hw/xwin/winscrinit.c:381:18: error: ‘struct _Screen’ has no member named ‘CreateWindowA’; did you mean ‘CreateWindow’?
>   381 |         pScreen->CreateWindow = winCreateWindowRootless;
>       |                  ^~~~~~~~~~~~
> ../hw/xwin/winscrinit.c:405:18: error: ‘struct _Screen’ has no member named ‘CreateWindowA’; did you mean ‘CreateWindow’?
>   405 |         pScreen->CreateWindow = winCreateWindowMultiWindow;
>       |                  ^~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 080d513b88 xwin: fix unitialized variables
> ../hw/xwin/winclipboard/xevents.c: In function ‘winClipboardSelectionNotifyData.constprop’:
> ../hw/xwin/winclipboard/xevents.c:313:23: warning: ‘codepage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   313 |     int iUnicodeLen = MultiByteToWideChar(codepage, 0,
>       |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   314 |                                           pszReturnData, -1, NULL, 0);
>       |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ../hw/xwin/winclipboard/xevents.c: In function ‘winClipboardFlushXEvents’:
> ../hw/xwin/winclipboard/xevents.c:550:35: warning: ‘codepage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   550 |             int iConvertDataLen = WideCharToMultiByte(codepage, 0,
>       |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   551 |                                                       (LPCWSTR) pszGlobalData, -1,
>       |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   552 |                                                       NULL, 0, NULL, NULL);
>       |                                                       ~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 603d9ed456 xkb: fix printf conversion error on Windows
> ../xkb/xkb.c: In function ‘_XkbSetMapCheckLength’:
> ../xkb/xkb.c:2440:53: warning: unknown conversion type character ‘z’ in format [-Wformat=]
>  2440 |     ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %zd got %zd\n", len, req_len);
>       |                                                     ^
> ../xkb/xkb.c:2440:61: warning: unknown conversion type character ‘z’ in format [-Wformat=]
>  2440 |     ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %zd got %zd\n", len, req_len);
>       |                                                             ^
> ../xkb/xkb.c:2440:12: warning: too many arguments for format [-Wformat-extra-args]
>  2440 |     ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %zd got %zd\n", len, req_len);
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 5fc5bc7d44 xwin: fix missing include of windsock2.h
Windows headers are pretty nitpicking about include order:

> In file included from /usr/i686-w64-mingw32/include/X11/Xwinsock.h:57,
>                  from /usr/i686-w64-mingw32/include/xcb/xcb_windefs.h:34,
>                  from /usr/i686-w64-mingw32/include/xcb/xcb.h:41,
>                  from ../hw/xwin/winmultiwindowicons.c:43:
> /usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 65a17ca552 xkb: XkbInitRules() don't hard-crash the server on strdup() fail
No need to hard-crash the whole server if some strdup() calls failing,
those fields already may be NULL, so consumers can handle that situation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 1bac33b0da xkb: ddxLoad: don't crash the server when strcpy() fails
No need for RunXkbComp() to hard-crash (by calling XNFstrdup()) the server
if strdup() fails to allocate more memory - it's callers already handling
the situation gracefully.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult ff6ee89494 dix: write out X_ListInstalledColormaps reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult b6cd982477 dix: write out X_ListProperties reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 67c09e3bc6 dix: write out X_GetProperty reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult fc13768c3e dix: write out X_ListExtensions reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult a1e5033170 dix: write out X_QueryExtension reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 0b585587a2 dix: write out X_QueryPointer reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult ec118ccbb8 dix: write out X_GrabKeyboard reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 02930c99fe dix: write out X_GrabPointer reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult d5d56b8c29 dix: write out X_GetInputFocus reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult eb184c316d dix: write out X_GetFontPath reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 62687ea1c2 dix: write out X_ListHosts reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 5fd2c1c70a dix: write out X_GetScreenSaver reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult d459390a2d dix: write out X_QueryBestSize reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult fa4c80243f dix: write out X_LookupColor reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 707fd2b1d7 dix: write out X_QueryColors reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 6e657b2ca5 dix: write out X_AllocColorPlanes reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 3a233ac98a dix: write out X-AllocColorCells reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult df44f063a0 dix: write out X_AllocNamedColor reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult f062333422 dix: write out X_AllocColor reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 725bb2d20d dix: write out X_ListInstalledColormaps reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 1f2cf6fe4b dix: write out X_QueryTextExtents reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 189f475093 dix: write out X_ListFontsWithInfo reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 712febb9b4 dix: write out X_ListFonts reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 83569a31c8 dix: write out X_QueryFont reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 9136207164 dix: write out X_GetAtomName reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 56f1c26056 dix: write out X_InternAtom reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult 9541233f8d dix: write out X_QueryTree reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:42 +02:00
Enrico Weigelt, metux IT consult f59ffc7c93 dix: write out X_GetWindowAttributes reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:33 +02:00
Enrico Weigelt, metux IT consult 71139c015e dix: write out X_QueryKeymap reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:26 +02:00
Enrico Weigelt, metux IT consult 13bec61739 dix: write out X_GetPointerControl reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:23 +02:00
Enrico Weigelt, metux IT consult 39dcf3e233 dix: write out X_GetPointerControl reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:19 +02:00
Enrico Weigelt, metux IT consult 46abb82984 dix: write out X_GetKeyboardControl reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:16 +02:00
Enrico Weigelt, metux IT consult 5829703de2 dix: write out X_GetKeyboardMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:12 +02:00
Enrico Weigelt, metux IT consult c8ea12d436 dix: write out X_GetPointerMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:09 +02:00
Enrico Weigelt, metux IT consult 1ef0e46cbc dix: write out X_SetPointerMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:05 +02:00
Enrico Weigelt, metux IT consult 6091ce6d57 dix: write out X_GetModifierMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:55:02 +02:00
Enrico Weigelt, metux IT consult 80d748e1cd dix: write out X_SetModifierMapping reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:59 +02:00
Enrico Weigelt, metux IT consult 361a8ef46f dix: write out X_GetSelectionOwner reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:55 +02:00
Enrico Weigelt, metux IT consult 0812c4953a dix: write out X_GetImage reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:52 +02:00
Enrico Weigelt, metux IT consult df63401d6d dix: write out X_TranslateCoords reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:49 +02:00
Enrico Weigelt, metux IT consult b06fc7e68c dix: write out X_GetGeometry reply directly
No need for using a complex callback machinery, if we just move the
little pieces of byte-swapping directly into the request handler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:45 +02:00
Enrico Weigelt, metux IT consult 923de1a7a4 dix: consolidate ProcGetGeometry()
No need to have it split into two functions one just wrapping
another, so move it all into one.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:42 +02:00
Enrico Weigelt, metux IT consult 1035323b36 os-support: systemd-logind: don't hard-crash Xserver on strdup() fail
No need to directly hard-crash the Xserver when strdup() fails, instead
try to handle the situation gracefully.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:39 +02:00
Enrico Weigelt, metux IT consult a17e8bda4d dix: make CountBits() inline
The function is small enough for easily being inlined.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:35 +02:00
Enrico Weigelt, metux IT consult e7e248f303 dix: unexport and document CountBits()
Not used by any drivers/modules, so no need to keep it exported.
Also adding a bit of documentation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:31 +02:00
Enrico Weigelt, metux IT consult 1cf7b33ab4 os: drop deprecated Xprintf()
Not used anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:27 +02:00
Enrico Weigelt, metux IT consult b63b1e60c7 os: drop deprecated XNFvprintf()
Nobody using it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:24 +02:00
Enrico Weigelt, metux IT consult 6ddaa0afe9 os: drop deprecated XNFprintf()
Nobody using it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:21 +02:00
Enrico Weigelt, metux IT consult 25de3f61a1 os: drop deprecated Xvprintf()
Nobody using it anymore, so no need for keeping it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:17 +02:00
Enrico Weigelt, metux IT consult b443f4bb88 os: drop Xasprintf() and Xvasprintf()
The supported platforms already have asprintf() and vasprintf(),
so there's no need for having our own implementation anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:13 +02:00
Enrico Weigelt, metux IT consult f6d63f96cd dix: unexport and document GetXIDRange()
Not used by any drivers (just the xcmisc extension), so no need
to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:09 +02:00
Enrico Weigelt, metux IT consult 2556900be7 dix: unexport and document GetXIDList()
Not used by any drivers (just the xcmisc extension), so no need
to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:06 +02:00
Enrico Weigelt, metux IT consult 727e8bcb09 dix: unexport and document HashResourceID()
Not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:03 +02:00
Enrico Weigelt, metux IT consult 6588a74c15 dix: make CLIENTOFFSET macro private
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:54:00 +02:00
Enrico Weigelt, metux IT consult ec8b5379b8 dix: make RESOURCE_ID_MASK private
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:56 +02:00
Enrico Weigelt, metux IT consult bd29dc5adf dix: make RESOURCE_CLIENT_MASK macro private
Not used in any external modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:53 +02:00
Enrico Weigelt, metux IT consult 46bc6335c5 dix: make CLIENT_BITS() macro private
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:50 +02:00
Enrico Weigelt, metux IT consult 706d3336ec dix: make SERVER_BIT define private
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:47 +02:00
Enrico Weigelt, metux IT consult 1ae30998d5 dix: make SameClient() macro private
Not used in any external modules, so need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:43 +02:00
Enrico Weigelt, metux IT consult 4ae7dca761 dix: add dixResouceIsServerOwned()
Little helper function for checking whether a resource XID
belongs to the server itself.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:40 +02:00
Enrico Weigelt, metux IT consult 1cbfe67a5a dix: let CreateGrab operate on ClientPtr instead of array index
Almost all callers have ClientPtr anyways, so we're just doing duplicate
array lookups. Just using ClientPtr directly is easier anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:37 +02:00
Enrico Weigelt, metux IT consult a09805f675 dix: add dixClientForXID()
Retrieves the ClientPtr for the owner of given resource.
This way reducing the sites directly accessing clients[] array.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:34 +02:00
Enrico Weigelt, metux IT consult ed7f0bb0aa include/resource.h: replace RESOURCE_CLIENT_BITS by ResourceClientBits()
We can write down the function name directly. Nobody else than a few
define's in here using that macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:30 +02:00
Enrico Weigelt, metux IT consult 0a315e45dd dix: replace CLIENT_ID() macro by dixClientIdForXID() inline function
Make it type-safe and a bit more obvious what it really does,
also adding some inline documentation. Since it's just some
bit shifting magic, it's qualified for inlining.

The CLIENT_ID() macro isn't used by any external modules, so the
new function doesn't need to be in a public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:27 +02:00
Enrico Weigelt, metux IT consult d80866e764 dix: add dixClientForOtherClients()
Helper function for retrieving the owning client of an OtherClients.

It's an actual function, so callers don't need access to internal
knowledge (definition of struct _OtherClients, clients[] array, ...)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:24 +02:00
Enrico Weigelt, metux IT consult e1f8794b1d dix: add dixClientForInputClients()
Helper function for retrieving the owning client of an InputClients.

It's an actual function, so callers don't need access to internal
knowledge (definition of struct _InputClients, clients[] array, ...)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:21 +02:00
Enrico Weigelt, metux IT consult 0ca0c334d8 dix: add dixClientForGrab()
Helper function for retrieving the owning client of a grab.

It's an actual function, so callers don't need access to internal
knowledge (definition of GrabRec, clients[] array, ...)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:16 +02:00
Enrico Weigelt, metux IT consult d697618c16 dix: replace wClient() macro by dixClientForWindow() inline function
Hide internals (drop the need to include windowstr.h), make it typesafe
as well as the naming easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:13 +02:00
Enrico Weigelt, metux IT consult 261c49b4c2 dix: events: clean up XaceHookSendAccess() client arg
Use NullClient macro instead of NULL or 0.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:10 +02:00
Enrico Weigelt, metux IT consult 6f675e4d01 os: auth: protect against duplicate auth keys
Protect the Add() proto funcs from adding duplicate auth keys.
If adding a duplicate is attempted, the XID of the already
existing one is returned instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:06 +02:00
Enrico Weigelt, metux IT consult 1629400be5 os: xdmcp: simplify AddAuth handler call
No need for loading the address into temporary variable and later doing
indirect call, since we can easily do direct call in each branch.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:03 +02:00
Enrico Weigelt, metux IT consult 6c6e0b09a1 os: auth: let GenerateAuthorization() return 0 on error
XID = 0 already is used as sign for error in several places,
so let's use that here, too.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:59 +02:00
Enrico Weigelt, metux IT consult a68f5c125c os: auth: generate XIDs in proto funcs only on success
Generate the auth object XIDs inside the proto funcs and only
on success, so we don't unnecessarily allocate XIDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:56 +02:00
Enrico Weigelt, metux IT consult e536c2035c os: auth: move GenerateRandomData() and make it static
Only used in mitauth.c, so we can move it there and make it static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:53 +02:00
Enrico Weigelt, metux IT consult e89006d015 os: auth: factor out auth proto names into defines
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:49 +02:00
Enrico Weigelt, metux IT consult 73abb7150d os: auth: consolidate GenerateAuthorization()
No need for having two implementations in os/ vs xwin.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:45 +02:00
Enrico Weigelt, metux IT consult 0da8fc466d os: auth: use strlen() for auth proto name length
No need to explicitly hard-code strings lengths when we can use
standard strlen(). Those code pathes are so cold that trying to
spare a few cycled for an (usually inlined) strlen() doesn't seem
to justify any extra care.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:41 +02:00
Enrico Weigelt, metux IT consult 58e661e1cc os: auth: improve readability and robustness of auth proto list
The code is easier to understand, but also more robust (eg. against struct
layout changes) if structs are initialized with explicit field names
instead of as lists.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:37 +02:00
Enrico Weigelt, metux IT consult 030b441e21 dix: resource: protect FakeClientID() from returning 0
Some callers treating XID = 0 as a sign for non-existing resource.
Practically should not happen, but nevertheless adding extra
protection, just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:34 +02:00
Enrico Weigelt, metux IT consult eb95982b2a bsd: drop PCCONS support
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones (at least that's the feedback I've gotten
from BSD community), so there's probably no practical use case for
supporting it in Xorg anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:31 +02:00
Enrico Weigelt, metux IT consult bef80a0db9 Xnest: drop special hack for Xlib's GC type
Now that the name clash on GC type between Xserver and xlib has been fixed,
there's no need to do the special renaming hack anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:28 +02:00
Enrico Weigelt, metux IT consult 46eeeec810 fix name clash on 'GC' between Xlib and Xserver
Both xlib as well as the Xserver use the same identifier "GC" for
different types. While on xlib it's just the numerical ID of a GC,
the xserver defines a struct for it by the same name. This is this
ugly and needs ridiculous hacks for Xserver code that needs xlib.

Easy to solve by just renaming the GC typedef to GCRec (consistent
with how we're naming other structs) and replacing GC* by GCPtr.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:25 +02:00
Enrico Weigelt, metux IT consult 38d62bcc08 dix: CreateColormap() pass in ClientPtr instead of client index
The function actually operates on ClientRec, so we can pass it in
directly, so it doesn't need to fetch it from clients[] array itself.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:22 +02:00
Enrico Weigelt, metux IT consult 1c8ef6d44d dix: colormap: let AllocColorCells() operate on ClientPtr instead of index
It's only caller already has a pointer to client struct, so no need to
let this function look it up again in the global clients array.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:19 +02:00
Enrico Weigelt, metux IT consult b9df6ed8a2 Xv: fix segfault on shutdown
Protect against adaptor having NULL port list in XvStopAdaptors()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:16 +02:00
Enrico Weigelt, metux IT consult 96523e64f3 xfixes: consolidate ProcXFixesSelectSelectionInput()
No need to have it ripped into two pieces, just making upcoming
changes more complicated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:13 +02:00
Enrico Weigelt, metux IT consult 69078b1d15 include: document the meaning of SERVER_BIT
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:10 +02:00
Enrico Weigelt, metux IT consult 7501ca09b9 dix: rename dixLookupClient() to dixLookupResourceOwner()
Choose a bit more precise / descriptive name for that function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:07 +02:00
Enrico Weigelt, metux IT consult a48b83b9a2 dix: dixLookupClient() align parameter naming with prototype
Align the function's parameter names with those defined in the prototype.
Especially it makes code easier to understand if the result parameter
is also named "result" here, as in the prototype.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:04 +02:00
Enrico Weigelt, metux IT consult 8e161ae771 Xext: sync: a bit of request handler documentation
Improve in-code docs of some request handlers, so it becomes a bit
more obvious what they're doing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:01 +02:00
Enrico Weigelt, metux IT consult 098008879b Xres: XResQueryClientIds: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:58 +02:00
Enrico Weigelt, metux IT consult 750b65de69 Xres: XResQueryClientPixmapBytes: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:44 +02:00
Enrico Weigelt, metux IT consult 146b04f4e2 Xres: XResQueryClientResources: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:41 +02:00
Enrico Weigelt, metux IT consult 1594bad1f8 Xres: XResQueryClients: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:38 +02:00
Enrico Weigelt, metux IT consult 2be400cd99 Xext: hashtable.h: unexport functions not used by drivers
This header isn't part of SDK and no external module using those functions,
so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:36 +02:00
Enrico Weigelt, metux IT consult 8060c995f5 panoramix: unexport XineramaVisualsEqualPtr and make it static
There's no user outside of panoramiX.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:33 +02:00
Enrico Weigelt, metux IT consult 1741809555 panoramix: unexport XineramaGetImageData()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:29 +02:00
Enrico Weigelt, metux IT consult 9f538c4f40 panoramix: unexport resource types
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:26 +02:00
Enrico Weigelt, metux IT consult b13f5e19c3 panoramix: unexport XineramaDeleteResource()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:22 +02:00
Enrico Weigelt, metux IT consult 78cb102e64 panoramix: unexport XineramaRegisterConnectionBlockCallback()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:20 +02:00
Enrico Weigelt, metux IT consult 08a40b7b76 panoramix: unexport PanoramiXFindIDByScrnum()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:17 +02:00
Enrico Weigelt, metux IT consult 5a7d4f81e8 panoramix: unexport PanoramiXCreateConnectionBlock()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:15 +02:00
Enrico Weigelt, metux IT consult 5af7c30252 panoramix: unexport PanoramiXConsolidate()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:12 +02:00
Enrico Weigelt, metux IT consult 67e5b099fb panoramix: unexport PanoramiXTranslateVisualID()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:09 +02:00
Enrico Weigelt, metux IT consult 194c28f5e5 panoramix: unexport screen dimension fields
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:06 +02:00
Enrico Weigelt, metux IT consult adfd065667 panoramix: drop unused XineramaReinitData()
Not used anywhere (also not in drivers), so no need to keep it around
any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:04 +02:00
Enrico Weigelt, metux IT consult 142fb829a4 Xace: drop obsolete XaceHook() prototype
The prototype had been forgetten when removing the function.

Fixes: facdaae4e8
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:01 +02:00
Enrico Weigelt, metux IT consult e58cb61e28 Xi: unexport PointerBarrierType field
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:57 +02:00
Enrico Weigelt, metux IT consult abfa0b888c compext: drop unused function CompositeRegisterImplicitRedirectionException()
Not used anywhere, neither internal nor drivers, so no need to keep it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:55 +02:00
Enrico Weigelt, metux IT consult 468e331cc9 dri: unexport drm_format_for_depth()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:52 +02:00
Enrico Weigelt, metux IT consult 3356690d35 dri: unexport dri3_send_open_reply()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:49 +02:00
Enrico Weigelt, metux IT consult 6cd503f3c5 dri: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:44 +02:00
Enrico Weigelt, metux IT consult 223c7ac40d exa: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:42 +02:00
Enrico Weigelt, metux IT consult 35ed325361 exa: drop ifdef on HAVE_DIX_CONFIG
We always have dix-config.h, so no need for extra guard.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:39 +02:00
Enrico Weigelt, metux IT consult 8d95320217 glamor: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:32 +02:00
Enrico Weigelt, metux IT consult f763f0ec44 glx: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:30 +02:00
Enrico Weigelt, metux IT consult d0f28b9648 glx: drop autogen marker from indirect_table.c
This file had been changed manually several times or at least a decode now,
so the claim it's being auto-generated isn't valid anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:27 +02:00
Enrico Weigelt, metux IT consult d48611ffd4 glx: drop autogen marker from indirect_size_get.c
This file had been changed manually several times or at least a decode now,
so the claim it's being auto-generated isn't valid anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:24 +02:00
Enrico Weigelt, metux IT consult 4d164ff7c8 Xext: drop checking for HAVE_DIX_CONFIG_H
Within the Xserver build, there's always dix-config.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:20 +02:00
Enrico Weigelt, metux IT consult 64eb27449e extinit: document why no*Extension fields need to be exported.
Usually no*Extension fields shouldn't be needed by drivers, but there
are a few exceptions: some drivers need to know whether composite or
Xinerama are active.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:18 +02:00
Enrico Weigelt, metux IT consult 56fa306fa5 exa: unexport ExaOffscreenMarkUsed()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:15 +02:00
Enrico Weigelt, metux IT consult b2b5be2068 exa: unexport exaMoveOutPixmap()
Only used inside EXA code, not used by any drivers, so no need to
keep it exported any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:13 +02:00
Enrico Weigelt, metux IT consult c0a4d9f174 exa: drop exaGetPixmapSize()
Not used by anybody, neither Xserver nor drivers, so no need to
keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:10 +02:00
Enrico Weigelt, metux IT consult dda1bb1e95 xwayland: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:07 +02:00
Enrico Weigelt, metux IT consult 5377ee4d81 xwin: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:05 +02:00
Enrico Weigelt, metux IT consult 8f26a2f6a7 xnest: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:00 +02:00
Enrico Weigelt, metux IT consult d8e6511b1b xfree86: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:57 +02:00
Enrico Weigelt, metux IT consult a83f56eb92 vfb: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:54 +02:00
Enrico Weigelt, metux IT consult 30d65cd9f1 kdrive: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:52 +02:00
Enrico Weigelt, metux IT consult e87d41a91d include: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:49 +02:00
Enrico Weigelt, metux IT consult 5f619d862d os: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:45 +02:00
Enrico Weigelt, metux IT consult 0127d6ef13 dix: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:43 +02:00
Enrico Weigelt, metux IT consult a2d9d2078f render: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:40 +02:00
Enrico Weigelt, metux IT consult 8c873c04cb randr: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:37 +02:00
Enrico Weigelt, metux IT consult 2d1b99e49f record: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:35 +02:00
Enrico Weigelt, metux IT consult a6ec907b22 miext: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:32 +02:00
Enrico Weigelt, metux IT consult 900ddb69a2 glamor: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:29 +02:00
Enrico Weigelt, metux IT consult 8c05f4db0a mi: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:27 +02:00
Enrico Weigelt, metux IT consult 55544ff85f Xi: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:24 +02:00
Enrico Weigelt, metux IT consult 085919667b glx: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:22 +02:00
Enrico Weigelt, metux IT consult a53acd9f27 dbe: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:19 +02:00
Enrico Weigelt, metux IT consult 28e8a3c475 exa: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:16 +02:00
Enrico Weigelt, metux IT consult c6b8b78a29 composite: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:49:13 +02:00
Enrico Weigelt, metux IT consult c4c5f03cb7 fb: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:17 +02:00
Enrico Weigelt, metux IT consult 7a8b8e110e damageext: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:14 +02:00
Enrico Weigelt, metux IT consult c96901a85a Xext: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:11 +02:00
Enrico Weigelt, metux IT consult 45d7b62d95 xfixes: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:08 +02:00
Enrico Weigelt, metux IT consult d199dcbe4c xkb: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:05 +02:00
Enrico Weigelt, metux IT consult 4de5adef96 xfree86: drop obsolete xf86GetEntityForSbusInfo()
Not used anywhere, neither Xserver nor drivers, so no need to keep it anymore.

According to git history, it had been introduced introduced in 2003 (*1),
but never called (inside the Xserver) - unclear whether it ever had been
actually used somewhere.

*1) 9508a382f8
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:03 +02:00
Enrico Weigelt, metux IT consult 3556c0fd62 xfree86: sbus: drop SBUS_DEVICE_MGX
There doesn't seem to be any driver for these cards anymore,
so no need for trying to probe them anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:48:00 +02:00
Enrico Weigelt, metux IT consult a1d6d71be6 xfree86: sbus: drop SBUS_DEVICE_GT
There doesn't seem to be any sungt driver anymore, so no need for
trying to probe those cards any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:57 +02:00
Enrico Weigelt, metux IT consult e4659aff38 xfree86: sbus: drop SBUS_DEVICE_CG12
There doesn't seem to be any suncg12 driver anymore, so no need for
trying to probe those cards any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:55 +02:00
Enrico Weigelt, metux IT consult e6aba22e66 xfree86: sbus: drop SBUS_DEVICE_CG8
There doesn't seem to be any suncg8 driver anymore, so no need for
trying to probe those cards any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:52 +02:00
Enrico Weigelt, metux IT consult 287d7e452c xfree86: sbus: drop SBUS_DEVICE_CG4
There doesn't seem to be any suncg4 driver anymore, so no need for
trying to probe those cards any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:49 +02:00
Enrico Weigelt, metux IT consult 5783b9f322 xfree86: sbus: drop SBUS_DEVICE_CG2
There doesn't seem to be any suncg2 driver anymore, no need for trying
to probe those cards any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:47 +02:00
Enrico Weigelt, metux IT consult d049e1c65c xfree86: sbus: drop SBUS_DEVICE_BW2
There doesn't seem to be any sunbw2 driver anymore, so no need for trying
to probe those cards any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:44 +02:00
Enrico Weigelt, metux IT consult 3dd736e3d4 xfree86: sbus: make promRootNode field static
Only used internally inside Sbus.c, so no need to keep it public any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:42 +02:00
Enrico Weigelt, metux IT consult 6464d0fee8 xfree86: sbus: make promGetBool() static
Only used internally inside Sbus.c, so no need to keep it public any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:39 +02:00
Enrico Weigelt, metux IT consult e602fed637 xfree86: sbus: make promGetProperty() static
Only used internally inside Sbus.c, so no need to keep it public any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:36 +02:00
Enrico Weigelt, metux IT consult ed0100479c xfree86: sbus: make promGetChild() static
Only used internally inside Sbus.c, so no need to keep it public any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:33 +02:00
Enrico Weigelt, metux IT consult 6700ba0be2 xfree86: sbus: make promGetSibling() static
Only used internally inside Sbus.c, so no need to keep it public any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:30 +02:00
Enrico Weigelt, metux IT consult bbf7cbb4cc xfree86: sbus: unexport struct sbus_devtable
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:28 +02:00
Enrico Weigelt, metux IT consult e33cee7e9c xfree86: sbus: unexport sbusDeviceTable field
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:25 +02:00
Enrico Weigelt, metux IT consult aaab62bd50 xfree86: sbus: unexport xf86SbusInfo field
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:21 +02:00
Enrico Weigelt, metux IT consult 83a85e06f7 xfree86: sbus: unexport sparcDriverName()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:17 +02:00
Enrico Weigelt, metux IT consult ad9d83ce73 xfree86: sbus: unexport sparcPromPathname2Node()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:15 +02:00
Enrico Weigelt, metux IT consult 334c3d012e xfree86: sbus: unexport sparcPromNode2Pathname()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:12 +02:00
Enrico Weigelt, metux IT consult 1a2fdce2a6 xfree86: sbus: unexport sparcPromAssignNodes()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:09 +02:00
Enrico Weigelt, metux IT consult be48faedd5 xfree86: sbus: unexport sparcPromGetProperty()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:06 +02:00
Enrico Weigelt, metux IT consult daa6587105 xfree86: sbus: unexport xf86SbusProbe()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:03 +02:00
Enrico Weigelt, metux IT consult d708b28adc treewide: drop COMPOSITE symbol
It's always enabled for very long time now (at least since meson transition),
there doesn't seem to be any need to ever disable it again. So we can reduce
code complexity by removing all the ifdef's.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:01 +02:00
Enrico Weigelt, metux IT consult 88455524fe miext: rootless: use PostCreateResources screen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new PostCreateScreenResources screen hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:58 +02:00
Enrico Weigelt, metux IT consult 766f51e0c1 xfree86: crtc: use PostCreateResources screen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new PostCreateScreenResources screen hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:55 +02:00
Enrico Weigelt, metux IT consult 36f0cfcecf exa: use PostCreateScreenResources hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new PostCreateScreenResources screen hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:52 +02:00
Enrico Weigelt, metux IT consult b0f94e1c5c dix: add CreateScreenResources callback mechanism
Right now, extensions that need to be called after the CreateScreenResources
proc had been run, must wrap the screen proc vector directly (all of them
forming kind of daisy chain), and so - when called - temporarily restore the
previous one, call it, wrap again, and if the call was successful finally
doing it's own stuff. (same is done for many other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

Instead introducing a simple approach for letting extension hook into a
post-CreateScreenResources callback list safely, w/o having to care much
about side effects with the call chain. Extensions now can simply register
their business logic and get called back - w/o ever having to mess with the
ScreenRec's internal structures.

Note that these hooks are executed *AFTER* the original CreateScreenResources()
proc had been called SUCCESSFULLY (returned TRUE), so callees can rely on
the DDX/driver had already done it's job.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:47 +02:00
Enrico Weigelt, metux IT consult cece84fa93 glamor: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:44 +02:00
Enrico Weigelt, metux IT consult f39bbe58d6 exa: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:42 +02:00
Enrico Weigelt, metux IT consult 60dd47abda damage: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:39 +02:00
Enrico Weigelt, metux IT consult 8264e0ae21 Xext: xv: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:36 +02:00
Enrico Weigelt, metux IT consult 63485bcc02 Xext: shm: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:34 +02:00
Enrico Weigelt, metux IT consult befc3d22cf dix: add per-screen pixmap destructor mechanism
Right now, extension specific pixmap destruction procedures are implemented
by wrapping the ScreenRec's DestroyPixmap() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

It's even getting worse: the proc also has to do ref counting, and only destroy
the pixmap if refconter reaching zero - that's all done in the individual screen
drivers. Therefore, all extensions must check for refcnt == 1, in order to know
when to really act.

This commit introduces a simple approach for letting extension hook into the
pixmap destruction safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their destructor proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:30 +02:00
Enrico Weigelt, metux IT consult b97b378af4 xfree86: shadowfb: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:27 +02:00
Enrico Weigelt, metux IT consult da21e09c2d xfree86: cursor: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:24 +02:00
Enrico Weigelt, metux IT consult 866afe931a xfree86: crtc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

This one doesn't look so trivial at first glance, but I've checked that
other functions called by xf86CrtcCloseScreen() just free'ing up some
memory and removing the CRTCs from some lists - thus a change in
execution order really shouldn't matter at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:20 +02:00
Enrico Weigelt, metux IT consult cc847cc43a xfree86: exa: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:17 +02:00
Enrico Weigelt, metux IT consult 0bfea99672 xfree86: xvmc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:15 +02:00
Enrico Weigelt, metux IT consult 743c35c562 xfree86: xv: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:12 +02:00
Enrico Weigelt, metux IT consult 0fb851e46f xfree86: sbus: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:08 +02:00
Enrico Weigelt, metux IT consult 57b9155a7d xfree86: fbman: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:05 +02:00
Enrico Weigelt, metux IT consult 0c39ca358e xfree86: cmap: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:02 +02:00
Enrico Weigelt, metux IT consult b0f1bc92e5 xfree86: randr: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:59 +02:00
Enrico Weigelt, metux IT consult 623171ce3f xfree86: dga: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:56 +02:00
Enrico Weigelt, metux IT consult 69f5c3c4ff panoramiX: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:53 +02:00
Enrico Weigelt, metux IT consult 0a516b5690 miext: rootless: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:49 +02:00
Enrico Weigelt, metux IT consult 1bc857d30f miext: shadow: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:46 +02:00
Enrico Weigelt, metux IT consult 46f2a97c18 miext: damage: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:43 +02:00
Enrico Weigelt, metux IT consult 4ca68c30aa present: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:40 +02:00
Enrico Weigelt, metux IT consult 710079a334 xwayland: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:38 +02:00
Enrico Weigelt, metux IT consult c927d13ed8 mi: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:34 +02:00
Enrico Weigelt, metux IT consult 56aad1434b mi: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:32 +02:00
Enrico Weigelt, metux IT consult 5a4656a731 randr: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:29 +02:00
Enrico Weigelt, metux IT consult a6a17034f3 glamor: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:26 +02:00
Enrico Weigelt, metux IT consult e16a50281b exa: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:24 +02:00
Enrico Weigelt, metux IT consult 074fa9b0ba compext: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:21 +02:00
Enrico Weigelt, metux IT consult 553ea7ebbe dri3: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:18 +02:00
Enrico Weigelt, metux IT consult a9d35bcdd2 render: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:15 +02:00
Enrico Weigelt, metux IT consult d61de13690 xvmc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:12 +02:00
Enrico Weigelt, metux IT consult 4d368c6be4 xv: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:45:09 +02:00
Enrico Weigelt, metux IT consult 600803e659 xfixes: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:47 +02:00
Enrico Weigelt, metux IT consult 4497e36cb5 Xext: shm: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:44 +02:00
Enrico Weigelt, metux IT consult c5780c4c35 dix: add per-screen close notify hook
Right now, extension specific actions on screen closing implemented by wrapping
the ScreenRec's PositionWindow() proc pointer: the extensions are storing the
original pointer in their private data and putting in their own one. On each
call, their proc restores the original one, calls it, and switches back again.
When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
screen closing path safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their hook proc (and an
opaque pointer) and get called back - w/o ever having to mess with the
ScreenRec's internal structures. These hooks are called before the original
vector (usually handled by DDX/screen driver directly) is called.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:41 +02:00
Enrico Weigelt, metux IT consult eca6201e98 rootless: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:39 +02:00
Enrico Weigelt, metux IT consult 669391f477 dbe: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:36 +02:00
Enrico Weigelt, metux IT consult 9dad5500ac (!1714) composite: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:35 +02:00
Enrico Weigelt, metux IT consult 479484b631 dix: add per-screen window position notify hook
Right now, extension specific actions on window positioning are implemented
by wrapping the ScreenRec's PositionWindow() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
window positioning path safely, w/o having to care much about side effects
with the call chain. Extensions now can simply register their hook proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures. These hooks are called before the original
vector (usually handled by DDX/screen driver directly) is called.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:33 +02:00
Enrico Weigelt, metux IT consult 6967c0033c xwayland: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:30 +02:00
Enrico Weigelt, metux IT consult 0a50759af4 xfree86: dri: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:27 +02:00
Enrico Weigelt, metux IT consult b60581e393 xfree86: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:24 +02:00
Enrico Weigelt, metux IT consult 06b1f9e2c0 kdrive: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:22 +02:00
Enrico Weigelt, metux IT consult f061315afa rootless: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:19 +02:00
Enrico Weigelt, metux IT consult c3d780d07f composite: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:16 +02:00
Enrico Weigelt, metux IT consult f208c7a971 xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:13 +02:00
Enrico Weigelt, metux IT consult c335d5a92e damage: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:11 +02:00
Enrico Weigelt, metux IT consult c14783ef81 render: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:07 +02:00
Enrico Weigelt, metux IT consult 4b4fba80e2 present: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:05 +02:00
Enrico Weigelt, metux IT consult 0b0cabb505 dbe: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:02 +02:00
Enrico Weigelt, metux IT consult 3a0edc36b6 dix: add per-screen window destructor hook
Right now, extension specific window destruction procedures are implemented
by wrapping the ScreenRec's DestroyWindow() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
window destruction safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their destructor proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:59 +02:00
Enrico Weigelt, metux IT consult 48ca8adc6d dix: make DeleteCallbackList() non-static and document it
Allow using it by other places outside this file, so we can also support
callback lists in dynamically allocated structures:

Those cases need to explicitly call DeleteCallbackList() before free()ing
the structures - otherwise we're getting heap corruptions, because the
actual deletion can happen asynchronously.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:56 +02:00
Enrico Weigelt, metux IT consult a110b3e02e dix: consolidate screen destruction in dixFreeScreen()
Consolidate duplicated screen destruction logic into new function
dixFreeScreen().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:54 +02:00
Enrico Weigelt, metux IT consult 14de20ce58 dix: replace FreeDefaultStipple()
It's just a one-liner only called once, so no actual need for it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:51 +02:00
Enrico Weigelt, metux IT consult d56d8307c1 dix: let FreeGCperDepth() operate on ScreenPtr and NULL protect it
Instead of retrieving the screen index from ScreenRec and passing this,
so the ScreenRec is looked up again, just pass in the ScreenPtr that
already have anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:48 +02:00
Enrico Weigelt, metux IT consult 1eaf1b0191 dix: NULL-protect FreeGC()
Make it possible to call FreeGC() w/o prior NULL checks.
In case of NULL, BadMatch is returned.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:23 +02:00
Enrico Weigelt, metux IT consult 9266733da3 xwin: fix missing include of mi/mi_priv.h
xwin relies on mi_priv.h being included indirectly, thus depending
on exact include within other header files. This can easily break if
something in other headers slightly changes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:20 +02:00
Enrico Weigelt, metux IT consult 05e5ee3671 miext: sync: drop useless CloseScreen wrapping
This wrapped CloseScreen function doesn't do anything actually useful,
so no need to keep it around any longer. It used to do a free() on the
private data (which had been wrong in the first place) but this had
been removed and so the whole function became useless, it had been
forgotten to be swept away.

Fixes: 469d5bf8b7
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:17 +02:00
Enrico Weigelt, metux IT consult d1e641739b xfree86: unexport xf86RandR12CreateScreenResources()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:14 +02:00
Enrico Weigelt, metux IT consult 7b8a5c4a72 xfree86: unexport xf86RandR12CloseScreen()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:11 +02:00
Enrico Weigelt, metux IT consult f26090eba6 egl: drop unused CreateScreenResources pointer
This field hasn't been actually used, so no need to keep it any longer.

Fixes: 60f14d60f6
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:08 +02:00
Enrico Weigelt, metux IT consult 1a97ed88cc kdrive: drop obsolete ifndef PHOENIX
The symbol isn't set anywhere, and git history didn't show anything
were it ever had been set, thus no need to keep this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:06 +02:00
Enrico Weigelt, metux IT consult a444407473 kdrive: call miCreateScreenResources() drectly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:03 +02:00
Enrico Weigelt, metux IT consult 981ee4fcf1 kdrive: directly calling KdCloseScreen() instead of wrapping
No need to wrap CloseScreen proc vector, we can call KdCloseScreen() from
KdXVCloseScreen() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:00 +02:00
Enrico Weigelt, metux IT consult d04872f8c4 kdrive: directly calling fbCloseScreen instead of wrapping
No need to wrap CloseScreen proc vector, we can call fbCloseScreen() from
KdCloseScreen() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:57 +02:00
Enrico Weigelt, metux IT consult c839203c8c xwayland: call miCreateScreenResources() directly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:55 +02:00
Enrico Weigelt, metux IT consult fbc1300cbc xwin: call miCreateScreenResources() directly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:52 +02:00
Enrico Weigelt, metux IT consult 61ac63e8df xwin: drop wrapping on ScreenRec->ModifyPixmapHeader()
Instead of complicated wrapping, just call fbModifyPixmapHeader() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:49 +02:00
Enrico Weigelt, metux IT consult 1758b94520 xwin: drop winResizeWindowMultiWindow()
This wrapping function for Screen->ResizeWindow() is does nothing more than
just call the original functions. So no need to keep wrapping it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:46 +02:00
Enrico Weigelt, metux IT consult 6d8713b6a7 xwin: drop wrapping on ScreenRec->MoveWindow()
Instead of complicated wrapping, just call fbMoveWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:43 +02:00
Enrico Weigelt, metux IT consult 0356a26d9f xwin: drop wrapping on ScreenRec->RestackWindow()
This proc vector is optional (callers check for non-null) and neither fb nor
mi set it, so we can just assign our function directly. No need for wrapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:41 +02:00
Enrico Weigelt, metux IT consult a698ebe1f8 xwin: drop wrapping on ScreenRec->ReparentWindow()
This proc vector is optional (callers check for non-null) and neither fb nor
mi set it, so we can just assign our function directly. No need for wrapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:38 +02:00
Enrico Weigelt, metux IT consult 41531e8220 xwin: drop wrapping on ScreenRec->UnrealizeWindow()
Instead of complicated wrapping, just call fbUnrealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:35 +02:00
Enrico Weigelt, metux IT consult 0dfe79f9da xwin: drop wrapping on ScreenRec->RealizeWindow()
Instead of complicated wrapping, just call fbRealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:32 +02:00
Enrico Weigelt, metux IT consult 7e84650e52 xwin: drop wrapping on ScreenRec->SetShape()
Instead of complicated wrapping, just call fbSetShape() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:30 +02:00
Enrico Weigelt, metux IT consult 6bcfef8cfa xwin: drop winCopyWindowMultiWindow()
This wrapping function for Screen->CopyWindow() is does nothing more than
just call the original functions. So no need to keep wrapping it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:26 +02:00
Enrico Weigelt, metux IT consult dce437bb53 xwin: call winFinishScreenInitFB() directly
Both engines, GDI as well as DirectDraw, using the same screen init finish function,
so no need to keep indirection via per-engine callback pointer.

The winFinishScreenInitFB() can also be made static now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:24 +02:00
Enrico Weigelt, metux IT consult 7cbb183721 xwin: glx: drop glxWinUnrealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:20 +02:00
Enrico Weigelt, metux IT consult 20aec694e4 xwin: glx: drop glxWinRealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:53 +02:00
Enrico Weigelt, metux IT consult 1b990d3c0c xwin: drop wrapping on ScreenRec->ChangeWindowAttributes()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:51 +02:00
Enrico Weigelt, metux IT consult acbb76fd70 xwin: drop wrapping on ScreenRec->CreateWindow()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:47 +02:00
Enrico Weigelt, metux IT consult 023ee2237f xwin: drop wrapping on ScreenRec->PositionWindow()
Instead of complicated wrapping, just call fbPositionWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:45 +02:00
Enrico Weigelt, metux IT consult b0460841e8 xwin: drop wrapping on ScreenRec->DestroyWindow()
Instead of complicated wrapping, just call fbDestroyWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:42 +02:00
Enrico Weigelt, metux IT consult 66e1b34a88 xfree86: modeset: call miCreateScreenResources() directly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:39 +02:00
Enrico Weigelt, metux IT consult 1c3150f507 xfixes: use embedded private instead of pointer
The private struct is pretty small and it needs to be allocated anyways,
so save an extra allocation by directly embedding it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:37 +02:00
Enrico Weigelt, metux IT consult bd8b8481da xfree86: fbdevhw: drop unused FBDEVHW_PLANES
Not used anywhere, neither internal nor external.

(BTW, those defines are only used within xf86-video-fbdev, so they maybe
could be moved over there.)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:34 +02:00
Enrico Weigelt, metux IT consult f794511711 xfree86: fbdevhw: drop unused fbdevHWSaveScreenWeak()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:31 +02:00
Enrico Weigelt, metux IT consult 95018dca2f xfree86: fbdevhw: drop unused fbdevHWEnterVTWeak()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:29 +02:00
Enrico Weigelt, metux IT consult 9bfdcb1ef2 xfree86: fbdevhw: drop unused fbdevHWGetBuildinMode()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:24 +02:00
Enrico Weigelt, metux IT consult e9775aad3d xfree86: fbdevhw: drop unused fbdevHWGetFD()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:20 +02:00
Enrico Weigelt, metux IT consult 7c60120c02 xfree86: fbdevhw: drop unused fbdevHWFreeRec()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:17 +02:00
Enrico Weigelt, metux IT consult e0b143cfd9 xfree86: fbdevhw: make fbdevHWGetRec() static
Not used by any external consumers, only within the same source file,
so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:15 +02:00
Enrico Weigelt, metux IT consult ac947ad0d6 fb: unexport fbGetScreenPixmap() macro
No external users, so no need to keep it exported any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:12 +02:00
Enrico Weigelt, metux IT consult 3e21e96ae4 fb: unexport fbGetGCPrivate() macro
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:09 +02:00
Enrico Weigelt, metux IT consult 05ffb3ec67 fb: unexport FbDash*() macros
No external users, so no need to keep them exported.

(note that xf86-video-intel has it's own copies of them)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:06 +02:00
Enrico Weigelt, metux IT consult b1f60ad68c fb: unexport FbMaskBits() macro
No external users, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:27 +02:00
Enrico Weigelt, metux IT consult df02054150 fb: unexport FB_HEAD_BITS and FB_TAIL_BITS macros
Not used by any driver, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:24 +02:00
Enrico Weigelt, metux IT consult cffb529195 fb: unexport FbBitsStrideToStipStride() macro
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:20 +02:00
Enrico Weigelt, metux IT consult 514a142ab0 fb: move FbStipStrideToBitsStride() to fbblt.c
It's only consumer is fbblt.c, so move it there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:17 +02:00
Enrico Weigelt, metux IT consult e85e8fae56 fb: move MEMCPY_WRAPPED() and MEMSET_WRAPPED() into fbblt.c
Only used inside fbblt.c, so we can move them into there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:15 +02:00
Enrico Weigelt, metux IT consult bfcbcf0302 fb: unexport fbListInstalledColormaps()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:12 +02:00
Enrico Weigelt, metux IT consult 50c2c59dc9 fb: unexport fbAllocatePrivates()
Only used inside fb/, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:09 +02:00
Enrico Weigelt, metux IT consult 4a94e4d01e fb: unexport fbSetBits()
Only used within fb/, not by any driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:05 +02:00
Enrico Weigelt, metux IT consult 97e82b3812 fb: unexport fbInitializeDrawable() and make it static
Only used inside fbpixmap.c (where it's defined), so can be static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:02 +02:00
Enrico Weigelt, metux IT consult 31548e3705 fb: unexport fbValidateDrawable()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:59 +02:00
Enrico Weigelt, metux IT consult 62d5d4ff83 fb: make fbGCFuncs static
Not used outside fbgc.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:56 +02:00
Enrico Weigelt, metux IT consult ab6c67e547 fb: make fbGCOps static
Not used anywhere outside fbgc.c, so can be static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:52 +02:00
Enrico Weigelt, metux IT consult 4125712079 fb: drop obsolete fbPolyFillArc and fbPolyRectangle defines
Those aliases haven't been used (outside fb core itself), since XAA removal
back 17 years ago, no no need to carry them in public interface any longer.

See: 703a9645f3
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:49 +02:00
Enrico Weigelt, metux IT consult 879589060c fb: drop obsolete fbGetExpose() macro
Hasn't been used since 15 years so, probably should was forgotten to clean up.

See: bbbf795e6b
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:46 +02:00
Enrico Weigelt, metux IT consult abaf937693 fb: drop obsolete FbLaneCase*() macros
They haven't been used for over a decade now, so no need to keem'em any longer.
(note: xf86-video-intel has it's own copy of them)
2025-06-12 16:39:43 +02:00
Enrico Weigelt, metux IT consult 5504bc42ae fb: drop obsolete FbMaskStip macro
Hasn't been used since 24bpp support was dropped, almost a decade ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:41 +02:00
Enrico Weigelt, metux IT consult db2568b834 fb: drop obsolete fbFillPolygon define
Hasn't been used since XAA removal, back 17 years ago. Probably just had been
forgotten to clean up.

See: 703a9645f3
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:38 +02:00
Enrico Weigelt, metux IT consult 7f835330a4 fb: drop FbRotStipLeft, FbRotRight, FbRotStipRight macros
Not used anywhere, so can be dropped. Doesn't seem to be ever used
since added over two decades ago.

See: 9508a382f8
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:35 +02:00
Enrico Weigelt, metux IT consult badafca022 fb: drop commented-out FbLeftBits and FbLeftBits macros
Not used anywhere, so can be dropped. They always have been commented-out
since added over two decades ago.

See: 9508a382f8

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:32 +02:00
Enrico Weigelt, metux IT consult c3fe57f095 fb: drop obsolete FB_STIP_ODDSTRIDE and FB_STIP_ODDPTR macro()
Those haven't been used for over a decade now, so no need to keep
it around any longer.

See: a198373685

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:29 +02:00
Enrico Weigelt, metux IT consult 093b029abf Xext: geext: drop obsolete geext.h
This header has now become obsolete. There're also no external consumers
(drivers, etc) left, so it now finally can be dropped entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:26 +02:00
Enrico Weigelt, metux IT consult b49a585fae Xext: geext: unexport GERegisterExtension() and document it
Not used by any external module (eg drivers), so no need to keep it
exported. Also documenting it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:23 +02:00
Enrico Weigelt, metux IT consult 1295fc3ff5 dri3: unexport VERIFY_DRI3_SYNCOBJ() macro
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:18 +02:00
Enrico Weigelt, metux IT consult 30c0dd3734 (!1956) dri3: move dri3_syncobj_type to non-public header
The symbol isn't exported, thus not accessible to modules.
No need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:19 +02:00
Enrico Weigelt, metux IT consult a5f8524d69 fb: overlay: drop unused fbOverlaySetupScreen()
Not used anywhere, neither internal nor drivers, so no need to keep
it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:17 +02:00
Enrico Weigelt, metux IT consult 652d350c25 fb: overlay: make fbOverlayWindowExposures() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:12 +02:00
Enrico Weigelt, metux IT consult f5d0c64e8d fb: overlay: make fbOverlayCopyWindow() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:09 +02:00
Enrico Weigelt, metux IT consult 47269bf935 fb: overlay: make fbOverlayUpdateLayerRegion() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:04 +02:00
Enrico Weigelt, metux IT consult b399cf2fe1 fb: overlay: make fbOverlayPaintKey() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:02 +02:00
Enrico Weigelt, metux IT consult 097cbc3def fb: overlay: make fbOverlayCreateScreenResources() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:58 +02:00
Enrico Weigelt, metux IT consult 4a1850a3a9 fb: overlay: make fbOverlayWindowLayer() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:56 +02:00
Enrico Weigelt, metux IT consult ae4aa34456 fb: overlay: make fbOverlayCloseScreen() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:53 +02:00
Enrico Weigelt, metux IT consult 1d579528ef fb: overlay: make fbOverlayCreateWindow() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:50 +02:00
Enrico Weigelt, metux IT consult fd3d162331 os: xdmcp: handle allocation failure
| ../os/xdmcp.c: In function ‘get_mcast_options’:
| ../os/xdmcp.c:1527:27: warning: dereference of possibly-NULL ‘mcastinfo’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|  1527 |             mcastinfo->ai = firstai;
|       |             ~~~~~~~~~~~~~~^~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:48 +02:00
Enrico Weigelt, metux IT consult c389f28af0 os: util: protect set_font_authorizations() from allocation failure
| ../os/utils.c: In function ‘set_font_authorizations’:
| ../os/utils.c:863:14: warning: dereference of possibly-NULL ‘result’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   863 |         *p++ = sizeof(AUTHORIZATION_NAME) >> 8;
|       |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:45 +02:00
Enrico Weigelt, metux IT consult eb09c17a54 os: ospoll_create(): protect from allocation failure
| ../os/ospoll.c: In function ‘ospoll_create’:
| ../os/ospoll.c:229:22: warning: dereference of possibly-NULL ‘ospoll’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   229 |     ospoll->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
|       |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:42 +02:00
Enrico Weigelt, metux IT consult 1e2842f3e5 composite: silence some warnings on possible NULL dereference
Unlikely to practically happen, but still safer to just check for sure.
A simple zero-value test doesn't cost us much (on modern CPUs perhaps
not even a full clock cycle).

| ../composite/compalloc.c: In function ‘compRedirectWindow’:
| ../composite/compalloc.c:167:35: warning: dereference of NULL ‘pClient’ [CWE-476] [-Wanalyzer-null-dereference]
|   167 |     ccw->id = FakeClientID(pClient->index);
|       |                            ~~~~~~~^~~~~~~

| ../composite/compalloc.c: In function ‘compUnredirectWindow’:
| ../composite/compalloc.c:331:75: warning: dereference of NULL ‘pClient’ [CWE-476] [-Wanalyzer-null-dereference]
|   331 |         if (ccw->update == update && dixClientIdForXID(ccw->id) == pClient->index) {
|       |                                                                    ~~~~~~~^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:39 +02:00
Enrico Weigelt, metux IT consult 10e9f99fb2 exa: protect against NULL pointer dereference
Since GetPictureScreenIfSet() explicitly can return NULL, better be
prepared for that to happen (instead of hard crash)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:36 +02:00
Enrico Weigelt, metux IT consult 6308fb6bf6 kdrive: protect against allocation failures and NULL pointers
Even if those situations shouldn't practically happen, it's better to have
some sanity checks just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:33 +02:00
Enrico Weigelt, metux IT consult 63097cb5c9 fb: pict: make fbGlyphs() static
Not used anywhere outside fbpict.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:29 +02:00
Enrico Weigelt, metux IT consult b0e7326f6d fb: pict: unexport fbTriangles()
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:19 +02:00
Enrico Weigelt, metux IT consult 12cb13d1fa fb: pict: unexport fbTrapezoids()
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:17 +02:00
Enrico Weigelt, metux IT consult 587fd5c708 fb: pict: unexport fbAddTriangles()
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:14 +02:00
Enrico Weigelt, metux IT consult 02e61f15a9 fb: pict: unexport fbRasterizeTrapezoid()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:11 +02:00
Enrico Weigelt, metux IT consult 5def7f3f64 render: NULL-protect SetPicturePictFilter()
Even though it shouldn't practically happen, better adding a trivial check,
just in case. The check is really cheap and possibly optimized-out.

| ../render/filter.c: In function ‘SetPicturePictFilter’:
| ../render/filter.c:388:36: warning: dereference of possibly-NULL ‘new_params’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   388 |         pPicture->filter_params[i] = params[i];
|       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:08 +02:00
Enrico Weigelt, metux IT consult 67751f6096 render: NULL protect cpAlphaMap()
Even though it practically should never happen, but just in case, and
for silencing the analyzer, add an extra check here (which doesn't
cost us much).

| ../render/picture.c: In function ‘cpAlphaMap’:
| ../render/picture.c:1002:30: warning: dereference of NULL ‘screen’ [CWE-476] [-Wanalyzer-null-dereference]
|  1002 |         id = res->info[screen->myNum].id;
|       |                        ~~~~~~^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:06 +02:00
Enrico Weigelt, metux IT consult 8a71c7338c render: glyph: extra NULL pointer protection
Even though it's probably never happening, but still better to protect from it,
just in case. The extra cost of it hard to measure on today's machines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:03 +02:00
Enrico Weigelt, metux IT consult 00080db825 test: add assert()s to fix analyzer warnings
Reduce the analyzer spam a bit by adding some extra asserts.
Since it's test code, we can't have enough of them anyways ;-)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:00 +02:00
Enrico Weigelt, metux IT consult be4f551d9f test: fix FILE pointer leak
Fix leaking open FILE*.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:58 +02:00
Enrico Weigelt, metux IT consult f1e7e52aa3 record: protect from NULL pointers
Even though the situation probably never happens, but better being extra
cautious, just in case.

| ../record/set.c: In function ‘IntervalListCreateSet’:
| ../record/set.c:364:5: warning: use of NULL ‘stackIntervals’ where non-null expected [CWE-476] [-Wanalyzer-null-argument]
|   364 |     memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
|       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:55 +02:00
Enrico Weigelt, metux IT consult 2be4669988 dix: a little bit more startup logging
Adding a little bit more logging to the startup process, eg. telling
when outputs or inputs have been initialized. Serving as a little aid for
debugging driver problems.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:50 +02:00
Enrico Weigelt, metux IT consult 8a5b65529c dix: protect input_option_set_value() from NULL pointer
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:47 +02:00
Enrico Weigelt, metux IT consult 3178018b84 dix: extra NULL safety check in SetClipRects()
Even though it might never be actually hit, it's better to have an
(really cheap) extra check, just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:44 +02:00
Enrico Weigelt, metux IT consult 9d13313511 dix: extra NULL protection in UnmapSubwindows()
Even though it probably won't be hit ever, it's still better to be
really sure instead of some remote chance for hard segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:42 +02:00
Enrico Weigelt, metux IT consult ee7e43ab21 dix: clear free()ed pointers on CloseDownExtensions()
As safety precaution, clear the pointers to extion records that just
have been free()ed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:39 +02:00
Enrico Weigelt, metux IT consult 77502c6836 dix: NULL-protect AllocGlyphCursor()
Return error to the client if sourcefont turns out to be NULL for
whatever reason.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:37 +02:00
Enrico Weigelt, metux IT consult af71108cd3 dix: devices: refine NULL checks in GetMaster()
The checking / branchin isn't entirely trivial to understand, and the
analyzer also gets confused. So rewrite it in an simpler way that's
easier to understand both the human reader as well as the analyzer.
(and so get rid of yet another false alarm)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:34 +02:00
Enrico Weigelt, metux IT consult 4d3d4a34ec dix: region: turn xfreeData() into inline func and add checks
For type-safety turn xfreeData() macro into an inline function.
Also adding some checks against accidentially free()'ing global data.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:31 +02:00
Enrico Weigelt, metux IT consult 765cb85350 dix: make DeviceEnterLeaveEvent() anaylzer-friendly
The analyzer giving a false alarm on potential NULL-pointer deref here.
Even though that case can't happen, it's also not immediately clear
to the human reader.

To make both the analyzer as well human reader happier, reformulating
this function to by using fast-return pattern.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:29 +02:00
Enrico Weigelt, metux IT consult 7b7579e956 dix: protect ChangeWindowDeviceCursor() from allocation failure
On memory allocation failure, return BadAlloc instead of crashing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:26 +02:00
Enrico Weigelt, metux IT consult 8b079ed198 include: regionstr.h: protect RegionUninit() from free()ing on .data
There might be a chance that RegionUninit() is trying to free() some
struct that's actually coming from .data segment.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:24 +02:00
Enrico Weigelt, metux IT consult 2b9ccde53a dix: dixfonts: explain analyzer false alarm on alleged free() of stack chunk
The analyzer is wrong here, because the free'd closure pointer really points
to some calloc()'d chunk, instead of the PolyText()'s stack frame.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:20 +02:00
Enrico Weigelt, metux IT consult 1e47ef4006 dix: NULL-protection in GestureAddRegularListener()
protect against the (unlikely) case that inputMasks == NULL.

| ../dix/gestures.c: In function ‘GestureAddRegularListener’:
| ../include/list.h:376:21: warning: dereference of NULL ‘0’ [CWE-476] [-Wanalyzer-null-dereference]
|   376 |         for (_entry = _list; _entry; _entry = (_entry)->_member)
| ../dix/gestures.c:241:9: note: in expansion of macro ‘nt_list_for_each_entry’
|   241 |         nt_list_for_each_entry(iclients, inputMasks->inputClients, next) {
|       |         ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:17 +02:00
Enrico Weigelt, metux IT consult f1ba454733 dix: protect from pScreen->SetCursorPosition == NULL
It's safer not relying on all ScreenProc's actually filled.

../dix/events.c: In function ‘CheckPhysLimits’:
../dix/events.c:780:14: warning: dereference of NULL ‘pScreen’ [CWE-476] [-Wanalyzer-null-dereference]
  780 |             (*pScreen->SetCursorPosition)
      |             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:14 +02:00
Enrico Weigelt, metux IT consult 654c9c1f3d dix: touch: NULL-protection in TouchAddRegularListener()
protect against the (unlikely) case that inputMasks == NULL.

| ../dix/touch.c: In function ‘TouchAddRegularListener’:
| ../include/list.h:376:21: warning: dereference of NULL ‘0’ [CWE-476] [-Wanalyzer-null-dereference]
|   376 |         for (_entry = _list; _entry; _entry = (_entry)->_member)
| ../dix/touch.c:766:9: note: in expansion of macro ‘nt_list_for_each_entry’
|   766 |         nt_list_for_each_entry(iclients, inputMasks->inputClients, next) {
|       |         ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:12 +02:00
Enrico Weigelt, metux IT consult 076bc54064 dix: region: add comments on xfreeData()
Commenting a few aspects need to be considered when using this macro.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:09 +02:00
Enrico Weigelt, metux IT consult e3a213f63c dix: protect against alloc failure in ‘DeviceFocusEvent()
Fixes analyzer warning:

| ../dix/enterleave.c: In function ‘DeviceFocusEvent’:
| ../dix/enterleave.c:788:20: warning: dereference of possibly-NULL ‘xi2event’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   788 |     xi2event->type = GenericEvent;
|   ‘DoFocusEvents’: events 1-4

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:05 +02:00
Enrico Weigelt, metux IT consult 6a8ee31e1b dix: move props into WindowRec and fix potential NULL deref
The pointer to the window properties is currently inside the WindowOptional
structure, which may or may not exist at any given time. Thus, before accessing
those fields, at least need to check whether it exists, potentially need to
create it first.

Since a pointer is small (in relation to WindowRec) and windows having properties
is a pretty common, we can make our life much simpler here by moving the pointer
directly into WindowRec, so we don't need extra WindowOptionalRec allocation.

This also fixes an analyzer warning on potential NULL dereference issue:

| ../dix/property.c: In function ‘dixChangeWindowProperty’:
|../dix/property.c:343:37: warning: dereference of NULL ‘*pWin.optional’ [CWE-476] [-Wanalyzer-null-dereference]
|  343 |         pProp->next = pWin->optional->userProps;
|      |                       ~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:03 +02:00
Enrico Weigelt, metux IT consult faae695d0a dix: protect doPolyText() from potential NULL dereference
There's a (theoretical) chance that origGC might be NULL, so better
be cautious and check for this - doesn't cost us much, probably just
another JZ instruction.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:57 +02:00
Enrico Weigelt, metux IT consult 634700301c xfree86: parser: fix possible use-after-free xf86freeOutputClassList()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:53 +02:00
Enrico Weigelt, metux IT consult 9b17febf75 xfree86: dri: extra safety checks for NULL pointers / disabled extension
Be more cautious on possible NULL pointers or not yet registered
devPrivates. Better a gracefully fail instead of hard segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:50 +02:00
Enrico Weigelt, metux IT consult 567898f17d xfree86: ddc: safety check for NULL pointer
Even though it *should* never be actually hit, it's still safer
to check for NULL instead of letting us crash with segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:47 +02:00
Enrico Weigelt, metux IT consult c0d068229b xfree86: common: extra safety checks for NULL pointers
Even though it's unlikely ever getting it, still safer to have some
extra checks / asserts than unexpected segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:45 +02:00
Enrico Weigelt, metux IT consult aad59c6dee xfree86: common: fix not-found check in xf86platformAddDevice()
Safer (and easier to understand) if we look at the result pointer
instead of the counter for testing whether device wasn't found.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:42 +02:00
Enrico Weigelt, metux IT consult d3c4e100ed xfree86: common: gracefully handle allocation failure
Better try to handle memory allocation gracefully than just hard
crashing by segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:40 +02:00
Enrico Weigelt, metux IT consult 111ca8af21 xfree86: utils: gracefully handle allocation failure.
Better failing gracefully instead of hard crash via segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:37 +02:00
Enrico Weigelt, metux IT consult 6c9f2ecc32 xfree86: int10: extra NULL protection
Even though chances are really low it's ever getting hit, it's still safer
to have some sanity checks (which don't cost us much) than risking segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:34 +02:00
Enrico Weigelt, metux IT consult 30c60ed578 xfree86: modes: fix uninitialized variables
| ../hw/xfree86/modes/xf86RandR12.c: In function ‘xf86ComputeCrtcPan’:
| ../hw/xfree86/modes/xf86RandR12.c:310:54: warning: use of uninitialized value ‘r[1]’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
|   310 |             q[i] = m->m[1][i] * r[0] - m->m[0][i] * r[1];
|       |                                                     ~^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:32 +02:00
Enrico Weigelt, metux IT consult 7ae09df3ae xfree86: loader: add assert() in LoadModule()
There's (remote) chance that the (internal) module name could become
NULL (eg. allocation failure). Even though chances to hit it are very
low, it's still better to have a check here (that doesn't cost us much),
just in case. Assert fail is still better than segfault, since we're
at least getting some hint what might have happened.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:29 +02:00
Enrico Weigelt, metux IT consult b28285332e xfree86: parser: check for alloc failure and possible NULL pointers
Adding paranoid extra checks against allocation failure and NULL pointers.
Even though might not be actually hit in practise, it's still better to
be cautious, just in case. And reducing analyzer noise this way.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:26 +02:00
Enrico Weigelt, metux IT consult 88d561bf18 xfree86: x86emu: add extra assert()'s
The analyzer warnings (possible NULL dereference) are probably just
false alarms. But for safety adding assert()'s, which don't cost us
anything in non-debug builds.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:24 +02:00
Enrico Weigelt, metux IT consult 1436690a43 glx: fix warning on potentially uninitialized variable in xorgGlxMakeCurrent()
| ../glx/glxcmds.c: In function ‘xorgGlxMakeCurrent’:
| ../glx/glxcmds.c:621:24: warning: use of uninitialized value ‘status’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
|   621 |                 return status;
|       |                        ^~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:21 +02:00
Enrico Weigelt, metux IT consult 2274f23e60 glx: NULL-protect validGlxFBConfigForWindow()
If this ever happens, we clearly have a bug, so print out proper warning,
instead of silently crashing the Xserver.

| ../glx/glxcmds.c: In function ‘validGlxFBConfigForWindow’:
| ../glx/glxcmds.c:127:16: warning: dereference of NULL ‘pVisual’ [CWE-476] [-Wanalyzer-null-dereference]
|   127 |     if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
|       |         ~~~~~~~^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:18 +02:00
Enrico Weigelt, metux IT consult 1e055b5ddc glx: protect createModeFromConfig() from allocation failure
| ../glx/glxdricommon.c: In function ‘createModeFromConfig’:
| ../glx/glxdricommon.c:142:23: warning: dereference of possibly-NULL ‘config’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   142 |     config->driConfig = driConfig;

Consumers can already handle returning NULL, so this seems the best compromise.
It will look like we don't have any modes at all. Certainly not nice, but at
least better than completely crashing the Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:16 +02:00
Enrico Weigelt, metux IT consult 9ee96639d7 glx: createcontext: silence analyzer warning and make code easier to understand
This warning is probably a false alarm, but it's trivial to fix.

| ../glx/createcontext.c: In function ‘__glXDisp_CreateContextAttribsARB’:
| ../glx/createcontext.c:172:24: warning: dereference of NULL ‘0’ [CWE-476] [-Wanalyzer-null-dereference]
|   172 |         switch (attribs[i * 2]) {
|       |                 ~~~~~~~^~~~~~~

The situation is too complex for the analyzer to handle:
(but also not immediately clear for the human reader)

* `attribs` is only NULL when req->numAttribs is 0
* in that case, the for loop is no-op, so `attribs` won't ever be deref'ed.

We can make it easier for both analyzer as well as human reader by just putting
the whole loop into an `if (req->numAttribs)` and assigning it inside there.
There shouldn't be any (practically measurable) extra cost.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:12 +02:00
Enrico Weigelt, metux IT consult 2b3bbce30b Xext: panoramix: extra safety checks
Even though risk of being actually hit is minimal, better having some extra
safety checks instead of segfaulting, just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:10 +02:00
Enrico Weigelt, metux IT consult 3f7370d53f Xext: panoramix: protect from allocation failures
Handle memory allocations gracefully, instead of just segfaulting.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:07 +02:00
Enrico Weigelt, metux IT consult b56b32bba7 Xext: panoramix: fix uninitialized variable
| ../Xext/panoramiXprocs.c: In function ‘PanoramiXCopyArea’:
| ../Xext/panoramiXprocs.c:1152:13: warning: use of uninitialized value ‘pGC’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
|  1152 |         if (pGC && pGC->graphicsExposures) {
|       |             ^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:04 +02:00
Enrico Weigelt, metux IT consult 6b7d35f71c Xext: xtest: extra NULL checks
Even though these probably never happen, it's still better having some
(really cheap) extra checks, just in case.

| ../Xext/xtest.c: In function ‘ProcXTestFakeInput’:
| ../Xext/xtest.c:385:17: warning: dereference of NULL ‘dev’ [CWE-476] [-Wanalyzer-null-dereference]
|   385 |         if (!dev->key)
|       |              ~~~^~~~~

| ../Xext/xtest.c:442:12: warning: dereference of NULL ‘dev’ [CWE-476] [-Wanalyzer-null-dereference]
|   442 |     if (dev->sendEventsProc)
|       |         ~~~^~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:33:00 +02:00
Enrico Weigelt, metux IT consult c4642f2632 Xext: shape: fix warning on possible NULL dereference
Try not to rely on deep black magic of calloc(), instead skip the whole
part of nrects is zero.

| ../Xext/shape.c: In function ‘ProcShapeGetRectangles’:
| ../Xext/shape.c:995:24: warning: dereference of possibly-NULL ‘rects’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   995 |             rects[i].x = box->x1;
|       |             ~~~~~~~~~~~^~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:58 +02:00
Enrico Weigelt, metux IT consult 7a6d2d41bd Xext: shm: protect against possible NULL dereference
| ../Xext/shm.c: In function ‘ShmExtensionInit’:
| ../Xext/shm.c:1534:29: warning: dereference of possibly-NULL ‘screen_priv’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|  1534 |             if (!screen_priv->shmFuncs)
|       |                  ~~~~~~~~~~~^~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:55 +02:00
Enrico Weigelt, metux IT consult 2594dec389 Xext: vidmode: protect against alloc failures and NULL pointers
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:51 +02:00
Enrico Weigelt, metux IT consult cd13a40667 Xext: selinux: fix possible NULL dereference
> ../Xext/xselinux_ext.c: In function ‘SELinuxSendItemsToClient’:
> ../Xext/xselinux_ext.c:358:18: warning: dereference of possibly-NULL ‘buf’ [CWE-690] [-Wanalyzer-possible-null-dereference]
>   358 |         buf[pos] = items[k].id;
>       |         ~~~~~~~~~^~~~~~~~~~~~~

> ../Xext/xselinux_ext.c: In function ‘SELinuxFreeItems’:
> ../Xext/xselinux_ext.c:335:9: warning: dereference of possibly-NULL ‘items’ [CWE-690] [-Wanalyzer-possible-null-dereference]
>   335 |         freecon(items[k].octx);
>       |         ^~~~~~~~~~~~~~~~~~~~~~

> ../Xext/xselinux_ext.c: In function ‘SELinuxPopulateItem’:
> ../Xext/xselinux_ext.c:321:11: warning: dereference of possibly-NULL ‘i’ [CWE-690] [-Wanalyzer-possible-null-dereference]
>   321 |     i->id = id;
>       |     ~~~~~~^~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:49 +02:00
Enrico Weigelt, metux IT consult 0e8ff0bf57 Xext: sync: protect from NULL pointer dereference
> ../Xext/sync.c: In function ‘IdleTimeQueryValue’:
> ../Xext/sync.c:2654:18: warning: dereference of NULL ‘priv’ [CWE-476] [-Wanalyzer-null-dereference]
>  2654 |         deviceid = priv->deviceid;
>       |         ~~~~~~~~~^~~~~~~~~~~~~~~~

> ../Xext/sync.c: In function ‘IdleTimeBlockHandler’:
> ../Xext/sync.c:2666:14: warning: dereference of NULL ‘priv’ [CWE-476] [-Wanalyzer-null-dereference]
>  2666 |     int64_t *less = priv->value_less;
>       |              ^~~~

> ../Xext/sync.c:2773:9: warning: dereference of NULL ‘priv’ [CWE-476] [-Wanalyzer-null-dereference]
>  2773 |     if (LastEventTimeWasReset(priv->deviceid)) {
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> ../Xext/sync.c: In function ‘IdleTimeBracketValues’:
> ../Xext/sync.c:2791:14: warning: dereference of NULL ‘priv’ [CWE-476] [-Wanalyzer-null-dereference]
>  2791 |     int64_t *less = priv->value_less;
>       |              ^~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:46 +02:00
Enrico Weigelt, metux IT consult 746648be85 Xext: sync: protect init_system_idle_counter() from allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:41 +02:00
Enrico Weigelt, metux IT consult a7f8d0db3d Xext: xres: protect against free()ing from non-heap
> ../Xext/xres.c: In function ‘DestroyFragments’:
> ../Xext/xres.c:124:9: warning: ‘free’ of ‘it’ which points to memory on the stack [CWE-590] [-Wanalyzer-free-of-non-heap]
>   124 |         free(it);
>      |         ^~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:38 +02:00
Enrico Weigelt, metux IT consult 5193f57aae randr: add BUG_* checks for possible NULL pointer issue
The ‘RRCrtcNotify() and RRCrtcSet() functions are exported, so there's chance
that a buggy driver could call them with NULL parameter, leading to segfault.
Those are hard to trace, so it's better having a BUG_* check here.

| ../randr/rrcrtc.c: In function ‘RRCrtcNotify’:
| ../randr/rrcrtc.c:187:5: warning: use of NULL ‘outputs’ where non-null expected [CWE-476] [-Wanalyzer-null-argument]
|   187 |     memcpy(crtc->outputs, outputs, numOutputs * sizeof(RROutputPtr));
|       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| ../randr/rrcrtc.c: In function ‘RRCrtcSet’:
| ../randr/rrcrtc.c:742:20: warning: dereference of NULL ‘outputs’ [CWE-476] [-Wanalyzer-null-dereference]
|   742 |         if (outputs[o]) {
|       |             ~~~~~~~^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:35 +02:00
Enrico Weigelt, metux IT consult 90cd5c38ee randr: skip payload assembly in ProcRRGetScreenInfo() no data to send
If there's no data to send, the whole reply payload can be skipped entirely.
This can also ease the whole code flow, and we don't need to rely on the
individual copy loops never trying to dereference a NULL pointer.
(what the analyzer can't proof). Also scoping several some variables that
are only used when there actually is data to send.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:33 +02:00
Enrico Weigelt, metux IT consult 74a3b2b728 randr: skip payload assembly in rrGetScreenResources() no data to send
If there's no data to send, the whole reply payload can be skipped entirely.
This can also ease the whole code flow, and we don't need to rely on the
individual copy loops never trying to dereference a NULL pointer.
(what the analyzer can't proof). Also scoping several some variables that
are only used when there actually is data to send.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:29 +02:00
Enrico Weigelt, metux IT consult 67b78a9f58 randr: simplify reply assembly in ProcRRListProviderProperties()
Moving payload buffer assembly right into the same branch where the buffer is
allocated, so making the whole code flow easier to understand. Also moving the
byteswap there (when the fields should still be in CPU cache), instead of having
some callback doing it much later, so even more simplication.

As a nice by-product, that's also reducing some analyzer noise.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:27 +02:00
Enrico Weigelt, metux IT consult 2e05296905 randr: no need to for local temp buffer in ProcRRQueryProviderProperty()
The code can be much simpler by just using CopySwap32Write().
And we also don't need the callback in WriteSwappedDataToClient(),
just call the corresponding write function directly.

This also makes some analyzer warnings go away.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:24 +02:00
Enrico Weigelt, metux IT consult b535db955a randr: ProcRRGetOutputInfo() skip payload assembly when nothing to do
If there's no extra payload to send, we can skip the whole payload
assembly chain.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:22 +02:00
Enrico Weigelt, metux IT consult 6b5c64d273 randr: simplify extra payload copying in ProcRRGetOutputInfo()
Make it a bit easier to understand how exactly the name string is copied into
the reply payload: just do the little memcpy() right where the target position
is decided any the rest of the payload is filled.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:19 +02:00
Enrico Weigelt, metux IT consult b67dabef12 randr: RROutputSetCrtcs(): simplify buffer allocation / copying
Instead of relying on memcpy() coping with NULL buffer when size == 0,
move the call to the branch where we actually have things to copy.

This also silences yet another analyzer warning.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:17 +02:00
Enrico Weigelt, metux IT consult acec1156b3 randr: RROutputSetModes(): simplify buffer allocation / copying
Instead of relying on memcpy() coping with NULL buffer when size == 0,
move the call to the branch where we actually have things to copy.

This also silences yet another analyzer warning.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:14 +02:00
Enrico Weigelt, metux IT consult 3279b81d7b randr: RROutputSetClones(): simplify buffer allocation / copying
Instead of relying on memcpy() coping with NULL buffer when size == 0,
move the call to the branch where we actually have things to copy.

This also silences yet another analyzer warning.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:12 +02:00
Enrico Weigelt, metux IT consult 5b13d85464 randr: refine allocation and copying of optional buffers
Simplifying the code flow allocating/checking/copying some buffers in
RRConfigureOutputProperty() and RRConfigureProviderProperty() so it's
easier to understand for both the human reader as well as the analyzer.

Depending on whether we have elements to process, a temporary buffer needs
to be allocated, checked for successful allocation and copy over data. The
way it's currently done is technically correct, but unnecessarily complex to
understand: instead of just branching on whether there are elements and doing
all the buffer-related things only then, the branching is done just somewhere
in the middle, only on checking for allocation failure, and relying on both
calloc() and memcpy() not doing weird things when size is zero.

It's easy to simplify by putting it all behind one if statement and so make
things easier for both human reader as well as the analyzer (so it's not
spilling out false alarms here anymore) and also drops unnecessary calls
in the zero-size case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:09 +02:00
Enrico Weigelt, metux IT consult ed289f734b os: don't ever try to mess with stderr / fd 2
1. We've got some ancient code here that's trying to open stderr (fd 2) itself,
   in case it cannot write there for strange reason. POSIX defines the three
   standard streams (and associated fd's) to be available on program startup
   (when main() is reached). One needs a sledgehammer for breaking a system
   so much that this doesn't work anymore - even calling a program directly
   from /etc/inittab does provide them.

2. The current implementation is not POSIX conformant - it should use freopen(),
   and it leaks FILE structure.

3. stderr is set to buffered mode, quite the opposite of POSIX - it states
   stderr shall NOT be buffered. Simple and obvious reason: not risking vital
   error information getting lost.

4. Placing The logfile in /usr/adm - an ancient, pre-FHS, directory that rarely
   exists on modern systems. That's even hardcoded, instead of derived from
   build-time given installation pathes.

Conculusio: obsolete and broken, thus removing it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:00 +02:00
Enrico Weigelt, metux IT consult 6a01f488c8 os: drop self-limiting resources
It's only rarely used and can be easily achieved by generic means,
eg. via ulimit or supervisor settings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:57 +02:00
Enrico Weigelt, metux IT consult b7b526024a glamor: fix segfault on calloc() failure
calloc() can always fail, so we need to prepared for this,
instead of just blindly segfault'ing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:54 +02:00
Enrico Weigelt, metux IT consult 016f62baad glamor: BUG_* checks on NULL atlas
If this happens, we really have a bug, so better spit out a warning
instead of just segfault'ing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:51 +02:00
Enrico Weigelt, metux IT consult b0c9e95a61 glamor: BUG_RETURN*() on pixmap private data
Usually shouldn't happen trying to accessing pixmap's glamor private
data w/o having it initialized first. But just in case there's some
subtle bug, adding extra checks, which don't cost us much.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:49 +02:00
Enrico Weigelt, metux IT consult faef79be75 glamor: protect from NULL return of GetPictureScreenIfSet()
GetPictureScreenIfSet() is designed that NULL can be returned.
Even though it should not happen in this particular case,
better be prepared for that, instead of just segfault'ing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:46 +02:00
Enrico Weigelt, metux IT consult 5fd11ec4a6 glamor: NULL-protect GLAMOR_PIXMAP_PRIV_HAS_FBO()
It could potentially be called with NULL pointer, but can't handle it,
so when that happens, it's a bug. Adding a BUG_RETURN_VAL() call here,
so it's giving us a hint where to look at.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:44 +02:00
Enrico Weigelt, metux IT consult 8b970b4bde xkb: fix uninitialized variables in XkmReadFile()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:40 +02:00
Enrico Weigelt, metux IT consult 269cd0f8ac xkb: maprules: fix potential NULL pointer dereference warnings
Even though the cases might be hypothetical, it's still better having some
tiny extra checks (that might be even optimized-out) and reduce the analyzer
noise a bit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:37 +02:00
Enrico Weigelt, metux IT consult 427400fcc0 xkb: fix NULL pointer dereference in XkbDDXLoadKeymapByNames()
In the rare case that NULL kbd is passed and also no components provided,
the corresponding error message code crashes on NULL pointer dereference.

| ../xkb/ddxLoad.c: In function ‘XkbDDXLoadKeymapByNames’:
| ../xkb/ddxLoad.c:393:25: warning: dereference of NULL ‘keybd’ [CWE-476] [-Wanalyzer-null-dereference]
|   393 |                    keybd->name ? keybd->name : "(unnamed keyboard)");
|       |                    ~~~~~^~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:34 +02:00
Enrico Weigelt, metux IT consult a1d1ee930d mi: miwideline: fix uninitialized fields in miWideLine()
| ../mi/miwideline.c: In function ‘miRoundCapClip’:
| ../mi/miwideline.c:1404:15: warning: use of uninitialized value ‘*face.dy’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
|  1404 |     dx = -face->dy;
|       |           ~~~~^~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:32 +02:00
Enrico Weigelt, metux IT consult 3b9ca877a4 mi: NULL-protect miFillGeneralPoly()
| In file included from ../mi/mipoly.c:59:
| ../mi/mipoly.c: In function ‘miFillGeneralPoly’:
| ../mi/mipoly.h:162:12: warning: dereference of NULL ‘pAET’ [CWE-476] [-Wanalyzer-null-dereference]
|   162 |    if (pAET->ymax == y) {          /* leaving this edge */ \
| ../mi/mipoly.c:591:17: note: in expansion of macro ‘EVALUATEEDGEEVENODD’
|   591 |                 EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
|       |                 ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:29 +02:00
Enrico Weigelt, metux IT consult fccc98645b mi: NULL-protection in ‘miInitVisuals()
NULL-Protect just against 'vid' might remain NULL.

| ../mi/micmap.c: In function ‘miInitVisuals’:
| ../mi/micmap.c:505:32: warning: dereference of NULL ‘vid’ [CWE-476] [-Wanalyzer-null-dereference]
|  505 |             visual->vid = *vid = FakeClientID(0);
|      |                           ~~~~~^~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:26 +02:00
Enrico Weigelt, metux IT consult a48e2d8532 Xi: exevents: extra asserts on NULL pointers
Even though shouldn't be practically hit, better have some asserts,
giving us an idea of the point of cause, instead of segfaulting,
just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:22 +02:00
Enrico Weigelt, metux IT consult cb69b80973 Xi: xibarriers: protect add_master_func() from allocation failure
Try to gracefully handle OOM situation, at not hard crashing.

| ../Xi/xibarriers.c: In function ‘add_master_func’:
| ../Xi/xibarriers.c:729:19: warning: dereference of NULL ‘pbd’ [CWE-476] [-Wanalyzer-null-dereference]
|  729 |     pbd->deviceid = *deviceid;
|       |     ~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:19 +02:00
Enrico Weigelt, metux IT consult d91121e876 Xi: exevents: NULL protection in ‘DeviceEventSuppressForWindow()
Protect against `inputMasks` could be NULL.

| ../Xi/exevents.c: In function ‘DeviceEventSuppressForWindow’:
| ../Xi/exevents.c:3246:32: warning: dereference of NULL ‘inputMasks’ [CWE-476] [-Wanalyzer-null-dereference]
|  3246 |         FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
|       |                      ~~~~~~~~~~^~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:15 +02:00
Enrico Weigelt, metux IT consult f022f1c764 Xi: fix double-free warning in FreePointerBarrierClient()
| ../Xi/xibarriers.c: In function ‘FreePointerBarrierClient’:
| ../Xi/xibarriers.c:127:9: warning: double-‘free’ of ‘pbd’ [CWE-415] [-Wanalyzer-double-free]
|   127 |         free(pbd);
|       |         ^~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:08 +02:00
Enrico Weigelt, metux IT consult 1c088613ba include: don't install propertyst.h
Nothing in here needs anything from that include file, so no need for
including it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:02 +02:00
Enrico Weigelt, metux IT consult 73d2d99ace xfree86: xf86Priv.h: dont include propertyst.h
Nothing in here needs anything from that include file, so no need for
including it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:45 +02:00
Enrico Weigelt, metux IT consult 505138167e xfree86: xf86.h: dont include propertyst.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:20 +02:00
Enrico Weigelt, metux IT consult 9d98f3a7ca xfree86: xf86Events.c: add missing include of property.h
the file calls some functions from property.h, so it needs to be included.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:16 +02:00
Enrico Weigelt, metux IT consult 42dd730e5a Xext: security: drop not needed include
Not needed in that header file, so drop it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:13 +02:00
Enrico Weigelt, metux IT consult aebc3c592e randr: unexport and document RRTransformCopy()
Not used by any external drivers, so no neeed to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:10 +02:00
Enrico Weigelt, metux IT consult 67c086a9f0 randr: unexport and document RRTransformSetFilter()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:07 +02:00
Enrico Weigelt, metux IT consult b2f3ef787c randr: unexport and document RRTransformEqual()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:04 +02:00
Enrico Weigelt, metux IT consult 07950dd411 randr: unexport and document RRTransformInit()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:30:01 +02:00
Enrico Weigelt, metux IT consult 5f776e857d randr: unexport and document RRXineramaExtensionInit()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:59 +02:00
Enrico Weigelt, metux IT consult 5998871151 randr: unexport and document RRQueryOutputProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:56 +02:00
Enrico Weigelt, metux IT consult 81df43802b randr: unexport and document RRGetOutputProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:53 +02:00
Enrico Weigelt, metux IT consult d3e1cc205c randr: unexport resource type IDs
Not used by any external drivers, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:50 +02:00
Enrico Weigelt, metux IT consult 097b9e9163 randr: unexport and document RRConfigureProviderProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:47 +02:00
Enrico Weigelt, metux IT consult 7c0c2f1460 randr: unexport and document RRChangeProviderProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:44 +02:00
Enrico Weigelt, metux IT consult 7b303bd8d0 randr: unexport and document RRDeleteProviderProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:39 +02:00
Enrico Weigelt, metux IT consult 538a8a80cd randr: unexport and document RRQueryProviderProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:36 +02:00
Enrico Weigelt, metux IT consult 08110b9192 randr: unexport and document RRGetProviderProperty()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:33 +02:00
Enrico Weigelt, metux IT consult 1e7752f10d randr: unexport and document RRProviderAutoConfigGpuScreen()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:30 +02:00
Enrico Weigelt, metux IT consult 9bbaf79703 randr: unexport and document RRDeliverProviderEvent()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:28 +02:00
Enrico Weigelt, metux IT consult d9ee0e7901 randr: unexport and document RRProviderDestroy()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:25 +02:00
Enrico Weigelt, metux IT consult 8632c2e76e randr: unexport and document RRProviderSetCapabilities()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:22 +02:00
Enrico Weigelt, metux IT consult cc8e32ef5e randr: unexport and document RRProviderCreate()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:19 +02:00
Enrico Weigelt, metux IT consult 506ca26514 randr: unexport and document RRProviderInitErrorValue()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:16 +02:00
Enrico Weigelt, metux IT consult 20d1a1f412 randr: unexport and document RRProviderInit()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:13 +02:00
Enrico Weigelt, metux IT consult 76aaccc4f3 randr: unexport and document RRDeleteAllOutputProperties()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:11 +02:00
Enrico Weigelt, metux IT consult 930d3cb5ce randr: unexport and document RRPointerScreenConfigured()
Not usde by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:07 +02:00
Enrico Weigelt, metux IT consult 13d8ee893f randr: unexport and document RROutputInitErrorValue()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:04 +02:00
Enrico Weigelt, metux IT consult 3bc4221ec2 randr: unexport and document RROutputInit()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:29:01 +02:00
Enrico Weigelt, metux IT consult e39070b448 randr: unexport and document RRDeliverOutputEvent()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:56 +02:00
Enrico Weigelt, metux IT consult 55474ddf66 randr: unexport and document RROutputSetSubpixelOrder()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:53 +02:00
Enrico Weigelt, metux IT consult 2214ebdc44 randr: unexport and document RROutputDeleteUserMode()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:50 +02:00
Enrico Weigelt, metux IT consult df8db3c479 randr: unexport and document RROutputAddUserMode()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:48 +02:00
Enrico Weigelt, metux IT consult be111fce3f randr: unexport and document RRModeInitErrorValue()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:44 +02:00
Enrico Weigelt, metux IT consult eb6af16528 randr: unexport and document RRModeInit()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:41 +02:00
Enrico Weigelt, metux IT consult 60a2d2dc37 randr: unexport and document RRModesForScreen()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:36 +02:00
Enrico Weigelt, metux IT consult 6b0f2261e5 randr: unexport and document RROutputIsLeased()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:32 +02:00
Enrico Weigelt, metux IT consult c5f604617c randr: unexport and document RRCrtcIsLeased()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:30 +02:00
Enrico Weigelt, metux IT consult 6b4e452741 randr: unexport and document RRLeaseFree()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:27 +02:00
Enrico Weigelt, metux IT consult d723e78cb8 randr: unexport and document RRLeaseTerminated()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:21 +02:00
Enrico Weigelt, metux IT consult 9dde572f29 randr: unexport and document RRClientKnowsRates()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:18 +02:00
Enrico Weigelt, metux IT consult c9a1dd9281 randr: unexport and document RRHasScanoutPixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:15 +02:00
Enrico Weigelt, metux IT consult 2c71b5f260 randr: unexport and document RRReplaceScanoutPixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:12 +02:00
Enrico Weigelt, metux IT consult eb297d3443 randr: unexport and document RRCrtcDetachScanoutPixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:07 +02:00
Enrico Weigelt, metux IT consult 4b0854252b randr: unexport and document RRCrtcInitErrorValue()
Not supposed to be called by drivers, just internal to the randr extsnsion,
so shouldn't have been exported in the first place.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:28:04 +02:00
Enrico Weigelt, metux IT consult dfa0207c03 randr: unexport and document RRCrtcInit()
Not supposed to be called by any driver, just internal to the extension,
so shouldn't have been exported in the first place.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:59 +02:00
Enrico Weigelt, metux IT consult 03ea1c6ec0 randr: unexport and document RRCrtcDestroy()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:56 +02:00
Enrico Weigelt, metux IT consult f7157f140e randr: unexport and document RRCrtcGetTransform()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:53 +02:00
Enrico Weigelt, metux IT consult a90448d3be randr: unexport and document RRCrtcGetScanoutSize()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:50 +02:00
Enrico Weigelt, metux IT consult 6d3ffc2197 randr: unexport and document RRDeliverCrtcEvent()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:47 +02:00
Enrico Weigelt, metux IT consult ca6b72e362 randr: unexport and document RRCrtcSetTransformSupport()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:44 +02:00
Enrico Weigelt, metux IT consult bf0ed1306e randr: unexport and document RRCrtcExists()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:40 +02:00
Enrico Weigelt, metux IT consult f6002ca703 randr: unexport and document RRVerticalRefresh()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:38 +02:00
Enrico Weigelt, metux IT consult 6fe2807f88 randr: unexport and document RROutputSetNonDesktop()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:35 +02:00
Enrico Weigelt, metux IT consult cb80660ad1 randr: unexport and document RRFirstEnabledCrtc()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:32 +02:00
Enrico Weigelt, metux IT consult cff509582c randr: unexport and document RRInit()
Not called, and should not be called, by drivers, so no need to
keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:28 +02:00
Enrico Weigelt, metux IT consult 4a5fa21098 randr: unexport and document RRResourcesChanged()
Not used by external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:26 +02:00
Enrico Weigelt, metux IT consult 93dfd59d81 randr: unexport and document RRDeliverScreenEvent()
Not used by external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:22 +02:00
Enrico Weigelt, metux IT consult aff4f8979e randr: move remaining dispatch prototypes to rrdispatch.h
Since we now have a separate header for them, move them all over to there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:20 +02:00
Enrico Weigelt, metux IT consult 7c9ad18930 randr: unexport provider related request handlers
Those aren't used by any drivers and never should so, thus no need to
keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:17 +02:00
Enrico Weigelt, metux IT consult 5eae9431a9 randr: unexport output related request handlers
Those aren't used by any drivers and never should so, thus no need to
keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:14 +02:00
Enrico Weigelt, metux IT consult 32b3218fe6 randr: unexport mode related request handlers
Those aren't used by any drivers and never should so, thus no need to
keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:11 +02:00
Enrico Weigelt, metux IT consult 006500cfd6 randr: unexport crtc related request handlers
Those aren't used by any drivers and never should so, thus no need to
keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:09 +02:00
Enrico Weigelt, metux IT consult aa981da992 randr: unexport screen related request handlers
Those aren't used by any drivers and never should so, thus no need to
keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:05 +02:00
Enrico Weigelt, metux IT consult 5a17f15f22 randr: make RRCrtcTransformSet() static
Only used locally inside rrcrtc.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:27:02 +02:00
Enrico Weigelt, metux IT consult 2484bcf474 randr: make RRCrtcPendingTransform() static
only used locally inside rrcrtc.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:59 +02:00
Enrico Weigelt, metux IT consult 0f43098a9b randr: make RRCrtcGammaGet() static
Only used locally inside rrcrtc.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:56 +02:00
Enrico Weigelt, metux IT consult c6aa23769e randr: make RRCrtcChanged() static
Only used locally inside rrcrtc.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:53 +02:00
Enrico Weigelt, metux IT consult c7faaf16ca randr: drop obsolete RRTransformFini()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:51 +02:00
Enrico Weigelt, metux IT consult 477b3d2821 randr: drop obsolete RRPostProviderPendingProperties()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:08 +02:00
Enrico Weigelt, metux IT consult a7e9bc1803 randr: drop obsolete RRDeleteAllProviderProperties()
Not used by anybody, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:05 +02:00
Enrico Weigelt, metux IT consult ad6fb1fbd3 randr: drop obsolete RRProviderLookup()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:26:02 +02:00
Enrico Weigelt, metux IT consult 79d0a49442 randr: drop unused RRPointerMoved()
Not used anywhere, so no need to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:58 +02:00
Enrico Weigelt, metux IT consult 00435fea20 randr: drop unused dummy RRCrtcGammaNotify()
Not called by anybody and been just a dummy for quite a while,
so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:55 +02:00
Enrico Weigelt, metux IT consult 648b96e5d4 randr: drop obsolete RRGetRotation()
Not used anymore, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:52 +02:00
Enrico Weigelt, metux IT consult 233ea698e6 XI: unexport XIPropToInt() and XIPropToFloat()
Not used by any drivers, and subject to upcoming changes, so no need
to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:48 +02:00
Enrico Weigelt, metux IT consult 6b772096ac glamor: unexport GLAMOR_CREATE_PIXMAP_* defines
Not used by any external drivers, so no need to keep it in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:45 +02:00
Enrico Weigelt, metux IT consult b854c905b8 glamor: unexport glamor_copy_window()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:42 +02:00
Enrico Weigelt, metux IT consult 8102744a43 glamor: unexport glamor_change_window_attributes()
Not needed by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:39 +02:00
Enrico Weigelt, metux IT consult 903cf95b71 glamor: unexport glamor_egl_screen_init()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:36 +02:00
Enrico Weigelt, metux IT consult 800ab10249 glamor: unexport glamor_get_drawable_modifiers()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:33 +02:00
Enrico Weigelt, metux IT consult 06447646ef glamor: unexport glamor_get_modifiers()
Not used by any external driveres, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:29 +02:00
Enrico Weigelt, metux IT consult 6f6aab87ea glamor: unexport glamor_get_formats()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:26 +02:00
Enrico Weigelt, metux IT consult 81c1479ea9 glamor: unexport glamor_pixmap_from_fds()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:23 +02:00
Enrico Weigelt, metux IT consult ea232c79ff glamor: unexport glamor_fds_from_pixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:20 +02:00
Enrico Weigelt, metux IT consult 8c79078c1c glamor: unexport glamor_egl_fd_from_pixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:17 +02:00
Enrico Weigelt, metux IT consult ccfc13e133 glamor: unexport glamor_egl_fd_name_from_pixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:13 +02:00
Enrico Weigelt, metux IT consult 4a702483a0 glamor: unexport glamor_egl_fds_from_pixmap()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:10 +02:00
Enrico Weigelt, metux IT consult 1bcd8166a0 glamor: unexport glamor_enable_dri3()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:07 +02:00
Enrico Weigelt, metux IT consult fca8571a1a glamor: unexport glamor_pixmap_exchange_fbos()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:04 +02:00
Enrico Weigelt, metux IT consult d0d4ced9d3 glamor: unexport glamor_set_glvnd_vendor()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:25:01 +02:00
Enrico Weigelt, metux IT consult c62b68fdf7 glamor: unexport glamor_set_pixmap_type()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:57 +02:00
Enrico Weigelt, metux IT consult 999ed88818 glamor: unexport glamor_set_pixmap_texture()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:54 +02:00
Enrico Weigelt, metux IT consult caec5ae78b glamor: make glamor_destroy_gc() static
Only needed inside glamor_core.c, no external callers, so it can be static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:49 +02:00
Enrico Weigelt, metux IT consult eb173d9a56 glamor: drop glamor_egl_create_textured_screen()
Not used anymore, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:46 +02:00
Enrico Weigelt, metux IT consult 3c0c56c4bf glamor: drop glamor_egl_create_textured_screen_ext() macro
Not used anymore, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:43 +02:00
Enrico Weigelt, metux IT consult bef5470f02 glamor: drop glamor_get_glvnd_vendor()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:40 +02:00
Enrico Weigelt, metux IT consult 8766d2b54d ephyr: workaround for name clash between Xlib and Xserver
A slight change in include order can cause Xlib to be included and defining
"GC" type, which is conflicting with Xserver's own type by same name.

As long as MR !1393 hasn't merged yet, we need to do an ugly workaround
using some preprocessor black magic.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:36 +02:00
Enrico Weigelt, metux IT consult 90003b42b6 xfree86: drop xf86VGAarbiter.h
It doesn't serve any practical purpose anymore and also isn't included
by any external driver, thus also no need to keep it in SDK.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:32 +02:00
Enrico Weigelt, metux IT consult 4e38c99155 xfree86: unexport xf86VGAarbiterAllowDRI()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:29 +02:00
Enrico Weigelt, metux IT consult b20ef5b181 xfree86: drop obsolete xf86VGAarbiterDeviceDecodes()
Not used by anybody, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:26 +02:00
Enrico Weigelt, metux IT consult b31b4c0ae2 xwayland: protect against alloc failures and NULL pointers
Protecting against NULL pointers and allocation failures.
Printing out a bug warning in those cases.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:22 +02:00
Enrico Weigelt, metux IT consult 25f50e2cc5 panoramix: replace FOR_NSCREENS() by FOR_NSCREENS_BACKWARD(i)
FOR_NSCREENS() is just alias for FOR_NSCREENS_BACKWARD(). In many cases
it really matters that we're going backwards and the last iteration visited
the screen #0, and that one is panoramix-wrapped.

Thus directly calling FOR_NSCREENS_BACKWARD() here and dropping the alias.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:18 +02:00
Enrico Weigelt, metux IT consult ffa080cdf0 xfree86: unexport xf86RemoveInputEventDrainCallback()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:15 +02:00
Enrico Weigelt, metux IT consult 885cab379b xfree86: unexport xf86AddInputEventDrainCallback()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:12 +02:00
Enrico Weigelt, metux IT consult 78df73b627 xfree86: unexport xf86LookupInput()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:08 +02:00
Enrico Weigelt, metux IT consult d345549372 xfree86: unexport xf86LookupInputDriver()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:05 +02:00
Enrico Weigelt, metux IT consult b700c6c81d xfree86: unexport xf86InputEnableVTProbe()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:24:02 +02:00
Enrico Weigelt, metux IT consult e16424212e xfree86: unexport xf86PostButtonEventM()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:59 +02:00
Enrico Weigelt, metux IT consult 2184917646 xfree86: make xf86VIDrvMsgVerb() static
Only used inside xf86Helper.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:55 +02:00
Enrico Weigelt, metux IT consult 2cfde50bac xfree86: make xf86PostKeyEvent() static
Only used inside xf86Xinput.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:52 +02:00
Enrico Weigelt, metux IT consult ef8a427e36 xfree86: drop obsolete xf86PostKeyEventM()
It's now only a wrapper calling xf86PostKeyEvent(), and no external driver
using it anymore, so we can drop it entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:48 +02:00
Enrico Weigelt, metux IT consult dba821515b xfree86: drop unused xf86DeleteInputDriver()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:45 +02:00
Enrico Weigelt, metux IT consult f89b48962d xfree86: drop unused xf86EnableDevice()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:42 +02:00
Enrico Weigelt, metux IT consult 77d254cb8b xfree86: drop unused xf86PostKeyEventP()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:38 +02:00
Enrico Weigelt, metux IT consult b79112e1bf xfree86: drop unused xf86PostProximityEventP()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:35 +02:00
Enrico Weigelt, metux IT consult fd80169cfe xfree86: drop unused xf86PostMotionEventP()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:32 +02:00
Enrico Weigelt, metux IT consult bf27c3441f xfree86: xf86Option: unexport xf86MarkOptionUsedByName()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:28 +02:00
Enrico Weigelt, metux IT consult 3ee128c0e1 xfree86: xf86Option: unexport xf86MarkOptionUsed()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:25 +02:00
Enrico Weigelt, metux IT consult 2d12c1285f xfree86: xf86Option: unexport xf86OptionListReport()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:22 +02:00
Enrico Weigelt, metux IT consult 167cefbec4 xfree86: xf86Option: make xf86CheckIfOptionUsedByName() static
Only used inside of xf86Option.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:18 +02:00
Enrico Weigelt, metux IT consult ed6517ac54 xfree86: xf86Option: drop unused xf86CheckIfOptionUsed()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:14 +02:00
Enrico Weigelt, metux IT consult 150c8ed6ce xfree86: xf86Option: drop unused xf86ReplacePercentOption()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:11 +02:00
Enrico Weigelt, metux IT consult d2e10b1c98 xfree86: xf86Option: drop unused xf86ReplaceRealOption()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:08 +02:00
Enrico Weigelt, metux IT consult 228cdd3bfe xfree86: xf86Option: drop unused xf86GetOptValReal()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:04 +02:00
Enrico Weigelt, metux IT consult b2425861a2 xfree86: xf86Option: drop unused xf86NewOption()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:23:01 +02:00
Enrico Weigelt, metux IT consult acfb7b9e96 xfree86: xf86Option: drop unused xf86CheckRealOption()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:58 +02:00
Enrico Weigelt, metux IT consult f353a4387a xfree86: i2c: drop unused xf86I2CWriteWord()
Not used anywhere, so no need to keep around it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:54 +02:00
Enrico Weigelt, metux IT consult 0779c670b6 xfree86: i2c: drop unused xf86I2CWriteBytes()
Not used anywhere, so no need to keep around it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:51 +02:00
Enrico Weigelt, metux IT consult d9a1dfb7ba xfree86: i2c: drop unused xf86I2CReadWord()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:48 +02:00
Enrico Weigelt, metux IT consult d4515dfa9c xfree86: i2c: drop unused xf86I2CReadStatus()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:45 +02:00
Enrico Weigelt, metux IT consult 7a61143169 xfree86: vbe: drop dead code
This never seemed to be actually enabled, just ifdef'ed out, so no
need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:37 +02:00
Enrico Weigelt, metux IT consult c5660ba20b xfree86: vbe: drop unused VBEGetVBEpmi()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:34 +02:00
Enrico Weigelt, metux IT consult 9680128539 xfree86: vbe: drop unused VBEGetDisplayStart()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:30 +02:00
Enrico Weigelt, metux IT consult c25368e091 xfree86: ddc: make DMTModes[] static
Only used inside xf86EdidModes.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:27 +02:00
Enrico Weigelt, metux IT consult b60303c16e xfree86: ddc: make FindDMTMode() static
Only used inside xf86EdidModes.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:24 +02:00
Enrico Weigelt, metux IT consult 3f4579ebad xfree86: ddc: unexport gtf_supported()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:21 +02:00
Enrico Weigelt, metux IT consult c6429560c6 xfree86: ddc: drop unused xf86MonitorIsHDMI()
Not used anywhere, so no need to keep it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:17 +02:00
Enrico Weigelt, metux IT consult 791401f8d2 xfree86: ddc: unexport xf86EdidMonitorSet()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:13 +02:00
Enrico Weigelt, metux IT consult 88d42e4e4b xfree86: xisb: drop unused XisbTrace()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:22:10 +02:00
Enrico Weigelt, metux IT consult caefc315b8 xfree86: xisb: drop unused XisbWrite()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:59 +02:00
Enrico Weigelt, metux IT consult 8626bb5482 xfree86: xv: unexport XF86XvScreenKey
Not used by any drivers, and the include is private anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:55 +02:00
Enrico Weigelt, metux IT consult f13a8c1798 xfree86: xv: don't install xf86xvpriv.h
Not included by any drivers, and it's supposed to be private anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:50 +02:00
Enrico Weigelt, metux IT consult 1d5ed400e3 xfree86: xv: drop unused xf86XVFillKeyHelperPort()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:45 +02:00
Enrico Weigelt, metux IT consult 6bd82e64a0 xfree86: fbman: move FBManagerFuncs into x86fbman.c
Only used here, so no need to keep it in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:41 +02:00
Enrico Weigelt, metux IT consult 9280991e7f xfree86: fbman: make xf86InitFBManagerRegion() static
Only called locally within xf86fbman.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:36 +02:00
Enrico Weigelt, metux IT consult a3ca5fd068 xfree86: fbman: make xf86RegisterOffscreenManager()
Only called locally within xf86fbman.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:31 +02:00
Enrico Weigelt, metux IT consult b782306f40 xfree86: fbman: drop FreeBoxesUpdateCallback
Nobody fills it anymore, so not needed at all anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:26 +02:00
Enrico Weigelt, metux IT consult ef49e6aa19 xfree86: fbman: drop RegisterFreeBoxCallback proc pointer
Nobody calls it anymore, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:21 +02:00
Enrico Weigelt, metux IT consult 57cd527271 xfree86: fbman: drop unused xf86RegisterFreeBoxCallback()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:15 +02:00
Enrico Weigelt, metux IT consult e2d418a929 xfree86: fbman: drop unused xf86AllocateLinearOffscreenArea()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:09 +02:00
Enrico Weigelt, metux IT consult d7a3dd5d56 xfree86: fbman: drop unused xf86FBManagerRunning()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:05 +02:00
Enrico Weigelt, metux IT consult 590a8967ab xfree86: fbman: drop unused xf86InitFBManagerArea()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:21:00 +02:00
Enrico Weigelt, metux IT consult 14a328ca14 xfree86: loader: drop unused MODULETEARDOWNPROTO() macro
Not used anywhere, so no need to keep it in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:54 +02:00
Enrico Weigelt, metux IT consult 1b973c4e11 xfree86: loader: drop unused GET_MODULE_*_VERSION macros
Not used anywhere, so no need to keep them around in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:49 +02:00
Enrico Weigelt, metux IT consult c2090c8e04 include: os: add returns_nonnull attribute to XNFalloc/XNFcallocarray
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:41 +02:00
Enrico Weigelt, metux IT consult 984453ad4f xfree86: drop ifdefs on _NO_XF86_PROTOTYPES
Nothing ever sets this symbol, so can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:35 +02:00
Enrico Weigelt, metux IT consult 8ad3c256d7 Xi: exevents: drop unused retvals on TryClientEvents() calls
The return values aren't used anywhere, so the assignment is not necessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:28 +02:00
Enrico Weigelt, metux IT consult 38e8cc47f5 dix: drop unused SetVendorRelease()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:19 +02:00
Enrico Weigelt, metux IT consult 06dbab958c dix: unexport InitAtoms() and FreeAllAtoms()
Not used by any drivers, very DIX-internal, so should not be part
of public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:15 +02:00
Enrico Weigelt, metux IT consult 39b0c088d5 dix: replace AtomError() by better messages
Not used by any exteral drivers (and really should not be used by them),
so can be replaced by more fitting error messages.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:12 +02:00
Enrico Weigelt, metux IT consult 9d78e139a0 dix: unexport SetInputCheck() and make it inline
Not used by any drivers, so no need to keep it exported.
It's also so simple (and rarely called) that easily can be inlined.

Also unexport HWEventQueueType and HWEventQueuePtr, since they're
not used by any drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:09 +02:00
Enrico Weigelt, metux IT consult b4d1ad0eaf dix: unexport LastEventTimeToggleResetAll()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:06 +02:00
Enrico Weigelt, metux IT consult 5b848b0dcc dix: unexport LastEventTimeToggleResetFlag()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:04 +02:00
Enrico Weigelt, metux IT consult afaafb5e6c dix: unexport LastEventTimeWasReset()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:01 +02:00
Enrico Weigelt, metux IT consult 64d15c4511 dix: unexport LastEventTime()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:58 +02:00
Enrico Weigelt, metux IT consult 34001b0102 dix: unexport NoticeEventTime()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:55 +02:00
Enrico Weigelt, metux IT consult c734df44ff dix: unexport NoticeTime()
Not used by any external drivers, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:52 +02:00
Enrico Weigelt, metux IT consult 2f7ba4bf32 dix: unexport InitBlockAndWakeupHandlers()
Not supposed to be called by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:49 +02:00
Enrico Weigelt, metux IT consult f069b91c8a dix: unexport WakeupHandler()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:46 +02:00
Enrico Weigelt, metux IT consult 9f0d07a7d9 dix: unexport BlockHandler()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:43 +02:00
Enrico Weigelt, metux IT consult 6dc7eab871 dix: rename IsFloating() to InputDevIsFloating()
Give it a better fitting name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:40 +02:00
Enrico Weigelt, metux IT consult 985f4c22c6 dix: unexport and document IsFloating()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:36 +02:00
Enrico Weigelt, metux IT consult 4f2bd438cd dix: rename IsMaster to InputDevIsMaster()
Give it a better fitting name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:33 +02:00
Enrico Weigelt, metux IT consult 1b3de34f22 dix: unexport IsMaster()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:30 +02:00
Enrico Weigelt, metux IT consult 537f8c4b82 dix: unexport IsKeyboardDevice()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:27 +02:00
Enrico Weigelt, metux IT consult 57bc6cb633 dix: unexport IsPointerDevice()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:24 +02:00
Enrico Weigelt, metux IT consult 6fc8b593a4 dix: rename IsParent() to WindowIsParent()
Spending it a more fitting name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:21 +02:00
Enrico Weigelt, metux IT consult abcd627d40 dix: unexport IsParent()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:18 +02:00
Enrico Weigelt, metux IT consult 14dba35dac dix: unexport PickKeyboard()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:15 +02:00
Enrico Weigelt, metux IT consult b592dc50db dix: unexport PickPointer()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:10 +02:00
Enrico Weigelt, metux IT consult b826800613 dix: unexport OtherClientGone()
Just an internal resource destructor, not used by any external
drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:07 +02:00
Enrico Weigelt, metux IT consult 0124a7c370 dix: unexport and document ScreenRestructured()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:04 +02:00
Enrico Weigelt, metux IT consult 2b89942c7a dix: unexport and document WindowsRestructured()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:00 +02:00
Enrico Weigelt, metux IT consult 17ef760571 dix: unexport and document WindowHasNewCursor()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:57 +02:00
Enrico Weigelt, metux IT consult 95f802e3f6 dix: unexport RootWindowFinalizeCallback field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:54 +02:00
Enrico Weigelt, metux IT consult 20b82a6efb dix: unexport DeviceEventCallback field
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:50 +02:00
Enrico Weigelt, metux IT consult 1ba07d8065 dix: unexport DeliverRawEvent()
Not used by any external drivers, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:46 +02:00
Enrico Weigelt, metux IT consult 472e686496 dix: unexport DeliverEventsToWindow()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:43 +02:00
Enrico Weigelt, metux IT consult 5d6d3b56ad dix: unexport DeliverEvents() and fix return type
* not needed by any drivers, so no need to keep it exported
* correct return type is `enum EventDeliveryState`

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:40 +02:00
Enrico Weigelt, metux IT consult a20e0304fe dix: unexport TryClientEvents()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:37 +02:00
Enrico Weigelt, metux IT consult 1dd10193a9 dix: unexport, document and rename GetSpriteWindow()
Not used by any drivers, so no need to keep it exported.
Also spending it for a better fitter name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:32 +02:00
Enrico Weigelt, metux IT consult 32a0109615 dix: unexport, document and rename GetCurrentRootWindow()
Not used by any drivers, so no need to keep it exported.
Also spending it for a better fitter name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:23 +02:00
Enrico Weigelt, metux IT consult 9e93d51e41 dix: unexport and document AlterSaveSetForClient()
Not used by any external drivers, so no need to keep it exported.
Also using XRetCode and marking paremters where NULL isn't allowed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:17 +02:00
Enrico Weigelt, metux IT consult 4b45c749e4 dix: drop unused parameter from ConfineToShape()
The device parameter is never used, so no point in passing it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:15 +02:00
Enrico Weigelt, metux IT consult 2da45bd9ca dix: unexport and document ConfineToShape()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:09 +02:00
Enrico Weigelt, metux IT consult a58fd6f511 (!2007) dix: unexport SendGraphicsExpose() and fix parameter types
* not used by any drivers, so no need to keep it exported
* fix parameter types to matching the protocol types

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:08 +02:00
Enrico Weigelt, metux IT consult a94e906084 dix: unexport SendErrorToClient() and fix parameter types
* not used by any drivers, so no need to keep it exported
* fix parameter types to matching the protocol types

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:05 +02:00
Enrico Weigelt, metux IT consult 689de526a4 dix: unexport and document ClientIsAsleep()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:01 +02:00
Enrico Weigelt, metux IT consult 2e0cde7b56 dix: unexport and document ClientWakeup()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:58 +02:00
Enrico Weigelt, metux IT consult 646c76adea dix: unexport and document ClientSignalAll()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:52 +02:00
Enrico Weigelt, metux IT consult b528301f97 dix: unexport and document ClientSignal()
Not used by any external drivers, so no need to keep it exported.

Also renamed to dixClientSignal(), since there's a conflicting prototype
in fontsproto.h.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:49 +02:00
Enrico Weigelt, metux IT consult 8104fc115d dix: unexport and document ClientSleep()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:45 +02:00
Enrico Weigelt, metux IT consult 49107319f7 dix: unexport and document MarkClientException()
Not supposed to be used by external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:42 +02:00
Enrico Weigelt, metux IT consult 5ae5fa9671 dix: unexport and document NextAvailableClient()
Only called from OS layer, thus should not be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:39 +02:00
Enrico Weigelt, metux IT consult e9351ba7e0 include: drop obsolete dixevents.h
The include has become empty now. Not used by any external drivers,
so it can be dropped now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:35 +02:00
Enrico Weigelt, metux IT consult fe951f7dd4 dix: unexport and document EventSuppressForWindow()
Not used by any external drivers, and not supposed to be used by them,
so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:32 +02:00
Enrico Weigelt, metux IT consult b15cde3a1c dix: unexport and document EventSelectForWindow()
Not used by any external drivers, and not supposed to be used by them,
so no need to keep it in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:29 +02:00
Enrico Weigelt, metux IT consult 8a49bfaa5b dix: XineramaTryClientEventsResult() change return type to Bool
Callers are only interested in whether event was actually sent
(retval==1) or not, so Bool is sufficient and easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:26 +02:00
Enrico Weigelt, metux IT consult 09f46c97b6 dix: MaybeDeliverEventToClient(): change return type to Bool
Callers are only interesed in whether event was actually sent
(retval==1) or not, so Bool is suffient and easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:22 +02:00
Enrico Weigelt, metux IT consult d74f591ce4 dix: MaybeDeliverEventToClient() drop count parameter
It's always called with just a single event, so no need for the count
parameter. Also renaming it in order to better fit it's new semantics.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:18 +02:00
Enrico Weigelt, metux IT consult 0b6715c6dc dix: unexport and document MaybeDeliverEventsToClient()
Not used by any external drivers, and only supposed to be DIX internal,
so shouldn't be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:14 +02:00
Enrico Weigelt, metux IT consult 3fd183f637 dix: unexport, rename and document GetSpriteCursor()
* not used by any external drivers, so no need to keep it exported
* choose better fitting name: InputDevGetSpriteCursor()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:16:59 +02:00
Enrico Weigelt, metux IT consult 0f522fa893 dix: unexport and document SetCriticalEvent()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:16:50 +02:00
Enrico Weigelt, metux IT consult 9f0fa773b9 dix: unexport events related request handlers
Request handlers aren't supposed to be called by external drivers directly,
so no need to keep them in the public SDK API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:16:45 +02:00
Enrico Weigelt, metux IT consult 4cbe7e550c sdk: add generic X return code
This type is should be used instead of plain int for all functions
returning and X error code (that's possibly sent to the client),
in order to make return value semantics clear to the humen reader.
(for the compiler, it still will be just an int)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:16:42 +02:00
Enrico Weigelt, metux IT consult 802a581f51 sdk: add _X_ATTRIBUTE_NONNULL_ARGS() macro
Adding a macro for specifying nonnull attributes, for easier future
transition to new C23 attributes or supporting strange compilers that
don't understand this attribute.

The purpose of using those attributes is aiding compiler warnings and
potential optimizations.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:16:37 +02:00
Alan Coopersmith 0d2213ec44 Xephyr.man: Use \- to get ASCII hyphens instead of Unicode dashes
Used in command-line arguments and email addresses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2009>
2025-05-31 15:15:13 -07:00
Alan Coopersmith ff4f2f718b man pages: don't use .BI macro with a single argument
Clears warnings from groff -rCHECKSTYLE=10:

an.tmac: Xephyr.man:53: style: .BI expects at least 2 arguments, got 1
an.tmac: Xephyr.man:55: style: .BI expects at least 2 arguments, got 1
an.tmac: Xwayland.man:151: style: .BI expects at least 2 arguments, got 1
an.tmac: Xwayland.man:166: style: .BI expects at least 2 arguments, got 1

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2009>
2025-05-31 15:10:35 -07:00
Alan Coopersmith 286578e83e XWin.man: fix typos in font change escapes
Fixes warnings from `mandoc -T lint`:

mandoc: XWin.man:332:28: WARNING: invalid escape sequence: \fp
mandoc: XWin.man:397:1: WARNING: invalid escape sequence: \fX

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2009>
2025-05-31 15:06:23 -07:00
Alan Coopersmith bd08e04fcb man pages: remove extraneous PP macros
Clears warnings from `mandoc -T lint` of the forms:
mandoc: Xorg.man:26:2: WARNING: skipping paragraph macro: PP after SH
mandoc: Xorg.man:40:2: WARNING: skipping paragraph macro: PP empty

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2009>
2025-05-31 15:01:49 -07:00
Alan Coopersmith 6dfe3e7db6 man pages: strip trailing whitespace
Gets rid of many warnings from `mandoc -T lint` of the form:
mandoc: ./man/Xserver.man:621:7: STYLE: whitespace at end of input line

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2009>
2025-05-31 14:51:24 -07:00
Alan Coopersmith 7aa1f121e4 mi: use common implementation of bit counting function
Reduce a bit of unexplained magic, and use ISA extensions where available

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1984>
2025-05-20 00:34:23 +00:00
Enrico Weigelt, metux IT consult 73f3c47608 randr: fix unconditional byte-swap in ProcRRGetProviderInfo()
The list of the associated provider's capabilities was always swapped
unconditionally, while it should only be in case of client having
opposite endianess.

Fixes: 426bc0a28e
Reported-By: dasha_uwu
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1977>
2025-05-18 23:42:19 +00:00
Enrico Weigelt, metux IT consult f0fd9f8bf4 dix: fix warning on redefinition of typedefs
| ../dix/input_priv.h:56:29: warning: redefinition of typedef 'InputOption' is a C11 feature [-Wtypedef-redefinition]
|    56 | typedef struct _InputOption InputOption;
|       |                             ^
| ../include/input.h:255:29: note: previous definition is here
|   255 | typedef struct _InputOption InputOption;
|       |                             ^
| In file included from ../hw/xfree86/common/xf86Cursor.c:36:
| ../dix/input_priv.h:57:25: warning: redefinition of typedef 'XI2Mask' is a C11 feature [-Wtypedef-redefinition]
|    57 | typedef struct _XI2Mask XI2Mask;
|       |                         ^
| ../include/input.h:256:25: note: previous definition is here
|   256 | typedef struct _XI2Mask XI2Mask;
|       |                         ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1978>
2025-05-18 17:35:31 +00:00
Olivier Fourdan b97b459c06 xwayland: Update sprite prior to clearing the focus window
Xwayland has its own XYToWindow() handler to account for the case when
the pointer leaves an X11 surface to enter another Wayland native window
(which of course are unknown to Xwayland).

When that occurs, Xwayland will treat it as if the pointer had entered
the root window so that the X11 clients receive an appropriate leave
event.

When the pointer leaves the X11 surface, Xwayland will call
CheckMotion() to update the sprite coordinates and possibly the cursor.

However, CheckMotion() will call back into the XYToWindow() handler,
which will then pretend the window has entered the root window, and that
may cause the wrong cursor to be applied.

To avoid the issue, change the order we do things, by calling
CheckMotion() first prior to clear up the internal focus window so that
the first call to XYToWindow() will return the correct X11 window so we
get to update the cursor correctly.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1811
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1915>
2025-05-16 10:02:53 +00:00
Alan Coopersmith 37b7ea8f8a render: miindex.c does not need header guard macros
Clears warning from clang 19.1.7:

render/miindex.c:27:9: warning: macro is not used [-Wunused-macros]
   27 | #define _MIINDEX_H_
      |         ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:16 +00:00
Alan Coopersmith f988558348 os: remove unused definition of BUGADDRESS
We stopped including this in error messages back in 2008

Clears warning from clang 19.1.7:

os/utils.c:1338:9: warning: macro is not used [-Wunused-macros]
 1338 | #define BUGADDRESS BUILDERADDR
      |         ^

Fixes: ef77e4c44 ("Remove useless commentary from environment and argument processing.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:16 +00:00
Alan Coopersmith d1cc5a599f test: remove extra return
Clears warning from clang 19.1.7:

test/misc.c:239:12: warning: 'return' will never be executed
 [-Wunreachable-code-return]
  239 |     return 0;

Fixes: 46b579e8d ("test: switch the unit tests to something resembling a test suite")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Alan Coopersmith 14e202d6a0 xfixes: cursor.c should include header for CursorVisible & EnableCursor
Clears warnings from clang 19.1.7:

xfixes/cursor.c:132:6: warning: no previous extern declaration for
 non-static variable 'CursorVisible' [-Wmissing-variable-declarations]
  132 | Bool CursorVisible = FALSE;
      |      ^
xfixes/cursor.c:133:6: warning: no previous extern declaration for
 non-static variable 'EnableCursor' [-Wmissing-variable-declarations]
  133 | Bool EnableCursor = TRUE;
      |      ^

Fixes: 2cec3cfbf ("include: move private definitions out of input.h")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Alan Coopersmith b490578242 os: connection.c should include header that defines GrabInProgress
Clears warning from clang 19.1.7:

os/connection.c:133:5: warning: no previous extern declaration for
 non-static variable 'GrabInProgress' [-Wmissing-variable-declarations]
  133 | int GrabInProgress = 0;
      |     ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Alan Coopersmith 0fefdc6e29 dix: tables.c should include header that defines InitialVector
Clears warning from clang 19.1.7:

dix/tables.c:59:7: warning: no previous extern declaration for non-static
 variable 'InitialVector' [-Wmissing-variable-declarations]
   59 | int (*InitialVector[3]) (ClientPtr /* client */) = {
      |       ^

Fixes: bae6cbc8c ("include: move private defs to dixstruct_priv.h")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Alan Coopersmith 062c339519 modesetting: fix typo in XF86ModuleVersionInfo initialization
Found by clang 19.1.7:

hw/xfree86/drivers/modesetting/driver.c:163:21:
 warning: initializer overrides prior initialization of this subobject
 [-Winitializer-overrides]
  163 |     ._modinfo1_   = MODINFOSTRING2,
      |                     ^~~~~~~~~~~~~~
hw/xfree86/drivers/modesetting/driver.c:162:21:
 note: previous initialization is here
  162 |     ._modinfo1_   = MODINFOSTRING1,
      |                     ^~~~~~~~~~~~~~

Fixes: 2a10eff6c ("xfree86: modsetting: use explicit field initializers for XF86ModuleData")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Alan Coopersmith 3eaa19d74b test: remove stray semi-colons after functions
Clears warnings from clang 19.1.7:

test/list.c:95:2: warning: extra ';' outside of a function [-Wextra-semi]
   95 | };
      |  ^

test/list.c:137:2: warning: extra ';' outside of a function [-Wextra-semi]
  137 | };
      |  ^

Fixes: 92788e677 ("test: add some tests for basic list manipulation.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Alan Coopersmith f9d25189fa xfree86: make modeline2c.awk put a newline at the end of xf86DefModeSet.c
Clears warning from clang 19.1.7:
hw/xfree86/common/xf86DefModeSet.c:288:62:
 warning: no newline at end of file [-Wnewline-eof]
  288 | const int xf86NumDefaultModes = ARRAY_SIZE(xf86DefaultModes);
      |                                                              ^

Fixes: 3bf7ff703 ("Size xf86DefaultModes explicitly.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1910>
2025-04-19 17:02:15 +00:00
Peter Harris dfbc672e85 Update mailmap for Peter Harris
My division was acquired by Rocket Software. The opentext.com email
address is no longer active.

Ref: https://investors.opentext.com/press-releases/press-releases-details/2024/OpenText-Completes-Divestiture-of-Application-Modernization-and-Connectivity-AMC-Business-to-Rocket-Software-for-2.275B/default.aspx
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1914>
2025-04-15 13:49:13 -04:00
Alan Coopersmith 845c4ae518 Xserver.man: correct list of available authorization protocols
XDM-AUTHORIZATION-2 (IPv6 capable version of -1) was never merged.
SUN-DES-1 was removed by commit 71b207a2e in 2024
MIT-KERBEROS-5 was removed by commit dfbe32b5b in 2007

Fixes: 71b207a2e ("os: drop SUN-DES-1 authentication")
Fixes: dfbe32b5b ("Remove the old Kerberos 5 authentication code.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1913>
2025-04-14 18:47:05 -07:00
Alan Coopersmith 80ad8a2c6d Xserver.man: add Xwayland(1) to list of server-specific man pages
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1913>
2025-04-14 15:56:34 -07:00
Alan Coopersmith b9c31cc9bc Xserver.man: allow line breaks in default font path
Allows nroff to insert a line break between iterm in the font path
instead of displaying it as a single, very overlength line.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1891>
2025-04-12 17:18:37 +00:00
Peter Hutterer cab9017485 dix: pick the right keyboard for focus FollowKeyboard
This fixes a crash when we try to send focus events and dereference
FollowKeyboardWin (0x3) as WindowPtr.

A device set to XSetDeviceFocus(FollowKeyboard) is supposed to follow
the focus of the corresponding master device. During ActivateKeyboard
a slave device is detached from the master for the duration for the grab
so we don't actually have a master to follow - leaving our oldWin set to
the FollowKeyboardWin constant. This later crashes when we try to
dereference it.

Fix this by getting the current master (if any), or the saved master (if
temporarily detached due to a grab). And if failing that, use the VCK
as fallback device - that is technically wrong but it's such a niche use
case that it shouldn't matter.

Reproducer:
     window = XCreateSimpleWindow(...)
     deviceid = any device that is IsXExtensionKeyboard device
     XSetDeviceFocus(deviceid, FollowKeyboard, ...)
     XGrabDevice(deviceid, window, ...)

Fixes: f01ee198ff ("dix: don't use inputInfo.keyboard to get the focus window in ActivateKbdGrab")

Found-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1870>
2025-04-07 15:45:50 +00:00
Enrico Weigelt, metux IT consult c445167da6 xwayland: no need to use WriteReplyToClient()
The WriteReplyToClient() macro is used for cases where byte swapping
is implemented in a separate callback function (set in a global vector
table). Since Xwl extension doesn't have such a callback, but does the
byte swapping directly in it's request handlers, there's no need to
call the WriteReplyToClient() macro - we can use WriteToClient() instead.

Fixes: 2700bc6045 - xwayland: add support for the XWAYLAND extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1878>
2025-04-07 07:47:30 +00:00
Enrico Weigelt, metux IT consult 32b3328e49 kdrive: Xkdrive.man: remove stray whitespace
Tiny editorial correction: drop a stray whitespace in manpage
that sneaked in at recent editorial changes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1876>
2025-04-02 00:54:31 +00:00
Enrico Weigelt, metux IT consult 52c2cb7439 ci: fix missing runner tag on FreeBSD jobs after gitlab migration
All jobs utilizing kvm (eg. FreeBSD) need the "kvm" runner tag set.
It used to work w/o it, since all runners did have kvm, but in the
new CI there are non-kvm runners, so we really need to set the tag.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1872>
2025-04-01 18:02:55 +00:00
Alan Coopersmith 5ac0a19e7f man pages: use .BR to mark up man page references
The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 13:36:54 -07:00
Alan Coopersmith b4b6b19c9a Xserver.man: remove X FireWall Proxy (xfwp) info
xfwp has not been maintained in many years, with ssh X11-Forwarding
preferred instead.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 13:27:33 -07:00
Bjarni Ingi Gislason bcf743f356 inputtestdrv.4: editorial changes for this man page
Use the correct macro for the font change of a single argument or
split the argument into two.

43:.BI Keyboard
46:.BI Pointer
52:.BI PointerAbsolute
58:.BI PointerAbsoluteProximity
62:.BI Touch
103:.BI xf86ITEventWaitForSync

-.-.

Wrong distance between sentences in the input file.

Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

19:server as input events. It supports the full set of the xf86 driver APIs
20:exposed by Xorg. The primary use cases of this input driver are various
29:is created after the driver is initialized. The paths to the socket is passed
37:Sets the path where the driver will create a named socket. Any existing file
47:Initializes a relative-mode pointer device. It will have four valuators -
53:Initializes an absolute-mode pointer device. It will have four valuators -
87:specifies the protocol version supported by it. If this version is lower than
91:to the driver. Each event is an instance of one of the
93:structs. The length field defines the full length of the struct in bytes and
96:The responses from the server follow the same structure. Each response is an
99:structs. The length field defines the full length of the struct in bytes and
104:event. After sending such event, the client must read of a
106:events. The completion of the read operation indicates that Xorg has fully

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

24:Please refer to xorg.conf(5) for general configuration
112:Xorg(1), xorg.conf(5), Xserver(1), X(7)

-.-

Additionally:

"read of a xf86... event" -> "read an xf86... event"

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095449

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 12:35:46 -07:00
Bjarni Ingi Gislason 49378eb510 exa.man: editorial changes for this man page
Wrong distance between sentences in the input file.

Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

Mark a final abbreviation point as such by suffixing it with "\&".

25:Disables acceleration of uploading pixmap data to the framebuffer. Default: No.

-.-.

Split a punctuation mark from a single argument for a two-font macro

40:.BR xorg.conf(5).

-.-.

Section headings (.SH and .SS) do not need quoting.

38:.SH "SEE ALSO"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

an.tmac:<stdin>:40: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095446

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 12:25:00 -07:00
Bjarni Ingi Gislason 359d12aa0b Xserver.man: some remarks and editorial changes for this man page
Output from "mandoc -T lint Xserver.1": (possibly shortened list)

mandoc: Xserver.1:117:4: WARNING: undefined escape, printing literally: \+
mandoc: Xserver.1:118:81: STYLE: input text line longer than 80 bytes: Allow connections fr...
mandoc: Xserver.1:122:84: STYLE: input text line longer than 80 bytes: Prohibit connections...

Add a comma (or \&) after "e.g." and "i.e.", or use English words
(man-pages(7)).

81:sets pointer acceleration (i.e. the ratio of how much is reported to how much
273:sets pointer acceleration threshold in pixels (i.e. after how many pixels
468:contain either an Internet hostname (e.g. expo.lcs.mit.edu)

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.

Xserver.1: line 118 length 81
Allow connections from clients with an endianess different to that of the server.

Xserver.1: line 122 length 84
Prohibit connections from clients with an endianess different to that of the server.

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072500

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 12:07:51 -07:00
Bjarni Ingi Gislason 056b447a33 Xserver.man: some editorial fixes for the manual
Wrong distance between sentences.

Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

Split lines longer than 100 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.

"[" and "]", showing optional arguments to options, should be typeset in roman.

Output from "test-groff -b -mandoc -dAD=l -rF0 -rHY=0 -t -w w -z -rSTYLECHECK=3":
an.tmac:<stdin>:104: style: .BI expects at least 2 arguments, got 1
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':524: macro 'B'
troff: backtrace: file '<stdin>':167
troff:<stdin>:167: warning: cannot select font 'F'

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1041094

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 11:55:55 -07:00
Bjarni Ingi Gislason f544e0df2c Xserver.man: Fix some textual and formatting issues
Protect . if not end of sentence

Protect an aphostrophe (', 0x27), if it can become a control character

Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of a name
for an option.

Adjust space between sentences or protect the indicator.

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869252

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 11:29:19 -07:00
Bjarni Ingi Gislason d7b7789cac Xserver.man: some minor markup changes
Dash for a range is \(en

Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of a name
for an option.

Add extra word space

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726063

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 11:16:49 -07:00
Bjarni Ingi Gislason c7b6424eed xorg.conf.5: Some formatting and word corrections in the manual
see man-pages(7) for a style manual.

Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919143

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 10:19:09 -07:00
Tanguy Ortolo e4d2de8198 xorg.conf.man: Complete the xorg.conf.5 manpage with Option "Disable"
The xorg.conf.5 manpage mentions an "Enable" option to enable a monitor
regardless of whether or not it is connected, but gives no indication of how
to disable it. This patch corrects that by documenting the "Disable" option.

Orignally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755809

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 10:03:36 -07:00
Bjarni Ingi Gislason 1f8e32ea65 xorg.conf.man: unprotected period in ellipses
Originally from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667983

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1875>
2025-03-29 09:51:17 -07:00
Peter Hutterer 4966fbb55a meson.build: print a summary of the DDX to build
Makes it easier to detect accidentally "oops, i'm not building Xwayland"

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1869>
2025-03-24 03:05:35 +00:00
Peter Hutterer 2bca68f41b dix: fix erroneous BUG_RETURN check
Check was inverted, we want to complain if evcount exceeds our target
array.

Fixes: 219c54b8a3 ("dix: fix DeviceStateNotify event calculation")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1868>
2025-03-21 11:42:41 +10:00
Alan Coopersmith 4b5d410591 dix-config.h: define HAVE_STRUCT_SOCKADDR_STORAGE for xtrans 1.6
xtrans 1.6 will use struct sockaddr_storage if HAVE_STRUCT_SOCKADDR_STORAGE
is defined, even if IPv6 is disabled, unlike previous versions which tied
it to the IPv6 #define.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1864>
2025-03-14 22:38:36 +00:00
Alan Coopersmith b73cd6066a pkgconfig files: Add URL
https://github.com/pkgconf/pkgconf/blob/master/man/pc.5 says it's
a mandatory field in *.pc files.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1863>
2025-03-09 07:32:28 +00:00
Peter Hutterer 797f63b8be Xi: disallow grabbing disabled devices
Grabbing a disabled (pointer) device will lead to a segfault later
in the myriad of places where we look at the device's spriteInfo - which
will be NULL.

As a workaround, disallow grabbing a disabled device by pretending it's
already grabbed. Since the point of a grab is to receive all events by
that device and disabled devices cannot send events, this should be Good
Enough.

Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1856>
2025-03-06 14:19:50 +01:00
Povilas Kanapickas 68054d0fe3 ci: Reuse xserver created by meson-dist job in driver build jobs
Currently each driver build job also builds the server. This is bad use
of resources because server build takes way more resources compared to a
driver build. Reusing already built xserver would resolve the issue.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1806>
2025-03-03 14:10:17 +00:00
Povilas Kanapickas 8e5a5cf2c1 ci: Add install prefix to the artifacts of meson-dist job
This will allow to reuse built xserver on subsequent driver build jobs

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1806>
2025-03-03 14:10:17 +00:00
Povilas Kanapickas f7d2e810ba ci: Adjust prefix instead of setting DESTDIR for meson-dist job
This ensures that the pkg-config files installed to
xserver-tarball/install will have correct paths. This is needed so that
xf86-driver-build-test will be able to reuse this installation of
xserver. It will be passed to that job via artifacts (subsequent
commits)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1806>
2025-03-03 14:10:17 +00:00
Povilas Kanapickas 8d1fa6acde ci: Point to last commit of xf86-video-qxl instead of master branch
This ensures that the tests don't start failing silently after new
commits are added to the QXL driver.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1806>
2025-03-03 14:10:17 +00:00
Enrico Weigelt, metux IT consult af86c5cbc2 Xnest: use authorative declarations from X11/XKBlib.h
Better use the headers from the library we're linking against,
instead of having our own private declarations.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1842>
2025-02-28 17:27:05 +00:00
Enrico Weigelt, metux IT consult cab3856903 xfree86: os-support: fix FTBS when no recent enough libdrm found
On Linux, the only supported platform bus backend (*1) is via DRM/DRI.
Trying to build it w/o (recent enough) libdrm fails as it tries to
compile the drm-based implementation, w/o having drm.h available. (*2)

In order to fix this, we need to compile noop-implementation instead.

*1) platform specific code for detecting video devices
*2) https://gitlab.freedesktop.org/xorg/xserver/-/issues/1771

Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1771
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1848>
2025-02-28 16:15:32 +00:00
Enrico Weigelt, metux IT consult e2ac461629 xfree86: platform_noop: add missing functions
In order to be able to build on Linux w/ platform_noop
(when no recent enough libdrm found), a few more dummy functions
are needed here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1848>
2025-02-28 16:15:32 +00:00
Enrico Weigelt, metux IT consult fe9c911e22 xfree86: xf86helper: fix NULL dereference
xf86MatchDevice() can segfault if screensecptr->device is NULL.

Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1767
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1847>
2025-02-28 16:41:09 +01:00
Enrico Weigelt, metux IT consult 628e94b164 os: let vpnprintf() accept %X
Several pieces of the code, as well as drivers are using %X, which
we don't support, so leading to error messages like this:

[2025-02-27 14:28:44] BUG: 'if (f[f_idx])'
[2025-02-27 14:28:44] BUG: ../xserver/os/log.c:538 in vpnprintf()
[2025-02-27 14:28:44] Unsupported printf directive 'X'
[2025-02-27 14:28:44]
[2025-02-27 14:28:44] Backtrace:
[2025-02-27 14:28:44] unw_get_proc_name failed: no unwind info found [-10]
[2025-02-27 14:28:44] 0: /usr/lib/Xorg (?+0x0) [0x5f4d1261bc47]
[2025-02-27 14:28:44] 1: /usr/lib/Xorg (LogVHdrMessageVerb+0x10f) [0x5f4d1261ca3f]
[2025-02-27 14:28:44] 2: /usr/lib/Xorg (LogHdrMessageVerb+0x85) [0x5f4d1261cae5]
[2025-02-27 14:28:44] 3: /usr/lib/Xorg (xf86VDrvMsgVerb+0x54) [0x5f4d12636604]
[2025-02-27 14:28:44] 4: /usr/lib/Xorg (xf86DrvMsg+0x97) [0x5f4d126367d7]
[2025-02-27 14:28:44] 5: /usr/lib/Xorg (xf86PrintEDID+0x545) [0x5f4d12654315]
[2025-02-27 14:28:44] 6: /usr/lib/Xorg (xf86OutputSetEDID+0x1bd) [0x5f4d12657e0d]

In the longer run, we'll have to decide whether we actually want to
implement the upper-case directive or change all callers to lower-case.

But for now it's better to just accept %X and interpret it as lower-case,
in order to fix those error messages. Whether it's printed as upper or
lower case is more or less an aesthetic matter.

Reported-By: guido iodice <guido.iodice@gmail.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1846>
2025-02-28 12:51:44 +01:00
Enrico Weigelt, metux IT consult 53876f1ef1 randr: fix RRGetCrtcTransform reply length, part 2
Mixed up reply vs request. Obviously, the size substracted from reply
struct's one has to be the one of the generic reply, not generic requst :o

Background: the meaning of the length field isn't entirely intuitive.

a) the size is in 4-byte units, instead of bytes (therefore passing through
   bytes_to_int32() call)
b) it's not the total packet size, but only the *extra* payload size, ergo:
   how much is the packet longer than a xGenericReply = 8 units = 32 bytes.
   (min. packet size is 32 bytes -> length = 0)

In order to prevent those kind of coding errors ever happening again, it might
be a good idea putting that into a generic macro.

Fixes: c6f1b8a735
Fixes: 0ca5aaba50
Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1797
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1845>
2025-02-27 12:18:20 +00:00
Enrico Weigelt, metux IT consult fe156104cf Revert "mi: drop obsolete miInitOverlay()"
This reverts commit 12ab2e314b.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult 41a75f01cc Revert "mi: drop obsolete miOverlayGetPrivateClips()"
This reverts commit 2c21824ee9.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult ab95b569e1 Revert "mi: drop obsolete miOverlayCollectUnderlayRegions()"
This reverts commit a860ce2c9f.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult 4cdc184c13 Revert "mi: drop obsolete miOverlayComputeCompositeClip()"
This reverts commit bfb69b7316.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult 9d88cc5f11 Revert "mi: drop obsolete miOverlayCopyUnderlay()"
This reverts commit be6985948d.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult d4f92a5688 Revert "mi: drop obsolete miOverlaySetRootClip()"
This reverts commit 00796cbf8c.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult 0463d7aaaa Revert "mi: drop now obsolete mioverlay.c"
This reverts commit 65b738ed60.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult f1d87a38ae Revert "mi: drop now obsolete mioverlay.h"
This reverts commit 6825f89cd2.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
2025-02-27 11:53:54 +00:00
Enrico Weigelt, metux IT consult 0ca5aaba50 randr: fix RRGetCrtcTransform reply length
Reply length field missed to add the payload's size.

Fixes: c6f1b8a735
Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1797
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1844>
2025-02-26 19:05:41 +01:00
Enrico Weigelt, metux IT consult a0c1eeea98 xkb: simplify loops in XkbRF_Free()
Make the code a bit easier to read by simplifying the loops.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult abfbc76824 xkb: drop obsolete parameter from XkbRF_Free()
The freeRules parameter is always set to TRUE, meaning always free the
XkbRF_RulesRec struct. Therefore also no need to clear out fields that
aren't going to be reused again, ever.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult a88b17565b xkb: maprules: use static struct init instead of memset()
Allow the compiler to figure out the most efficient way to do the
struct initialization, and a little improvement on code readability.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult ffd7ca8af2 xkb: maprules: put some loop counters into local scope
Prevent from being accidentially removed and making the code a
little bit easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 60d37d0158 xkb: make XkbRF_Create() static inline
The function is nothing more than a calloc() call, so we can spare
an actual function call here by making it static inline.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult a82fa00835 xkb: unexport XkbRF_RuleRec struct
Not used outside xkb, so no need to keep it in public API header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 83c8a90a61 xkb: unexport XkbRF_GroupRec struct
Not used outside xkb, so no need to keep it in public API header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 043dc8041c xkb: unexport XkbRF_RulesRec struct
Not used by any drivers, so no need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 34372cb3da xkb: unexport XkbRF_Free()
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 89475cbed4 xkb: unexport XkbRF_Create()
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult c376cd2c3d xkb: unexport XkbRF_LoadRules()
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult d3b328ba4a xkb: unexport XkbRF_GetComponents()
Only used inside xkb/* - not used by any modules, so no need
to keep maintaining it in public headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult b535fd7a4c xkb: move XkbRF_* defines into xkb/maprules.c
Only used there so no need to keep them in public API header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 1a9592ea4b xkb: move _XKB_RF_NAMES_PROP_ATOM define into xkbInit.c
It's only used there, nowhere else, so no need to keep it in
a public API header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 5030f23f94 xkb: drop unused XkbRF_Invalid define from xkbrules.h
Not used anywhere, so no need to keep it in public interface.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 975aed300e xkb: drop unused _XKB_RF_NAMES_PROP_MAXLEN define
Not used anywhere, so no need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult e38eeb4718 xkb: drop unused XkbRF_LoadRulesByName()
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1840>
2025-02-26 13:43:52 +00:00
Enrico Weigelt, metux IT consult 00843efafb Xext: drop disable flag for GE extension
There's really no practical use for disabling GEEext, would just
cause the Xserver misbehaviour (eg. missing byte swapping)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1812>
2025-02-26 13:34:19 +00:00
Enrico Weigelt, metux IT consult a7401945c4 dix: add prefix to grab state value defines
make it a bit easier to diffenciate from other symbols by
adding a prefix to their names.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1837>
2025-02-26 13:24:41 +00:00
Enrico Weigelt, metux IT consult 5f6cb45ac3 dix: unexport defines for device grab states
These aren't used anywhere in modules or outside DIX & XI, so
no need to keep them in public API any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1837>
2025-02-26 13:24:41 +00:00
Alan Coopersmith 42a1f25faf xkb: Add tbGetBufferString helper function
Handles common case of allocating & copying string to temporary buffer

(cherry picked from xorg/lib/libxkbfile@8a91517ca6ea77633476595b0eb5b213357c60e5)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1821>
2025-02-26 13:15:34 +00:00
Martin Burggraf 7a23010232 xkb: correcting mathematical nonsense in XkbGeomFPText
Fixes formatting of negative numbers, so they don't show minus sign
after the decimal point.

(cherry picked from xorg/lib/libxkbfile@d2ec504fec2550f4fd046e801b34317ef4a4bab9)

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1821>
2025-02-26 13:15:34 +00:00
Alan Coopersmith 60419d8e4a xkb: Convert more sprintf calls to snprintf in xkbtext.c
Based on xorg/lib/libxkbfile@390acfe5bb88cdab509b5eaae4041f265e969d2b

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1821>
2025-02-26 13:15:34 +00:00
José Expósito 6d33834186 xkb: Check that needed is > 0 in XkbResizeKeyActions
Passing a negative value in `needed` to the `XkbResizeKeyActions()`
function can create a `newActs` array of an unespected size.
Check the value and return if it is invalid.

This error has been found by a static analysis tool. This is the report:

    Error: OVERRUN (CWE-119):
    libX11-1.8.7/src/xkb/XKBMAlloc.c:811: cond_const:
      Checking "xkb->server->size_acts == 0" implies that
      "xkb->server->size_acts" is 0 on the true branch.
    libX11-1.8.7/src/xkb/XKBMAlloc.c:811: buffer_alloc:
      "calloc" allocates 8 bytes dictated by parameters
      "(size_t)((xkb->server->size_acts == 0) ? 1 : xkb->server->size_acts)"
      and "8UL".
    libX11-1.8.7/src/xkb/XKBMAlloc.c:811: var_assign:
      Assigning: "newActs" = "calloc((size_t)((xkb->server->size_acts == 0) ? 1 : xkb->server->size_acts), 8UL)".
    libX11-1.8.7/src/xkb/XKBMAlloc.c:815: assignment:
      Assigning: "nActs" = "1".
    libX11-1.8.7/src/xkb/XKBMAlloc.c:829: cond_at_least:
      Checking "nCopy > 0" implies that "nCopy" is at least 1 on the
      true branch.
    libX11-1.8.7/src/xkb/XKBMAlloc.c:830: overrun-buffer-arg:
      Overrunning buffer pointed to by "&newActs[nActs]" of 8 bytes by
      passing it to a function which accesses it at byte offset 15
      using argument "nCopy * 8UL" (which evaluates to 8).
    #  828|
    #  829|           if (nCopy > 0)
    #  830|->             memcpy(&newActs[nActs], XkbKeyActionsPtr(xkb, i),
    #  831|                      nCopy * sizeof(XkbAction));
    #  832|           if (nCopy < nKeyActs)

(cherry picked from xorg/lib/libx11@af1312d2873d2ce49b18708a5029895aed477392)

Signed-off-by: José Expósito <jexposit@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1821>
2025-02-26 13:15:34 +00:00
Alan Coopersmith 09c6f09eb7 xkb: ensure XkbAllocNames sets num_rg to 0 on allocation failure
If there was a previous radio_groups array which we failed to realloc
and freed instead, clear the array size in the XkbNamesRec.

Taken from xorg/lib/libx11@258a8ced681dc1bc50396be7439fce23f9807e2a

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1821>
2025-02-26 13:15:34 +00:00
Michel Dänzer f73f8ccb60 ci: Install XCB dependencies for meson tests
The lack of these prevented some of the tests from running in CI.
2025-02-26 09:57:07 +01:00
Peter Hutterer 68c17477d2 mi: guard miPointer functions against NULL dereferences
Already in place for some functions, let's add it to most others.
The only function missing is miPointerSetPosition() which needs to
return the ScreenPtr and that one is unclear if we don't have a screen -
returning NULL will crash the caller(s) so let's wait for something to
trigger this bug before we try to fix it wrongly.

Related to #1782

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1771>
2025-02-26 04:17:03 +00:00
Peter Hutterer acbdd0ecdd mi: don't crash on miPointerGetPosition for disabled devices
If a device is disabled, its master device is forcibly reset to NULL but
unlike a floating device it doesn't have a sprite allocated. Calling
miPointerGetPosition for a disabled device thus crashes.

Avoid this by returning 0/0 for any device without a miPointer.
This is a quick fix only, a proper fix for this issue is rather more
involved.

Closes #1782

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1771>
2025-02-26 04:17:02 +00:00
Olivier Fourdan 05e54fefaf test: Fix xsync test
The xsync test is relying on the values being changed even in the case
of a BadMatch value.

Typically, it updates the delta but does not update the test type
comparison, so when passing a negative value, it generates a BadMatch.

That's actually not correct, and that will fail with the new fixes that
check the validity of the values prior to apply the changes.

Fix the test by updating the test type as needed.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1835>
2025-02-25 19:25:40 +01:00
Olivier Fourdan c285798984 sync: Apply changes last in SyncChangeAlarmAttributes()
SyncChangeAlarmAttributes() would apply the various changes while
checking for errors.

If one of the changes triggers an error, the changes for the trigger,
counter or delta value would remain, possibly leading to inconsistent
changes.

Postpone the actual changes until we're sure nothing else can go wrong.

Related to CVE-2025-26601, ZDI-CAN-25870

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 16:11:58 +01:00
Olivier Fourdan 8cbc90c881 sync: Do not fail SyncAddTriggerToSyncObject()
We do not want to return a failure at the very last step in
SyncInitTrigger() after having all changes applied.

SyncAddTriggerToSyncObject() must not fail on memory allocation, if the
allocation of the SyncTriggerList fails, trigger a FatalError() instead.

Related to CVE-2025-26601, ZDI-CAN-25870

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan f52cea2f93 sync: Check values before applying changes
In SyncInitTrigger(), we would set the CheckTrigger function before
validating the counter value.

As a result, if the counter value overflowed, we would leave the
function SyncInitTrigger() with the CheckTrigger applied but without
updating the trigger object.

To avoid that issue, move the portion of code checking for the trigger
check value before updating the CheckTrigger function.

Related to CVE-2025-26601, ZDI-CAN-25870

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan 16a1242d0f sync: Do not let sync objects uninitialized
When changing an alarm, the change mask values are evaluated one after
the other, changing the trigger values as requested and eventually,
SyncInitTrigger() is called.

SyncInitTrigger() will evaluate the XSyncCACounter first and may free
the existing sync object.

Other changes are then evaluated and may trigger an error and an early
return, not adding the new sync object.

This can be used to cause a use after free when the alarm eventually
triggers.

To avoid the issue, delete the existing sync object as late as possible
only once we are sure that no further error will cause an early exit.

CVE-2025-26601, ZDI-CAN-25870

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan 6e0f332ba4 dix: Dequeue pending events on frozen device on removal
When a device is removed while still frozen, the events queued for that
device remain while the device itself is freed.

As a result, replaying the events will cause a use after free.

To avoid the issue, make sure to dequeue and free any pending events on
a frozen device when removed.

CVE-2025-26600, ZDI-CAN-25871

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan b07192a8be composite: initialize border clip even when pixmap alloc fails
If it fails to allocate the pixmap, the function compAllocPixmap() would
return early and leave the borderClip region uninitialized, which may
lead to the use of uninitialized value as reported by valgrind:

 Conditional jump or move depends on uninitialised value(s)
    at 0x4F9B33: compClipNotify (compwindow.c:317)
    by 0x484FC9: miComputeClips (mivaltree.c:476)
    by 0x48559A: miValidateTree (mivaltree.c:679)
    by 0x4F0685: MapWindow (window.c:2693)
    by 0x4A344A: ProcMapWindow (dispatch.c:922)
    by 0x4A25B5: Dispatch (dispatch.c:560)
    by 0x4B082A: dix_main (main.c:282)
    by 0x429233: main (stubmain.c:34)
  Uninitialised value was created by a heap allocation
    at 0x4841866: malloc (vg_replace_malloc.c:446)
    by 0x4F47BC: compRedirectWindow (compalloc.c:171)
    by 0x4FA8AD: compCreateWindow (compwindow.c:592)
    by 0x4EBB89: CreateWindow (window.c:925)
    by 0x4A2E6E: ProcCreateWindow (dispatch.c:768)
    by 0x4A25B5: Dispatch (dispatch.c:560)
    by 0x4B082A: dix_main (main.c:282)
    by 0x429233: main (stubmain.c:34)

 Conditional jump or move depends on uninitialised value(s)
    at 0x48EEDBC: pixman_region_translate (pixman-region.c:2233)
    by 0x4F9255: RegionTranslate (regionstr.h:312)
    by 0x4F9B7E: compClipNotify (compwindow.c:319)
    by 0x484FC9: miComputeClips (mivaltree.c:476)
    by 0x48559A: miValidateTree (mivaltree.c:679)
    by 0x4F0685: MapWindow (window.c:2693)
    by 0x4A344A: ProcMapWindow (dispatch.c:922)
    by 0x4A25B5: Dispatch (dispatch.c:560)
    by 0x4B082A: dix_main (main.c:282)
    by 0x429233: main (stubmain.c:34)
  Uninitialised value was created by a heap allocation
    at 0x4841866: malloc (vg_replace_malloc.c:446)
    by 0x4F47BC: compRedirectWindow (compalloc.c:171)
    by 0x4FA8AD: compCreateWindow (compwindow.c:592)
    by 0x4EBB89: CreateWindow (window.c:925)
    by 0x4A2E6E: ProcCreateWindow (dispatch.c:768)
    by 0x4A25B5: Dispatch (dispatch.c:560)
    by 0x4B082A: dix_main (main.c:282)
    by 0x429233: main (stubmain.c:34)

 Conditional jump or move depends on uninitialised value(s)
    at 0x48EEE33: UnknownInlinedFun (pixman-region.c:2241)
    by 0x48EEE33: pixman_region_translate (pixman-region.c:2225)
    by 0x4F9255: RegionTranslate (regionstr.h:312)
    by 0x4F9B7E: compClipNotify (compwindow.c:319)
    by 0x484FC9: miComputeClips (mivaltree.c:476)
    by 0x48559A: miValidateTree (mivaltree.c:679)
    by 0x4F0685: MapWindow (window.c:2693)
    by 0x4A344A: ProcMapWindow (dispatch.c:922)
    by 0x4A25B5: Dispatch (dispatch.c:560)
    by 0x4B082A: dix_main (main.c:282)
    by 0x429233: main (stubmain.c:34)
  Uninitialised value was created by a heap allocation
    at 0x4841866: malloc (vg_replace_malloc.c:446)
    by 0x4F47BC: compRedirectWindow (compalloc.c:171)
    by 0x4FA8AD: compCreateWindow (compwindow.c:592)
    by 0x4EBB89: CreateWindow (window.c:925)
    by 0x4A2E6E: ProcCreateWindow (dispatch.c:768)
    by 0x4A25B5: Dispatch (dispatch.c:560)
    by 0x4B082A: dix_main (main.c:282)
    by 0x429233: main (stubmain.c:34)

Fix compAllocPixmap() to initialize the border clip even if the creation
of the backing pixmap has failed, to avoid depending later on
uninitialized border clip values.

Related to CVE-2025-26599, ZDI-CAN-25851

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan c1ff84bef2 composite: Handle failure to redirect in compRedirectWindow()
The function compCheckRedirect() may fail if it cannot allocate the
backing pixmap.

In that case, compRedirectWindow() will return a BadAlloc error.

However that failure code path will shortcut the validation of the
window tree marked just before, which leaves the validate data partly
initialized.

That causes a use of uninitialized pointer later.

The fix is to not shortcut the call to compHandleMarkedWindows() even in
the case of compCheckRedirect() returning an error.

CVE-2025-26599, ZDI-CAN-25851

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan bba9df1a9d Xi: Fix barrier device search
The function GetBarrierDevice() would search for the pointer device
based on its device id and return the matching value, or supposedly NULL
if no match was found.

Unfortunately, as written, it would return the last element of the list
if no matching device id was found which can lead to out of bounds
memory access.

Fix the search function to return NULL if not matching device is found,
and adjust the callers to handle the case where the device cannot be
found.

CVE-2025-26598, ZDI-CAN-25740

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan 0e4ed94952 xkb: Fix buffer overflow in XkbChangeTypesOfKey()
If XkbChangeTypesOfKey() is called with nGroups == 0, it will resize the
key syms to 0 but leave the key actions unchanged.

If later, the same function is called with a non-zero value for nGroups,
this will cause a buffer overflow because the key actions are of the wrong
size.

To avoid the issue, make sure to resize both the key syms and key actions
when nGroups is 0.

CVE-2025-26597, ZDI-CAN-25683

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan 80d69f0142 xkb: Fix computation of XkbSizeKeySyms
The computation of the length in XkbSizeKeySyms() differs from what is
actually written in XkbWriteKeySyms(), leading to a heap overflow.

Fix the calculation in XkbSizeKeySyms() to match what kbWriteKeySyms()
does.

CVE-2025-26596, ZDI-CAN-25543

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan 11fcda8753 xkb: Fix buffer overflow in XkbVModMaskText()
The code in XkbVModMaskText() allocates a fixed sized buffer on the
stack and copies the virtual mod name.

There's actually two issues in the code that can lead to a buffer
overflow.

First, the bound check mixes pointers and integers using misplaced
parenthesis, defeating the bound check.

But even though, if the check fails, the data is still copied, so the
stack overflow will occur regardless.

Change the logic to skip the copy entirely if the bound check fails.

CVE-2025-26595, ZDI-CAN-25545

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Peter Hutterer b0a09ba602 dix: keep a ref to the rootCursor
CreateCursor returns a cursor with refcount 1 - that refcount is used by
the resource system, any caller needs to call RefCursor to get their own
reference. That happens correctly for normal cursors but for our
rootCursor we keep a variable to the cursor despite not having a ref for
ourselves.

Fix this by reffing/unreffing the rootCursor to ensure our pointer is
valid.

Related to CVE-2025-26594, ZDI-CAN-25544

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Olivier Fourdan 01642f263f Cursor: Refuse to free the root cursor
If a cursor reference count drops to 0, the cursor is freed.

The root cursor however is referenced with a specific global variable,
and when the root cursor is freed, the global variable may still point
to freed memory.

Make sure to prevent the rootCursor from being explicitly freed by a
client.

CVE-2025-26594, ZDI-CAN-25544

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

v2: Explicitly forbid XFreeCursor() on the root cursor (Peter Hutterer
<peter.hutterer@who-t.net>)
v3: Return BadCursor instead of BadValue (Michel Dänzer
<michel@daenzer.net>)

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1828>
2025-02-25 11:43:01 +01:00
Jan Engelhardt 530e80375e glamor: explicitly draw endpoints of line segments
The OpenGL 4.6 specification §14.5.1 "Basic Line Rasterization"
figure 14.2 says:

"""A diamond shaped region of height 1 is placed around each fragment
center; those regions that the line segment **exits** cause
rasterization to produce corresponding fragments."""

As the line does not necessarily exit the last diamond,
it is necessary to explicitly paint a pixel at line ends.

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1434
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1755>
2025-02-24 20:39:12 +00:00
Enrico Weigelt, metux IT consult 6fad884ce7 randr: RRScreenInit(): drop unnecessary zero'ing
The whole struct is already allocated by calloc(), so no need to explicitly
zero-out individual fields.

Fixes: 479b2be4ba - Clear allocated RandR screen private structure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 73467faeb2 randr: ProcRRQueryOutputProperty(): use SwapShort()/SwapLong()
Simplify reply payload preparation and sendout by using SwapShort()
and SwapLong() instead of WriteToClientSwapped() and callbacks.

This also allows even further simplifications by using generic macros
for the request send path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult e3001b71b3 randr: ProcRRListOutputProperties(): use SwapShort()/SwapLong()
Simplify reply payload preparation and sendout by using SwapShort()
and SwapLong() instead of WriteToClientSwapped() and callbacks.

This also allows even further simplifications by using generic macros
for the request send path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult d9863f7cb0 randr: ProcRRGetCrtcGamma(): use SwapShort()/SwapLong()
Simplify reply payload preparation and sendout by using SwapShort()
and SwapLong() instead of WriteToClientSwapped() and callbacks.

This also allows even further simplifications by using generic macros
for the request send path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 62b8497999 randr: ProcRRGetProviderProperty(): use SwapShort()/SwapLong()
Simplify reply payload preparation and sendout by using SwapShort()
and SwapLong() instead of WriteToClientSwapped() and callbacks.

This also allows even further simplifications by using generic macros
for the request send path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 8789be52a4 randr: ProcRRGetOutputProperty(): use SwapShort()/SwapLong()
Simplify reply payload preparation and sendout by using SwapShort()
and SwapLong() instead of WriteToClientSwapped() and callbacks.

This also allows even further simplifications by using generic macros
for the request send path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 53d43bd8dc randr: ProcRRGetOutputProperty(): rename reply struct to "rep"
Harmonize it with all the other reply struct fields, so we can later
use generic macros for final preparation and writeout.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 05188ccec1 randr: RRCreateProviderProperty(): use calloc()
We can rely on everything being cleared. And usually even faster, as the
compiler can emit optimized instructions for clearing a whole block at once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 3d3137513a randr: RROutputCreate(): use calloc()
We can rely on everything being cleared. And usually even faster, as the
compiler can emit optimized instructions for clearing a whole block at once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 1bc6ca30a9 randr: ProcRRGetMonitors(): collect reply payload in temporary buffer
Instead of arbitrary count of individual WriteToClient() calls on small
chunks, collect the whole payload in a buffer and write it out all at once.

This also makes possible to use generic macros for reply sending, as well
as further simplifications in the write-out path.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 203f59c6d3 randr: ProcRRGetMonitors() use SwapLongs instead of callbacks
WriteSwappedDataToClient() calls a callback on each single field.
We can have it easier and more efficient by just using SwapLongs()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult c6f1b8a735 randr: ProcRRGetCrtcTransform(): split reply header and payload
Using struct initializer for the reply header and only allocating the
payload on heap. This allows using generic macros for reply preparation
and send-out later.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 90abc95c85 randr: ProcRRGetCrtcInfo(): use locally scoped variables
Improve readability by moving the variables into local scopes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 7eff742ef2 randr: use struct initializer for reply structs
Improve readability, move the declarations to where they're needed first
and get rid of extra individual assignments. In some cases this should also
allow the compiler to produce a bit more efficient code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 6d2c42d0c8 randr: RRCrtcCreate(): drop unnecessary zero assigments
The struct is already zero'ed out by calloc(), so no need to additionally
clear individual fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 058815bed1 randr: use explicit case statement instead of SProcRandrVector table
No need to go indirectly through a vector table, since everything's fixed
anyways. It's not a pretty robust programming style: any changes need great
care, in order to not mix up things.

Replacing this by direct switch/case statement, which is using the defines
from the xrandr protocol headers. Also adding a little bit more protection
against subtle programming errors and reducing cognitive load (source size)
on understanding the code by using a tiny macro for deducing define name and
function name from the request's name.

This approach actually uncovered some subtle bug that had been waiting in
the dark for over 15 years.

As collateral benefit, getting a tiny bit better performance.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 42677ae1e3 randr: use explicit case statement instead of ProcRandrVector table
No need to go indirectly through a vector table, since everything's fixed
anyways. It's not a pretty robust programming style: any changes need great
care, in order to not mix up things.

Replacing this by direct switch/case statement, which is using the defines
from the xrandr protocol headers. Also adding a little bit more protection
against subtle programming errors and reducing cognitive load (source size)
on understanding the code by using a tiny macro for deducing define name and
function name from the request's name.

This approach actually uncovered some subtle bug that had been waiting in the
dark for over 15 years (see commit b87314c876)

As collateral benefit, getting a tiny bit better performance.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult ed17224403 randr: let SProc*'s call their Proc*'s directly
No need to go indirectly through an vector table. It's much clearer and
easier to understand when calling them directly. And a tiny bit performance
improvement as collateral benefit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
2025-02-24 20:30:26 +00:00
Enrico Weigelt, metux IT consult 1fc9a26afd drop not needed includes of geext.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1810>
2025-02-24 20:19:55 +00:00
Enrico Weigelt, metux IT consult a955b83848 Xext: dpms: need to include geext.h
It's calling GERegisterExtension(), which is defined in geext.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1810>
2025-02-24 20:19:55 +00:00
Enrico Weigelt, metux IT consult ce1f0c9375 present: need to include geext.h
It's calling GERegisterExtension(), which is defined in geext.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1810>
2025-02-24 20:19:55 +00:00
Enrico Weigelt, metux IT consult 80593ab279 misc.h: move out MAXEXTENSIONS to geext.c
The only user of it is geext.c, so no need to have that define
in a public include file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1810>
2025-02-24 20:19:55 +00:00
Enrico Weigelt, metux IT consult 3f469acb96 panoramix: don't install panoramiX.h and panoramiXsrv.h
Not used by any drivers/modules, so no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1815>
2025-02-24 20:06:30 +00:00
Enrico Weigelt, metux IT consult 86244ff36f dbe: fix byte swapping in SProcDbeSwapBuffers()
The loop forgot to move the SwapInfo pointer, so the same list entry
gets swapped over and over again, while the remaining ones get ignored.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1822>
2025-02-24 16:24:53 +01:00
Enrico Weigelt, metux IT consult de0aed0543 misc.h: move out checked_int64_(add|subtract)
These inline functions are used only in exactly one place,
so no need to keep them in a public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1808>
2025-02-23 18:08:45 +00:00
Enrico Weigelt, metux IT consult b664b44869 present: fix prototype for present_select_input()
Wants XID instead of CARD32 for 2nd parameter.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1809>
2025-02-23 18:01:02 +00:00
Enrico Weigelt, metux IT consult 90bc995016 Xext: geext: move geeint.h stuff into geext.c
Everything in here only used by geext.c, so no need to keep
a separate header file for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 658f1b34ee Xext: geext.h: fix missing include of Xfuncproto.h
Needed for _X_EXPORT.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 20d4c40df4 Xext: geext.h: don't include <dix-config.h>
Really no need to ever include it from here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult a7600ac884 Xext: geext: move struct _GEExtension into geext.c
Not used anywhere outside geext implementation itself,
so shouldn't be public at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 896937298b Xext: geext: unexport GEExtensions[]
This field isn't used by anybody outside, nor should it be accessed
directly. So better make it local.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 6fa340c578 Xext: geext: drop unused GEInitEvent()
This function isn't called by anybody, so no need to keep it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 480a7e4b11 Xext: geext: drop unused GEV() macro
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult ae7bbd36df Xext: geext: drop unused GEEXT() macro
Not used by anybody, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult b865f44f5e Xext: geext: drop unused GEEXTIDX() macro
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 1006a37f7d Xext: geext: drop unused GEMaskIsSet() macro
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult c1d49e19b9 Xext: geext: drop unused GECLIENT() macro
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 01ad88b8c8 Xext: geext: drop unused GEIsType() macro
Not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult bdb5d4867a Xext: geext: drop unused GEEventFill() macro
It's not used anywhere, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1811>
2025-02-23 17:53:25 +00:00
Enrico Weigelt, metux IT consult 1dc648b1b7 os: drop unused TimerCheck()
This isn't used anywhere, so can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1789>
2025-02-23 17:46:13 +00:00
Enrico Weigelt, metux IT consult d973c43810 os: unexport SetCriticalOutputPending()
Not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1814>
2025-02-23 17:39:18 +00:00
Enrico Weigelt, metux IT consult 573d70ae25 xwin: don't need NULL check before free()
free() is safe against NULL arguments.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1818>
2025-02-23 17:32:49 +00:00
Enrico Weigelt, metux IT consult eafec5836a glamor: don't need NULL check before free()
free() is safe against NULL arguments.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1818>
2025-02-23 17:32:49 +00:00
Enrico Weigelt, metux IT consult e4e3b69626 Xext: geext: fix regression in SProcGEQueryVersion()
Commit 36dd28129b had an ugly typo
(probably broke on rebase - shame on myself) causing SProcGEQueryVersion()
calling itself recursively. Obviously, ProcGEQueryVersion() needs
to be called instead.

Fixes: 36dd28129b
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1817>
2025-02-23 17:25:29 +00:00
Enrico Weigelt, metux IT consult 7ca8c1518c present: need to include <X11/Xfuncproto.h>
Some headers making use of X_EXPORT macro, so Xfuncproto.h should be
included explicitly, instead of silently relying any other include
already doing that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1813>
2025-02-23 17:18:46 +00:00
Enrico Weigelt, metux IT consult b55d726a7b present: need to include dix-config.h
dix-config.h always needs to be included first, otherwise things
can get messed up in really obscure ways, eg. certain types silently
changing in size and causing mysterious crashes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1813>
2025-02-23 17:18:46 +00:00
Enrico Weigelt, metux IT consult 2e6f3a632b meson.build: enable VLA warning
variable length arrays can be dangerous, so better don't use
them at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1819>
2025-02-20 17:28:05 +01:00
Enrico Weigelt, metux IT consult b4f0c1abd5 test: sync: don't use VLA
The array size is fixed anyways, so we can use a symbol instead
of variable.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1819>
2025-02-20 17:28:01 +01:00
Enrico Weigelt, metux IT consult f894801fa2 xfree86: modesetting: don't use VLA
even through this specific case is correct and safe, it's safer to
remove all VLA usages and forbid them completely by compiler flag.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1819>
2025-02-20 17:26:49 +01:00
Doug Brown a0834009cf dri2: Protect against dri2ClientPrivate assertion failures
If DRI2ScreenInit hasn't been called yet, DRI2Authenticate and
DRI2CreateDrawable2 cause the X server to crash. This has been observed
to happen on multiple modern Linux distros in various conditions,
including QEMU and VMware VMs. Make these functions more robust in order
to prevent the crash.

This patch was originally provided by Bernhard Übelacker and expanded
upon by Mark Wagner.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1053
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1534
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1608>
2025-02-19 11:25:01 +00:00
Enrico Weigelt, metux IT consult 6c88eb0cc4 misc.h: unexport compare_version()
Not used by any external modules, so no need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1807>
2025-02-18 11:17:40 +00:00
Enrico Weigelt, metux IT consult 804b2c081b os: unexport CloseWellKnownConnections()
Not used by any modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult 0d95b53a20 os: unexport ResetWellKnownSockets()
Not used by any modules (and not supposed to be), so should not
be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult dd05532b38 os: unexport CreateWellKnownSockets()
Not used by any modules (and not supposed to be), so should not
be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult 59b39ee6ee os: unexport NotifyParentProcess()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult c9ee4245a2 os: unexport ResetOsBuffers()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult 583dbe832d os: unexport FlushIfCriticalOutputPending()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult be16616715 os: unexport FlushAllOutput()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult c6b223459c os: unexport ResetCurrentRequest()
Not used by any external modules, so no need to keep it in public API.

Since it's used by DRI, still needs the _X_EXPORT flag, as long as DRI
is a dynamically loaded module.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:45 +00:00
Enrico Weigelt, metux IT consult 189a70dfb2 os: unexport InsertFakeRequest()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult ba665948f6 os: unexport WriteFdToClient()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult effe8d66bd os: unexport ReadRequestFromClient()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult 9b0c3c62f2 os: unexport ListenOnOpenFD()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult d637e1d284 os: unexport AddClientOnOpenFD()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult a84ae08526 os: unexport ClientAuthorized()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult c6b8207342 os: unexport AuthorizationIDOfClient()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult 1f27d3d653 os: unexport ClientIsLocal()
Not used by any modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1790>
2025-02-18 10:53:44 +00:00
Enrico Weigelt, metux IT consult 6ec89c91f3 ci: update freebsd builder image
FreeBSD upstream removed image for 14.0 image, so we need to update.
Also increasing image size, since the new images are too small.
(needs update of ci-templates)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1784>
2025-02-18 10:43:28 +01:00
Enrico Weigelt, metux IT consult 80f5d29c84 xfree86: doc: update docs on XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult e88762896e xfree86: inputtest: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult 2a10eff6c5 xfree86: modsetting: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult c8ad9c6567 xfree86: exa: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult c862cf3c3a xfree86: fbdevhw: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult d87e93bf40 xfree86: xf86int10module: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult f54993a222 xfree86: xfbmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult a2e20304e0 xfree86: vgaHWmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult 3066125bec xfree86: shmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult f0590decb6 xfree86: sfbmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult 03becba76b xfree86: glxmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult 7dd8d0627c xfree86: fbmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:30 +00:00
Enrico Weigelt, metux IT consult c46e645bad glamor: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:29 +00:00
Enrico Weigelt, metux IT consult 1848027892 xfree86: xf86configure: use NULL instead of 0
Zero pointers should be initialized w/ NULL instead of raw 0.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1788>
2025-02-17 19:41:29 +00:00
Enrico Weigelt, metux IT consult 346d5f5c35 os: move BUG_*() macros to own private header
These macros aren't used by any external modules, so no need
to keep them public. Moving them into private header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1804>
2025-02-17 19:32:48 +00:00
Enrico Weigelt, metux IT consult a6b2eb3780 misc.h: drop LengthRestB() macro
Only used at exactly one place, for trivial size computation, so not worth
having an extra macro in a public header for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1805>
2025-02-17 19:25:14 +00:00
Alan Coopersmith 9af363b046 ci: update XTS to a commit that doesn't require -fcommon workaround
xorg/test/xts!10 fixed XTS to build with recent gcc without adding -fcommon

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1786>
2025-02-17 19:16:04 +00:00
Enrico Weigelt, metux IT consult f209ac2014 doc: drop removed PaintWindowBackground() and PaintWindowBorder()
These have been removed 1.5 decades ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1785>
2025-02-17 19:05:55 +00:00
Enrico Weigelt, metux IT consult f4d878086e Xext: selinux: use static reply struct init on declaration
Make the code a bit easier to read by using initialization of the reply
structs, at the point of declaration. Most of them aren't written to later,
just passed into WriteReplyToClient(). Also dropping some useless zero
assignments (struct initializers automatically zero-out unmentioned fields).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1795>
2025-02-17 18:58:10 +00:00
Enrico Weigelt, metux IT consult 94d942267a dri: report failed memory allocation
ProcXF86DRIGetDrawableInfo() should report failed memory allocation instead
of pretending everything's okay.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1797>
2025-02-17 18:50:25 +00:00
Enrico Weigelt, metux IT consult 2539ddae50 modsetting: also add libglx to library symbol test
Increase test coverage a bit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1798>
2025-02-17 18:42:52 +00:00
Enrico Weigelt, metux IT consult e10283d842 xfree86: os-support: unexport xf86scanpci()
Not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1800>
2025-02-17 18:35:43 +00:00
Enrico Weigelt, metux IT consult b3ec0bf58a dix: unexport MakePredeclaredAtoms()
Should never be called by modules/drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1802>
2025-02-17 18:13:33 +00:00
Enrico Weigelt, metux IT consult 9dc26f6743 os: no need to defined PATH_MAX
All our supported platforms define it, so no need to do
it on our own.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1803>
2025-02-17 16:55:13 +01:00
Enrico Weigelt, metux IT consult 6c24e53a89 os: drop `upstart` specific SIGSTOP signaling logic
Upstart is long dead, discontinued a decade ago, so there's no
need to keep around a special signaling logic just for it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1791>
2025-02-14 14:25:28 +01:00
Enrico Weigelt, metux IT consult 6349773d5e mi: (re)export and document miPointerInitialize()
Xrdp project request exporting this function again, because (unlike the
usual xf86-video-* drivers) they need their own custom cursor handling:
RDP is designed to draw cursors on client side.

Also documenting what the function does.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1787>
2025-02-13 23:53:39 +00:00
Andy Myers 7933cc24d0 xvfb: Add multiple CRTC support
Multiple CRTCs can be added on a per-screen basis with the new -crtcs
option. Each CRTC has one associated output. Outputs beyond the first
are disabled by default and can be enabled by setting a mode. Outputs
can be disabled again by setting the associated CRTC's mode and output
to None.

Signed-off-by: Andy Myers <andy.myers@zetier.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1749>
2025-02-13 23:22:49 +00:00
Enrico Weigelt, metux IT consult b61647f3a1 dix: add in-code docs for dixDestroyPixmap()
Give some more explaination for the dixDestroyPixmap() function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult ee798cf212 exa: simplify CreatePixmap()/DestroyPixmap() handlers error pathes
Instead of complex wrap/unwrap trickery in the error path, just
protect the DestroyPixmap() handlers from half-initialized state.

Prior to this change, we always had to make sure, the we're calling
the original (screen driver's) handler directly, instead of our own
(which calls the original one, too), so it doesn't do any damage.
This isn't necessary anymore, since it finds out on it own what to do.

This not just makes the code flow simpler and easier to understand, but
also clears the road for decoupling the extension specific pixmap destructor
logic from the ScreenRec proc vectors (*1).

*1) see: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1755
         https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 69837185c0 glx: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 0132baa422 xwayland: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 4d1953728e xfree86: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult c117925ace vfb: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 4378656cbb kdrive: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 0a54e24721 xnest: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult c8607ca66f render: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult d2a93d0346 randr: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 4628254698 mi: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 372a510ef0 miext: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 7a0f8301c5 glamor: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 08ec122fa7 fb: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 9ca03e6da0 exa: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 4694b8488e dri3: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 668d9fc40e dbe: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult eb5476381a composite: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 5b541780c1 dix: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult c0f3b5bcef Xext: shm: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 7ce19233bc Xext: saver: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:30 +01:00
Enrico Weigelt, metux IT consult 984da40fbb doc: document that ScreenRec->DestroyPixmap() shouldn't be called directly
Direct calls to ScreenRec->DestroyPixmap() is fragile and blocks cleaning up
the wrapping jungle, so use the proper dix function instead.

While this function originally wasn't made for that purpose (and so we have an
useless parameter here, and the naming isn't entirely correct), it's the best
effort we have right now, without breaking existing API: it's already exported
since long time, so drivers can be easily converted and still work with both
new and older Xserver ABI versions.

Retrospectively, this already should have been done 20 years ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
2025-02-12 17:48:26 +01:00
Enrico Weigelt, metux IT consult 2e0c19b6d9 dix: add getter for display name
Xrdp needs to know the current display name (for setting up it's
own server sockets accordingly). Instead of exporting an internal
field, adding a little getter for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1783>
2025-02-11 19:13:01 +01:00
Enrico Weigelt, metux IT consult 80a3df55ae xfree86: xf86Opt.h: fix missing include
<X11/Xdefs.h> is needed for `Bool` type.

Consumers shouldn't have to rely on Xdefs.h being accidentally included
by something else.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1782>
2025-02-11 14:52:15 +00:00
Enrico Weigelt, metux IT consult 5f1bdd0aa3 ci: add intel driver to build matrix
Add the intel driver to our CI, in order to prevent API breaks going
unnoticed again.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
2025-02-11 09:53:59 +01:00
Enrico Weigelt, metux IT consult d4f60b5462 ci: workaround for building xf86-video-intel via autotools
This driver's meson build scripts are currently broken, but autotools
still works fine. So add a little workaround for forcing it to be built
via autotools, even if meson.build file is there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
2025-02-11 09:53:59 +01:00
Enrico Weigelt, metux IT consult 9b3b938ede os: re-add System() function for backwards compat
This function had been unexported long ago, but the Intel driver
still needs it. Adding a tiny temporary compat wrapper, so Intel
team has time to keep up with us.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
2025-02-11 09:53:59 +01:00
Enrico Weigelt, metux IT consult 5b6f2292a3 os: drop win32-only System() function
Not used anymore, so it can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
2025-02-11 09:53:59 +01:00
Enrico Weigelt, metux IT consult f837dee79d win32: use lib system() instead of our own function
mingw32 has system() function, so we don't need our own implementation
anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
2025-02-11 09:53:59 +01:00
Enrico Weigelt, metux IT consult 6789b911c4 render: picturestr.h: re-add compat macros for intel driver
The ancient pict_f_vector and pixman_f_vector macros have been a fallout
from long ago transition to pixman and had been removed quite a while ago.

Unfortunately, Intel driver (which is not under our reign) hasn't been
kept up to date yet. So re-adding the compat macro, until Intel driver
team had a chance to keep up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
2025-02-11 09:53:59 +01:00
Aki Sakurai 3562298068 xquartz: fix inverted tablet pen Y tilt on macOS
On macOS, the y tilt behavior is inverted; an increase in the tilt
value corresponds to tilting the device away from the user.

see https://chromium-review.googlesource.com/c/chromium/src/+/2348544
see 0f128fd7c5/src/plugins/platforms/cocoa/qnsview_tablet.mm (L63)

Fixes #792

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1779>
2025-02-10 22:02:16 +08:00
Aki Sakurai da0de21b72 xquartz: fix compilation
Fixes #1788

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1777>
2025-02-10 19:37:18 +08:00
Spiky Caterpillar 2631cad85d No longer leak FDs on VT switch.
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/997>
2025-02-08 17:38:20 +02:00
Randy Palamar 5677de586f os/osinit: fix build when execinfo.h is missing
HAVE_BACKTRACE gets set on systems with libunwind however
execinfo.h may be missing (on *BSD or musl for example).
HAVE_EXECINFO_H has been defined by the build system for a long
time but previously not used.

Signed-off-by: Randy Palamar <randy@rnpnr.xyz>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1207>
2025-02-08 15:22:29 +00:00
Enrico Weigelt, metux IT consult 143a6a21e1 miext: rootless: fix unused variables
Compiling w/ -Werror (which our CI does) breaks compile due a buch of
unused variables.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1703>
2025-02-08 15:15:57 +00:00
Enrico Weigelt, metux IT consult 6ee163cb94 mi: miexpose: fix FTBS w/ rootless helper
FTBS when rootless subsys enabled:

> ../mi/miexpose.c: In function ‘miPaintWindow’:
> ../mi/miexpose.c:411:15: error: unused variable ‘orig_pWin’ [-Werror=unused-variable]
>   411 |     WindowPtr orig_pWin = pWin;
>       |               ^~~~~~~~~
> cc1: all warnings being treated as errors

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1703>
2025-02-08 15:15:57 +00:00
Enrico Weigelt, metux IT consult bcbc7479f3 xfree86: common: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1681>
2025-02-07 22:40:06 +00:00
Enrico Weigelt, metux IT consult 5fd918421a xfree86: fbdevhw: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1681>
2025-02-07 22:40:06 +00:00
Enrico Weigelt, metux IT consult 4ba0cf1f55 xfree86: os-support: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1681>
2025-02-07 22:40:06 +00:00
Enrico Weigelt, metux IT consult 1f93ec5c33 xfree86: i2c: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1681>
2025-02-07 22:40:06 +00:00
Enrico Weigelt, metux IT consult 76874498be glx: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1681>
2025-02-07 22:40:06 +00:00
Enrico Weigelt, metux IT consult 6fc4f35f62 xfree86: use LogMessageVerb() instead of xf86MsgVerb()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1681>
2025-02-07 22:40:06 +00:00
Enrico Weigelt, metux IT consult 8e8bf63908 os: move AbortServer() to os/utils.c
This function doesn't much to do with logging, except for being
called once by FatalError(). It's better placed in utils.c

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1678>
2025-02-07 18:45:35 +01:00
Ivaylo Dimitrov 579eb31222 linux: Fix BUS_PLATFORM detection for non-PCI devices
Commit 74b7427c41 (linux: Make platform device probe less fragile)
effectively dropped busid detection for non-PCI devices, for example on
OMAP we have "ID_PATH=platform-omapdrm.0". For such devices busid will not
be set, making platform probes (and server mediated fd support) impossible.

Fix that by extending config_udev_odev_setup_attribs() logic to support
platform devices as well.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1761>
2025-02-07 15:10:17 +00:00
Doug Johnson e0588d2110 os: backtrace: Fix -Wincompatible-pointer-types compiler error on 32-bit targets
```
../os/backtrace.c: In function ‘print_registers’:
../os/backtrace.c:94:52: error: passing argument 3 of ‘_ULarm_get_reg’ from incompatible pointer type [-Wincompatible-pointer-types]
   94 |         ret = unw_get_reg(&cursor, regs[i].regnum, &val);
      |                                                    ^~~~
      |                                                    |
      |                                                    uint64_t * {aka long long unsigned int *}
```
Switched to libunwind's un_word_t type and PRIxPTR fprintf fmt specification

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1763>
2025-02-07 16:58:02 +02:00
Enrico Weigelt, metux IT consult 4f2c6c98b7 xfree86: mark LoaderShouldIgnoreABI() and LoaderGetABIVersion() deprecated
These functions are only used by the proprietary NVidia drivers,
so keeping them only for backwards compat. Nobody else should ever
really need them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1773>
2025-02-07 14:46:21 +01:00
Enrico Weigelt, metux IT consult 13a16de310 Revert "xfree86: loader: drop unused LoaderShouldIgnoreABI()"
This reverts commit d8c47a3db6.

Proprietary NVidia driver needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1773>
2025-02-07 14:46:21 +01:00
Enrico Weigelt, metux IT consult ea118d3897 Revert "xfree86: loader: drop unused LoaderGetABIVersion()"
This reverts commit f3887956ec.

Proprietary NVidia drivers still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1773>
2025-02-07 14:46:21 +01:00
Enrico Weigelt, metux IT consult e3cbde9914 include: unexport no*Extension flags
Most of these flags aren't used by any drivers, so no need to keep them
exported. Only three exceptions: composite, Panoramix/Xinerama and Xv.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1519>
2025-02-07 12:00:58 +01:00
Enrico Weigelt, metux IT consult 356e18dcc6 os: move out extension disable flags to corresponing extensions
The OS abstraction isn't really the right place for those flags,
they are're probably better off in their corresponding extensions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1519>
2025-02-07 12:00:53 +01:00
Enrico Weigelt, metux IT consult 8539f35818 Revert "xv: unexport XvScreenRec and XvScreenPtr"
This reverts commit 58a2fb8b6f.

Needed by xf86-video-intel driver. Didn't get noticed, because we don't
have this driver in our CI yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1772>
2025-02-07 10:08:41 +01:00
Enrico Weigelt, metux IT consult 37dd2897d4 Xext: saver: consolidate (non-)xinerama versions
We can make it a bit simpler by doing the request header
checking only once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591>
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult 8236ef3b56 Xext: saver: use explicit switch/case for dispatching
It's more robust / easier understandable programming style to use explicit
switch statements, case'ing on the constants defined in the protocol header,
instead of implicitly via a some opaque call table. It's also done this
way in the other extensions, so making the code a bit more consistent.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591>
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult 40469a9d51 Xext: saver: skip unneeded zero init and zero-swapping
When using struct initializers, all fields not set explicitly are zero.
Also no need to swap fields that are known to be zero.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591>
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult fdb8c8ea41 Xext: saver: fix missing swap in QueryVersion reply
The `majorVersion` and `minorVersion` fields are CARD16, thus need to be swapped.
OTOH, the lengths field is zero anyways, so no need to swap it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591>
2025-02-06 23:56:51 +00:00
Enrico Weigelt, metux IT consult 1efb2151e3 xfree86: sdksyms.sh: add more headers
Add some headers that are still needed by drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:34 +00:00
Enrico Weigelt, metux IT consult cf03948572 xfree86: move private definitions out of dri.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:34 +00:00
Enrico Weigelt, metux IT consult 1d3c26446d xfree86: move private definitions out of dri2.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:34 +00:00
Enrico Weigelt, metux IT consult 00c2a8fb0a xfree86: ddc: move private definitions from xf86DDC.h to xf86DDC_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:34 +00:00
Enrico Weigelt, metux IT consult d4724009ce xfree86: parser: move private defs from xf86Parser.h to xf86Parser_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:34 +00:00
Enrico Weigelt, metux IT consult ac5e95be49 xfree86: modes: move private definitions out of from xf86RandR12.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:33 +00:00
Enrico Weigelt, metux IT consult 013eaacdd0 xfree86: common: move private defs out of xf86VGAarbiter.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:33 +00:00
Enrico Weigelt, metux IT consult df33e1c51b xfree86: common: move private defs from xf86Xinput.h to xf86Xinput_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:33 +00:00
Enrico Weigelt, metux IT consult a0eea4e0ec xfree86: int10: move private defs out of xf86int10.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:33 +00:00
Enrico Weigelt, metux IT consult 50d1a98c6a xfree86: common: move private defs out of xf86sbusBus.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1290>
2025-02-06 23:51:33 +00:00
Enrico Weigelt, metux IT consult f4eb217f11 os: log: replace VErrorF() by LogVMessageVerb()
Since LogVMessageVerb() is now signal safe, we can use this one instead.
Leaving VErrorF() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult 9652bc73e2 xwin: drop duplicate OsVendorVErrorF()
It really doesn't seem to be necessary to protect a LogVMessageVerb()
call by extra mutex on windows only, while obviously not needed on
any other platform.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult da22bc9ae0 os: log: replace VErrorFSigSafe() by VErrorF()
Since VErrorF() is now signal safe, we can use this one instead.
Leaving VErrorFSigSafe() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult 2d18c353b4 os: log: replace ErrorFSigSafe() by ErrorF()
Since ErrorF() is now signal safe, we can use this one instead.
Leaving ErrorFSigSafe() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult dd37cc4855 os: log: replace LogMessageVerbSigSafe() by LogMessageVerb()
Since LogMessageVerb() is now signal safe, we can use this one instead.
Leaving LogMessageVerbSigSafe() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult 5962211612 os: log: make LogVMessageVerb() signal safe
We already have our own signal safe vnsprintf() implementation, which is used
for formatting log messages while being in a signal handler, there's no need
to have two separate implementations of all the logging functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult 71b8953597 os: log: consolidate log formatting functions
Simplify log formatting functions and remove redundancies, e.g.:

* common function for line termination
* copy prefix directly instead of *printf'ing it
* now just exactly one LogSWrite() call per message
  (good for other log targets like syslog)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:27 +00:00
Enrico Weigelt, metux IT consult f5fe8a6379 os: log: drop unused variables
Drop some unneeded variabes, whose values can be computed at compile-time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1691>
2025-02-06 23:35:26 +00:00
Enrico Weigelt, metux IT consult a33639f975 xvmc: move over protocol version defines into xvmc.c
These are exclusively used in one source file, so no need to keep them
in a global header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1693>
2025-02-06 23:29:10 +00:00
Enrico Weigelt, metux IT consult 171db3b01b meson: drop defining BIGREQS
This symbol isn't used for decades, so no need to define it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1700>
2025-02-06 23:22:31 +00:00
Enrico Weigelt, metux IT consult 4235d2375a xfree86: vgahw: drop obsolete vgaHWSaveScreenWeak()
No callers left, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:40 +00:00
Enrico Weigelt, metux IT consult be9b89ef0f xfree86: vgahw: drop obsolete vgaHWDisable()
No callers left, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:40 +00:00
Enrico Weigelt, metux IT consult bb0295b397 xfree86: vgahw: drop obsolete vgaHWSetRegCounts
No callers left, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:40 +00:00
Enrico Weigelt, metux IT consult 515d19806c xfree86: vgahw: make vgaHWSaveColormap() static
No external callers anymore, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:40 +00:00
Enrico Weigelt, metux IT consult 79522220a6 xfree86: vgahw: make vgaHWSaveMode() static
No external callers left, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:40 +00:00
Enrico Weigelt, metux IT consult f004998b78 xfree86: vgaha: make vgaHWRestoreColormap() static
No external callers left, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:40 +00:00
Enrico Weigelt, metux IT consult 30380cb207 xfree86: vgahw: make vgaHWRestoreMode() static
No external callers anymore, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:39 +00:00
Enrico Weigelt, metux IT consult cd2457412f xfree86: vgahw: drop obsolete vgaHWBlankScreenWeak()
Not used anymore, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:39 +00:00
Enrico Weigelt, metux IT consult a415e6ed37 xfree86: vgahw: drop obsolete vgaHWProtectWeak()
Not used anymore, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1724>
2025-02-06 23:15:39 +00:00
Enrico Weigelt, metux IT consult 00f69564c5 xfree86: common: unexport UnloadModule() and UnloadSubModule()
Not used by any driver/module, so no need to keep it exported.
Also making them type-safe.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1722>
2025-02-06 23:09:02 +00:00
Enrico Weigelt, metux IT consult b0452ecff4 xfree86: drop obsolete macro INITARGS
This macro isn't used anymore for 12 years now, see commit:

    5079db78ae

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1722>
2025-02-06 23:09:02 +00:00
Enrico Weigelt, metux IT consult f3887956ec xfree86: loader: drop unused LoaderGetABIVersion()
This function isn't called anywhere, neither in xserver nor modules, thus no
need to keep it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1722>
2025-02-06 23:09:02 +00:00
Enrico Weigelt, metux IT consult d8c47a3db6 xfree86: loader: drop unused LoaderShouldIgnoreABI()
This function isn't called anywhere, neither in xserver nor modules, thus no
need to keep it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1722>
2025-02-06 23:09:02 +00:00
Enrico Weigelt, metux IT consult 24d693c5ae dix: make dixDestroyPixmap() NULL-proof
Make dixDestroyPixmap() check for NULL pointer, so callers don't need to
do it anymore. Returning TRUE on NULL pointer - but most callers won't
even look at the retval anyways.

Together with subsequent commits, which will make use of that function,
instead of calling raw ScreenRec->DestroyPixmap vectors, this gives us some
more freedom for architectural changes, eg. get rid of the extremely
complicated and fragile wrapping chains.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1709>
2025-02-06 23:02:06 +00:00
Enrico Weigelt, metux IT consult ef62929f58 treewide: NULL-protect ScreenRec->DestroyPixmap() calls
Right now, we're assuming that even when deep nesting involved, the proc
vector is always set to a valid function. One the one hand it requires
extra dummy procs in some cases, OTOH it's making upcoming refactoring
of the code flow unnecessarily complex.

The big plot (of subsequent commits) is splitting out the extension's
(and possibly subsystem's) special logic out of the wrapping chain and
let them be executed independently from the DDX/drivers - when applicable
even only when the pixmap is really destroyed (not just unref'ed).
(At some later point, it might even become be actually a valid situation
that DestroyPixmap vector really being NULL.)

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754
See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1755

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1709>
2025-02-06 23:02:06 +00:00
Enrico Weigelt, metux IT consult af2d3e9487 xnest: drop obsolete mi.h include
Since moving to mi_priv.h, we don't need to include mi.h here.

Fixes: 94451181c2
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1725>
2025-02-06 22:53:43 +00:00
Enrico Weigelt, metux IT consult f8fc46cbbf include: drop now empty xkbfile.h
This (public) file isn't used by anybody outside Xserver tree
and doesn't contain anything useful anymore, so lets drop it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
2025-02-06 22:45:25 +00:00
Enrico Weigelt, metux IT consult 3f8a5475c9 xkb: unexport remaining internal declarations
These are only used inside xkb/*, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
2025-02-06 22:45:25 +00:00
Enrico Weigelt, metux IT consult 660657a2c3 xkb: unexport functions from xkbout.c
These are only used inside xkb/*, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
2025-02-06 22:45:25 +00:00
Enrico Weigelt, metux IT consult 5d98664ec1 xkb: unexport functions from xkbfmisc.c
These are only used inside xkb/*, so no need to keep them exported.

Also replacing some macros by inline functions in order to improve
type-safety and debugging, and adding documentation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
2025-02-06 22:45:25 +00:00
Enrico Weigelt, metux IT consult 114c1c84b1 xkb: move XkbConvertGetByNameComponents and make it static
This function has only one caller in xkb.c, so no need to keep it exported,
can be moved over into xkb.c and made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
2025-02-06 22:45:25 +00:00
Enrico Weigelt, metux IT consult cd52a8f8a4 xfree86: common: dont install xf86MatchDrivers.h
xf86MatchDrivers.h doesn't export any symbols, thus doesn't need to
be installed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1738>
2025-02-07 00:39:00 +02:00
Enrico Weigelt, metux IT consult 0b123a0413 xfree86: unexport xf86PlatformMatchDriver()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1738>
2025-02-07 00:38:58 +02:00
Enrico Weigelt, metux IT consult 16ca87703c xfree86: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 190346663b Xi: drop now obsolete swap procs
Lots of SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult dc9a998b96 Xext: xv: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 753e6c44ba Xext: xtest: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 0c87f9b1da Xext: xcmisc: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 9a3daf908c Xext: vidmode: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 3bb15b3e04 Xext: sync: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult c8c42490b7 Xext: shm: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult a7bdfdb3b5 Xext: shape: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 07131dccc5 Xext: saver: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:52 +00:00
Enrico Weigelt, metux IT consult 515992b046 Xext: panoramiX: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 98dbd817f6 Xext: dpms: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 0da419246e randr: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 851ce5c6a8 dbe: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 4c3ff75772 dix: 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.

Also dropping now obsolete SProcNoOperation().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 643f91266e xwin: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 4cb141307c xwayland: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 65224a2f9a xquartz: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 7e5c342be1 xfree86: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 4d053f22f3 Xi: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 54d4dd619c Xext: xv: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 69982abf7b Xext: xtest: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:51 +00:00
Enrico Weigelt, metux IT consult 8a5d2a1335 Xext: selinux: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 8b57516414 Xext: xres: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 776efd3cfc Xext: xf86bigfont: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 405a227c73 Xext: xcmisc: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 65cb5e5575 Xext: vidmode: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult bf6d132df6 Xext: sync: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 75544f1f58 Xext: shm: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult a105c1f7a9 Xext: shape: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult cd413baa4b Xext: security: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult b52f5f9693 Xext: saver: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 23a8d9be71 Xext: panoramiX: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult fb40f65ee0 Xext: dpms: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:50 +00:00
Enrico Weigelt, metux IT consult 4f56025812 Xext: bigreq: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult d9760ad127 dri3: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 7e2bbba067 damage: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult fea6b99519 randr: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 00ab4ff813 render: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 5bcbacce6c present: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 4454b71f4b pseudoramiX: 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.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult b4df6f1fe3 record: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 9b88a64ba9 dbe: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 96344583e4 composite: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult eea9e4e84b xfixes: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:49 +00:00
Enrico Weigelt, metux IT consult 9af095e121 xkb: 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult 44c063d93d Xext: xtest: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult c3e1f6fccf Xext: vidmode: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult dab1299745 Xext: shape: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult 67a3319d73 Xext: security: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult bacc4b1477 Xext: saver: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult ef396a28b7 xquartz: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult a623060185 xkb: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult 4b2115a182 randr: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult fc9f8f8d3c Xi: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1639>
2025-02-06 22:28:48 +00:00
Enrico Weigelt, metux IT consult e1e8ab3ddf mi: miline.h: drop DEFAULTZEROLINEBIAS from public header
This define in only used locally, in exactly one source file,
thus no neeed to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1726>
2025-02-06 22:18:12 +00:00
Enrico Weigelt, metux IT consult c06d9da5b6 mi: miline.h: unexport only locally used macros
These macros are only used in one source file, so move them there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1726>
2025-02-06 22:18:11 +00:00
Enrico Weigelt, metux IT consult 36dd28129b Xext: geext: simplify dispatcher
Most of the complexity here isn't needed at all. It can be really trivial,
since we just have one operation anyways.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1596>
2025-02-06 21:26:32 +00:00
Enrico Weigelt, metux IT consult 6df7ba38ae Xext: geext: drop unused variable extEntry
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1596>
2025-02-06 21:26:32 +00:00
Enrico Weigelt, metux IT consult a57db845bb Xext: shape: clean up Xinerama dispatch
Simplify the dispatching by moving the branching between Xinerama
vs. single screen into the actual request handlers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1598>
2025-02-06 21:08:13 +00:00
Enrico Weigelt, metux IT consult 6825f89cd2 mi: drop now obsolete mioverlay.h
This used to be part of public API, but no (known) driver ever
using it, nor any exported functions left. The only internal consumer
(mioverlay.c) also gone now, so it's time to drop this file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult 65b738ed60 mi: drop now obsolete mioverlay.c
Since it became practically empty, we can remove it now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult 00796cbf8c mi: drop obsolete miOverlaySetRootClip()
Not used by any (known) drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult 54704e4a50 mi: drop obsolete miOverlaySetTransFunction()
Not used by any (known) drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult be6985948d mi: drop obsolete miOverlayCopyUnderlay()
Not used by any (known) drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult bfb69b7316 mi: drop obsolete miOverlayComputeCompositeClip()
Not used by any (known) drivers anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult a860ce2c9f mi: drop obsolete miOverlayCollectUnderlayRegions()
Not used by any known drivers/modules.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult 2c21824ee9 mi: drop obsolete miOverlayGetPrivateClips()
It's not used anymore, not even by any (known) drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult 12ab2e314b mi: drop obsolete miInitOverlay()
It doesn't seem to be used anywhere for quite some time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1503>
2025-02-06 21:00:08 +00:00
Enrico Weigelt, metux IT consult 30fb73d9af Xnest: drop obsolete xnest-config.h
This file became pretty no-op, just including dix-config.h.
So we can remove it now and include dix-config.h directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1632>
2025-02-06 20:22:52 +00:00
Enrico Weigelt, metux IT consult 7130072dc5 Xnest: no need to include xkb-config.h
Xnest doesn't need anything from xkb-config.h, so no need to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1632>
2025-02-06 20:22:52 +00:00
Enrico Weigelt, metux IT consult ec13a6a61f Xnest: simplify disabling unsupported extension
Instead of strange #undef hacks in various places, just go the straight
route and set the corresponding no*Extension flags on server startup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1632>
2025-02-06 20:22:52 +00:00
Enrico Weigelt, metux IT consult a647cc8a41 glx: DoQueryContext(): use core's swapping macros
No need to have duplicated byte swapping macros in GLX for things that
the core alreay provides. Using core's macros is actually even easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:23 +00:00
Enrico Weigelt, metux IT consult 56ca98aa47 glx: DoQueryContext(): drop duplicate write path
We now have two copies of the same write path in both swapped and
non-swapped branch. One is enough.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:23 +00:00
Enrico Weigelt, metux IT consult ab4142bc75 glx: DoQueryContext(): determine reply length from buffer size
The reply length (in units as well as bytes) can safely be determined
at compile time, by using sizeof() operator. No need for unnecessarily
complicated shifting bits back and forth.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:23 +00:00
Enrico Weigelt, metux IT consult ef77c486d5 glx: DoQueryContext(): explicitly use reply buf type defined by spec
The spec defines the reply as array of "CARD32", not "int". The latter
just accidentially has the same type (for now :o), but it's *semantically*
incorrect. Using CARD32 instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:23 +00:00
Enrico Weigelt, metux IT consult 0a7763bfce glx: DoQueryContext(): use fixed size array instead of variable length
Our array here really is fixed, but it's size is determined by a variable
(that's assigned a fix values), unncessarily making it a VLA (even making
it const doesn't change that), so giving false alarms when compiling w/
-Wvla or -Werror=vla.

Replacing the variable by #define trivially fixes this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:23 +00:00
Enrico Weigelt, metux IT consult 6bd673ab15 glx: use sizeof() for reply struct
The reply struct's size can safely be determined by the sizeof()
operator, so no need for using an extra define here. Making the code
easier to read and also open the door for future convenience macros
that might determine the buffer size on their own.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:23 +00:00
Enrico Weigelt, metux IT consult 558ded4dbf glx: assign at declaration
Assigning structs at declaration is quicker to read/understand. No need
to support ancient compilers that couldn't do that, anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
2025-02-06 20:04:22 +00:00
Enrico Weigelt, metux IT consult 161c3c8398 os: drop obsolete LogHdrMessage()
This function isn't used anywhere, so no need to keep it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1677>
2025-02-06 19:57:52 +00:00
Enrico Weigelt, metux IT consult 216fc6fe83 dix: drop remains of ancient code generator
This script used to generated xproto header as well as a piece of source
for initializing the builtin atoms in the Xserver (MakePredeclaredAtoms()).

At least with R6.6 baseline it didn't seem to be used anymore, and - at least
since the modularization - it's completely broken and useless.

Since we now have a new generator, running directly in the build process,
this ancient script can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1670>
2025-02-06 19:29:52 +00:00
Enrico Weigelt, metux IT consult 44e6558934 dix: generate MakePredeclaredAtoms() from BuiltInAtoms file
This function probably been (half?) auto generated somewhere back in the
dark ages (there're still remains of the former generator, which doesn't
work anymore, and hasn't been updated for ages). It's been added to SCM
with R6.6 baseline - and from that on manually maintained.

Adding a little generator to create source from "BuiltInAtoms" file,
directly in the build process.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1670>
2025-02-06 19:29:52 +00:00
Enrico Weigelt, metux IT consult 4775f547d8 netbsd: disable pccons support
On NetBSD, pccons is (almost) dead: only remaining port is arc,
but only on some specific kernel, which is unlikely to be used
for running X.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1588>
2025-02-06 19:03:25 +00:00
Enrico Weigelt, metux IT consult 3ed962b858 xfree86: os-support: bsd: consolidate duplicate defines
Consolidate defines duplicated across several sources into one header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1411>
2025-02-06 16:22:42 +00:00
Enrico Weigelt, metux IT consult 923da4d569 xfree86: os-support: unexport DEV_MEM defines
DEV_MEM define isn't used by any drivers, and BSD seems to be the only one
left using that define (Linux uses the symbol, but defines on its own)

Therefore, just define it where actually used and drop it from the global
xf86OSlib.h file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1411>
2025-02-06 16:22:42 +00:00
Enrico Weigelt, metux IT consult d79432e0d4 Xnest: tidy up extension blacklisting in miinitext.c
The DDX'es sometimes need to disable certain extensions. Instead of complex
include cascades with ifdef'ed ddx-specific include from dix code, it's
more clean to add some clear and explicit knobs set by the DDX'es individual
meson.build.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1401>
2025-02-06 16:14:03 +00:00
Enrico Weigelt, metux IT consult 584bbe9988 xfree86: parser: rename IOBASE for fixing name conflict
Resolve conflicts with OS headers definining IOBASE by renaming the
IOBASE enum value to XF86_TOKEN_IOBASE.

This way, don't need the special #undef hack anymore.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1405>
2025-02-06 16:05:00 +00:00
Enrico Weigelt, metux IT consult a1fa019012 xfree86: parser: drop obsolete token enum values
These have been forgotten on some major cleanup back almost two decades ago.
(Daniel dropped a lot of dead code, which already had been removed earlier
but merged back accidentially).

Didn't look further back on where exactly they had become obsolete - being
unused for decades should be enough justification for dropping.

Fixes: 81913a1291
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1405>
2025-02-06 16:05:00 +00:00
Enrico Weigelt, metux IT consult fb696a7d7b rename old symbol PANORAMIX to XINERAMA
PANORAMIX was the original working title of the extension, before it became
official standard. Just nobody cared about fixing the symbols to the official
naming.

For backwards compatibility with drivers, the old PANORAMIX symbol will
still be set.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1258>
2025-02-06 15:51:27 +00:00
Enrico Weigelt, metux IT consult a0326994cc config: unexport config_pre_init()
This function isn't used by any drivers/modules, so no need to export it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1360>
2025-02-06 16:24:01 +01:00
Enrico Weigelt, metux IT consult e67f2a5eb5 include: move out private definitions from hotplug.h
Public server module API shouldn't be clobbered with private definitions,
thus move them out to private header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1360>
2025-02-06 16:24:00 +01:00
Enrico Weigelt, metux IT consult dda06aff96 xfree86: common: make _xf86_get_platform_device_attrib() a real function
Doing so that struct OdevAttributes doesn't need to be exposed to
drivers anymore. It really doesn't seem to be a hot path, so not
inlining anymore shouldn't have any practical performance impact.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1360>
2025-02-06 16:22:57 +01:00
Enrico Weigelt, metux IT consult aae9bd3f62 mi: unexport SetInstalledmiColormap() macro
Not neeed by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult c3c538784a mi: unexport miExpandDirectColors()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 3cf2408232 mi: unexport miXYToWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 85be6c82b0 mi: unexport miSpriteTrace()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 6c3b432053 mi: unexport miMarkUnrealizedWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult b23ecec2f4 mi: unexport miChangeBorderWidth()
Not used by any driveres/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 597ba690d3 mi: unexport miSetShape()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult f11e203215 mi: unexport miGetLayerWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 14565a4561 mi: unexport miResizeWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult faad8ed1c6 mi: unexport miMoveWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 0624a8bad4 mi: unexport miHandleValidateExposures()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult ade6650a81 mi: unexport miMarkOverlappedWindows()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult bcbb6eec62 mi: unexport miMarkWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 3856b6cb5e mi: unexport miClearToBackground()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 7e21a514d7 mi: unexport miValidateTree()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult c2ee74c523 mi: unexport miShapedWindowIn()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult d14ae53e1f mi: unexport miCreateScreenResources()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 191cca0905 mi: unexport miSourceValidate()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult a54e8f5343 mi: unexport miPaintWindow()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult e424f49cdb mi: unexport miWindowExposures()
Not used by any modules/drivers, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 8d07450904 mi: unexport miSendExposures()
Not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 7748984e3a mi: unexport mieqSetHandler()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 964127ce10 mi: unexport mieqRemoveCallbackOnDrained()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 269d54c48f mi: unexport mieqAddCallbackOnDrained()
Not used by any modules/drivers, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 9aa23b6abd mi: unexport mieqProcessInputEvents()
Not used by any drivers/modules, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 0f7770bce3 mi: unexport mieqProcessDeviceEvent()
Not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 413e6ed2c8 mi: unexport mieqSwitchScreen()
Not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 9dd280607f mi: unexport mieqEnqueue()
Not used by any (known) drivers, so no need to keep it exported.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 4742790351 mi: unexport mieqFini()
Not used by any driver/module, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 5ac361cce9 mi: unexport mieqInit()
Not used by any drivers/modules so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 8a6bbc80f3 mi: unexport miStepDash()
Not used by any module/driver, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult aaaa0a35e5 mi: unexport miWideArc()
It's not used by any modules/drivers, so no need to keep it public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 12c507cd1f mi: make CopyGetMasterEvent() static
It's not used outside mieq.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 6dbb957922 mi: make miRecolorCursor() static
It's only used inside mipointer.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1727>
2025-02-06 16:45:20 +02:00
Enrico Weigelt, metux IT consult 471147d4b9 mi: unexport miPointerPrivKeyRec
Not used by any (known) driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult 8ca88b8f75 mi: unexport miPointerUpdateSprite()
Not used by any (known) drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult 4933780f28 mi: unexport miPointerInvalidateSprite()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult fdd509f345 mi: unexport miPointerUpdateSprite()
Not used by any (known) driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult 64cd343569 mi: unexport miPointerSetScreen()
Not used by any (known) drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult 6c04f94f3b mi: unexport miPointerWarpCursor()
Not used by any known drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult 44c2e08877 mi: unexport miPointerInitialize()
It's not used by any drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1505>
2025-02-06 14:38:05 +00:00
Enrico Weigelt, metux IT consult c8daf76c3e glx: drop obsolete warnings on files being generated
These files haven't been auto-generated, but instead manually changed for
at least over a decade now, so these warnings have become wrong.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1728>
2025-02-06 14:29:54 +00:00
Enrico Weigelt, metux IT consult 2d8af9cc5e glx: drop obsolete glxbyteorder.h
It's just a local header, doing nothing more than including misc.h,
so we can just include misc.h directly and drop glxbyteorder.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1728>
2025-02-06 14:29:54 +00:00
Olivier Fourdan e8784b7d89 xwayland/glamor: Disable GLAMOR after GBM cleanup
The cleanup function for GBM is called on the various error paths.

Once xwl_glamor_gbm_cleanup() has been called, GBM support is no longer
usable (and the corresponding data structures are freed), so there is
no way we can keep using GLAMOR after that point.

Make sure to explicitly disable GLAMOR support in that case, so we do
not crash later on trying to use GBM.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1768>
2025-02-04 11:46:25 +01:00
Michel Dänzer b27b5cd5f3 xwayland/glamor: Clean-up GBM's screen private on failure
If we bail out initializing GBM glamor backend, the screen private for
the GBM backend may remain, pointing at freed memory.

To avoid that issue, make sure to clear up the screen's private for the
GBM backend.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1785
Signed-off-by: Michel Dänzer <michel@daenzer.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1768>
2025-02-04 11:45:56 +01:00
Julian Orth 45c1d22ff6 xwayland: Don't run key behaviors and actions
Consider the following keymap:

```xkb
xkb_keymap {
    xkb_keycodes {
        <compose> = 135;
    };
    xkb_symbols {
        key <compose> {
            [ SetGroup(group = +1) ]
        };
    };
};
```

When the user presses the compose key, the following happens:

1. The compositor forwards the key to Xwayland.
2. Xwayland executes the SetGroup action and sets the base_group to 1
   and the effective group to 1.
3. The compositor updates its own state and sends the effective group,
   1, to Xwayland.
4. Xwayland sets the locked group to 1 and the effective group to
   1 + 1 = 2.

This is wrong since pressing compose should set the effective group to 1
but to X applications the effective group appears to be 2.

This commit makes it so that Xwayland completely ignores the key
behaviors and actions of the keymap and only updates the modifier and
group components in response to the wayland modifiers events.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1758>
2025-02-03 05:37:48 +00:00
Julian Orth 8d9184db5f xwayland: copy repeat settings from the compositor map
Previously the repeat settings sent by the compositor were completely
ignored.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1759>
2025-01-28 15:32:20 +01:00
Alan Coopersmith 6cc358dfb4 os: if inet_ntop() is available, use it for IPv4 addresses as well
Support for using inet_ntop() was originally added to support IPv6,
and only used for IPv6 addresses in AuthAudit().  Two decades later,
support for inet_ntop() is ubiquitous and OS'es have marked inet_ntoa()
as deprecated, so use the modern interface for IPv4 as well now.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1760>
2025-01-27 22:34:51 +00:00
Alan Coopersmith 2ffe0f8a35 os: if getaddrinfo() is available, use it, even if IPv6 support is disabled
Support for using getaddrinfo() was originally added to support IPv6,
and only used if IPv6 support was enabled.  Two decades later, support
for getaddrinfo() is ubiquitous and OS'es have marked gethostbyname()
as deprecated, so use the modern interface whenever we can now.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1760>
2025-01-27 22:34:51 +00:00
Pierre-Eric Pelloux-Prayer 5397854877 glamor: reject configs using unsupported rgbBits size
The supported color depths is a hardcoded list for now, so we
need to honor the value exposed there otherwise we'll get
inconsistencies between what glXGetFBConfigs and XListDepths
report to applications.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1764>
2025-01-21 09:16:52 +00:00
Pierre-Eric Pelloux-Prayer 83b13387ab glamor: use gbm_format_for_depth instead of open-coding it
This way glamor_back_pixmap_from_fd deals with the same depth
values as glamor_pixmap_from_fds.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1764>
2025-01-21 09:16:52 +00:00
Pierre-Eric Pelloux-Prayer 87afcc7699 glamor: return the result of gbm_format_for_depth
This way the caller knows if the conversion failed.
While at it, check for width/height at the same time.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1764>
2025-01-21 09:16:52 +00:00
Olivier Fourdan 080fb49eff os/connection: Make sure partial is initialized
Following the change in Xtrans 1.5 that allows for partial connections
to succeed, we need to make sure partial is properly initialized at
first, otherwise we rely on an uninitialized variable.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Suggested-by: Twaik Yont <twaikyont@gmail.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1783
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1765>
2025-01-17 08:24:19 +00:00
Olivier Fourdan 92bcebfd7e xkb: Always use MAP_LENGTH keymap size
Generating the modifier modmap, the helper function generate_modkeymap()
would check the entire range up to the MAP_LENGTH.

However, the given keymap might have less keycodes than MAP_LENGTH, in
which case we would go beyond the size of the modmap, as reported by
ASAN:

==ERROR: AddressSanitizer: heap-buffer-overflow
READ of size 1 at 0x5110001c225b thread T0
    #0 0x5e7369393873 in generate_modkeymap ../dix/inpututils.c:309
    #1 0x5e736930dcce in ProcGetModifierMapping ../dix/devices.c:1794
    #2 0x5e7369336489 in Dispatch ../dix/dispatch.c:550
    #3 0x5e736934407d in dix_main ../dix/main.c:275
    #5 0x7e46d47b2ecb in __libc_start_main
    #6 0x5e73691be324 in _start (xserver/build/hw/xwayland/Xwayland)

Address is located 0 bytes after 219-byte region
allocated by thread T0 here:
    #0 0x7e46d4cfc542 in realloc
    #1 0x5e73695aa90e in _XkbCopyClientMap ../xkb/xkbUtils.c:1142
    #2 0x5e73695aa90e in XkbCopyKeymap ../xkb/xkbUtils.c:1966
    #3 0x5e73695b1b2f in XkbDeviceApplyKeymap ../xkb/xkbUtils.c:2023
    #4 0x5e73691c6c18 in keyboard_handle_keymap ../hw/xwayland/xwayland-input.c:1194

As MAP_LENGTH is used in various code paths where the max keycode might
not be easily available, best is to always use MAP_LENGTH to allocate the
keymaps so that the code never run past the buffer size.

If the max key code is smaller than the MAP_LENGTH limit, fill-in the gap
with zeros.

That also simplifies the code slightly as we do not constantly need to
reallocate the keymap to adjust to the max key code size.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1780
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1762>
2025-01-13 11:44:11 +01:00
Olivier Fourdan 8707d2835c xwayland: Do not keep the cursor's pixmap around
Currently, Xwayland creates a pixmap backed by shared memory buffer as
soon as an X11 cursor is realized, which is destroyed when the cursor is
eventually unrealized.

If an X11 client is leaking cursors, Xwayland will be creating new
pixmaps continuously, which will eventually cause an error once the
limit is reached, and get Xwayland killed.

However, we do not need the shared memory buffer to stay around, we
already have the buffer retention mechanism which will take care of
keeping the buffer around until the Wayland compositor is done with it,
so we could just create and destroy the pixmap as needed when setting
the cursor.

That would not fix the leak in the X11 application, yet that would
mitigate the risk of Xwayland being killed by reaching the shared memory
limits, until the client itself reaches the limit of X11 resources.

v2: Don't increase the pixmap refcnt to destroy it just after (Michel)

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Suggested-by: Michel Dänzer <michel@daenzer.net>
See-also: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1773
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1754>
2024-12-20 09:29:03 +01:00
Matt Turner bdacb100bf hw/xfree86: Fix -Wincompatible-pointer-types sbus compile failure
```
../hw/xfree86/common/xf86sbusBus.c: In function ‘xf86SbusConfigureNewDev’:
../hw/xfree86/common/xf86sbusBus.c:751:21: error: passing argument 1 of ‘XNFasprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
  751 |         XNFasprintf(&GDev->busID, "SBUS:%s", promPath);
      |                     ^~~~~~~~~~~~
      |                     |
      |                     const char **
```

Apply the same fix as in commit e1e01d2e3 ("xfree86/common: Warning
fixes. Mostly const string handling.")

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1751>
2024-12-16 22:41:47 -05:00
Matt Turner 00a96cd82a hw/xfree86: Fix -Wmissing-prototypes warnings
None of these functions are used elsewhere in the Xserver nor in any of
the xf86-video-sun* DDXs.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1751>
2024-12-16 22:41:04 -05:00
Peter Hutterer 298c5dcb02 Ignore the coding style change commit during git blame
git supports ignoring specific revs during git blame, configured via

  $ git config blame.ignoreRevsFile .git-blame-ignore-revs

Let's make this easier for developers to set up, starting with the
one massive coding style change commit.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1748>
2024-12-06 09:55:53 +10:00
Olivier Fourdan e4804d11e8 xwayland: Add xdg-system-bell support
For the Wayland compositors who do not implement XkbBellNotifyMask but
support the Wayland protocol xdg-system-bell, use that to ring the
bell.

v2: Be more selective on the device, make sure it's a keyboard and it
    has core events.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1742>
2024-12-02 08:55:34 +00:00
Olivier Fourdan 1ccc19d1df build: Bump wayland-protocols requirement to 1.38
To get xdg-system-bell-v1 protocol.

This is just preparation work for the next commits.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1742>
2024-12-02 08:55:34 +00:00
Olivier Fourdan a55ed3309b ci: Install wayland-protocols 1.38
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1742>
2024-12-02 08:55:34 +00:00
Olivier Fourdan d98b36461a ci: Check for DDXen to be built
Add a script in CI to check for the mere presence of the expected DDXen
to be built.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1743>
2024-11-19 09:19:15 +01:00
Olivier Fourdan fbedb9b12b ci: Force build of default DDXen in the default target
If any dependency that a DDX requires is missing, the build of the DDX
will be automatically disabled, and the CI check will succeed.

We want the build to fail if any of the expected DDX cannot be built in
the CI, so let's force-enable them at build time.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>

v2: Use a variable for the DDX build args (Peter Hutterer
    <peter.hutterer@who-t.net>)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1743>
2024-11-19 09:19:15 +01:00
Alan Coopersmith cac0d08102 Revert "xfree86: os-support: move CONSOLE_X_BELL into bsd_bell.c"
This reverts commit 8958a99c02.
It broke the build of the xf86-input-keyboard driver, which relies
on CONSOLE_X_BELL in src/bsd_kbd.c.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1741>
2024-11-13 16:47:52 -08:00
Alan Coopersmith 5268fbd7cf xkbtext_priv.h: fix typo in header guard definition
Found by clang 13.0.1:

../xkb/xkbtext_priv.h:5:9: warning: '_XSERVER_XKB_XKBTEXT_PRIV_H' is used
 as a header guard here, followed by #define of a different macro
 [-Wheader-guard]
#ifndef _XSERVER_XKB_XKBTEXT_PRIV_H
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../xkb/xkbtext_priv.h:6:9: note: '_XSERVER_XKB_XKBTEXt_PRIV_H' is defined
 here; did you mean '_XSERVER_XKB_XKBTEXT_PRIV_H'?
#define _XSERVER_XKB_XKBTEXt_PRIV_H
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
        _XSERVER_XKB_XKBTEXT_PRIV_H

Fixes: 434044cb0 ("xkb: unexport functions from xkbtext.c")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1740>
2024-11-10 12:51:10 -08:00
Sérgio Basto 4cd7e2e819 Revert "fb: Declare wfbFinishScreenInit, wfbScreenInit for !FB_ACCESS_WRAPPER"
This reverts commit 34a430a16e

Signed-off-by: Sérgio M. Basto <sergio@serjux.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1720>
2024-11-08 17:42:09 +00:00
Michel Dänzer 8c4b137237 xwayland: Always decrement expecting_event in xwl_output_create
If we bail without decrementing it, xwl_screen_init will keep waiting
indefinitely for an event which never arrives.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1739>
2024-11-05 09:28:46 +00:00
Michel Dänzer 375c35a5e4 xwayland/glamor: Drop expecting_event bailing from xwl_drm_handle_device
If we bail without decrementing xwl_screen->expecting_event,
xwl_screen_init will keep waiting indefinitely for an event which never
arrives.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1648
Fixes: 2f113d68f6 ("xwayland: Add glamor and DRI3 support")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1739>
2024-11-05 09:28:46 +00:00
Alan Coopersmith a1b5aa5a7f dix-config.h: add HAVE_SOCKLEN_T definition
Needed to build with IPv6 disabled using gcc 14 on some platforms to avoid:

In file included from /usr/X11/include/X11/Xtrans/transport.c:67,
                 from xstrans.c:17:
/usr/X11/include/X11/Xtrans/Xtranssock.c: In function ‘_XSERVTransSocketOpen’:
/usr/X11/include/X11/Xtrans/Xtranssock.c:467:28: error: passing argument 5
 of ‘getsockopt’ from incompatible pointer type [-Wincompatible-pointer-types]
  467 |             (char *) &val, &len) == 0 && val < 64 * 1024)
      |                            ^~~~
      |                            |
      |                            size_t * {aka long unsigned int *}

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1736>
2024-10-30 12:26:58 -07:00
Michel Dänzer 56ba0b2a5f xwayland/present: Check allow_commits in xwl_present_flip
We're not supposed to call wl_surface_commit while
xwl_window->allow_commits is false. Bailing results in falling back to
a copy.

Noticed by inspection while looking into an issue which turned out to be
due to something else.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1764
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1732>
2024-10-30 10:56:31 +00:00
Matthieu Herrb 85b7765714 xkb: Fix buffer overflow in _XkbSetCompatMap()
The _XkbSetCompatMap() function attempts to resize the `sym_interpret`
buffer.

However, It didn't update its size properly. It updated `num_si` only,
without updating `size_si`.

This may lead to local privilege escalation if the server is run as root
or remote code execution (e.g. x11 over ssh).

CVE-2024-9632, ZDI-CAN-24756

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1733>
2024-10-29 14:41:59 +01:00
Alan Coopersmith bf63d9b34e modesetting: avoid memory leak when ms_present_check_unflip() returns FALSE
Found by Oracle Parfait 13.3 static analyzer:
   Memory leak [memory-leak]:
      Memory leak of pointer event allocated with calloc(1, 16)
        at line 470 of hw/xfree86/drivers/modesetting/present.c in
	function 'ms_present_unflip'.
          event allocated at line 431 with calloc(1, 16)
          event leaks when ms_present_check_unflip(...) == 0 at line 438
              and i >= config->num_crtc at line 445

Fixes: 13c7d53df ("modesetting: Implement page flipping support for Present.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-28 05:38:25 +00:00
Alan Coopersmith b65eea43dd dix: limit checks to MAX_VALUATORS when generating Xi events
Previously, it was looping through sizeof(ev->valuators.mask) * 8
valuators, where valuators.mask is defined as an array of
(MAX_VALUATORS + 7) / 8 entries.  Since MAX_VALUATORS is defined as 36,
this made it actually loop through 40 entries.  The last 4 bits in this
array should never be set, so we should never access memory outside the
bounds of the arrays defined to be exactly MAX_VALUATORS in length, but
we can make the static analyzer happier and not waste time checking bits
that should never be set.

Found by Oracle Parfait 13.3 static analyzer:

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 741 of dix/eventconvert.c in function 'eventToDeviceEvent'.

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 808 of dix/eventconvert.c in function 'eventToRawEvent'.

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data_raw[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 809 of dix/eventconvert.c in function 'eventToRawEvent'.

Fixes: b2ba77bac ("dix: add EventToXI2 and GetXI2Type.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-28 05:38:25 +00:00
Alan Coopersmith 4b073d65bb dix: fix button offset when generating DeviceButtonStateNotify events
Found by Oracle Parfait 13.3 static analyzer:
   Buffer Overflow in STD C function [buffer-overflow-call-stdc]:
      Buffer overflow in call to memcpy. Buffer &bev->buttons[4] of
       size 24 is written at an offset of 28
      Array size is 28 bytes, index is 32
        at line 743 of dix/enterleave.c in function
	 'DeliverStateNotifyEvent'.

Fixes: a85f0d6b9 ("Xi: fix use of button->down - bitflags instead of int arrays.")
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-28 05:38:25 +00:00
Alan Coopersmith 7af077dd2f render: avoid NULL pointer dereference if PictureFindVisual returns NULL
Found by Oracle Parfait 13.3:
   Null pointer dereference [null-pointer-deref]:
      Read from null pointer pVisual
        at line 257 of dix/colormap.c in function 'CreateColormap'.
          Null pointer introduced at line 412 of render/picture.c in
	   function 'PictureFindVisual'.
          Constant 'NULL' passed into function CreateColormap, argument
	   pVisual, from call at line 431 in function
	   'PictureInitIndexedFormat'.
          Function PictureFindVisual may return constant 'NULL' at
	   line 412, called at line 429.

Fixes: d4a101d4e ("Integration of DAMAGE-XFIXES branch to trunk")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-28 05:38:25 +00:00
Alan Coopersmith d10589cc09 Xi: avoid NULL pointer dereference if GetXTestDevice returns NULL
The comments in that function say "This only happens if master is a
slave device. don't do that" but static analysis doesn't respect that.

Found by Oracle Parfait 13.3:
   Null pointer dereference [null-pointer-deref]:
      Read from null pointer XTestptr
        at line 274 of Xi/xichangehierarchy.c in function 'remove_master'.
          Null pointer introduced at line 691 of Xext/xtest.c in function
	   'GetXTestDevice'.
          Function GetXTestDevice may return constant 'NULL' at line 691,
	   called at line 273 of Xi/xichangehierarchy.c in function
	   'remove_master'.
   Null pointer dereference [null-pointer-deref]:
      Read from null pointer XTestkeybd
        at line 279 of Xi/xichangehierarchy.c in function 'remove_master'.
          Null pointer introduced at line 691 of Xext/xtest.c in function
	   'GetXTestDevice'.
          Function GetXTestDevice may return constant 'NULL' at line 691,
	   called at line 278 of Xi/xichangehierarchy.c in function
	   'remove_master'.

Fixes: 0814f511d ("input: store the master device's ID in the devPrivate for XTest devices.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-28 05:38:25 +00:00
Alan Coopersmith fa711c486a xfree86: avoid memory leak on realloc failure
Found by Oracle Parfait 13.3 static analyzer:
   Memory leak [memory-leak]:
      Memory leak of pointer optname allocated with asprintf(&optname,
      "\"%s\"", p->name)
        at line 326 of hw/xfree86/common/xf86Configure.c in function
	'configureDeviceSection'.
          optname allocated at line 309 with asprintf(&optname, "\"%s\"",
	  p->name)

Fixes: code inherited from XFree86
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-28 05:38:25 +00:00
Alan Coopersmith 45c485bfdf dix: Use __builtin_popcountl if available to replace Ones()
If the compiler knows of a better algorithm for counting the number of
bits set in a word for the target CPU, let it use that, instead of the
classic algorithm optimized for PDP-6.

Based on xorg/lib/libxext@490a25e6f8a4d2482af4364c700b68ad11a4d10b

v2: make old version static inline, stop exporting after !1695

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1674>
2024-10-26 10:04:13 -07:00
Enrico Weigelt, metux IT consult 1642adec3b dix: unexport Ones()
It's not used by any module/driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1695>
2024-10-26 16:35:57 +00:00
Michel Dänzer 91b5a003a5 xwayland/glamor/gbm: Don't close fence_fd after xwl_glamor_wait_fence
eglCreateSyncKHR takes ownership of the file descriptor. Noticed by
inspection.

While we're at it, move the fence_fd declaration to the scope where
it's used.

Last but not least, close the fd in xwl_glamor_wait_fence when bailing
before calling eglCreateSyncKHR, and document that it takes ownership.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1712>
2024-10-22 16:26:09 +00:00
Alan Coopersmith b306df5a60 os: NextDPMSTimeout: mark intentional fallthroughs in switch
The comment at the top of the function tells humans the fallthroughs
are intentional, but gcc doesn't parse that.

Clears 3 -Wimplicit-fallthrough warnings from gcc 14.1

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1716>
2024-10-11 22:20:16 +00:00
YaoBing Xiao e12d9863fd xwayland: prevent potential null pointer dereference
Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1718>
2024-10-11 10:00:39 +08:00
Tj 728b54528d xfree86: fbdevhw: fix pci detection on recent Linux
Linux kernel v6.9 has changed the symlink to point to the parent device. This
breaks fbdev_open() detection logic. Change it to use the subsystem symlink
instead which will remain stable.

Kernel v6.8:

[    14.067] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[    14.067] (II) fbdev_open() buf=../../devices/platform/vesa-framebuffer.0/graphics/fb0

Kernel v6.9:

[    15.609] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[    15.609] (II) fbdev_open() buf=../../devices/pci0000:00/0000:00:01.0/vesa-framebuffer.0/graphics/fb0

Originally found in automated Debian ISO QA testing [0] and confirmed in Linux [1].

Tested on kernels v6.9.7 and v6.8.12

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075713
[1] https://lore.kernel.org/lkml/lLyvPFC_APGHNfyGNHRpQy5izBikkaTPOpHooZIT3fFAoJPquSI31ZMueA99XTdr8ysir3X7O7IMdc6za-0m79vr_claeparHhoRouVgHOI=@proton.me/

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1714
Signed-off-by: Tj <tj.iam.tj@proton.me>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1612>
2024-10-10 21:32:46 +00:00
Enrico Weigelt, metux IT consult a136ce3d57 xfre86: drop xf86Msg() in favor of LogMessageVerb()
This function is doing the same like LogMessageVerb(), so no need to keep
around a duplicate implementation. Leaving it as a macro, until all callers,
also in drivers, have been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1679>
2024-10-10 21:16:26 +00:00
Enrico Weigelt, metux IT consult 14767eccc0 xfree86: drop xf86MsgVerb() in favor of LogMessageVerb()
This function is doing the same like LogMessageVerb(), so no need to keep
around a duplicate implementation. Leaving it as a macro, until all callers,
also in drivers, have been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1679>
2024-10-10 21:16:26 +00:00
Enrico Weigelt, metux IT consult b87314c876 randr: fix wrong call to RRGetScreenResources() in swapped case
ProcRRGetScreenResources() vs. RRGetScreenResourcesCurrent() have different
semantics - this also must be followed in byte-swapped case.

Fixes: fc70839431 - Add server support for RRGetScreenResourcesCurrent
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1630>
2024-10-10 20:59:35 +00:00
Enrico Weigelt, metux IT consult 73cf8d3560 xfree86: dri: unexport DRIDestroyWindow() and make it static
This function is only called inside dri.c, not used by any drivers
(and wouldn't make sense to do so), so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1713>
2024-10-10 20:42:23 +00:00
Enrico Weigelt, metux IT consult 9323ba6fed xwin: fix memleak on freeing pixmaps
Xwin's DestroyPixmap proc just free()s the PixmapRec directly, w/o catering
for devPrivate's, so leaving a memleak. The correct DIX function for this
is FreePixmap().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1710>
2024-10-10 20:27:11 +00:00
Enrico Weigelt, metux IT consult 33a4250157 xvmc: unexport XvMCFindXvImage()
It's not needed by any driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1694>
2024-10-10 19:59:48 +00:00
Enrico Weigelt, metux IT consult f65520c4a7 Xext: xvmc: drop unused XvMCScreenInitProc
This pointer field isn't used anywhere, neither in Xorg nor in drivers.
No need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1692>
2024-10-10 19:25:15 +00:00
Enrico Weigelt, metux IT consult 6625cc14df pseudoramix: replace PseudoramiXTrace & PseudoramiXDebug by LogMessageVerb
Since we're only going through macros (that are calling these), this extra
wrapper function isn't needed at all - using LogMessageVerb() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1689>
2024-10-10 18:59:40 +00:00
Enrico Weigelt, metux IT consult e8c4857938 xfree86: unexport xf86SetVerbosity() and xf86SetLogVerbosity()
These aren't used by any modules/drivers, so no need to keep them exported.
Also drop the return value, which isn't used by any caller.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1687>
2024-10-10 18:25:54 +00:00
Enrico Weigelt, metux IT consult 27a5c59180 os: drop redefining getpid() on mingw32
mingw32 does does have getpid() function, so conditionally redefining
it to _getpid() isn't necessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1686>
2024-10-10 17:55:56 +00:00
Enrico Weigelt, metux IT consult e5b5b302d3 os: replace LogVWrite() by LogVMessageVerb()
It's just a wrapper around LogVMessageVerb() and no external module
using it, so can easily be optimized-away.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1683>
2024-10-10 17:34:12 +00:00
Enrico Weigelt, metux IT consult c26023a009 os: replace LogWrite() by LogMessageVerb()
It's nothing but a wrapper, doing the same as LogMessageVerb(X_NONE, ...),
and no external module / driver needs it, so can be easily optimized away.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1683>
2024-10-10 17:34:12 +00:00
Enrico Weigelt, metux IT consult 37446b70de os.h: drop unnecessary guard on stdlib.h include
It's a standard C header, that's always present, so no extra guard needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1684>
2024-10-10 17:16:00 +00:00
Enrico Weigelt, metux IT consult d43d346541 os: log: use localtime_r() on mingw builds
MingW also provides localtime_r(), but needs _POSIX_THREAD_SAFE_FUNCTIONS
symbol before including anything, in order for the prototype being defined.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1685>
2024-10-10 16:58:01 +00:00
Enrico Weigelt, metux IT consult 78d420870f xquartz: drop unused code
These code pieces have been commented out since their introduction back
almost two decades ago, so probably no need for them anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1603>
2024-10-10 16:42:38 +00:00
Enrico Weigelt, metux IT consult 886c282242 swapreq.h: drop SWAPREQ_PROC
This macro doesn't do anything more than just making the function declarations
a few bytes smaller, but this makes the code harder to read (eg. when just
grepping through the code base).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1609>
2024-10-10 16:10:32 +00:00
Enrico Weigelt, metux IT consult e97adda52d xfree86: modesetting: merge FreeRec() into FreeScreen()
No need to have one function doing nothing more than calling another one
with the same prototype.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1611>
2024-10-10 15:47:51 +00:00
Enrico Weigelt, metux IT consult bd40e9f836 xfree86: os-support: move including machine/sysarch.h out of public header
The only consumer seems to be one BSD specific file, the few drivers using
the *_iopl seem to include it on their own. Thus, no need to keep it in
public headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
2024-10-10 15:12:22 +00:00
Enrico Weigelt, metux IT consult 4d677fab46 xfree86: os-support: move CONSOLE_X_TV_ON/OFF to i386_video.c
These are only used in i386_video.c, so move them there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
2024-10-10 15:12:22 +00:00
Enrico Weigelt, metux IT consult 758bee502d xfree86: os-support: move CONSOLE_X_MODE_ON/OFF to bsd_init.c
These are only used in bsd_init.c, so move them there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
2024-10-10 15:12:22 +00:00
Enrico Weigelt, metux IT consult 8958a99c02 xfree86: os-support: move CONSOLE_X_BELL into bsd_bell.c
This define is only used inside bsd_bell.c, so move it there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
2024-10-10 15:12:22 +00:00
Enrico Weigelt, metux IT consult d7e0d174a5 xfree86: os-support: drop unused CONSOLE_GET_* defines
These don't seem to be used anywhere, so we can drop them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
2024-10-10 15:12:22 +00:00
Enrico Weigelt, metux IT consult 0560cb35ce xfree86. os-support: drop obsolete XMODE_* defines
These only had been used by xf86-video-chips, but meanwhile this
defines them on it's own, so we can drop them from here now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1420>
2024-10-10 15:12:22 +00:00
Enrico Weigelt, metux IT consult 91a67c7fcc mi: misprite.h: drop unnecessary extern on functions
By C standard, functions are always extern if not specified otherwise.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1501>
2024-10-10 14:44:52 +00:00
Enrico Weigelt, metux IT consult 9432106b30 xkb: drop unused variable extDevReason
fix warning on unused variable:

> ../xkb/xkb.c:3576:18: warning: variable 'extDevReason' set but not used [-Wunused-but-set-variable]
>     unsigned int extDevReason;
                 ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1426>
2024-10-10 14:25:41 +00:00
Enrico Weigelt, metux IT consult e79dfb87e9 xkb: xkbInit: fix char signess mismatch
On NetBSD gives warning:

../xkb/xkbInit.c: In function ‘XkbProcessArguments’:
../xkb/xkbInit.c:778:57: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  778 |             if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                         ^
../xkb/xkbInit.c:782:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  782 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
../xkb/xkbInit.c:792:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  792 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
../xkb/xkbInit.c:799:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  799 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 02be87b880 xkb: xkbtext: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../xkb/xkbtext.c:32:
../xkb/xkbtext.c: In function ‘XkbAtomText’:
../xkb/xkbtext.c:94:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   94 |             if ((tmp == rtrn) && (!isalpha(*tmp)))
      |                                            ^
../xkb/xkbtext.c:96:31: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   96 |             else if (!isalnum(*tmp))
      |                               ^
../xkb/xkbtext.c: In function ‘XkbIMWhichStateMaskText’:
../xkb/xkbtext.c:470:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  470 |                 buf[len + 9] = toupper(buf[len + 9]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbControlsMaskText’:
../xkb/xkbtext.c:532:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  532 |                 buf[len + 3] = toupper(buf[len + 3]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbStringText’:
../xkb/xkbtext.c:563:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  563 |         if (!isprint(*in)) {
      |                      ^
../xkb/xkbtext.c:584:21: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  584 |         if (isprint(*in))
      |                     ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult bb9953db3f os: utils: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/utils.c:75:
../os/utils.c: In function ‘VerifyDisplayName’:
../os/utils.c:624:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  624 |         if (!isdigit(d[i])) {
      |                       ^
../os/utils.c: In function ‘ProcessCommandLine’:
../os/utils.c:942:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  942 |             if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
      |                                            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 9446ae487c os: access: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/access.c:96:
../os/access.c: In function ‘ResetHosts’:
../os/access.c:981:49: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  981 |                 lhostname[i] = tolower(ohostname[i]);
      |                                                 ^

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 3b99837b78 xfree86: parser: scan: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/parser/scan.c:58:
../hw/xfree86/parser/scan.c: In function ‘xf86getToken’:
../hw/xfree86/parser/scan.c:343:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  343 |         else if ((c == ',') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c:346:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  346 |         else if ((c == '-') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c: In function ‘xf86nameCompare’:
../hw/xfree86/parser/scan.c:1031:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                   ^
../hw/xfree86/parser/scan.c:1031:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                  ^
../hw/xfree86/parser/scan.c:1032:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                   ^
../hw/xfree86/parser/scan.c:1032:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                  ^
../hw/xfree86/parser/scan.c:1042:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                       ^
../hw/xfree86/parser/scan.c:1042:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                      ^
../hw/xfree86/parser/scan.c:1043:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                       ^
../hw/xfree86/parser/scan.c:1043:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 7830b007e4 xfree86: common: xf86Configure: fix char signess mismatch
On NetBSD gives warning:

../hw/xfree86/common/xf86Configure.c: In function ‘xf86AddBusDeviceToConfigure’:
../hw/xfree86/common/xf86Configure.c:125:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  125 |     for (j = 0; (lower_driver[j] = tolower(driver[j])); j++);
      |                                                  ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 43a57fc6e9 xfree86: common: xf86pciBus: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86pciBus.c:35:
../hw/xfree86/common/xf86pciBus.c: In function ‘xf86ParsePciBusString’:
../hw/xfree86/common/xf86pciBus.c:286:27: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  286 |             if (!isdigit(d[i])) {
      |                           ^
../hw/xfree86/common/xf86pciBus.c:293:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  293 |         if (!isdigit(p[i])) {
      |                       ^
../hw/xfree86/common/xf86pciBus.c:307:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  307 |         if (!isdigit(p[i])) {
      |                       ^
../hw/xfree86/common/xf86pciBus.c:320:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  320 |         if (!isdigit(p[i])) {
      |                       ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 1f861bbb9d xfree86: common: xf86Option: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86Option.c:39:
../hw/xfree86/common/xf86Option.c: In function ‘xf86NormalizeName’:
../hw/xfree86/common/xf86Option.c:915:25: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  915 |             if (isupper(*p))
      |                         ^
../hw/xfree86/common/xf86Option.c:916:32: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  916 |                 *q++ = tolower(*p);
      |                                ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 99017bf948 xfree86: common: xf86Bus: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86Bus.c:36:
../hw/xfree86/common/xf86Bus.c: In function ‘StringToBusType’:
../hw/xfree86/common/xf86Bus.c:270:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  270 |     if (isdigit(busID[0])) {
      |                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
2024-10-10 13:56:05 +00:00
Enrico Weigelt, metux IT consult 84be5b4e9c dix: unexport non-public functions from dixgrabs.h and document prototypes
* unexport functions from dixgrab.h, that aren't used by any driver/module.
* add paremeter names to prototypes
* add doxygen-style documentation for all the prototypes

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:50:57 +00:00
Enrico Weigelt, metux IT consult e7c225aef6 dix: CreateGrab() rename "type" parameter to "eventType"
Make it clear what exactly this parameter is for.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:50:57 +00:00
Enrico Weigelt, metux IT consult 48cee2fd22 dix: make FreeGrab() NULL tolerant
Allow NULL parameters to be passed to FreeGrab(), so callers don't all
need to check on their own anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:50:57 +00:00
Enrico Weigelt, metux IT consult 93856053b7 dix: make CopyGrab() static
This function is only called once in the same source file, no external callers
at all. So, it doesn't need to be visible outside that file, and we can allow
the compiler to do whatever fancy optimizations it might wanna do.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:50:57 +00:00
Enrico Weigelt, metux IT consult bd8d3455fb os: don't include client.h anymore
There's no need to include client.h anymore. But still leaving it, in case
some external consumer relying on it's presence.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult 1891a8dc14 os: unexport client id retrieval functions
These aren't used by any (known) external modules, thus no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult ed3c2aeeb1 os: unexport DetermineClientPid() and DetermineClientCmd()
These aren't used by any drivers/modules, so no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult 7ac7a2d6de os: split off internal definitions from client.h
The client.h file is part of the public module API, but it also contains
definitions that aren't useful for being used in modules. Splitting them
out into their own client_priv.h file, which isn't part of the API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:45:29 +00:00
Enrico Weigelt, metux IT consult a917f6a8a8 drop obsolete HAVE_DIX_CONFIG_H
The symbol controls whether to include dix-config.h, and it's always set,
thus we don't need it (and dozens of ifdef's) anymore.

This commit only removes them from our own source files, where we can
guarantee that dix-config.h is present - leaving the (potentially exported)
headers untouched.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:38:31 +00:00
Enrico Weigelt, metux IT consult 4cac1ee46d dix: drop unnecessary check on HAVE_DIX_CONFIG_H
The dix-config.h include file is always present, so no need for
an extra check and conditional include.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:38:31 +00:00
Enrico Weigelt, metux IT consult 313334ec28 Xnest: drop obsolete ifdef HAVE_XNEST_CONFIG_H
These files are always compiled w/ HAVE_XNEST_CONFIG_H and always
need to include this file, so the ifdef can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:38:31 +00:00
Enrico Weigelt, metux IT consult 79ad940021 os: log: drop unncessary HAVE_DIX_CONFIG
It's always defined and dix-config.h is always present, so need for the
extra check.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1680>
2024-10-09 00:01:18 +00:00
Enrico Weigelt, metux IT consult 2a959a27df os: log: drop unnecessary ifdef's
The #ifdef's for log prefix defines aren't needed, so drop them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1680>
2024-10-09 00:01:18 +00:00
Michel Dänzer 23dde0860c xwayland/present: Update surface window again if manual redirect fails
Even if the manual redirect didn't result in the surface window we
wanted, it might be different again without the redirect.

I don't know of any specific scenario hitting this though, it's more of
a theoretical safeguard.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1637>
2024-10-02 08:02:03 +00:00
Michel Dänzer e6c649e6e6 xwayland/glamor: Try manual redirect only if parent window has depth 32
That's the case 8e8bc0a1ef ("xwayland: Try manual redirection for
surface window in glamor_check_flip") was intended for. If the parent
window doesn't have depth 32, the automatic redirection might have been
done by a client, in which case doing the manual redirection may run
into trouble.

Fixes: 8e8bc0a1ef ("xwayland: Try manual redirection for surface window in glamor_check_flip")
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1724
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1637>
2024-10-02 08:02:03 +00:00
Mike Blumenkrantz ff8ec59c97 xwayland: connect to the wl display before calling into EGL
using EGL (e.g., eglQueryString, epoxy_has_egl_extension)
before establishing this connection
enables the GBM/EGL implementation to potentially consume the
WAYLAND_SOCKET fd, which, if closed, will cause the compositor
to kill this xserver

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1646>
2024-09-24 08:07:39 +00:00
Olivier Fourdan 57a446c0f9 os: Fix NULL pointer dereference
RemoveHost() can be called from DisableLocalHost() with a NULL client,
but doesn't actually check whether the given client pointer is valid on
error and assigns the error value unconditionally, leading to a possible
NULL pointer dereference and a crash of the Xserver.

To avoid the issue, simply check whether the client pointer is not NULL
prior to assign the errorValue.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1752
See-also: https://bugzilla.redhat.com/2313799
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1701>
2024-09-23 09:36:52 +02:00
872 changed files with 16178 additions and 34261 deletions

24
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,24 @@
# This file contains revisions to be ignored by git blame.
# These revisions are expected to be formatting-only changes.
#
# Calling `git blame --ignore-revs-file .git-blame-ignore-revs` will
# tell git blame to ignore changes made by these revisions when assigning
# assigning blame, as if the change never happened.
#
# You can enable this as a default for your local repository by running
# `git config blame.ignoreRevsFile .git-blame-ignore-revs`
# Important: if you do this, then switch to a branch without this file,
# `git blame` will fail with an error.
#
# Introduce a consistent coding style
9838b7032ea9792bec21af424c53c07078636d21
# Drop trailing whitespaces
732fd7e571b81d63aa44d6e4cf55883479e88f2f
# glamor: Apply x-indent.sh.
d84d71029ae9e462559d64eff7259e2cc7732fac
# indent fixes (OMG SO UGLY), and nuke old RCS keywords.
6d7083bd69724586338d79784655328f1fcd2ae5

View File

@ -0,0 +1,65 @@
name: 🐞 Bug report
description: Create a report to help us improve
labels: [bug, needs-triage]
#type: bug
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to help everyone identify and fix the bug. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: dropdown
id: affected-version
attributes:
label: Select the version
options:
- 25.0.0.X
- Git master branch
- other or don't know
default: 1
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe your issue
placeholder: When I did X then Y happened.
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
placeholder: |
1. Start ...
2. Do this
3. Do that
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect?
placeholder: I expected this to happen.
- type: textarea
id: environment
attributes:
label: Additional Information
description: Additional information you want to provide such as logs, system info, environment, screenshots, etc.
placeholder: |
Add any other context about the bug here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for reporting this issue! We will get back to you as soon as possible.

View File

@ -0,0 +1,49 @@
name: ✨ Feature request
description: Suggest a feature for this software
labels: [enhancement, needs-triage]
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to properly describe the new software feature you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: "Describe the feature"
placeholder: A thing in X that allows to do Y.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: "It should be implemented because"
placeholder: Doing Y is needed for Z.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: "What are the alternatives?"
placeholder: We could do A or B instead.
- type: textarea
id: context
attributes:
label: Additional context
description: Additional information you want to provide such as references to related issues or protocols, the implications on existing use cases, etc.
placeholder: |
Add any other context about the feature request here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for your suggestion! Let's see together if it can be implemented.

View File

@ -0,0 +1,50 @@
name: 🔧 Code cleanup
description: Level up the source code
labels: [code-cleanup, needs-triage]
#type: codecleanup
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to properly describe the code cleanup you are suggesting. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: "Describe the cleanup"
placeholder: C in X needs to be changed into D.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: "It should be done because"
placeholder: Having D is needed for E.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: "What are the alternatives?"
placeholder: We could do A or B instead.
- type: textarea
id: context
attributes:
label: Additional context
description: Additional information you want to provide such as implications on existing code, how to ensure API/ABI stability, which tests are needed or to be run, related issues, etc.
placeholder: |
Add any other context about the cleanup here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for looking at the source code! Let's see together how it can be improved.

View File

@ -0,0 +1,39 @@
name: 🔖 Documentation update
description: Make your mark for better documentation
labels: [documentation, needs-triage]
#type: docchange
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to help others understand our software. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: Describe the update
placeholder: These things need to be better documented.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Additional Information
description: Additional information you want to provide such as tickets related to changes in the software, affected files, screenshots, etc.
placeholder: |
Add any other context about the update here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for requesting this update! We will get back to you as soon as possible.

44
.github/ISSUE_TEMPLATE/05-org-task.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: ✅ Organizational task
description: Create a task for project organization
labels: [needs-triage, organization]
#type: task
body:
- type: markdown
attributes:
value: |
Please fill out the sections below to get organizational things done. If you have a general idea or question then please use the [discussions](https://github.com/orgs/X11Libre/discussions).
- type: textarea
id: description
attributes:
label: Describe the task
placeholder: These things need to be done.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: "It should be done because"
placeholder: Doing Y is needed for Z.
- type: textarea
id: environment
attributes:
label: Additional Information
description: Additional information you want to provide such as the context for bigger tasks, the implicatons on existing workflows, related issues, etc.
placeholder: |
Add any other context about the task here.
- type: checkboxes
id: checks
attributes:
label: Extra fields
options:
- label: I have checked the existing [issues](https://github.com/X11Libre/xserver/issues)
required: true
- label: I have read the [Contributing Guidelines](https://github.com/X11Libre/xserver/blob/master/CONTRIBUTING.md)
required: true
- label: I'd like to work on this issue
- type: markdown
attributes:
value: |
Thanks for adding this task! We will get back to you as soon as possible.

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: XLibre Community Support
url: https://github.com/orgs/X11Libre/discussions
about: Please ask and answer questions here.
- name: Mailing List
url: https://www.freelists.org/list/xlibre
about: You can join the discussions on our mailing list.

32
.github/scripts/compile-drivers.sh vendored Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -e
. .github/scripts/util.sh
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig/:$PKG_CONFIG_PATH"
export ACLOCAL_PATH="/usr/share/aclocal:/usr/local/share/aclocal"
export X11L_DRV_GIT=https://github.com/X11Libre/
mkdir -p $DRV_BUILD_DIR
cd $DRV_BUILD_DIR
build_drv_ac xf86-input-elographics $X11L_DRV_GIT/xf86-input-elographics master
build_drv_ac xf86-input-evdev $X11L_DRV_GIT/xf86-input-evdev master
build_drv_ac xf86-input-libinput $X11L_DRV_GIT/xf86-input-libinput master
build_drv_ac xf86-input-mouse $X11L_DRV_GIT/xf86-input-mouse master
build_drv_ac xf86-input-synaptics $X11L_DRV_GIT/xf86-input-synaptics master
build_drv_ac xf86-video-amdgpu $X11L_DRV_GIT/xf86-video-amdgpu xf86-video-amdgpu-23.0.0
build_drv_ac xf86-video-ati $X11L_DRV_GIT/xf86-video-ati xf86-video-ati-22.0.0
build_drv_ac xf86-video-intel $X11L_DRV_GIT/xf86-video-intel.git master
build_drv_ac xf86-video-nouveau $X11L_DRV_GIT/xf86-video-nouveau xf86-video-nouveau-1.0.18
build_drv_ac xf86-video-omap $X11L_DRV_GIT/xf86-video-omap master
build_drv_ac xf86-video-qxl $X11L_DRV_GIT/xf86-video-qxl master
build_drv_ac xf86-video-r128 $X11L_DRV_GIT/xf86-video-r128 master
build_drv_ac xf86-video-vesa $X11L_DRV_GIT/xf86-video-vesa xf86-video-vesa-2.6.0
build_drv_ac xf86-video-vmware $X11L_DRV_GIT/xf86-video-vmware xf86-video-vmware-13.4.0
# doesn't compile on Linux
# build_drv_ac xf86-input-mouse $X11L_DRV_GIT/xf86-input-mouse master
# build_drv_ac xf86-input-keyboard $X11L_DRV_GIT/xf86-input-keyboard master

13
.github/scripts/conf.sh vendored Normal file
View File

@ -0,0 +1,13 @@
export X11_OS=`uname -s`
export X11_PREFIX="${X11_PREFIX:-$HOME/x11}"
export X11_BUILD_DIR="${X11_BUILD_DIR:-$HOME/build-deps}"
export DRV_BUILD_DIR="${DRV_BUILD_DIR:-$HOME/build-drivers}"
case "$X11_OS" in
Darwin) export FDO_CI_CONCURRENT=`sysctl -n hw.logicalcpu` ;;
Linux) export FDO_CI_CONCURRENT=`nproc` ;;
esac
export PATH="$X11_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="$X11_PREFIX/lib/x86_64-linux-gnu/pkgconfig:$X11_PREFIX/lib/pkgconfig:$X11_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"

34
.github/scripts/install-prereq.sh vendored Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
. .github/scripts/util.sh
mkdir -p $X11_BUILD_DIR
cd $X11_BUILD_DIR
build_meson rendercheck https://gitlab.freedesktop.org/xorg/test/rendercheck rendercheck-1.6
if [ "$X11_OS" = "Linux" ]; then
build_meson drm https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.121 \
-Domap=enabled
fi
build_meson libxcvt https://gitlab.freedesktop.org/xorg/lib/libxcvt libxcvt-0.1.0
build_ac xorgproto https://gitlab.freedesktop.org/xorg/proto/xorgproto xorgproto-2024.1
if [ "$X11_OS" = "Linux" ]; then
build_meson wayland https://gitlab.freedesktop.org/wayland/wayland 1.21.0 \
-Dtests=false -Ddocumentation=false -Ddtd_validation=false
build_meson wayland-protocols https://gitlab.freedesktop.org/wayland/wayland-protocols 1.38
build_meson libdecor https://gitlab.freedesktop.org/libdecor/libdecor 0.1.1 \
-D{demo,install_demo}=false
build_meson libei https://gitlab.freedesktop.org/libinput/libei 1.0.0 \
-Dtests=disabled -Ddocumentation=[] -Dliboeffis=enabled
fi
if [ "$X11_OS" = "Darwin" ]; then
build_ac xset https://gitlab.freedesktop.org/xorg/app/xset xset-1.2.5
fi
build_ac_xts xts https://gitlab.freedesktop.org/xorg/test/xts master # dbbfa96c036e596346147081cbceda136e7c86c1
clone_source piglit https://gitlab.freedesktop.org/mesa/piglit main # 265896c86f90cb72e8f218ba6a3617fca8b9a1e3
echo '[xts]' > piglit/piglit.conf
echo "path=$X11_BUILD_DIR/xts" >> piglit/piglit.conf

38
.github/scripts/macos/install-pkg.sh vendored Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
set -e
brew update
brew install \
autoconf \
automake \
bdftopcf \
libapplewm \
libtool \
libx11 \
libxau \
libxaw \
libxcb \
libxdmcp \
libxext \
libxfixes \
libxfont2 \
libxkbfile \
libxi \
libxmu \
libxrender \
libxt \
libxtst \
meson \
mkfontscale \
pkgconf \
pixman \
util-macros \
xdpyinfo \
xkbcomp \
xkeyboard-config \
xtrans
pip3 install --break-system-packages \
mako

95
.github/scripts/ubuntu/install-pkg.sh vendored Executable file
View File

@ -0,0 +1,95 @@
#!/bin/bash
set -e
# Packages which are needed by this script, but not for the xserver build
EPHEMERAL="
libexpat-dev
libgles2-mesa-dev
libxkbcommon-dev
x11-utils
x11-xserver-utils
xauth
xvfb
"
apt-get update
apt-get install -y \
$EPHEMERAL \
autoconf \
automake \
build-essential \
ca-certificates \
libaudit-dev \
libbsd-dev \
libcairo2-dev \
libdbus-1-dev \
libdrm-dev \
libegl1-mesa-dev \
libepoxy-dev \
libevdev2 \
libexpat1 \
libffi-dev \
libgbm-dev \
libgcrypt-dev \
libgl1-mesa-dev \
libgles2 \
libglx-mesa0 \
libinput10 \
libinput-dev \
libnvidia-egl-wayland-dev \
libpciaccess-dev \
libpixman-1-dev \
libselinux1-dev \
libspice-protocol-dev \
libsystemd-dev \
libudev-dev \
libunwind-dev \
libx11-dev \
libx11-xcb-dev \
libxau-dev \
libxaw7-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-util0-dev \
libxcb-xf86dri0-dev \
libxcb-xkb-dev \
libxcb-xv0-dev \
libxcb1-dev \
libxdmcp-dev \
libxext-dev \
libxfixes-dev \
libxfont-dev \
libxi-dev \
libxinerama-dev \
libxkbcommon0 \
libxkbfile-dev \
libxmu-dev \
libxmuu-dev \
libxpm-dev \
libxrender-dev \
libxres-dev \
libxshmfence-dev \
libxt-dev \
libxtst-dev \
libxv-dev \
mesa-common-dev \
meson \
nettle-dev \
libpango1.0-dev \
pkg-config \
x11-xkb-utils \
xfonts-utils \
xkb-data \
xtrans-dev \
xutils-dev \
libxaw7-dev \
python3-mako

161
.github/scripts/ubuntu/remove-unused-pkg.sh vendored Executable file
View File

@ -0,0 +1,161 @@
#!/bin/bash
apt-mark auto \
7zip \
7zip-rar \
acl \
ant \
apache2 \
apache2-bin \
aria2 \
azure-cli \
brotli \
buildah \
chrony \
cifs-utils \
clang-format-16 \
clang-format-17 \
clang-format-18 \
clang-tidy-16 \
clang-tidy-17 \
clang-tidy-18 \
cloud-init \
dbus \
dotnet-sdk-8.0 \
eatmydata \
efibootmgr \
firefox \
fonts-noto-color-emoji \
gfortran \
gfortran-12 \
gfortran-13 \
gfortran-14 \
google-chrome-stable \
google-cloud-cli \
haveged \
keyutils \
kubectl \
libeatmydata1 \
libgmp-dev \
liblz4-dev \
libmysqlclient-dev \
libpq-dev \
libsqlite3-dev \
libssl-dev \
libtss2-esys-3.0.2-0t64 \
libtss2-mu-4.0.1-0t64 \
libtss2-rc0t64 \
libwrap0 \
libyaml-dev \
lsscsi \
lz4 \
mediainfo \
mercurial \
microsoft-edge-stable \
mysql-client \
mysql-server \
ncurses-base \
ncurses-bin \
ncurses-term \
nginx \
nvme-cli \
packages-microsoft-prod \
php-pear \
php8.3 \
php8.3-amqp \
php8.3-apcu \
php8.3-bcmath \
php8.3-bz2 \
php8.3-cgi \
php8.3-cli \
php8.3-common \
php8.3-curl \
php8.3-dba \
php8.3-dev \
php8.3-enchant \
php8.3-fpm \
php8.3-gd \
php8.3-gmp \
php8.3-igbinary \
php8.3-imagick \
php8.3-imap \
php8.3-interbase \
php8.3-intl \
php8.3-ldap \
php8.3-mbstring \
php8.3-memcache \
php8.3-memcached \
php8.3-mongodb \
php8.3-mysql \
php8.3-odbc \
php8.3-opcache \
php8.3-pcov \
php8.3-pgsql \
php8.3-phpdbg \
php8.3-pspell \
php8.3-readline \
php8.3-redis \
php8.3-snmp \
php8.3-soap \
php8.3-sqlite3 \
php8.3-sybase \
php8.3-tidy \
php8.3-xdebug \
php8.3-xml \
php8.3-xsl \
php8.3-yaml \
php8.3-zip \
php8.3-zmq \
pigz \
podman \
pollinate \
postgresql-16 \
powershell \
python-babel-localedata \
python3-babel \
python3-dev \
python3-jinja2 \
python3-json-pointer \
python3-jsonpatch \
python3-jsonschema \
python3-markupsafe \
python3-parted \
python3-pyrsistent \
python3-serial \
python3-six \
python3-tz \
python3-venv \
rpm \
ruby-full \
session-manager-plugin \
shellcheck \
shim-signed \
skopeo \
snap \
snmp \
software-properties-common \
sphinxsearch \
sqlite3 \
swig \
sysstat \
systemd-coredump \
temurin-11-jdk \
temurin-17-jdk \
temurin-21-jdk \
temurin-8-jdk \
texinfo \
tk \
tree \
tzdata \
ubuntu-server \
ubuntu-standard \
unzip \
upx-ucl \
util-linux \
walinuxagent \
xvfb \
xz-utils \
zip \
zsync
apt-get autoremove -y

110
.github/scripts/util.sh vendored Normal file
View File

@ -0,0 +1,110 @@
. .github/scripts/conf.sh
clone_source() {
local pkgname="$1"
local url="$2"
local ref="$3"
if [ ! -f $pkgname/.git/config ]; then
echo "need to clone $pkgname"
git clone $url $pkgname --branch=$ref --depth 1
else
echo "already cloned $pkgname"
fi
}
build_meson() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
meson "$@" build -Dprefix=$X11_PREFIX
ninja -j${FDO_CI_CONCURRENT:-4} -C build install
)
touch $X11_PREFIX/$pkgname.DONE
fi
}
build_ac() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
./autogen.sh --prefix=$X11_PREFIX
make -j${FDO_CI_CONCURRENT:-4} install
)
touch $X11_PREFIX/$pkgname.DONE
fi
}
build_drv_ac() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
./autogen.sh # --prefix=$X11_PREFIX
make -j${FDO_CI_CONCURRENT:-4} # install
)
}
build_ac_xts() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
CFLAGS='-fcommon'
if [ "$X11_OS" = "Darwin" ]; then
# xts5/include/XtTest.h includes <X11/Intrinsic.h> => needs xt
# xts5/src/libXtaw/*.c include <X11/Xaw/*.h> and <X11/Xmu/*.h> => need xmu and xaw7
sed -E -i~ 's|(\[XTS\], \[)|\1xt xmu xaw7 |' configure.ac
# xts5/Xlib14/X{mb,wc}TextListToTextProperty.m define a function accepting `XTextProperty` but call it passing
#`XTextProperty*`; since the parameter is seemingly meant for output, accept it as pointer
sed -E -i~ -e 's|(XTextProperty)[[:space:]]+(text_prop_good)|\1 *\2|' -e 's|(style_good),[[:space:]]*&(text_prop_good)|\1,\2|' -e 's|text_prop_good\.|text_prop_good->|' xts5/Xlib14/X{mb,wc}TextListToTextProperty.m
# xts5/Xlib*/*.m forward-declare `strcpy()` which is incompatible with _FORTIFY_SOURCE > 0 where `strcpy` is
# a macro; set _FORTIFY_SOURCE to 0 as we don't care much about security in this test code
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0"
# declarations for `XtAppSetError{,Msg}Handler()` in <X11/Intrinsic.h> (libXt) make it hard to write warning-
# free code: they want a noreturn-annotated handler as input but return old handler without noreturn annotation,
# so e.g. `XtAppSetErrorHandler(XtAppSetErrorHandler(NULL))` (similar to xts5/Xt13/XtAppSetError*Handler.m)
# doesn't compile complaining about incompatible function pointers, at least with Apple Clang 16 (not sure why
# it treats this warning as error by default though)
if cc -Werror=unknown-warning-option -Wincompatible-function-pointer-types -c -xc -o /dev/null /dev/null 2>/dev/null; then
CFLAGS="$CFLAGS -Wno-error=incompatible-function-pointer-types"
fi
fi
./autogen.sh --prefix=$X11_PREFIX CFLAGS="$CFLAGS"
make -j${FDO_CI_CONCURRENT:-4} install
)
touch $X11_PREFIX/$pkgname.DONE
fi
}

182
.github/workflows/build-xserver.yml vendored Normal file
View File

@ -0,0 +1,182 @@
name: Build X servers
permissions:
contents: read
env:
MESON_BUILDDIR: "build"
X11_PREFIX: /home/runner/x11
X11_BUILD_DIR: /home/runner/build-deps
on:
push:
pull_request:
jobs:
xserver-build-ubuntu:
env:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=false -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: prepare build environment
run: |
MACHINE=`gcc -dumpmachine`
echo "MACHINE=$MACHINE" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
sudo chown root /bin/tar && sudo chmod u+s /bin/tar
- name: apt cache
uses: actions/cache@v4
with:
path: /var/cache/apt
key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }}
restore-keys: apt-cache-
- name: pkg install
run: sudo .github/scripts/ubuntu/install-pkg.sh
- name: X11 prereq cache
uses: actions/cache@v4
with:
path: |
${{ env.X11_PREFIX }}
${{ env.X11_BUILD_DIR }}/xts
${{ env.X11_BUILD_DIR }}/piglit
key: ${{ runner.name }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }}
restore-keys: ${{ runner.name }}-x11-deps-
- name: generic prereq
run: .github/scripts/install-prereq.sh
- name: build
run: .gitlab-ci/meson-build.sh
- name: tests (may fail)
continue-on-error: true
run: meson test -C "${{ env.MESON_BUILDDIR }}" --print-errorlogs || true
env:
XTEST_DIR: ${{ env.X11_BUILD_DIR }}/xts
PIGLIT_DIR: ${{ env.X11_BUILD_DIR }}/piglit
- name: archive build logs
uses: actions/upload-artifact@v4
with:
name: build-logs
path: |
build/meson-logs/*
- name: ddx build check
run: .gitlab-ci/check-ddx-build.sh
- name: manpage check
run: .gitlab-ci/manpages-check
drivers-build-ubuntu:
env:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=false -Dwerror=false -Dxcsecurity=false -Dxorg=true -Dxvfb=false -Dxnest=false
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: prepare build environment
run: |
MACHINE=`gcc -dumpmachine`
echo "MACHINE=$MACHINE" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
sudo chown root /bin/tar && sudo chmod u+s /bin/tar
- name: apt cache
uses: actions/cache@v4
with:
path: /var/cache/apt
key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }}
restore-keys: apt-cache-
- name: pkg install
run: sudo .github/scripts/ubuntu/install-pkg.sh
- name: X11 prereq cache
uses: actions/cache@v4
with:
path: |
${{ env.X11_PREFIX }}
${{ env.X11_BUILD_DIR }}/xts
${{ env.X11_BUILD_DIR }}/piglit
key: ${{ runner.name }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }}
restore-keys: ${{ runner.name }}-x11-deps-
- name: generic prereq
run: .github/scripts/install-prereq.sh
- name: build xserver sdk
run: |
echo -n > .meson_environment
echo "export MESON_BUILDDIR=$MESON_BUILDDIR" >> .meson_environment
echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> .meson_environment
.gitlab-ci/meson-build.sh --skip-test
sudo meson install --no-rebuild -C "$MESON_BUILDDIR"
sudo mkdir -p /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules
sudo chown -R runner /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules
- name: compile drivers
run: .github/scripts/compile-drivers.sh
xserver-build-macos:
env:
MESON_ARGS: -Dprefix=/tmp -Dglx=false -Dxnest=false
X11_PREFIX: /Users/runner/x11
X11_BUILD_DIR: /Users/runner/build-deps
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: prepare build environment
run: |
echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
- name: homebrew cache
uses: actions/cache@v4
with:
path: /Users/runner/Library/Caches/Homebrew
key: ${{ runner.os }}-homebrew-cache-${{ hashFiles('.github/scripts/macos/install-pkg.sh') }}
restore-keys: ${{ runner.os }}-homebrew-cache-
- name: pkg install
run: .github/scripts/macos/install-pkg.sh
- name: X11 prereq cache
uses: actions/cache@v4
with:
path: |
${{ env.X11_PREFIX }}
${{ env.X11_BUILD_DIR }}/xts
${{ env.X11_BUILD_DIR }}/piglit
key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }}
restore-keys: ${{ runner.os }}-x11-deps-
- name: generic prereq
run: .github/scripts/install-prereq.sh
- name: build
run: .gitlab-ci/meson-build.sh
- name: tests (may fail)
continue-on-error: true
run: meson test -C "${{ env.MESON_BUILDDIR }}" --print-errorlogs -j1 || true
env:
XTEST_DIR: ${{ env.X11_BUILD_DIR }}/xts
PIGLIT_DIR: ${{ env.X11_BUILD_DIR }}/piglit
- name: archive build logs
uses: actions/upload-artifact@v4
with:
name: build-logs-macos
path: |
build/meson-logs/*
- name: ddx build check
run: .gitlab-ci/check-ddx-build.sh
- name: manpage check
run: .gitlab-ci/manpages-check

View File

@ -4,7 +4,7 @@
# Please see the ci-templates documentation for details:
# https://freedesktop.pages.freedesktop.org/ci-templates/
.templates_sha: &template_sha c5626190ec14b475271288dda7a7dae8dbe0cd76 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha ef5e4669b7500834a17ffe9277e15fbb6d977fff # see https://docs.gitlab.com/ee/ci/yaml/#includefile
# FDO_DISTRIBUTION_TAG is the tag of the docker image used for the build jobs.
# If the image doesn't exist yet, the docker-image stage generates it.
@ -21,10 +21,10 @@ variables:
REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
XORG_DEBIAN_VERSION: 'bullseye-slim'
XORG_DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
XORG_DEBIAN_TAG: '2024-09-13-xvmc'
XORG_FREEBSD_VERSION: '14.0'
XORG_DEBIAN_TAG: '2025-03-07-libdrm.1'
XORG_FREEBSD_VERSION: '14.2'
XORG_FREEBSD_EXEC: ''
XORG_FREEBSD_TAG: '2024-09-10-fix-freebsd-xcb'
XORG_FREEBSD_TAG: '2025-05-27-xcb'
include:
- project: 'freedesktop/ci-templates'
@ -92,9 +92,6 @@ stages:
.xorg_paths: &xorg_paths
- hw/xfree86/**/*
.xwayland_paths: &xwayland_paths
- hw/xwayland/**/*
.all_ddx_paths:
- hw/**/*
@ -105,11 +102,14 @@ stages:
FDO_DISTRIBUTION_TAG: '$XORG_DEBIAN_TAG'
.freebsd:
tags:
- kvm
variables:
FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG'
FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION'
FDO_DISTRIBUTION_EXEC: ''
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim libxvmc xcb-util xcb-util-wm'
FDO_IMAGE_SIZE: '30G'
debian-bullseye:
extends:
@ -169,22 +169,23 @@ meson:
- .gitlab-ci/meson-build.sh --run-test
- .gitlab-ci/check-piglit-results.sh
- .gitlab-ci/manpages-check
- .gitlab-ci/check-ddx-build.sh
variables:
XTEST_DIR: /root/xts
PIGLIT_DIR: /root/piglit
LP_NUM_THREADS: 0
MESON_DDX_BUILD_ARGS: >
-Dxorg=${BUILD_XORG} -Dxephyr=${BUILD_XEPHYR} -Dxvfb=${BUILD_XVFB} -Dxnest=${BUILD_XNEST}
BUILD_XEPHYR: true
BUILD_XNEST: true
BUILD_XORG: true
BUILD_XVFB: true
MESON_EXTRA_ARGS: ${MESON_DDX_BUILD_ARGS}
meson-noglamor:
extends: meson
variables:
MESON_EXTRA_ARGS: >
-Dglamor=false
xwayland-nolibdecor:
extends: meson
variables:
MESON_EXTRA_ARGS: >
-Dlibdecor=false -Dxorg=false -Dxephyr=false -Dxvfb=false -Dxnest=false
MESON_EXTRA_ARGS: -Dglamor=false ${MESON_DDX_BUILD_ARGS}
mingw-cross-build:
extends: .common-build-and-test
@ -207,6 +208,8 @@ freebsd:
- /app/vmctl start
- set +e
- scp -r $PWD "vm:"
# need to install extra packages, as long as image cant be rebuilt
- /app/vmctl exec "pkg update && pkg add libxvmc xcb-util xcb-util-wm"
# need to install newer xorgproto
- /app/vmctl exec "cd $CI_PROJECT_NAME/dep.xorgproto && ./autogen.sh --prefix=/usr && make && make install"
- /app/vmctl exec "cd $CI_PROJECT_NAME && PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" MESON_ARGS=\"$MESON_ARGS\" MESON_BUILDDIR=\"$MESON_BUILDDIR\" .gitlab-ci/meson-build.sh --skip-test" && touch .success
@ -222,17 +225,18 @@ meson-dist:
when: always
paths:
- $MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/xlibre-xnest-*/$MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/xserver-*/$MESON_BUILDDIR/meson-logs/
- xserver-tarball/install/
script:
- .gitlab-ci/meson-build.sh --run-dist
- mkdir xserver-tarball
- tar xf $MESON_BUILDDIR/meson-dist/xlibre-xnest-*.tar.xz -C xserver-tarball --strip-components=1
- tar xf $MESON_BUILDDIR/meson-dist/xserver-*.tar.xz -C xserver-tarball --strip-components=1
- .gitlab-ci/meson-build.sh -C xserver-tarball --skip-test --skip-dist --run-install
variables:
MESON_DIST_ARGS: --no-tests
DESTDIR: xserver-tarball/install/
MESON_EXTRA_ARGS: -Dprefix=$CI_PROJECT_DIR/xserver-tarball/install/
.xf86-driver-build-test:
xf86-driver-build-test:
extends:
- .xorg-image@debian
- .ci-run-policy
@ -240,140 +244,124 @@ meson-dist:
parallel:
matrix:
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-elographics
SHA: master
SHA: xf86-input-elographics-1.4.4
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
SHA: xf86-input-evdev-2.10.6
SHA: xf86-input-evdev-2.11.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-joystick
SHA: master
SHA: fa296d27fb479107fa6328a7565f665de2de98d3 # 5 commits ahead of 1.6.4
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
SHA: xf86-input-libinput-1.4.0
SHA: xf86-input-libinput-1.5.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
SHA: xf86-input-mouse-1.9.5
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
SHA: xf86-input-synaptics-1.9.2
SHA: xf86-input-synaptics-1.10.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-vmmouse
SHA: master
SHA: 3bbcb6a143bb3f53e5b776fb70a4933229c1781a # 2 commits ahead of 13.2.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-void
SHA: master
SHA: b43e11eeb8b96aa87da910991da8b005d9847783 # 4 commits ahead of 1.4.2
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
SHA: xf86-video-amdgpu-23.0.0
SHA: 2cb59a92de4a19909682a35e4f31f3c02de2899f # 18 commits ahead of 23.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-apm
SHA: master
SHA: 196784e691b8f8739792439434ffa002e9f5cdfa # 14 commits ahead of 1.3.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ark
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-armsoc
SHA: master
SHA: 109745d5c7e6982ee0dabbc5a233c1f2667ad5c9 # 9 commits ahead of 0.7.4
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ast
SHA: master
SHA: db56de34bdf70f1904dba50d98774aaa950a2ca5 # 10 commits ahead of 1.1.6
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
SHA: xf86-video-ati-22.0.0
SHA: c610c037369500089baddd86aa3cf8046f3dc48b # 11 commits ahead of 22.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-chips
SHA: master
SHA: 4503aece04cc8860df18ce946633b5449a0cb47b # 7 commits ahead of 1.5.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-cirrus
SHA: master
SHA: 15d68316524c593bd67a6ea59b5c746a94c6c1f6 # 10 commits ahead of 1.6.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-dummy
SHA: master
SHA: 3a407a34c4a2b6b263a535b6aa7b49dd70784fdf # 9 commits ahead of 0.4.1
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev
SHA: master
SHA: c8d9f3be7e95689d793bb2f45a5dddf409e46811 # 15 commits ahead of 0.5.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-i128
SHA: master
SHA: 4fd0309834deca78e5ef6cad5ecba8864a308ba5 # 7 commits ahead of 1.4.1
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-i740
SHA: master
SHA: d610334264e82a18477b9a5c3a4095c49c18f47b # 11 commits ahead of 1.4.0
- REPO: https://gitlab.freedesktop.org/metux/xf86-video-intel
SHA: submit/fixes-for-xserver # temporary
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mach64
SHA: master
SHA: 878048e3aec04c6bb8034f21afdfff37e3528c5f # 20 commits ahead of 6.9.7
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga
SHA: master
SHA: 66ee371516c48c30b67684317a8e3c24ba7f1f4e # 11 commits ahead of 2.0.1
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-neomagic
SHA: master
SHA: 69cafdeebf7c338ede076424f9bcb97f26ede7a8 # 8 commits ahead of 1.3.1
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nested
SHA: master
SHA: 86b6dc3bb6d78f40905ecc63df3635b284214836 # no release yet
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau
SHA: master
SHA: xf86-video-nouveau-1.0.18
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
SHA: master
SHA: a8608636da97fdd880edb1bce919a0d3029f24dd # 15 commits ahead of 2.1.23
- REPO: https://gitlab.freedesktop.org/metux/xf86-video-qxl
SHA: incubate # temporary
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-r128
SHA: master
SHA: bc21fcdffa623bb8e7150e1da69aeaed6cd7c5d2 # 1 commits ahead of 6.13.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-rendition
SHA: master
SHA: 49d50f1fdeb4dc81895fec81be9fae1dc78e5974 # 14 commits ahead of 4.2.7
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-s3virge
SHA: master
SHA: 8834f100114ba136d52590e711054ab063306421 # 11 commits ahead of 1.11.1
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-savage
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-siliconmotion
SHA: master
SHA: 09f6c06f0a793c7d297f152227b551c128f20875 # 8 commits ahead of 2.4.1
- REPO: https://gitlab.freedesktop.org/metux/xf86-video-siliconmotion
SHA: incubate # temporary
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis
SHA: master
SHA: ee451146c0afd735b50488588f82f3f158e9da03 # 68 commits ahead of 0.12.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sisusb
SHA: master
SHA: ccff93b681968463d00793a9a7c5c2db8301634f # 30 commits ahead of 0.12.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg14
SHA: master
SHA: 471e04fe84abaf2f868fb85566d99495142692a9 # 9 commits ahead of 1.1.3
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg3
SHA: master
SHA: 8162844221f6d59e540c3c3a146a9c581d413949 # 9 commits ahead of 1.1.3
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg6
SHA: master
SHA: 37a28d0d9dbb9b0c6631aa7b09d558d5f552c627 # 10 commits ahead of 1.1.3
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunffb
SHA: master
SHA: 6100635debdda392ca420e87c5b0d70bd22dfed8 # 14 commits ahead of 1.2.3
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunleo
SHA: master
SHA: 6d56a007f3d47fa43e95f1a0c8619be00b0c1c97 # 10 commits ahead of 1.2.3
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suntcx
SHA: master
SHA: c1c0e384b95da18b81793612b90f693891f2e476 # 9 commits ahead of 1.1.3
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-tdfx
SHA: master
SHA: 5253278119a4db07b5a01856f0de34e576f4dcdd # 9 commits ahead of 1.5.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-trident
SHA: master
SHA: fddaa2084b9aac51a845ee1ede8c498cbc9330cf # 13 commits ahead of 1.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l
SHA: master
SHA: eb1e55874cbacf7455f70269581a877e88e3bf37 # 15 commits ahead of 0.3.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vbox
SHA: master
SHA: ec4bc6b8e9d1a83526573d27afd099debbd5b86b # 7 commits ahead of 1.0.1
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
SHA: xf86-video-vesa-2.6.0
SHA: 5b33e95acb831768c52d491de079a1adcae762e0 # 10 commits ahead of 2.6.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
SHA: xf86-video-vmware-13.4.0
SHA: 92cc4534146dd84c0d843759cdb30f75abddddd6 # 6 commits ahead 13.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-voodoo
SHA: master
SHA: c70353ddf49d557c596a47b835b6b8d8bbe35ebe # 15 commits ahead of 1.2.6
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-xgi
SHA: master
SHA: e73ff14a7f1b7562ff447aad527641cc35f557ae # 49 commits ahead 1.6.1
script:
# Install the server first
- .gitlab-ci/meson-build.sh --skip-test --run-install
# built xserver is taken from meson-dist job
- export PKG_CONFIG_PATH=$(pwd)/xserver-tarball/install/lib/x86_64-linux-gnu/pkgconfig
- export ACLOCAL_PATH=$(pwd)/xserver-tarball/install/share/aclocal/
- unset MESON_EXTRA_ARGS
- DRIVER=$(basename $REPO)
- git clone "$REPO" "$DRIVER"
- git -C "$DRIVER" checkout "$SHA"
- |
if [[ -e "$DRIVER/meson.build" ]]; then
if [[ -e "$DRIVER/meson.build" ]] && [[ "$DRIVER" != "xf86-video-intel" ]]; then
.gitlab-ci/meson-build.sh -C "$DRIVER" --skip-test
else
pushd "$DRIVER" || exit 1
./autogen.sh && make
fi
needs:
- "meson"
- meson-dist
dependencies:
- meson-dist
variables:
GIT_DEPTH: 1
MESON_ARGS: -Dprefix=/usr/
MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
#
# Verify that commit messages are as expected
#
check-commits:
extends:
- .fdo.ci-fairy
needs: []
stage: test
script:
- ci-fairy check-commits --junit-xml=results.xml
except:
- master@xorg/xserver
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
allow_failure: true
MESON_EXTRA_ARGS: -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
#
# Verify that the merge request has the allow-collaboration checkbox ticked

25
.gitlab-ci/check-ddx-build.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -e
set -o xtrace
check_executable () {
if [[ ! -x $MESON_BUILDDIR/$1 ]]; then
echo "$1 not found after build"
exit 1
fi
return 0
}
if [[ -z "$MESON_BUILDDIR" ]]; then
echo "\$MESON_BUILDDIR not set"
exit 1
fi
[[ "$BUILD_XEPHYR" == true ]] && check_executable "hw/kdrive/ephyr/Xephyr"
[[ "$BUILD_XNEST" == true ]] && check_executable "hw/xnest/Xnest"
[[ "$BUILD_XORG" == true ]] && check_executable "hw/xfree86/Xorg"
[[ "$BUILD_XQUARTZ" == true ]] && check_executable "hw/xquartz/mach-startup/Xquartz"
[[ "$BUILD_XVFB" == true ]] && check_executable "hw/vfb/Xvfb"
exit 0

View File

@ -27,4 +27,3 @@ check_piglit_results ()
check_piglit_results xephyr-glamor hw/kdrive/ephyr/Xephyr.p/ephyr_glamor.c.o
check_piglit_results xvfb hw/vfb/Xvfb
check_piglit_results xwayland hw/xwayland/Xwayland

View File

@ -49,7 +49,6 @@ apt-get install -y \
libglx-mesa0 \
libinput10 \
libinput-dev \
libnvidia-egl-wayland-dev \
libpango1.0-0 \
libpango1.0-dev \
libpciaccess-dev \
@ -60,12 +59,13 @@ apt-get install -y \
libtool \
libudev-dev \
libunwind-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxau-dev \
libxaw7-dev \
libxcb-damage0-dev \
libxcb-dri2-0-dev \
libxcb-dri3-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
@ -75,11 +75,15 @@ apt-get install -y \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-sync-dev \
libxcb-util0-dev \
libxcb-xf86dri0-dev \
libxcb-xinput-dev \
libxcb-xkb-dev \
libxcb-xv0-dev \
libxcb1-dev \
libxcursor-dev \
libxdamage-dev \
libxdmcp-dev \
libxext-dev \
libxfixes-dev \
@ -91,13 +95,16 @@ apt-get install -y \
libxmu-dev \
libxmuu-dev \
libxpm-dev \
libxrandr-dev \
libxrender-dev \
libxres-dev \
libxshmfence-dev \
libxss-dev \
libxt-dev \
libxtst-dev \
libxv-dev \
libxvmc-dev \
libxxf86vm-dev \
libz-mingw-w64-dev \
linux-libc-dev/bullseye-backports \
mesa-common-dev \
@ -110,6 +117,7 @@ apt-get install -y \
python3-mako \
python3-numpy \
python3-six \
valgrind \
weston \
x11-xkb-utils \
xfonts-utils \
@ -121,8 +129,8 @@ apt-get install -y \
cd /root
# Xwayland requires drm 2.4.116 for drmSyncobjEventfd
git clone https://gitlab.freedesktop.org/mesa/drm --depth 1 --branch=libdrm-2.4.116
# drm 2.4.116 for drmSyncobjEventfd
git clone https://gitlab.freedesktop.org/mesa/drm --depth 1 --branch=libdrm-2.4.121
cd drm
meson _build
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
@ -137,7 +145,7 @@ ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
cd ..
rm -rf libxcvt
# xserver requires xorgproto >= 2024.1 for XWAYLAND
# xserver requires xorgproto >= 2024.1
git clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git --depth 1 --branch=xorgproto-2024.1
pushd xorgproto
./autogen.sh
@ -145,38 +153,6 @@ make -j${FDO_CI_CONCURRENT:-4} install
popd
rm -rf xorgproto
# wayland-protocols requires wayland-scanner 1.20, but Debian bullseye has 1.18 only
git clone https://gitlab.freedesktop.org/wayland/wayland.git --depth 1 --branch=1.21.0
cd wayland
meson -Dtests=false -Ddocumentation=false -Ddtd_validation=false _build
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
cd ..
rm -rf wayland
# Xwayland requires wayland-protocols >= 1.34, but Debian bullseye has 1.20 only
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.34
cd wayland-protocols
meson _build
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
cd ..
rm -rf wayland-protocols
# Install libdecor for Xwayland
git clone https://gitlab.freedesktop.org/libdecor/libdecor.git --depth 1 --branch=0.1.1
cd libdecor
meson _build -D{demo,install_demo}=false
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
cd ..
rm -rf libdecor
# Install libei for Xwayland
git clone https://gitlab.freedesktop.org/libinput/libei.git --depth 1 --branch=1.0.0
cd libei
meson setup _build -Dtests=disabled -Ddocumentation=[] -Dliboeffis=enabled
ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
cd ..
rm -rf libei
git clone https://gitlab.freedesktop.org/mesa/piglit.git
cd piglit
git checkout 265896c86f90cb72e8f218ba6a3617fca8b9a1e3
@ -184,10 +160,8 @@ cd ..
git clone https://gitlab.freedesktop.org/xorg/test/xts
cd xts
git checkout dbbfa96c036e596346147081cbceda136e7c86c1
# Using -fcommon until we get a proper fix into xtst.
# See discussion at https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/913
CFLAGS=-fcommon ./autogen.sh
git checkout 12a887c2c72c4258962b56ced7b0aec782f1ffed
./autogen.sh
xvfb-run make -j${FDO_CI_CONCURRENT:-4}
cd ..

View File

@ -1,6 +1,6 @@
#!/bin/sh
find build/ -regex ".*\.[1-9]$" -exec grep -E \
find build/ -type f -regex ".*\.[1-9]$" -exec grep -E \
@vendorversion@\|\
@xorgversion@\|\
@xservername@\|\

View File

@ -277,7 +277,8 @@ Paulo Zanoni <paulo.r.zanoni@intel.com> Paulo Ricardo Zanoni <pzanoni@mandriva.c
Pekka Paalanen <pekka.paalanen@collabora.co.uk> <pekka.paalanen@collabora.com>
Peter Harris <pharris@opentext.com> <peter.harris@hummingbird.com>
Peter Harris <pharris2@rocketsoftware.com> <peter.harris@hummingbird.com>
Peter Harris <pharris2@rocketsoftware.com> <pharris@opentext.com>
Peter Hutterer <peter.hutterer@who-t.net> <peter.hutterer@redhat.com>
Peter Hutterer <peter.hutterer@who-t.net> <peter@cs.unisa.edu.au>

1
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1 @@
404

18
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,18 @@
# Contribution Guidelines
1. All commits need a sign-off by the author (except for drafts)
If additional reviewers gave their ack, a proper attribution
header may be added.
2. Commit messages should explain what's really done here and their
headlines need a short an precise subject. See history for examples.
Keep in mind that history is also a piece of documentation.
3. Once release is out, bugfixes should be submitted separately, against
the affected release branch(es) as well as master (so multiple pull requests)
4. If new functions or types are introduced, these should be documented
in-code, so we can generate docs directly from the code :)
5. Use pull request tags if you can - if we need some more, just ask.

View File

@ -8,6 +8,7 @@ possible, and insert their name to this list. Please sort by surname
for people, and by the full name for other entities (e.g. Juliusz
Chroboczek sorts before Intel Corporation sorts before Daniel Stone).
Copyright © 2025 Enrico Weigelt, metux IT consult
Copyright © 2011 Dave Airlie
Copyright © 2000-2001 Juliusz Chroboczek
Copyright © 1998 Egbert Eich

1
CoC.md Normal file
View File

@ -0,0 +1 @@
-ENOENT

141
README.md
View File

@ -1,35 +1,128 @@
X Server
--------
XLibre Xserver
===============
The X server accepts requests from client applications to create windows,
which are (normally rectangular) "virtual screens" that the client program
can draw into.
Xlibre is a fork of the [Xorg Xserver](https://gitlab.freedesktop.org/xorg/xserver)
with lots of code cleanups and enhanced functionality.
Windows are then composed on the actual screen by the X server
(or by a separate composite manager) as directed by the window manager,
which usually communicates with the user via graphical controls such as buttons
and draggable titlebars and borders.
This fork was necessary since toxic elements within Xorg projects, moles
from BigTech, are boycotting any substantial work on Xorg, in order to
destroy the project, to eliminate competition of their own products.
Classic "embrace, extend, extinguish" tactics.
For a comprehensive overview of X Server and X Window System, consult the
following article:
https://en.wikipedia.org/wiki/X_server
Right after journalists first began covering the planned fork Xlibre,
on June 6th 2025, Redhat employees started a purge on the Xlibre founder's
GitLab account on freedesktop.org: deleted the git repo, tickets, merge
requests, etc, and so fired the shot that the whole world heard.
All questions regarding this software should be directed at the
Xorg mailing list:
This is an independent project, not at all affiliated with BigTech or any
of their subsidiaries or tax evasion tools, nor any political activists
groups, state actors, etc. It's explicitly free of any "DEI" or similar
discriminatory policies. Anybody who's treating others nicely is welcomed.
https://lists.freedesktop.org/mailman/listinfo/xorg
It doesn't matter which country you're coming from, your political views,
your race, your sex, your age, your food menu, whether you wear boots or
heels, whether you're furry or fairy, Conan or McKay, comic character, a
small furry creature from Alpha Centauri, or just a boring average person.
Anybody who's interested in bringing X forward is welcome.
The primary development code repository can be found at:
Together we'll make X great again!
https://gitlab.freedesktop.org/xorg/xserver
Upgrade notice
--------------
For patch submission instructions, see:
* Module ABIs have changed - drivers MUST be recompiled against this Xserver
version, otherwise the Xserver can crash or fail to start up correctly.
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
* If your console is locked up (no input possible, not even VT switch), then
most likely the input driver couldn't be loaded due to a version mismatch.
When unsure, it's best to be prepared to ssh into your machine from another one
or set a timer that's calling `chvt 1` after certain time, so you don't
need a cold reboot.
Or, make sure that you have magic `SysRq` key enabled (`Alt+PrtSc`)
via sysctl (`kernel.sysrq=1`), then press following combination depending on keyboard
layout to make kernel regain control over keyboard to make VT switching work:
- QWERTY/AZERTY keyboard layout: `SysRq + R`
- Dvorak/Colemak keyboard layout: `SysRq + P`
As with other projects hosted on freedesktop.org, X.Org follows its
Code of Conduct, based on the Contributor Covenant. Please conduct
yourself in a respectful and civilized manner when using the above
mailing lists, bug trackers, etc:
* Proprietary Nvidia drivers might break: they still haven't managed to do
even simple cleanups to catch up with Xorg master for about a year.
All attempts to get into direct mail contact have failed. We're trying to
work around this, but cannot give any guarantees. But you can make it work
by adding `Option "IgnoreABI" "1"` line to `ServerFlags` section in Xorg config.
https://www.freedesktop.org/wiki/CodeOfConduct
* Most Xorg drivers should run as-is (once recompiled!), with some exceptions.
See `.gitlab-ci.yml` for the versions/branches built along with Xlibre.
Driver repositories
-------------------
Since Redhat had deleted and banned all X11Libre repositories from freedesktop.org,
the driver repositories are now moved to GitHub:
| Driver | Git repository | Release tag |
| --- | --- | --- |
| xf86-input-elographics: | https://github.com/X11Libre/xf86-input-elographics | xlibre-xf86-input-elographics-1.4.4.1 |
| xf86-input-evdev: | https://github.com/X11Libre/xf86-input-evdev | xlibre-xf86-input-evdev-2.11.0.1 |
| xf86-input-void: | https://github.com/X11Libre/xf86-input-void | xlibre-xf86-input-void-1.4.2.1 |
| xf86-input-joystick: | https://github.com/X11Libre/xf86-input-joystick | xlibre-xf86-input-joystick-1.6.4.1 |
| xf86-input-keyboard: | https://github.com/X11Libre/xf86-input-keyboard | xlibre-xf86-input-keyboard-2.1.0.1 |
| xf86-input-libinput: | https://github.com/X11Libre/xf86-input-libinput | xlibre-xf86-input-libinput-1.5.0.1 |
| xf86-input-mouse: | https://github.com/X11Libre/xf86-input-mouse | xlibre-xf86-input-mouse-1.9.5.1 |
| xf86-input-synaptics: | https://github.com/X11Libre/xf86-input-synaptics | xlibre-xf86-input-synaptics-1.10.0.1 |
| xf86-input-vmmouse: | https://github.com/X11Libre/xf86-input-vmmouse | xlibre-xf86-input-vmmouse-13.2.0.1 |
| xf86-input-wacom: | https://github.com/X11Libre/xf86-input-wacom | xlibre-xf86-input-wacom-1.2.3.1 |
| xf86-video-amdgpu: | https://github.com/X11Libre/xf86-video-amdgpu | xlibre-xf86-video-amdgpu-23.0.0.1 |
| xf86-video-apm: | https://github.com/X11Libre/xf86-video-apm | xlibre-xf86-video-apm-1.3.0.1 |
| xf86-video-ark: | https://github.com/X11Libre/xf86-video-ark | xfree-xf86-video-ark-0.7.6.1 |
| xf86-video-ast: | https://github.com/X11Libre/xf86-video-ast | xlibre-xf86-video-ast-1.2.0 |
| xf86-video-ati: | https://github.com/X11Libre/xf86-video-ati | xfree-xf86-video-ati-22.0.0.1 |
| xf86-video-chips: | https://github.com/X11Libre/xf86-video-chips | xlibre-xf86-video-chips-1.5.0.1 |
| xf86-video-cirrus: | https://github.com/X11Libre/xf86-video-cirrus | xlibre-xf86-video-cirrus-1.6.0.1 |
| xf86-video-dummy: | https://github.com/X11Libre/xf86-video-dummy | xlibre-xf86-video-dummy-0.4.1.1 |
| xf86-video-fbdev: | https://github.com/X11Libre/xf86-video-fbdev | xlibre-xf86-video-fbdev-0.5.1.1 |
| xf86-video-freedreno: | https://github.com/X11Libre/xf86-video-freedreno | xlibre-xf86-video-freedreno-1.4.0.1 |
| xf86-video-geode: | https://github.com/X11Libre/xf86-video-geode | xlibre-xf86-video-geode-2.18.1.1 |
| xf86-video-i128: | https://github.com/X11Libre/xf86-video-i128 | xlibre-xf86-video-i128-1.4.1.1 |
| xf86-video-i740: | https://github.com/X11Libre/xf86-video-i740 | xlibre-xf86-video-i740-1.4.0.1 |
| xf86-video-intel: | https://github.com/X11Libre/xf86-video-intel | xlibre-xf86-video-intel-3.0.0.1 |
| xf86-video-mach64: | https://github.com/X11Libre/xf86-video-mach64 | xlibre-xf86-video-mach64-6.10.0.1 |
| xf86-video-mga: | https://github.com/X11Libre/xf86-video-mga | xlibre-xf86-video-mga-2.1.0.1 |
| xf86-video-neomagic: | https://github.com/X11Libre/xf86-video-neomagic | xlibre-xf86-video-neomagic-1.3.1.1 |
| xf86-video-nested: | https://github.com/X11Libre/xf86-video-nested | xlibre-xf86-video-nested-1.0.0.1 |
| xf86-video-nouveau: | https://github.com/X11Libre/xf86-video-nouveau | xlibre-xf86-video-nouveau-1.0.18.1 |
| xf86-video-nv: | https://github.com/X11Libre/xf86-video-nv | xlibre-xf86-video-nv-2.1.23.1 |
| xf86-video-omap: | https://github.com/X11Libre/xf86-video-omap | xlibre-xf86-video-omap-0.4.5.1 |
| xf86-video-qxl: | https://github.com/X11Libre/xf86-video-qxl | xlibre-xf86-video-qxl-0.1.6.1 |
| xf86-video-r128: | https://github.com/X11Libre/xf86-video-r128 | xlibre-xf86-video-r128-6.13.0.1 |
| xf86-video-rendition: | https://github.com/X11Libre/xf86-video-rendition | xlibre-xf86-video-rendition-4.2.7.1 |
| xf86-video-s3virge: | https://github.com/X11Libre/xf86-video-s3virge | xlibre-xf86-video-s3virge-1.11.1.1 |
| xf86-video-savage: | https://github.com/X11Libre/xf86-video-savage | xlibre-xf86-video-savage-2.4.1.1 |
| xf86-video-siliconmotion: | https://github.com/X11Libre/xf86-video-siliconmotion | xlibre-xf86-video-siliconmotion-1.7.10.1 |
| xf86-video-sis: | https://github.com/X11Libre/xf86-video-sis | xlibre-xf86-video-sis-0.12.0.1 |
| xf86-video-sisusb: | https://github.com/X11Libre/xf86-video-sisusb | xlibre-xf86-video-sisusb-0.9.7.1 |
| xf86-video-suncg14: | https://github.com/X11Libre/xf86-video-suncg14 | xlibre-xf86-video-suncg14-1.2.0 |
| xf86-video-suncg3: | https://github.com/X11Libre/xf86-video-suncg3 | xlibre-xf86-video-suncg3-1.1.3.0 |
| xf86-video-suncg6: | https://github.com/X11Libre/xf86-video-suncg6 | xlibre-xf86-video-suncg6-1.1.3.1 |
| xf86-video-sunffb: | https://github.com/X11Libre/xf86-video-sunffb | xlibre-xf86-video-sunffb-1.2.3.1 |
| xf86-video-sunleo: | https://github.com/X11Libre/xf86-video-sunleo | xlibre-xf86-video-sunleo-1.2.3.1 |
| xf86-video-suntcx: | https://github.com/X11Libre/xf86-video-suntcx | xlibre-xf86-video-suntcx-1.1.3.1 |
| xf86-video-tdfx: | https://github.com/X11Libre/xf86-video-tdfx | xlibre-xf86-video-tdfx-1.5.0.1 |
| xf86-video-trident: | https://github.com/X11Libre/xf86-video-trident | xlibre-xf86-video-trident-1.4.0.1 |
| xf86-video-vbox: | https://github.com/X11Libre/xf86-video-vbox | xlibre-xf86-video-vbox-1.0.1.1 |
| xf86-video-v4l: | https://github.com/X11Libre/xf86-video-v4l | xlibre-xf86-video-v4l-0.3.0.1 |
| xf86-video-vesa: | https://github.com/X11Libre/xf86-video-vesa | xlibre-xf86-video-vesa-2.6.0.1 |
| xf86-video-vmware: | https://github.com/X11Libre/xf86-video-vmware | xlibre-xf86-video-vmware-13.4.0.1 |
| xf86-video-voodoo: | https://github.com/X11Libre/xf86-video-voodoo | xlibre-xf86-video-voodoo-1.2.6.1 |
| xf86-video-wsfb: | https://github.com/X11Libre/xf86-video-wsfb | xlibre-xf86-video-wsfb-0.4.1.1 |
| xf86-video-xgi: | https://github.com/X11Libre/xf86-video-xgi | xlibre-xf86-video-xgi-1.6.1.1 |
Contact
-------
| | |
| --- | --- |
| Mailing list: | https://www.freelists.org/list/xlibre |
| Telegram channel: | https://t.me/x11dev |
| Matrix room (mirror of tg group): | https://matrix.to/#/#xlibre:matrix.org |

View File

@ -34,6 +34,7 @@ Equipment Corporation.
#include "miext/extinit_priv.h"
#include "os/screensaver.h"
#include "Xext/geext_priv.h"
#include "misc.h"
#include "os.h"
@ -144,10 +145,9 @@ ProcDPMSSelectInput(register ClientPtr client)
}
/* build the entry */
pNewEvent = (DPMSEventPtr)malloc(sizeof(DPMSEventRec));
pNewEvent = calloc(1, sizeof(DPMSEventRec));
if (!pNewEvent)
return BadAlloc;
pNewEvent->next = 0;
pNewEvent->client = client;
pNewEvent->mask = stuff->eventMask;
/*
@ -163,7 +163,7 @@ ProcDPMSSelectInput(register ClientPtr client)
* of clients selecting input
*/
if (i != Success || !pHead) {
pHead = (DPMSEventPtr *)malloc(sizeof(DPMSEventPtr));
pHead = calloc(1, sizeof(DPMSEventPtr));
if (!pHead ||
!AddResource(eventResource, DPMSEventType, (void *)pHead)) {
FreeResource(clientResource, X11_RESTYPE_NONE);
@ -588,7 +588,7 @@ DPMSExtensionInit(void)
ClientType = CreateNewResourceType(DPMSFreeClient, "DPMSClient");
DPMSEventType = CreateNewResourceType(DPMSFreeEvents, "DPMSEvent");
eventResource = FakeClientID(0);
eventResource = dixAllocServerXID();
if (DPMSEnabled && ClientType && DPMSEventType &&
(extEntry = AddExtension(DPMSExtensionName, 0, 0,

View File

@ -1,8 +1,6 @@
/* Prototypes for functions that the DDX must provide */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _DPMSPROC_H_
#define _DPMSPROC_H_

View File

@ -26,20 +26,34 @@
#include <dix-config.h>
#include <X11/extensions/ge.h>
#include "windowstr.h"
#include <X11/extensions/geproto.h>
#include "miext/extinit_priv.h"
#include "Xext/geext_priv.h"
#include "geint.h"
#include "geext.h"
#include "windowstr.h"
#include "protocol-versions.h"
Bool noGEExtension = FALSE;
#define MAXEXTENSIONS 128
DevPrivateKeyRec GEClientPrivateKeyRec;
GEExtension GEExtensions[MAXEXTENSIONS];
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
/** Struct to keep information about registered extensions */
typedef struct _GEExtension {
/** Event swapping routine */
void (*evswap) (xGenericEvent *from, xGenericEvent *to);
} GEExtension, *GEExtensionPtr;
static GEExtension GEExtensions[MAXEXTENSIONS];
typedef struct _GEClientInfo {
CARD32 major_version;
CARD32 minor_version;
} GEClientInfoRec, *GEClientInfoPtr;
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
/* Forward declarations */
static void SGEGenericEvent(xEvent *from, xEvent *to);
@ -96,7 +110,7 @@ SProcGEQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return SProcGEQueryVersion(client);
return ProcGEQueryVersion(client);
}
/************************************************************/
@ -201,14 +215,3 @@ GERegisterExtension(int extension,
/* extension opcodes are > 128, might as well save some space here */
GEExtensions[EXT_MASK(extension)].evswap = ev_swap;
}
/* Sets type and extension field for a generic event. This is just an
* auxiliary function, extensions could do it manually too.
*/
void
GEInitEvent(xGenericEvent *ev, int extension)
{
ev->type = GenericEvent;
ev->extension = extension;
ev->length = 0;
}

View File

@ -1,81 +0,0 @@
/*
Copyright 2007 Peter Hutterer <peter@cs.unisa.edu.au>
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the author shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the author.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GEEXT_H_
#define _GEEXT_H_
#include <X11/extensions/geproto.h>
/** Struct to keep information about registered extensions */
typedef struct _GEExtension {
/** Event swapping routine */
void (*evswap) (xGenericEvent *from, xGenericEvent *to);
} GEExtension, *GEExtensionPtr;
/* All registered extensions and their handling functions. */
extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
/* Typecast to generic event */
#define GEV(ev) ((xGenericEvent*)(ev))
/* Returns the extension offset from the event */
#define GEEXT(ev) (GEV(ev)->extension)
/* Return zero-based extension offset (offset - 128). Only for use in arrays */
#define GEEXTIDX(ev) (GEEXT(ev) & 0x7F)
/* True if mask is set for extension on window */
#define GEMaskIsSet(pWin, extension, mask) \
((pWin)->optional && \
(pWin)->optional->geMasks && \
((pWin)->optional->geMasks->eventMasks[(extension) & 0x7F] & (mask)))
/* Returns first client */
#define GECLIENT(pWin) \
(((pWin)->optional) ? (pWin)->optional->geMasks->geClients : NULL)
/* Returns the event_fill for the given event */
#define GEEventFill(ev) \
GEExtensions[GEEXTIDX(ev)].evfill
#define GEIsType(ev, ext, ev_type) \
((GEV(ev)->type == GenericEvent) && \
GEEXT(ev) == (ext) && \
GEV(ev)->evtype == (ev_type))
/* Interface for other extensions */
extern _X_EXPORT void GERegisterExtension(int extension,
void (*ev_dispatch) (xGenericEvent
*from,
xGenericEvent
*to));
extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension);
#endif /* _GEEXT_H_ */

22
Xext/geext_priv.h Normal file
View File

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XORG_GEEXT_PRIV_H
#define _XORG_GEEXT_PRIV_H
#include <X11/Xproto.h>
typedef void (*XorgGESwapProcPtr) (xGenericEvent *from, xGenericEvent *to);
/*
* Register generic event extension dispatch handler
*
* @param extension base opcode
* @param event swap handler function
*/
_X_EXPORT /* just for Nvidia legacy */
void GERegisterExtension(int extension, XorgGESwapProcPtr swap_handler);
#endif /* _XORG_GEEXT_PRIV_H */

View File

@ -1,51 +0,0 @@
/*
* Copyright 2007-2008 Peter Hutterer
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Author: Peter Hutterer, University of South Australia, NICTA
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GEINT_H_
#define _GEINT_H_
#include <X11/X.h>
#include <X11/Xproto.h>
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include <X11/extensions/geproto.h>
extern DevPrivateKeyRec GEClientPrivateKeyRec;
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
typedef struct _GEClientInfo {
CARD32 major_version;
CARD32 minor_version;
} GEClientInfoRec, *GEClientInfoPtr;
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
#endif /* _GEINT_H_ */

View File

@ -1,6 +1,9 @@
#include <dix-config.h>
#include <stdlib.h>
#include "dix/resource_priv.h"
#include "misc.h"
#include "hashtable.h"
@ -39,7 +42,7 @@ ht_create(int keySize,
{
int c;
int numBuckets;
HashTable ht = malloc(sizeof(struct HashTableRec));
HashTable ht = calloc(1, sizeof(struct HashTableRec));
if (!ht) {
return NULL;
@ -52,7 +55,7 @@ ht_create(int keySize,
ht->elements = 0;
ht->bucketBits = INITHASHSIZE;
numBuckets = 1 << ht->bucketBits;
ht->buckets = xallocarray(numBuckets, sizeof(*ht->buckets));
ht->buckets = calloc(numBuckets, sizeof(*ht->buckets));
ht->cdata = cdata;
if (ht->buckets) {
@ -93,7 +96,7 @@ double_size(HashTable ht)
int newNumBuckets = 1 << newBucketBits;
int c;
newBuckets = xallocarray(newNumBuckets, sizeof(*ht->buckets));
newBuckets = calloc(newNumBuckets, sizeof(*ht->buckets));
if (newBuckets) {
for (c = 0; c < newNumBuckets; ++c) {
xorg_list_init(&newBuckets[c]);
@ -127,7 +130,7 @@ ht_add(HashTable ht, const void *key)
if (!elem) {
goto outOfMemory;
}
elem->key = malloc(ht->keySize);
elem->key = calloc(1, ht->keySize);
if (!elem->key) {
goto outOfMemory;
}

View File

@ -51,15 +51,15 @@ typedef struct {
@param[in] cdata Opaque data that will be passed to hash and
comparison functions
*/
extern _X_EXPORT HashTable ht_create(int keySize,
int dataSize,
HashFunc hash,
HashCompareFunc compare,
void *cdata);
HashTable ht_create(int keySize,
int dataSize,
HashFunc hash,
HashCompareFunc compare,
void *cdata);
/** @brief HtDestruct deinitializes the structure. It does not free the
memory allocated to HashTableRec
*/
extern _X_EXPORT void ht_destroy(HashTable ht);
void ht_destroy(HashTable ht);
/** @brief Adds a new key to the hash table. The key will be copied
and a pointer to the value will be returned. The data will
@ -75,12 +75,12 @@ extern _X_EXPORT void ht_destroy(HashTable ht);
to avoid returning NULL. Obviously the data pointed cannot be
modified, as implied by dataSize being 0.
*/
extern _X_EXPORT void *ht_add(HashTable ht, const void *key);
void *ht_add(HashTable ht, const void *key);
/** @brief Removes a key from the hash table along with its
associated data, which will be free'd.
*/
extern _X_EXPORT void ht_remove(HashTable ht, const void *key);
void ht_remove(HashTable ht, const void *key);
/** @brief Finds the associated data of a key from the hash table.
@ -93,45 +93,45 @@ extern _X_EXPORT void ht_remove(HashTable ht, const void *key);
use HtMember instead to determine if a key has been
inserted.
*/
extern _X_EXPORT void *ht_find(HashTable ht, const void *key);
void *ht_find(HashTable ht, const void *key);
/** @brief A generic hash function */
extern _X_EXPORT unsigned ht_generic_hash(void *cdata,
const void *ptr,
int numBits);
unsigned ht_generic_hash(void *cdata,
const void *ptr,
int numBits);
/** @brief A generic comparison function. It compares data byte-wise. */
extern _X_EXPORT int ht_generic_compare(void *cdata,
const void *l,
const void *r);
int ht_generic_compare(void *cdata,
const void *l,
const void *r);
/** @brief A debugging function that dumps the distribution of the
hash table: for each bucket, list the number of elements
contained within. */
extern _X_EXPORT void ht_dump_distribution(HashTable ht);
void ht_dump_distribution(HashTable ht);
/** @brief A debugging function that dumps the contents of the hash
table: for each bucket, list the elements contained
within. */
extern _X_EXPORT void ht_dump_contents(HashTable ht,
void (*print_key)(void *opaque, void *key),
void (*print_value)(void *opaque, void *value),
void* opaque);
void ht_dump_contents(HashTable ht,
void (*print_key)(void *opaque, void *key),
void (*print_value)(void *opaque, void *value),
void* opaque);
/** @brief A hashing function to be used for hashing resource IDs when
used with HashTables. It makes no use of cdata, so that can
be NULL. It uses HashXID underneath, and should HashXID be
unable to hash the value, it switches into using the generic
hash function. */
extern _X_EXPORT unsigned ht_resourceid_hash(void *cdata,
const void * data,
int numBits);
unsigned ht_resourceid_hash(void *cdata,
const void * data,
int numBits);
/** @brief A comparison function to be used for comparing resource
IDs when used with HashTables. It makes no use of cdata,
so that can be NULL. */
extern _X_EXPORT int ht_resourceid_compare(void *cdata,
const void *a,
const void *b);
int ht_resourceid_compare(void *cdata,
const void *a,
const void *b);
#endif // HASHTABLE_H

View File

@ -9,8 +9,6 @@ srcs_xext = [
]
hdrs_xext = [
'geext.h',
'geint.h',
'syncsdk.h',
]
@ -45,7 +43,6 @@ endif
if build_xinerama
srcs_xext += ['panoramiX.c', 'panoramiXprocs.c', 'panoramiXSwap.c']
hdrs_xext += ['panoramiX.h', 'panoramiXsrv.h']
endif
if build_xsecurity
@ -61,13 +58,13 @@ if build_xv
hdrs_xext += ['xvdix.h', 'xvmcext.h']
endif
libxserver_xext = static_library('libxserver_xext',
libxserver_xext = static_library('xserver_xext',
srcs_xext,
include_directories: inc,
dependencies: common_dep,
)
libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
libxserver_xext_vidmode = static_library('xserver_xext_vidmode',
'vidmode.c',
include_directories: inc,
dependencies: common_dep,

208
Xext/namespace/config.c Normal file
View File

@ -0,0 +1,208 @@
#include <dix-config.h>
#include <string.h>
#include <X11/Xdefs.h>
#include "os/auth.h"
#include "namespace.h"
struct Xnamespace ns_root = {
.allowMouseMotion = TRUE,
.allowShape = TRUE,
.allowTransparency = TRUE,
.allowXInput = TRUE,
.allowXKeyboard = TRUE,
.builtin = TRUE,
.name = NS_NAME_ROOT,
.refcnt = 1,
.superPower = TRUE,
};
struct Xnamespace ns_anon = {
.builtin = TRUE,
.name = NS_NAME_ANONYMOUS,
.refcnt = 1,
};
struct xorg_list ns_list = { 0 };
char *namespaceConfigFile = NULL;
static struct Xnamespace* select_ns(const char* name)
{
struct Xnamespace *walk;
xorg_list_for_each_entry(walk, &ns_list, entry) {
if (strcmp(walk->name, name)==0)
return walk;
}
struct Xnamespace *newns = calloc(1, sizeof(struct Xnamespace));
newns->name = strdup(name);
xorg_list_append(&newns->entry, &ns_list);
return newns;
}
#define atox(c) ('0' <= c && c <= '9' ? c - '0' : \
'a' <= c && c <= 'f' ? c - 'a' + 10 : \
'A' <= c && c <= 'F' ? c - 'A' + 10 : -1)
// warning: no error checking, no buffer clearing
static int hex2bin(const char *in, char *out)
{
while (in[0] && in[1]) {
int top = atox(in[0]);
if (top == -1)
return 0;
int bottom = atox(in[1]);
if (bottom == -1)
return 0;
*out++ = (top << 4) | bottom;
in += 2;
}
return 1;
}
/*
* loadConfig
*
* Load the container config
*/
static void parseLine(char *line, struct Xnamespace **walk_ns)
{
// trim newline and comments
char *c1 = strchr(line, '\n');
if (c1 != NULL)
*c1 = 0;
c1 = strchr(line, '#');
if (c1 != NULL)
*c1 = 0;
/* get the first token */
char *token = strtok(line, " ");
if (token == NULL)
return;
// if no "container" statement hasn't been issued yet, use root NS
struct Xnamespace * curr = (*walk_ns ? *walk_ns : &ns_root);
if (strcmp(token, "container") == 0)
{
if ((token = strtok(NULL, " ")) == NULL)
{
XNS_LOG("container missing id\n");
return;
}
curr = *walk_ns = select_ns(token);
return;
}
if (strcmp(token, "auth") == 0)
{
token = strtok(NULL, " ");
if (token == NULL)
return;
struct auth_token *new_token = calloc(1, sizeof(struct auth_token));
if (new_token == NULL)
FatalError("Xnamespace: failed allocating token\n");
new_token->authProto = strdup(token);
token = strtok(NULL, " ");
new_token->authTokenLen = strlen(token)/2;
new_token->authTokenData = calloc(1, new_token->authTokenLen);
if (!new_token->authTokenData) {
free(new_token);
return;
}
hex2bin(token, new_token->authTokenData);
new_token->authId = AddAuthorization(strlen(new_token->authProto),
new_token->authProto,
new_token->authTokenLen,
new_token->authTokenData);
xorg_list_append(&new_token->entry, &curr->auth_tokens);
return;
}
if (strcmp(token, "allow") == 0)
{
while ((token = strtok(NULL, " ")) != NULL)
{
if (strcmp(token, "mouse-motion") == 0)
curr->allowMouseMotion = TRUE;
else if (strcmp(token, "shape") == 0)
curr->allowShape = TRUE;
else if (strcmp(token, "transparency") == 0)
curr->allowTransparency = TRUE;
else if (strcmp(token, "xinput") == 0)
curr->allowXInput = TRUE;
else if (strcmp(token, "xkeyboard") == 0)
curr->allowXKeyboard = TRUE;
else
XNS_LOG("unknown allow: %s\n", token);
}
return;
}
if (strcmp(token, "superpower") == 0)
{
curr->superPower = TRUE;
return;
}
XNS_LOG("unknown token \"%s\"\n", token);
}
Bool XnsLoadConfig(void)
{
xorg_list_append_ndup(&ns_root.entry, &ns_list);
xorg_list_append_ndup(&ns_anon.entry, &ns_list);
if (!namespaceConfigFile) {
XNS_LOG("no namespace config given - Xnamespace disabled\n");
return FALSE;
}
FILE *fp = fopen(namespaceConfigFile, "r");
if (fp == NULL) {
FatalError("failed loading container config: %s\n", namespaceConfigFile);
return FALSE;
}
struct Xnamespace *walk_ns = NULL;
char linebuf[1024];
while (fgets(linebuf, sizeof(linebuf), fp) != NULL)
parseLine(linebuf, &walk_ns);
fclose(fp);
XNS_LOG("loaded namespace config file: %s\n", namespaceConfigFile);
struct Xnamespace *ns;
xorg_list_for_each_entry(ns, &ns_list, entry) {
XNS_LOG("namespace: \"%s\" \n", ns->name);
struct auth_token *at;
xorg_list_for_each_entry(at, &ns->auth_tokens, entry) {
XNS_LOG(" auth: \"%s\" \"", at->authProto);
for (int i=0; i<at->authTokenLen; i++)
printf("%02X", (unsigned char)at->authTokenData[i]);
printf("\"\n");
}
}
return TRUE;
}
struct Xnamespace *XnsFindByName(const char* name) {
struct Xnamespace *walk;
xorg_list_for_each_entry(walk, &ns_list, entry) {
if (strcmp(walk->name, name)==0)
return walk;
}
return NULL;
}

View File

@ -0,0 +1,34 @@
#define HOOK_NAME "client"
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "dix/extension_priv.h"
#include "dix/registry_priv.h"
#include "mi/miinitext.h"
#include "include/extinit.h"
#include "include/extnsionst.h"
#include "include/propertyst.h"
#include "include/protocol-versions.h"
#include "include/windowstr.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
void hookClient(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceClientAccessRec);
struct XnamespaceClientPriv *obj = XnsClientPriv(param->target);
if (subj->ns->superPower || XnsClientSameNS(subj, obj))
return;
XNS_HOOK_LOG("BLOCKED access on client %d\n", param->target->index);
/* returning BadValue instead of BadAccess, because we're pretending
the requested client doens't even exist at all. */
param->status = BadValue;
}

View File

@ -0,0 +1,45 @@
#define HOOK_NAME "clienstate"
#include <dix-config.h>
#include "dix/registry_priv.h"
#include "os/client_priv.h"
#include "os/auth.h"
#include "namespace.h"
#include "hooks.h"
void hookClientState(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(NewClientInfoRec);
switch (client->clientState) {
case ClientStateInitial:
// better assign *someting* than null -- clients can't do anything yet anyways
XnamespaceAssignClient(subj, &ns_anon);
break;
case ClientStateRunning:
subj->authId = AuthorizationIDOfClient(client);
short unsigned int name_len = 0, data_len = 0;
const char * name = NULL;
char * data = NULL;
if (AuthorizationFromID(subj->authId, &name_len, &name, &data_len, &data)) {
XnamespaceAssignClient(subj, XnsFindByAuth(name_len, name, data_len, data));
} else {
XNS_HOOK_LOG("no auth data - assuming anon\n");
}
break;
case ClientStateRetained:
XnamespaceAssignClient(subj, NULL);
break;
case ClientStateGone:
XnamespaceAssignClient(subj, NULL);
break;
default:
XNS_HOOK_LOG("unknown state =%d\n", client->clientState);
break;
}
}

View File

@ -0,0 +1,64 @@
#define HOOK_NAME "device"
#include <dix-config.h>
#include <X11/extensions/XIproto.h>
#include <X11/extensions/XI2proto.h>
#include <X11/extensions/XKB.h>
#include "dix/dix_priv.h"
#include "dix/extension_priv.h"
#include "dix/registry_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
void hookDevice(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceDeviceAccessRec);
if (subj->ns->superPower)
goto pass;
// should be safe to pass for anybody
switch (client->majorOp) {
case X_QueryPointer:
case X_GetInputFocus:
case X_GetKeyboardMapping:
case X_GetModifierMapping:
case X_GrabButton: // needed by xterm -- should be safe
goto pass;
case EXTENSION_MAJOR_XKEYBOARD:
switch(client->minorOp) {
case X_kbSelectEvents: // needed by xterm
case X_kbGetMap: // needed by xterm
case X_kbBell: // needed by GIMP
case X_kbPerClientFlags: // needed by firefox
case X_kbGetState: // needed by firefox
case X_kbGetNames: // needed by firefox
case X_kbGetControls: // needed by firefox
goto pass;
default:
XNS_HOOK_LOG("BLOCKED unhandled XKEYBOARD %s\n", LookupRequestName(client->majorOp, client->minorOp));
goto block;
}
case EXTENSION_MAJOR_XINPUT:
switch (client->minorOp) {
case X_ListInputDevices:
case X_XIQueryDevice:
goto pass;
default:
XNS_HOOK_LOG("BLOCKED unhandled Xinput request\n");
goto block;
}
}
block:
param->status = BadAccess;
return;
pass:
param->status = Success;
return;
}

View File

@ -0,0 +1,67 @@
#define HOOK_NAME "ext-access"
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "dix/extension_priv.h"
#include "dix/registry_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
/* called on X_QueryExtension */
void hookExtAccess(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceExtAccessRec);
/* root NS has super powers */
if (subj->ns->superPower)
goto pass;
switch (param->ext->index + EXTENSION_BASE) {
/* unrestricted access */
case EXTENSION_MAJOR_BIG_REQUESTS:
case EXTENSION_MAJOR_DAMAGE:
case EXTENSION_MAJOR_DOUBLE_BUFFER:
case EXTENSION_MAJOR_GENERIC_EVENT:
case EXTENSION_MAJOR_PRESENT:
case EXTENSION_MAJOR_SYNC:
case EXTENSION_MAJOR_XC_MISC:
case EXTENSION_MAJOR_XFIXES:
case EXTENSION_MAJOR_XKEYBOARD:
case EXTENSION_MAJOR_XRESOURCE:
goto pass;
/* really blacklisted */
case EXTENSION_MAJOR_MIT_SCREEN_SAVER:
case EXTENSION_MAJOR_RECORD:
case EXTENSION_MAJOR_SECURITY:
case EXTENSION_MAJOR_XTEST:
case EXTENSION_MAJOR_XVIDEO:
goto reject;
/* only allowed if namespace has flag set */
case EXTENSION_MAJOR_SHAPE:
if (subj->ns->allowShape)
goto pass;
goto reject;
/* only allowed if namespace has flag set */
case EXTENSION_MAJOR_XINPUT:
if (subj->ns->allowXInput)
goto pass;
goto reject;
}
XNS_HOOK_LOG("unhandled extension query: %s (%d)\n", param->ext->name, param->ext->index);
return;
reject:
param->status = BadAccess;
return;
pass:
param->status = Success;
return;
}

View File

@ -0,0 +1,115 @@
#define HOOK_NAME "ext-dispatch"
#include <dix-config.h>
#include <stdio.h>
#include <X11/Xdefs.h> // syncproto.h is broken
#include <X11/Xmd.h>
#include <X11/extensions/syncproto.h>
#include <X11/extensions/XIproto.h>
#include <X11/extensions/XKB.h>
#include <X11/extensions/xfixeswire.h>
#include "dix/dix_priv.h"
#include "dix/extension_priv.h"
#include "dix/registry_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
void hookExtDispatch(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceExtAccessRec);
/* root NS has super powers */
if (subj->ns->superPower)
goto pass;
switch (client->majorOp) {
/* unrestricted access to these */
case EXTENSION_MAJOR_BIG_REQUESTS:
case EXTENSION_MAJOR_DAMAGE:
case EXTENSION_MAJOR_DOUBLE_BUFFER:
case EXTENSION_MAJOR_GENERIC_EVENT:
case EXTENSION_MAJOR_PRESENT:
case EXTENSION_MAJOR_XC_MISC:
case EXTENSION_MAJOR_XRESOURCE:
goto pass;
/* allow several operations */
case EXTENSION_MAJOR_XKEYBOARD:
if (subj->ns->allowXKeyboard)
goto pass;
switch (client->minorOp) {
case X_kbUseExtension:
case X_kbGetMap:
case X_kbSelectEvents: // fixme: might need special filtering
case X_kbGetState:
case X_kbGetNames:
case X_kbGetControls:
case X_kbPerClientFlags:
goto pass;
}
XNS_HOOK_LOG("BLOCKED unhandled XKEYBOARD call: %s\n", param->ext->name);
goto reject;
/* allow if namespace has flag set */
case EXTENSION_MAJOR_SHAPE:
if (subj->ns->allowShape)
goto pass;
break;
case EXTENSION_MAJOR_XINPUT:
if (subj->ns->allowXInput)
goto pass;
switch (client->minorOp) {
case X_ListInputDevices:
goto pass;
}
break;
case EXTENSION_MAJOR_XFIXES:
switch (client->minorOp) {
case X_XFixesQueryVersion:
case X_XFixesCreateRegion:
case X_XFixesSetCursorName:
case X_XFixesSelectSelectionInput:
goto pass;
}
XNS_HOOK_LOG("BLOCKED unhandled XFIXES call: %s\n", param->ext->name);
goto reject;
break;
case EXTENSION_MAJOR_SYNC:
switch (client->minorOp) {
case X_SyncCreateCounter:
case X_SyncDestroyCounter:
case X_SyncInitialize:
case X_SyncSetCounter:
goto pass;
}
XNS_HOOK_LOG("REJECT unhandled SYNC call: %s\n", param->ext->name);
goto reject;
break;
/* really blacklisted */
case EXTENSION_MAJOR_MIT_SCREEN_SAVER:
case EXTENSION_MAJOR_RECORD:
case EXTENSION_MAJOR_SECURITY:
case EXTENSION_MAJOR_XTEST:
goto reject;
break;
}
XNS_HOOK_LOG("unhandled extension call: %s\n", param->ext->name);
return;
reject:
XNS_HOOK_LOG("rejecting extension call: %s\n", param->ext->name);
param->status = BadAccess;
return;
pass:
param->status = Success;
return;
}

View File

@ -0,0 +1,71 @@
#define HOOK_NAME "initroot"
#include <dix-config.h>
#include <stdio.h>
#include <X11/Xatom.h>
#include <X11/Xmd.h>
#include "dix/window_priv.h"
#include "namespace.h"
#include "hooks.h"
static inline int setWinStrProp(WindowPtr pWin, Atom name, const char *text) {
return dixChangeWindowProperty(serverClient, pWin, name, XA_STRING,
8, PropModeReplace, strlen(text), text, TRUE);
}
void hookInitRootWindow(CallbackListPtr *pcbl, void *data, void *screen)
{
ScreenPtr pScreen = (ScreenPtr)screen;
// only act on first screen
if (pScreen->myNum)
return;
/* create the virtual root windows */
WindowPtr realRoot = pScreen->root;
assert(realRoot);
struct Xnamespace *walk;
xorg_list_for_each_entry(walk, &ns_list, entry) {
if (strcmp(walk->name, NS_NAME_ROOT)==0) {
walk->rootWindow = realRoot;
XNS_LOG("<%s> actual root 0x%0x\n", walk->name, walk->rootWindow->drawable.id);
continue;
}
int rc = 0;
WindowPtr pWin = dixCreateWindow(
FakeClientID(0), realRoot, 0, 0, 23, 23,
0, /* bw */
InputOutput,
0, /* vmask */
NULL, /* vlist */
0, /* depth */
serverClient,
wVisual(realRoot), /* visual */
&rc);
if (!pWin)
FatalError("hookInitRootWindow: cant create per-namespace root window for %s\n", walk->name);
Mask mask = pWin->eventMask;
pWin->eventMask = 0; /* subterfuge in case AddResource fails */
if (!AddResource(pWin->drawable.id, X11_RESTYPE_WINDOW, (void *) pWin))
FatalError("hookInitRootWindow: cant add per-namespace root window as resource\n");
pWin->eventMask = mask;
walk->rootWindow = pWin;
// set window name
char buf[PATH_MAX] = { 0 };
snprintf(buf, sizeof(buf)-1, "XNS-ROOT:%s", walk->name);
setWinStrProp(pWin, XA_WM_NAME, buf);
XNS_LOG("<%s> virtual root 0x%0x\n", walk->name, walk->rootWindow->drawable.id);
}
}

View File

@ -0,0 +1,47 @@
#define HOOK_NAME "property"
#include <dix-config.h>
#include <stdio.h>
#include "dix/dix_priv.h"
#include "dix/registry_priv.h"
#include "include/propertyst.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
static inline Bool winIsRoot(WindowPtr pWin) {
if (!pWin)
return FALSE;
if (pWin->drawable.pScreen->root == pWin)
return TRUE;
return FALSE;
}
void hookPropertyAccess(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XacePropertyAccessRec);
struct XnamespaceClientPriv *obj = XnsClientPriv(dixClientForWindow(param->pWin));
ATOM name = (*param->ppProp)->propertyName;
if (XnsClientSameNS(subj, obj))
return;
if (param->pWin == subj->ns->rootWindow)
return;
if (winIsRoot(param->pWin)) {
XNS_HOOK_LOG("window is the screen's root window\n");
} else {
XNS_HOOK_LOG("not a root window\n");
}
XNS_HOOK_LOG("access to property %s (atom 0x%x) window 0x%lx of client %d\n",
NameForAtom(name),
name,
(unsigned long)param->pWin->drawable.id,
dixClientForWindow(param->pWin)->index);
}

View File

@ -0,0 +1,75 @@
#define HOOK_NAME "recieve"
#include <dix-config.h>
#include <X11/Xmd.h>
#include "dix/extension_priv.h"
#include "dix/registry_priv.h"
#include "dix/resource_priv.h"
#include "Xext/xacestr.h"
#include "Xi/exglobals.h"
#include "namespace.h"
#include "hooks.h"
static inline Bool isRootWin(WindowPtr pWin) {
return (pWin->parent == NullWindow && dixClientForWindow(pWin) == serverClient);
}
void
hookReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceReceiveAccessRec);
struct XnamespaceClientPriv *obj = XnsClientPriv(dixClientForWindow(param->pWin));
// send and receive within same namespace permitted without restrictions
if (XnsClientSameNS(subj, obj))
goto pass;
for (int i=0; i<param->count; i++) {
const int type = param->events[i].u.u.type;
switch (type) {
case GenericEvent: {
xGenericEvent *gev = (xGenericEvent*)&param->events[i].u;
if (gev->extension == EXTENSION_MAJOR_XINPUT) {
switch (gev->evtype) {
case XI_RawMotion:
if ((!subj->ns->allowMouseMotion) || !isRootWin(param->pWin))
goto reject;
continue;
case XI_RawKeyPress:
case XI_RawKeyRelease:
goto reject;
default:
XNS_HOOK_LOG("XI unknown %d\n", gev->evtype);
goto reject;
}
}
XNS_HOOK_LOG("BLOCKED #%d generic event extension=%d\n", i, gev->extension);
goto reject;
}
break;
default:
XNS_HOOK_LOG("BLOCKED event type #%d 0%0x 0%0x %s %s%s\n", i, type, param->events[i].u.u.detail,
LookupEventName(type), (type & 128) ? "fake" : "",
isRootWin(param->pWin) ? " (root window)" : "");
goto reject;
break;
}
}
pass:
return;
reject:
param->status = BadAccess;
XNS_HOOK_LOG("BLOCKED client %d [NS %s] receiving event sent to window 0x%lx of client %d [NS %s]\n",
client->index,
subj->ns->name,
(unsigned long)param->pWin->drawable.id,
dixClientForWindow(param->pWin)->index,
obj->ns->name);
return;
}

View File

@ -0,0 +1,142 @@
#define HOOK_NAME "resource"
#include <dix-config.h>
#include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h"
#include "dix/extension_priv.h"
#include "dix/registry_priv.h"
#include "dix/window_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
static int checkAllowed(Mask requested, Mask allowed) {
return ((requested & allowed) == requested);
}
void hookResourceAccess(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceResourceAccessRec);
ClientPtr owner = dixLookupXIDOwner(param->id);
struct XnamespaceClientPriv *obj = XnsClientPriv(owner);
// server can do anything
if (param->client == serverClient)
goto pass;
// special filtering for windows: block transparency for untrusted clients
if (param->rtype == X11_RESTYPE_WINDOW) {
WindowPtr pWindow = (WindowPtr) param->res;
if (param->access_mode & DixCreateAccess) {
if (!subj->ns->allowTransparency) {
pWindow->forcedBG = TRUE;
}
}
}
// resource access inside same container is always permitted
if (XnsClientSameNS(subj, obj))
goto pass;
// check for root windows (screen or ns-virtual)
if (param->rtype == X11_RESTYPE_WINDOW) {
WindowPtr pWindow = (WindowPtr) param->res;
/* white-listed operations on namespace's virtual root window */
if (pWindow == subj->ns->rootWindow) {
switch (client->majorOp) {
case X_DeleteProperty:
case X_ChangeProperty:
case X_GetProperty:
case X_RotateProperties:
case X_QueryTree:
goto pass;
}
XNS_HOOK_LOG("unhandled access to NS' virtual root window 0x%0x\n", pWindow->drawable.id);
}
/* white-listed operations on actual root window */
if (pWindow && (pWindow == pWindow->drawable.pScreen->root)) {
switch (client->majorOp) {
case X_CreateWindow:
if (checkAllowed(param->access_mode, DixAddAccess))
goto pass;
break;
case X_CreateGC:
case X_CreatePixmap:
if (checkAllowed(param->access_mode, DixGetAttrAccess))
goto pass;
break;
// we reach here when destroying a top-level window:
// ProcDestroyWindow() checks whether one may remove a child
// from it's parent.
case X_DestroyWindow:
if (param->access_mode == DixRemoveAccess)
goto pass;
break;
case X_TranslateCoords:
case X_QueryTree:
goto pass;
case X_ChangeWindowAttributes:
case X_QueryPointer:
goto reject;
case X_SendEvent:
/* send hook needs to take care of this */
goto pass;
case EXTENSION_MAJOR_XINPUT:
switch(client->minorOp) {
// needed by xeyes. we should filter the mask
case X_XISelectEvents:
goto pass;
}
XNS_HOOK_LOG("unhandled XI operation on (real) root window\n");
goto reject;
}
}
}
/* server resources */
if (obj->isServer) {
if (param->rtype == X11_RESTYPE_COLORMAP) {
if (checkAllowed(param->access_mode, DixReadAccess | DixGetPropAccess | DixUseAccess | DixGetAttrAccess | DixAddAccess))
goto pass;
}
if (param->rtype == X11_RESTYPE_WINDOW) {
/* allowed ones should already been catched above */
XNS_HOOK_LOG("REJECT server owned window 0x%0x!\n", ((WindowPtr)param->res)->drawable.id);
goto reject;
}
if (checkAllowed(param->access_mode, DixReadAccess))
goto pass;
}
reject: ;
char accModeStr[128];
LookupDixAccessName(param->access_mode, (char*)&accModeStr, sizeof(accModeStr));
XNS_HOOK_LOG("BLOCKED access 0x%07lx %s to %s 0x%06lx of client %d @ %s\n",
(unsigned long)param->access_mode,
accModeStr,
LookupResourceName(param->rtype),
(unsigned long)param->id,
owner->index, // resource owner
obj->ns->name);
param->status = BadAccess;
return;
pass:
// request is passed as it is (or already had been rewritten)
param->status = Success;
}

View File

@ -0,0 +1,67 @@
#define HOOK_NAME "selection"
#include <dix-config.h>
#include <stdio.h>
#include "dix/selection_priv.h"
#include "namespace.h"
#include "hooks.h"
static inline const char *stripNS(const char* name) {
if ((!name) || (name[0] != '<'))
return name; // can this ever happen ?
const char *got = strchr(name, '>');
if (!got)
return name;
return ++got;
}
/*
* This hook is rewriting the client visible selection names to internally used,
* per namespace ones. Whenever a client is asking for a selection, it's name
* is replaced by a namespaced one, e.g. asking for "PRIMARY" while being in
* namespace "foo" will become "<foo>PRIMARY"
*
* A malicious client could still send specially crafted messages to others,
* asking them to send their selection data to him. This needs to be solved
* separately, by a send hook.
*/
void hookSelectionFilter(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(SelectionFilterParamRec);
/* no rewrite if client is in root namespace */
if (subj->ns->superPower)
return;
const char *origSelectionName = NameForAtom(param->selection);
char selname[PATH_MAX] = { 0 };
snprintf(selname, sizeof(selname)-1, "<%s>%s", subj->ns->name, origSelectionName);
Atom realSelection = MakeAtom(selname, strlen(selname), TRUE);
switch (param->op) {
case SELECTION_FILTER_GETOWNER:
case SELECTION_FILTER_SETOWNER:
case SELECTION_FILTER_CONVERT:
case SELECTION_FILTER_LISTEN:
// TODO: check whether window really belongs to the client
param->selection = realSelection;
break;
case SELECTION_FILTER_NOTIFY:
{
// need to translate back, since we're having the ns-prefixed name here
const char *stripped = stripNS(origSelectionName);
param->selection = MakeAtom(stripped, strlen(stripped), TRUE);
break;
}
// nothing to do here: already having the client visible name
case SELECTION_FILTER_EV_REQUEST:
case SELECTION_FILTER_EV_CLEAR:
break;
}
}

View File

@ -0,0 +1,53 @@
#define HOOK_NAME "send"
#include <dix-config.h>
#include "dix/registry_priv.h"
#include "dix/resource_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
/* TRUE if subj client is allowed to do things on obj)
* usually if they're in the same namespace or subj is in a parent
* namespace of obj
*/
static Bool clientAllowedOnClient(ClientPtr subj, ClientPtr obj) {
struct XnamespaceClientPriv *subjPriv = XnsClientPriv(subj);
struct XnamespaceClientPriv *objPriv = XnsClientPriv(obj);
if (subjPriv && subjPriv->ns->superPower)
return TRUE;
return XnsClientSameNS(subjPriv, objPriv);
}
void hookSend(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceSendAccessRec);
/* if no sending client, then it's coming internally from the server itself */
if (!client)
goto pass;
ClientPtr targetClient = dixClientForWindow(param->pWin);
struct XnamespaceClientPriv *obj = XnsClientPriv(targetClient);
if (clientAllowedOnClient(client, targetClient))
goto pass;
XNS_HOOK_LOG("BLOCK target @ %s\n", obj->ns->name);
for (int i = 0; i < param->count; i++) {
XNS_HOOK_LOG("sending event of type %s to window 0x%lx of client %d\n",
LookupEventName(param->events[i].u.u.type),
(unsigned long)param->pWin->drawable.id,
targetClient->index);
}
param->status = BadAccess;
return;
pass:
param->status = Success;
return;
}

View File

@ -0,0 +1,37 @@
#define HOOK_NAME "server"
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "dix/registry_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
void hookServerAccess(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(XaceServerAccessRec);
if (subj->ns->superPower)
goto pass;
switch (client->majorOp) {
case X_ListFonts:
case X_ListFontsWithInfo:
goto pass;
case X_GrabServer:
goto reject;
}
XNS_HOOK_LOG("BLOCKED access to server configuration request %s\n",
LookupRequestName(client->majorOp, client->minorOp));
reject:
param->status = BadAccess;
return;
pass:
param->status = Success;
}

View File

@ -0,0 +1,44 @@
#define HOOK_NAME "windowproperty"
#include <dix-config.h>
#include <X11/Xmd.h>
#include "dix/dix_priv.h"
#include "dix/property_priv.h"
#include "dix/window_priv.h"
#include "namespace.h"
#include "hooks.h"
void hookWindowProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(PropertyFilterParam);
// no redirect on super power
if (subj->ns->superPower)
return;
const ClientPtr owner = dixLookupXIDOwner(param->window);
if (!owner) {
param->status = BadWindow;
param->skip = TRUE;
XNS_HOOK_LOG("owner of window 0x%0x doesn't exist\n", param->window);
return;
}
// whitelist anything that goes to caller's own namespace
struct XnamespaceClientPriv *obj = XnsClientPriv(owner);
if (XnsClientSameNS(subj, obj))
return;
// allow access to namespace virtual root
if (param->window == subj->ns->rootWindow->drawable.id)
return;
// redirect root window access to namespace's virtual root
if (dixWindowIsRoot(param->window)) {
param->window = subj->ns->rootWindow->drawable.id;
return;
}
}

41
Xext/namespace/hooks.h Normal file
View File

@ -0,0 +1,41 @@
#ifndef __XSERVER_NAMESPACE_HOOKS_H
#define __XSERVER_NAMESPACE_HOOKS_H
#include "dix/registry_priv.h"
#include "include/misc.h"
#include "namespace.h"
#define XNS_HOOK_LOG(...) do { \
printf("XNS [" HOOK_NAME "] (#%d@%d) {%s} <%s>: ", \
(client ? client->index : -1), \
(client ? client->sequence : -1), \
(subj ? (subj->ns ? subj->ns->name : "(no ns)") : "<no client>"), \
LookupRequestName(client ? client->majorOp : 0, \
client ? client->minorOp : 0)); \
printf(__VA_ARGS__); \
} while (0)
#define XNS_HOOK_HEAD(t) \
t *param = calldata; \
ClientPtr client = param->client; \
if (!client) { \
/* XNS_LOG("hook %s NULL client\n", HOOK_NAME); */ \
} \
struct XnamespaceClientPriv *subj = XnsClientPriv(client);
void hookClient(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookClientState(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookDevice(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookExtAccess(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookExtDispatch(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookInitRootWindow(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookPropertyAccess(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookReceive(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookResourceAccess(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookSelectionFilter(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookSend(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookServerAccess(CallbackListPtr *pcbl, void *unused, void *calldata);
void hookWindowProperty(CallbackListPtr *pcbl, void *unused, void *calldata);
#endif /* __XSERVER_NAMESPACE_HOOKS_H */

View File

@ -0,0 +1,22 @@
libxserver_namespace = static_library(
'xserver_namespace',
[
'config.c',
'hook-client.c',
'hook-clientstate.c',
'hook-device.c',
'hook-ext-access.c',
'hook-ext-dispatch.c',
'hook-init-rootwindow.c',
'hook-property.c',
'hook-receive.c',
'hook-resource.c',
'hook-selection.c',
'hook-send.c',
'hook-server.c',
'hook-windowproperty.c',
'namespace.c',
],
include_directories: inc,
dependencies: common_dep,
)

View File

@ -0,0 +1,92 @@
#include <dix-config.h>
#include <stdio.h>
#include <X11/Xmd.h>
#include "dix/dix_priv.h"
#include "dix/property_priv.h"
#include "dix/selection_priv.h"
#include "include/os.h"
#include "miext/extinit_priv.h"
#include "Xext/xacestr.h"
#include "namespace.h"
#include "hooks.h"
Bool noNamespaceExtension = TRUE;
DevPrivateKeyRec namespaceClientPrivKeyRec = { 0 };
void
NamespaceExtensionInit(void)
{
XNS_LOG("initializing namespace extension ...\n");
/* load configuration */
if (!XnsLoadConfig()) {
XNS_LOG("No config file. disabling Xns extension\n");
return;
}
if (!(dixRegisterPrivateKey(&namespaceClientPrivKeyRec, PRIVATE_CLIENT,
sizeof(struct XnamespaceClientPriv)) &&
AddCallback(&ClientStateCallback, hookClientState, NULL) &&
AddCallback(&PostInitRootWindowCallback, hookInitRootWindow, NULL) &&
AddCallback(&PropertyFilterCallback, hookWindowProperty, NULL) &&
AddCallback(&SelectionFilterCallback, hookSelectionFilter, NULL) &&
XaceRegisterCallback(XACE_CLIENT_ACCESS, hookClient, NULL) &&
XaceRegisterCallback(XACE_DEVICE_ACCESS, hookDevice, NULL) &&
XaceRegisterCallback(XACE_EXT_DISPATCH, hookExtDispatch, NULL) &&
XaceRegisterCallback(XACE_EXT_ACCESS, hookExtAccess, NULL) &&
XaceRegisterCallback(XACE_PROPERTY_ACCESS, hookPropertyAccess, NULL) &&
XaceRegisterCallback(XACE_RECEIVE_ACCESS, hookReceive, NULL) &&
XaceRegisterCallback(XACE_RESOURCE_ACCESS, hookResourceAccess, NULL) &&
XaceRegisterCallback(XACE_SEND_ACCESS, hookSend, NULL) &&
XaceRegisterCallback(XACE_SERVER_ACCESS, hookServerAccess, NULL)))
FatalError("NamespaceExtensionInit: allocation failure\n");
/* Do the serverClient */
struct XnamespaceClientPriv *srv = XnsClientPriv(serverClient);
*srv = (struct XnamespaceClientPriv) { .isServer = TRUE };
XnamespaceAssignClient(srv, &ns_root);
}
void XnamespaceAssignClient(struct XnamespaceClientPriv *priv, struct Xnamespace *newns)
{
if (priv->ns != NULL)
priv->ns->refcnt--;
priv->ns = newns;
if (newns != NULL)
newns->refcnt++;
}
void XnamespaceAssignClientByName(struct XnamespaceClientPriv *priv, const char *name)
{
struct Xnamespace *newns = XnsFindByName(name);
if (newns == NULL)
newns = &ns_anon;
XnamespaceAssignClient(priv, newns);
}
struct Xnamespace* XnsFindByAuth(size_t szAuthProto, const char* authProto, size_t szAuthToken, const char* authToken)
{
struct Xnamespace *walk;
xorg_list_for_each_entry(walk, &ns_list, entry) {
struct auth_token *at;
xorg_list_for_each_entry(at, &walk->auth_tokens, entry) {
int protoLen = at->authProto ? strlen(at->authProto) : 0;
if ((protoLen == szAuthProto) &&
(at->authTokenLen == szAuthToken) &&
(memcmp(at->authTokenData, authToken, szAuthToken)==0) &&
(memcmp(at->authProto, authProto, szAuthProto)==0))
return walk;
}
}
// default to anonymous if credentials aren't assigned to specific NS
return &ns_anon;
}

View File

@ -0,0 +1,82 @@
#ifndef __XSERVER_NAMESPACE_H
#define __XSERVER_NAMESPACE_H
#include <stdio.h>
#include <X11/Xmd.h>
#include "include/dixstruct.h"
#include "include/list.h"
#include "include/privates.h"
#include "include/window.h"
#include "include/windowstr.h"
struct auth_token {
struct xorg_list entry;
const char *authProto;
char *authTokenData;
size_t authTokenLen;
XID authId;
};
struct Xnamespace {
struct xorg_list entry;
const char *name;
Bool builtin;
Bool allowMouseMotion;
Bool allowShape;
Bool allowTransparency;
Bool allowXInput;
Bool allowXKeyboard;
Bool superPower;
struct xorg_list auth_tokens;
size_t refcnt;
WindowPtr rootWindow;
};
extern struct xorg_list ns_list;
extern struct Xnamespace ns_root;
extern struct Xnamespace ns_anon;
struct XnamespaceClientPriv {
Bool isServer;
XID authId;
struct Xnamespace* ns;
};
#define NS_NAME_ROOT "root"
#define NS_NAME_ANONYMOUS "anon"
extern DevPrivateKeyRec namespaceClientPrivKeyRec;
Bool XnsLoadConfig(void);
struct Xnamespace *XnsFindByName(const char* name);
struct Xnamespace* XnsFindByAuth(size_t szAuthProto, const char* authProto, size_t szAuthToken, const char* authToken);
void XnamespaceAssignClient(struct XnamespaceClientPriv *priv, struct Xnamespace *ns);
void XnamespaceAssignClientByName(struct XnamespaceClientPriv *priv, const char *name);
static inline struct XnamespaceClientPriv *XnsClientPriv(ClientPtr client) {
if (client == NULL) return NULL;
return dixLookupPrivate(&client->devPrivates, &namespaceClientPrivKeyRec);
}
static inline Bool XnsClientSameNS(struct XnamespaceClientPriv *p1, struct XnamespaceClientPriv *p2)
{
if (!p1 && !p2)
return TRUE;
if (!p1 || !p2)
return FALSE;
return (p1->ns == p2->ns);
}
#define XNS_LOG(...) do { printf("XNS "); printf(__VA_ARGS__); } while (0)
static inline Bool streq(const char *a, const char *b)
{
if (!a && !b)
return TRUE;
if (!a || !b)
return FALSE;
return (strcmp(a,b) == 0);
}
#endif /* __XSERVER_NAMESPACE_H */

View File

@ -0,0 +1,18 @@
# auth <proto> <hex-key>
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad90b0
auth MIT-MAGIC-COOKIE-1 56f8e62b78e58962de0ceefc05ad90b0
# container <name> <parent_name>
container xeyes root
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad90b8
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad90a8
allow mouse-motion
allow shape
allow xinput
container xclock root
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad90b7
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad91b7
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad92b7
auth MIT-MAGIC-COOKIE-1 46f8e62b78e58962de0ceefc05ad93b7

View File

@ -32,7 +32,11 @@ Equipment Corporation.
#include <X11/extensions/panoramiXproto.h>
#include "dix/dix_priv.h"
#include "dix/resource_priv.h"
#include "dix/screen_hooks_priv.h"
#include "miext/extinit_priv.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "cursor.h"
@ -45,17 +49,13 @@ Equipment Corporation.
#include "window.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "panoramiX.h"
#include "panoramiXsrv.h"
#include "globals.h"
#include "servermd.h"
#include "resource.h"
#include "picturestr_priv.h"
#include "xfixesint.h"
#include "damageextint.h"
#ifdef COMPOSITE
#include "compint.h"
#endif
#include "protocol-versions.h"
#ifdef GLXPROXY
@ -74,7 +74,7 @@ int PanoramiXPixWidth = 0;
int PanoramiXPixHeight = 0;
int PanoramiXNumScreens = 0;
_X_EXPORT RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL };
RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL };
static int PanoramiXNumDepths;
static DepthPtr PanoramiXDepths;
@ -88,7 +88,7 @@ RESTYPE XRT_GC;
RESTYPE XRT_COLORMAP;
static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
static XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
/*
* Function prototypes
@ -123,7 +123,6 @@ typedef struct {
typedef struct {
CreateGCProcPtr CreateGC;
CloseScreenProcPtr CloseScreen;
} PanoramiXScreenRec, *PanoramiXScreenPtr;
static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
@ -148,21 +147,23 @@ static const GCFuncs XineramaGCFuncs = {
pGCPriv->wrapFuncs = (pGC)->funcs;\
(pGC)->funcs = &XineramaGCFuncs;
static Bool
XineramaCloseScreen(ScreenPtr pScreen)
static void XineramaCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unsused)
{
dixScreenUnhookClose(pScreen, XineramaCloseScreen);
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
if (!pScreenPriv)
return;
pScreen->CreateGC = pScreenPriv->CreateGC;
if (pScreen->myNum == 0)
RegionUninit(&PanoramiXScreenRegion);
free(pScreenPriv);
return (*pScreen->CloseScreen) (pScreen);
dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey, NULL);
}
static Bool
@ -352,7 +353,7 @@ PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
data.screen = screen;
data.id = id;
return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
return LookupClientResourceComplex(dixClientForXID(id), type,
XineramaFindIDByScrnum, &data);
}
@ -368,7 +369,7 @@ XineramaRegisterConnectionBlockCallback(void (*func) (void))
{
XineramaConnectionCallbackList *newlist;
if (!(newlist = malloc(sizeof(XineramaConnectionCallbackList))))
if (!(newlist = calloc(1, sizeof(XineramaConnectionCallbackList))))
return FALSE;
newlist->next = ConnectionCallbackList;
@ -384,7 +385,7 @@ XineramaInitData(void)
int i, w, h;
RegionNull(&PanoramiXScreenRegion);
FOR_NSCREENS(i) {
FOR_NSCREENS_BACKWARD(i) {
BoxRec TheBox;
RegionRec ScreenRegion;
@ -418,13 +419,6 @@ XineramaInitData(void)
}
}
void
XineramaReinitData(void)
{
RegionUninit(&PanoramiXScreenRegion);
XineramaInitData();
}
/*
* PanoramiXExtensionInit():
* Called from InitExtensions in main().
@ -439,7 +433,6 @@ PanoramiXExtensionInit(void)
Bool success = FALSE;
ExtensionEntry *extEntry;
ScreenPtr pScreen = screenInfo.screens[0];
PanoramiXScreenPtr pScreenPriv;
if (noPanoramiXExtension)
return;
@ -474,9 +467,9 @@ PanoramiXExtensionInit(void)
* run in non-PanoramiXeen mode.
*/
FOR_NSCREENS(i) {
FOR_NSCREENS_BACKWARD(i) {
pScreen = screenInfo.screens[i];
pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
PanoramiXScreenPtr pScreenPriv = calloc(1, sizeof(PanoramiXScreenRec));
dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
pScreenPriv);
if (!pScreenPriv) {
@ -484,11 +477,10 @@ PanoramiXExtensionInit(void)
return;
}
pScreenPriv->CreateGC = pScreen->CreateGC;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
dixScreenHookClose(pScreen, XineramaCloseScreen);
pScreenPriv->CreateGC = pScreen->CreateGC;
pScreen->CreateGC = XineramaCreateGC;
pScreen->CloseScreen = XineramaCloseScreen;
}
XRC_DRAWABLE = CreateNewResourceClass();
@ -584,10 +576,7 @@ PanoramiXExtensionInit(void)
PanoramiXRenderInit();
PanoramiXFixesInit();
PanoramiXDamageInit();
#ifdef COMPOSITE
PanoramiXCompositeInit();
#endif
}
Bool
@ -806,7 +795,6 @@ extern void
PanoramiXConsolidate(void)
{
int i;
PanoramiXRes *root, *defmap, *saver;
ScreenPtr pScreen = screenInfo.screens[0];
DepthPtr pDepth = pScreen->allowedDepths;
VisualPtr pVisual = pScreen->visuals;
@ -820,14 +808,26 @@ PanoramiXConsolidate(void)
for (i = 0; i < pScreen->numVisuals; i++)
PanoramiXMaybeAddVisual(pVisual++);
root = malloc(sizeof(PanoramiXRes));
PanoramiXRes *root = calloc(1, sizeof(PanoramiXRes));
if (!root)
return;
root->type = XRT_WINDOW;
defmap = malloc(sizeof(PanoramiXRes));
PanoramiXRes *defmap = calloc(1, sizeof(PanoramiXRes));
if (!defmap) {
free(root);
return;
}
defmap->type = XRT_COLORMAP;
saver = malloc(sizeof(PanoramiXRes));
PanoramiXRes *saver = calloc(1, sizeof(PanoramiXRes));
if (!saver) {
free(root);
free(defmap);
return;
}
saver->type = XRT_WINDOW;
FOR_NSCREENS(i) {
FOR_NSCREENS_BACKWARD(i) {
ScreenPtr scr = screenInfo.screens[i];
root->info[i].id = scr->root->drawable.id;
@ -889,9 +889,7 @@ PanoramiXResetProc(ExtensionEntry * extEntry)
PanoramiXRenderReset();
PanoramiXFixesReset();
PanoramiXDamageReset();
#ifdef COMPOSITE
PanoramiXCompositeReset ();
#endif
screenInfo.numScreens = PanoramiXNumScreens;
for (i = 256; i--;)
ProcVector[i] = SavedProcVector[i];
@ -1072,7 +1070,7 @@ ProcXineramaQueryScreens(ClientPtr client)
xXineramaScreenInfo scratch;
int i;
FOR_NSCREENS(i) {
FOR_NSCREENS_BACKWARD(i) {
scratch.x_org = screenInfo.screens[i]->x;
scratch.y_org = screenInfo.screens[i]->y;
scratch.width = screenInfo.screens[i]->width;
@ -1171,7 +1169,7 @@ XineramaGetImageData(DrawablePtr *pDrawables,
depth = (format == XYPixmap) ? 1 : pDraw->depth;
FOR_NSCREENS(i) {
FOR_NSCREENS_BACKWARD(i) {
BoxRec TheBox;
ScreenPtr pScreen;
@ -1253,11 +1251,15 @@ XineramaGetImageData(DrawablePtr *pDrawables,
for (j = 0, index = (pitch * y) + x, index2 = 0; j < h;
j++, index += pitch, index2 += ScratchPitch) {
if (w) {
if (!shift)
if (!shift) {
assert(ScratchMem);
memcpy(data + index, ScratchMem + index2, w);
else
}
else {
assert(ScratchMem);
CopyBits(data + index, shift,
ScratchMem + index2, w);
}
}
if (leftover) {
@ -1277,6 +1279,7 @@ XineramaGetImageData(DrawablePtr *pDrawables,
w *= j;
for (j = 0; j < h; j++) {
assert(ScratchMem);
memcpy(data + (pitch * (y + j)) + x,
ScratchMem + (ScratchPitch * j), w);
}

View File

@ -32,13 +32,12 @@ Equipment Corporation.
* PanoramiX definitions
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _PANORAMIX_H_
#define _PANORAMIX_H_
#include <X11/Xmd.h>
#include <X11/extensions/panoramiXproto.h>
#include "gcstruct.h"
@ -70,7 +69,6 @@ typedef struct {
#define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
#define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++)
#define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
#define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)

View File

@ -28,6 +28,11 @@ Equipment Corporation.
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/panoramiXproto.h>
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "cursor.h"
#include "cursorstr.h"
@ -39,9 +44,6 @@ Equipment Corporation.
#include "window.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "panoramiX.h"
#include <X11/extensions/panoramiXproto.h>
#include "panoramiXsrv.h"
#include "globals.h"
#include "panoramiXh.h"

View File

@ -1,8 +1,10 @@
/*
* Server dispatcher function replacements
*/
#ifndef XSERVER_PANORAMIXH_H
#define XSERVER_PANORAMIXH_H
extern int PanoramiXCreateWindow(ClientPtr client);
extern int PanoramiXChangeWindowAttributes(ClientPtr client);
extern int PanoramiXDestroyWindow(ClientPtr client);
@ -71,3 +73,5 @@ extern int connBlockScreenStart;
extern xConnSetupPrefix connSetupPrefix;
extern int (*SavedProcVector[256]) (ClientPtr client);
#endif /* XSERVER_PANORAMIXH_H */

View File

@ -33,19 +33,18 @@ Equipment Corporation.
#include "dix/dix_priv.h"
#include "os/osdep.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "windowstr.h"
#include "dixfontstr.h"
#include "gcstruct.h"
#include "colormapst.h"
#include "scrnintstr.h"
#include "opaque.h"
#include "inputstr.h"
#include "migc.h"
#include "misc.h"
#include "dixstruct.h"
#include "panoramiX.h"
#include "panoramiXsrv.h"
#include "resource.h"
#include "panoramiXh.h"
@ -117,7 +116,7 @@ PanoramiXCreateWindow(ClientPtr client)
}
}
if (!(newWin = malloc(sizeof(PanoramiXRes))))
if (!(newWin = calloc(1, sizeof(PanoramiXRes))))
return BadAlloc;
newWin->type = XRT_WINDOW;
@ -557,7 +556,6 @@ PanoramiXCirculateWindow(ClientPtr client)
int
PanoramiXGetGeometry(ClientPtr client)
{
xGetGeometryReply rep;
DrawablePtr pDraw;
int rc;
@ -568,7 +566,7 @@ PanoramiXGetGeometry(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetGeometryReply) {
xGetGeometryReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -602,7 +600,16 @@ PanoramiXGetGeometry(ClientPtr client)
rep.borderWidth = pWin->borderWidth;
}
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.root);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.borderWidth);
}
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
return Success;
}
@ -614,7 +621,6 @@ PanoramiXTranslateCoords(ClientPtr client)
REQUEST(xTranslateCoordsReq);
int rc;
WindowPtr pWin, pDst;
xTranslateCoordsReply rep;
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
@ -623,7 +629,8 @@ PanoramiXTranslateCoords(ClientPtr client)
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
if (rc != Success)
return rc;
rep = (xTranslateCoordsReply) {
xTranslateCoordsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
@ -674,7 +681,13 @@ PanoramiXTranslateCoords(ClientPtr client)
rep.dstY += screenInfo.screens[0]->y;
}
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.child);
swaps(&rep.dstX);
swaps(&rep.dstY);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
@ -694,7 +707,7 @@ PanoramiXCreatePixmap(ClientPtr client)
if (result != Success)
return (result == BadValue) ? BadDrawable : result;
if (!(newPix = malloc(sizeof(PanoramiXRes))))
if (!(newPix = calloc(1, sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
@ -801,7 +814,7 @@ PanoramiXCreateGC(ClientPtr client)
}
}
if (!(newGC = malloc(sizeof(PanoramiXRes))))
if (!(newGC = calloc(1, sizeof(PanoramiXRes))))
return BadAlloc;
newGC->type = XRT_GC;
@ -917,7 +930,7 @@ PanoramiXCopyGC(ClientPtr client)
if (result != Success)
return result;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
stuff->srcGC = srcGC->info[j].id;
stuff->dstGC = dstGC->info[j].id;
result = (*SavedProcVector[X_CopyGC]) (client);
@ -1098,11 +1111,11 @@ PanoramiXCopyArea(ClientPtr client)
if ((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
DrawablePtr drawables[MAXSCREENS];
DrawablePtr pDst;
GCPtr pGC;
GCPtr pGC = NULL;
char *data;
int pitch, rc;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
rc = dixLookupDrawable(drawables + j, src->info[j].id, client, 0,
DixGetAttrAccess);
if (rc != Success)
@ -1136,7 +1149,7 @@ PanoramiXCopyArea(ClientPtr client)
}
free(data);
if (pGC->graphicsExposures) {
if (pGC && pGC->graphicsExposures) {
RegionRec rgn;
int dx, dy;
BoxRec sourceBox;
@ -1156,7 +1169,7 @@ PanoramiXCopyArea(ClientPtr client)
RegionInit(&rgn, &sourceBox, 1);
/* subtract the (screen-space) clips of the source drawables */
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
ScreenPtr screen = screenInfo.screens[j];
RegionPtr sd;
@ -1374,7 +1387,6 @@ PanoramiXPolyPoint(ClientPtr client)
{
PanoramiXRes *gc, *draw;
int result, npoint, j;
xPoint *origPts;
Bool isRoot;
REQUEST(xPolyPointReq);
@ -1397,7 +1409,10 @@ PanoramiXPolyPoint(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
if (npoint > 0) {
origPts = xallocarray(npoint, sizeof(xPoint));
xPoint *origPts = calloc(npoint, sizeof(xPoint));
if (!origPts)
return BadAlloc;
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j) {
@ -1439,7 +1454,6 @@ PanoramiXPolyLine(ClientPtr client)
{
PanoramiXRes *gc, *draw;
int result, npoint, j;
xPoint *origPts;
Bool isRoot;
REQUEST(xPolyLineReq);
@ -1462,7 +1476,9 @@ PanoramiXPolyLine(ClientPtr client)
isRoot = IS_ROOT_DRAWABLE(draw);
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
if (npoint > 0) {
origPts = xallocarray(npoint, sizeof(xPoint));
xPoint *origPts = calloc(npoint, sizeof(xPoint));
if (!origPts)
return BadAlloc;
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j) {
@ -1504,7 +1520,6 @@ PanoramiXPolySegment(ClientPtr client)
{
int result, nsegs, i, j;
PanoramiXRes *gc, *draw;
xSegment *origSegs;
Bool isRoot;
REQUEST(xPolySegmentReq);
@ -1531,7 +1546,9 @@ PanoramiXPolySegment(ClientPtr client)
return BadLength;
nsegs >>= 3;
if (nsegs > 0) {
origSegs = xallocarray(nsegs, sizeof(xSegment));
xSegment *origSegs = calloc(nsegs, sizeof(xSegment));
if (!origSegs)
return BadAlloc;
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
FOR_NSCREENS_FORWARD(j) {
@ -1573,7 +1590,6 @@ PanoramiXPolyRectangle(ClientPtr client)
int result, nrects, i, j;
PanoramiXRes *gc, *draw;
Bool isRoot;
xRectangle *origRecs;
REQUEST(xPolyRectangleReq);
@ -1599,7 +1615,9 @@ PanoramiXPolyRectangle(ClientPtr client)
return BadLength;
nrects >>= 3;
if (nrects > 0) {
origRecs = xallocarray(nrects, sizeof(xRectangle));
xRectangle *origRecs = calloc(nrects, sizeof(xRectangle));
if (!origRecs)
return BadAlloc;
memcpy((char *) origRecs, (char *) &stuff[1],
nrects * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j) {
@ -1640,7 +1658,6 @@ PanoramiXPolyArc(ClientPtr client)
int result, narcs, i, j;
PanoramiXRes *gc, *draw;
Bool isRoot;
xArc *origArcs;
REQUEST(xPolyArcReq);
@ -1666,7 +1683,9 @@ PanoramiXPolyArc(ClientPtr client)
return BadLength;
narcs /= sizeof(xArc);
if (narcs > 0) {
origArcs = xallocarray(narcs, sizeof(xArc));
xArc *origArcs = calloc(narcs, sizeof(xArc));
if (!origArcs)
return BadAlloc;
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j) {
@ -1705,7 +1724,6 @@ PanoramiXFillPoly(ClientPtr client)
int result, count, j;
PanoramiXRes *gc, *draw;
Bool isRoot;
DDXPointPtr locPts;
REQUEST(xFillPolyReq);
@ -1728,7 +1746,9 @@ PanoramiXFillPoly(ClientPtr client)
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
if (count > 0) {
locPts = xallocarray(count, sizeof(DDXPointRec));
DDXPointPtr locPts = calloc(count, sizeof(DDXPointRec));
if (!locPts)
return BadAlloc;
memcpy((char *) locPts, (char *) &stuff[1],
count * sizeof(DDXPointRec));
FOR_NSCREENS_FORWARD(j) {
@ -1771,8 +1791,6 @@ PanoramiXPolyFillRectangle(ClientPtr client)
int result, things, i, j;
PanoramiXRes *gc, *draw;
Bool isRoot;
xRectangle *origRects;
REQUEST(xPolyFillRectangleReq);
REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
@ -1797,7 +1815,9 @@ PanoramiXPolyFillRectangle(ClientPtr client)
return BadLength;
things >>= 3;
if (things > 0) {
origRects = xallocarray(things, sizeof(xRectangle));
xRectangle *origRects = calloc(things, sizeof(xRectangle));
if (!origRects)
return BadAlloc;
memcpy((char *) origRects, (char *) &stuff[1],
things * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j) {
@ -1838,7 +1858,6 @@ PanoramiXPolyFillArc(ClientPtr client)
PanoramiXRes *gc, *draw;
Bool isRoot;
int result, narcs, i, j;
xArc *origArcs;
REQUEST(xPolyFillArcReq);
@ -1864,7 +1883,9 @@ PanoramiXPolyFillArc(ClientPtr client)
return BadLength;
narcs /= sizeof(xArc);
if (narcs > 0) {
origArcs = xallocarray(narcs, sizeof(xArc));
xArc *origArcs = calloc(narcs, sizeof(xArc));
if (!origArcs)
return BadAlloc;
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j) {
@ -1946,7 +1967,6 @@ PanoramiXGetImage(ClientPtr client)
DrawablePtr drawables[MAXSCREENS];
DrawablePtr pDraw;
PanoramiXRes *draw;
xGetImageReply xgi;
Bool isRoot;
char *pBuf;
int i, x, y, w, h, format, rc;
@ -2020,12 +2040,7 @@ PanoramiXGetImage(ClientPtr client)
IncludeInferiors);
}
xgi = (xGetImageReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.visual = wVisual(((WindowPtr) pDraw)),
.depth = pDraw->depth
};
if (format == ZPixmap) {
widthBytesLine = PixmapBytePad(w, pDraw->depth);
length = widthBytesLine * h;
@ -2039,7 +2054,13 @@ PanoramiXGetImage(ClientPtr client)
}
xgi.length = bytes_to_int32(length);
xGetImageReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.visual = wVisual(((WindowPtr) pDraw)),
.depth = pDraw->depth,
.length = bytes_to_int32(length),
};
if (widthBytesLine == 0 || h == 0)
linesPerBuf = 0;
@ -2050,10 +2071,15 @@ PanoramiXGetImage(ClientPtr client)
if (linesPerBuf > h)
linesPerBuf = h;
}
if (!(pBuf = xallocarray(linesPerBuf, widthBytesLine)))
if (!(pBuf = calloc(linesPerBuf, widthBytesLine)))
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.visual);
}
WriteToClient(client, sizeof(rep), &rep);
if (linesPerBuf == 0) {
/* nothing to do */
@ -2289,7 +2315,7 @@ PanoramiXCreateColormap(ClientPtr client)
if (result != Success)
return result;
if (!(newCmap = malloc(sizeof(PanoramiXRes))))
if (!(newCmap = calloc(1, sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
@ -2361,7 +2387,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
if (result != Success)
return result;
if (!(newCmap = malloc(sizeof(PanoramiXRes))))
if (!(newCmap = calloc(1, sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;

View File

@ -1,34 +1,33 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _PANORAMIXSRV_H_
#define _PANORAMIXSRV_H_
#include "panoramiX.h"
extern _X_EXPORT int PanoramiXNumScreens;
extern _X_EXPORT int PanoramiXPixWidth;
extern _X_EXPORT int PanoramiXPixHeight;
extern _X_EXPORT RegionRec PanoramiXScreenRegion;
extern int PanoramiXNumScreens;
extern int PanoramiXPixWidth;
extern int PanoramiXPixHeight;
extern RegionRec PanoramiXScreenRegion;
extern _X_EXPORT VisualID PanoramiXTranslateVisualID(int screen, VisualID orig);
extern _X_EXPORT void PanoramiXConsolidate(void);
extern _X_EXPORT Bool PanoramiXCreateConnectionBlock(void);
extern _X_EXPORT PanoramiXRes *PanoramiXFindIDByScrnum(RESTYPE, XID, int);
extern _X_EXPORT Bool
XineramaRegisterConnectionBlockCallback(void (*func) (void));
extern _X_EXPORT int XineramaDeleteResource(void *, XID);
// exported for nvidia
_X_EXPORT VisualID PanoramiXTranslateVisualID(int screen, VisualID orig);
extern _X_EXPORT void XineramaReinitData(void);
void PanoramiXConsolidate(void);
Bool PanoramiXCreateConnectionBlock(void);
PanoramiXRes *PanoramiXFindIDByScrnum(RESTYPE, XID, int);
Bool XineramaRegisterConnectionBlockCallback(void (*func) (void));
int XineramaDeleteResource(void *, XID);
/* only exported for Nvidia legacy. This really shouldn't be used by drivers */
extern _X_EXPORT RESTYPE XRC_DRAWABLE;
extern _X_EXPORT RESTYPE XRT_WINDOW;
extern _X_EXPORT RESTYPE XRT_PIXMAP;
extern _X_EXPORT RESTYPE XRT_GC;
extern _X_EXPORT RESTYPE XRT_COLORMAP;
extern _X_EXPORT RESTYPE XRT_PICTURE;
extern RESTYPE XRT_WINDOW;
extern RESTYPE XRT_PIXMAP;
extern RESTYPE XRT_GC;
extern RESTYPE XRT_COLORMAP;
extern RESTYPE XRT_PICTURE;
/*
* Drivers are allowed to wrap this function. Each wrapper can decide that the
@ -38,16 +37,15 @@ extern _X_EXPORT RESTYPE XRT_PICTURE;
* screen 0.
*/
typedef Bool (*XineramaVisualsEqualProcPtr) (VisualPtr, ScreenPtr, VisualPtr);
extern _X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
extern _X_EXPORT void XineramaGetImageData(DrawablePtr *pDrawables,
int left,
int top,
int width,
int height,
unsigned int format,
unsigned long planemask,
char *data, int pitch, Bool isRoot);
void XineramaGetImageData(DrawablePtr *pDrawables,
int left,
int top,
int width,
int height,
unsigned int format,
unsigned long planemask,
char *data, int pitch, Bool isRoot);
static inline void
panoramix_setup_ids(PanoramiXRes * resource, ClientPtr client, XID base_id)

View File

@ -36,9 +36,12 @@ in this Software without prior written authorization from the X Consortium.
#include "dix/colormap_priv.h"
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "dix/window_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "os/screensaver.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "os.h"
@ -50,13 +53,8 @@ in this Software without prior written authorization from the X Consortium.
#include "resource.h"
#include "gcstruct.h"
#include "cursorstr.h"
#include "colormapst.h"
#include "xace.h"
#include "inputstr.h"
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif /* XINERAMA */
#ifdef DPMSExtension
#include <X11/extensions/dpmsconst.h>
#include "dpmsproc.h"
@ -65,10 +63,6 @@ in this Software without prior written authorization from the X Consortium.
Bool noScreenSaverExtension = FALSE;
// temporary workaround for win32/mingw32 name clash
// see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355
#undef CreateWindow
static int ScreenSaverEventBase = 0;
static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force);
@ -277,13 +271,10 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
static void
FreeAttrs(ScreenSaverAttrPtr pAttr)
{
PixmapPtr pPixmap;
CursorPtr pCursor;
if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pPixmap = pAttr->pBorderPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pAttr->pBackgroundPixmap, 0);
dixDestroyPixmap(pAttr->pBorderPixmap, 0);
if ((pCursor = pAttr->pCursor) != 0)
FreeCursor(pCursor, (Cursor) 0);
}
@ -479,7 +470,7 @@ CreateSaverWindow(ScreenPtr pScreen)
if (GrabInProgress && GrabInProgress != pAttr->client->index)
return FALSE;
pWin = CreateWindow(pSaver->wid, pScreen->root,
pWin = dixCreateWindow(pSaver->wid, pScreen->root,
pAttr->x, pAttr->y, pAttr->width, pAttr->height,
pAttr->borderWidth, pAttr->class,
pAttr->mask, (XID *) pAttr->values,
@ -504,13 +495,11 @@ CreateSaverWindow(ScreenPtr pScreen)
mask |= CWBorderPixmap;
}
if (pAttr->pCursor) {
CursorPtr cursor;
if (!pWin->optional)
if (!MakeWindowOptional(pWin)) {
FreeResource(pWin->drawable.id, X11_RESTYPE_NONE);
return FALSE;
}
cursor = RefCursor(pAttr->pCursor);
if (!MakeWindowOptional(pWin)) {
FreeResource(pWin->drawable.id, X11_RESTYPE_NONE);
return FALSE;
}
CursorPtr cursor = RefCursor(pAttr->pCursor);
if (pWin->optional->cursor)
FreeCursor(pWin->optional->cursor, (Cursor) 0);
pWin->optional->cursor = cursor;
@ -760,7 +749,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
depth = stuff->depth;
visual = stuff->visualID;
/* copied directly from CreateWindow */
/* copied directly from dixCreateWindow */
if (class == CopyFromParent)
class = pParent->drawable.class;
@ -813,7 +802,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
return BadMatch;
}
/* end of errors from CreateWindow */
/* end of errors from dixCreateWindow */
pPriv = GetScreenPrivate(pScreen);
if (pPriv && pPriv->attr) {
@ -831,7 +820,7 @@ ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
goto bail;
}
/* over allocate for override redirect */
pAttr->values = values = xallocarray(len + 1, sizeof(unsigned long));
pAttr->values = values = calloc(len + 1, sizeof(unsigned long));
if (!values) {
ret = BadAlloc;
goto bail;
@ -1220,7 +1209,7 @@ ProcScreenSaverSuspend(ClientPtr client)
* to the record, so the screensaver will be re-enabled and the record freed
* if the client disconnects without reenabling it first.
*/
this = malloc(sizeof(ScreenSaverSuspensionRec));
this = calloc(1, sizeof(ScreenSaverSuspensionRec));
if (!this)
return BadAlloc;

View File

@ -32,16 +32,17 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h"
#include "dix/registry_priv.h"
#include "dix/resource_priv.h"
#include "miext/extinit_priv.h"
#include "os/audit.h"
#include "os/auth.h"
#include "os/client_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
#include "inputstr.h"
#include "windowstr.h"
#include "propertyst.h"
#include "colormapst.h"
#include "privates.h"
#include "xacestr.h"
#include "securitysrv.h"
@ -205,7 +206,7 @@ SecurityDeleteAuthorization(void *value, XID id)
.type = SecurityEventBase + XSecurityAuthorizationRevoked,
.authId = pAuth->id
};
WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
WriteEventsToClient(dixClientForOtherClients(pEventClient), 1, (xEvent *) &are);
FreeResource(pEventClient->resource, X11_RESTYPE_NONE);
}
@ -383,7 +384,7 @@ SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
}
}
pEventClient = malloc(sizeof(OtherClients));
pEventClient = calloc(1, sizeof(OtherClients));
if (!pEventClient)
return BadAlloc;
pEventClient->mask = mask;
@ -404,7 +405,6 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
REQUEST(xSecurityGenerateAuthorizationReq);
int len; /* request length in CARD32s */
Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */
int err; /* error to return from this function */
XID authId; /* authorization ID assigned by os layer */
xSecurityGenerateAuthorizationReply rep; /* reply struct */
@ -490,9 +490,8 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname,
stuff->nbytesAuthData, protodata,
&authdata_len, &pAuthdata);
if ((XID) ~0L == authId) {
err = SecurityErrorBase + XSecurityBadAuthorizationProtocol;
goto bailout;
if (!authId) {
return SecurityErrorBase + XSecurityBadAuthorizationProtocol;
}
/* now that we've added the auth, remember to remove it if we have to
@ -502,7 +501,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
/* associate additional information with this auth ID */
pAuth = malloc(sizeof(SecurityAuthorizationRec));
SecurityAuthorizationPtr pAuth = calloc(1, sizeof(SecurityAuthorizationRec));
if (!pAuth) {
err = BadAlloc;
goto bailout;
@ -742,7 +741,6 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XaceResourceAccessRec *rec = calldata;
SecurityStateRec *subj, *obj;
int cid = CLIENT_ID(rec->id);
Mask requested = rec->access_mode;
Mask allowed = SecurityResourceMask;
@ -757,8 +755,12 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
if (rec->rtype == X11_RESTYPE_WINDOW)
allowed |= SecurityWindowExtraMask;
ClientPtr owner = dixClientForXID(rec->id);
if (!owner)
goto denied;
/* special checks for server-owned resources */
if (cid == 0) {
if (dixResouceIsServerOwned(rec->id)) {
if (rec->rtype & RC_DRAWABLE)
/* additional operations allowed on root windows */
allowed |= SecurityRootWindowExtraMask;
@ -772,15 +774,15 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
allowed |= DixReadAccess;
}
if (clients[cid] != NULL) {
obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
return;
}
obj = dixLookupPrivate(&owner->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
return;
denied:
SecurityAudit("Security: denied client %d access %lx to resource 0x%lx "
"of client %d on request %s\n", rec->client->index,
(unsigned long)requested, (unsigned long)rec->id, cid,
(unsigned long)requested, (unsigned long)rec->id,
dixClientIdForXID(rec->id),
SecurityLookupRequestName(rec->client));
rec->status = BadAccess; /* deny access */
}
@ -856,13 +858,13 @@ SecurityProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
Mask allowed = SecurityResourceMask | DixReadAccess;
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
obj = dixLookupPrivate(&dixClientForWindow(rec->pWin)->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
SecurityAudit("Security: denied client %d access to property %s "
"(atom 0x%x) window 0x%lx of client %d on request %s\n",
rec->client->index, NameForAtom(name), name,
(unsigned long)rec->pWin->drawable.id, wClient(rec->pWin)->index,
(unsigned long)rec->pWin->drawable.id, dixClientForWindow(rec->pWin)->index,
SecurityLookupRequestName(rec->client));
rec->status = BadAccess;
}
@ -878,7 +880,7 @@ SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata)
int i;
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
obj = dixLookupPrivate(&dixClientForWindow(rec->pWin)->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, DixSendAccess, 0) == Success)
return;
@ -893,7 +895,7 @@ SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata)
rec->client->index,
LookupEventName(rec->events[i].u.u.type),
(unsigned long)rec->pWin->drawable.id,
wClient(rec->pWin)->index);
dixClientForWindow(rec->pWin)->index);
rec->status = BadAccess;
return;
}
@ -907,7 +909,7 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
SecurityStateRec *subj, *obj;
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
obj = dixLookupPrivate(&dixClientForWindow(rec->pWin)->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, DixReceiveAccess, 0) == Success)
return;
@ -915,7 +917,7 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
SecurityAudit("Security: denied client %d from receiving an event "
"sent to window 0x%lx of client %d\n",
rec->client->index, (unsigned long)rec->pWin->drawable.id,
wClient(rec->pWin)->index);
dixClientForWindow(rec->pWin)->index);
rec->status = BadAccess;
}

View File

@ -33,7 +33,6 @@ from The Open Group.
#include <X11/extensions/secur.h>
#include "input.h" /* for DeviceIntPtr */
#include "property.h" /* for PropertyPtr */
#include "pixmap.h" /* for DrawablePtr */
#include "resource.h" /* for RESTYPE */

View File

@ -33,7 +33,10 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h"
#include "dix/gc_priv.h"
#include "dix/window_priv.h"
#include "miext/extinit_priv.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "os.h"
@ -48,6 +51,8 @@ in this Software without prior written authorization from The Open Group.
#include "gcstruct.h"
#include "protocol-versions.h"
Bool noShapeExtension = FALSE;
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */
);
@ -65,13 +70,6 @@ static void SShapeNotifyEvent(xShapeNotifyEvent * /* from */ ,
* externally by the Xfixes extension and are now defined in window.h
*/
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif /* XINERAMA */
Bool noShapeExtension = FALSE;
static int ShapeEventBase = 0;
static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
@ -270,8 +268,9 @@ ShapeRectangles(ClientPtr client, xShapeRectanglesReq *stuff)
return BadMatch;
srcRgn = RegionFromRects(nrects, prects, ctype);
if (!pWin->optional)
MakeWindowOptional(pWin);
if (!MakeWindowOptional(pWin))
return BadAlloc;
switch (stuff->destKind) {
case ShapeBounding:
destRgn = &pWin->optional->boundingShape;
@ -309,7 +308,7 @@ ProcShapeRectangles(ClientPtr client)
if (result != Success)
return result;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
stuff->dest = win->info[j].id;
result = ShapeRectangles(client, stuff);
if (result != Success)
@ -366,8 +365,9 @@ ShapeMask(ClientPtr client, xShapeMaskReq *stuff)
return BadAlloc;
}
if (!pWin->optional)
MakeWindowOptional(pWin);
if (!MakeWindowOptional(pWin))
return BadAlloc;
switch (stuff->destKind) {
case ShapeBounding:
destRgn = &pWin->optional->boundingShape;
@ -414,7 +414,7 @@ ProcShapeMask(ClientPtr client)
else
pmap = NULL;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
stuff->dest = win->info[j].id;
if (pmap)
stuff->src = pmap->info[j].id;
@ -443,8 +443,9 @@ ShapeCombine(ClientPtr client, xShapeCombineReq *stuff)
rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess);
if (rc != Success)
return rc;
if (!pDestWin->optional)
MakeWindowOptional(pDestWin);
if (!MakeWindowOptional(pDestWin))
return BadAlloc;
switch (stuff->destKind) {
case ShapeBounding:
createDefault = CreateBoundingShape;
@ -492,8 +493,9 @@ ShapeCombine(ClientPtr client, xShapeCombineReq *stuff)
else
srcRgn = (*createSrc) (pSrcWin);
if (!pDestWin->optional)
MakeWindowOptional(pDestWin);
if (!MakeWindowOptional(pDestWin))
return BadAlloc;
switch (stuff->destKind) {
case ShapeBounding:
destRgn = &pDestWin->optional->boundingShape;
@ -536,7 +538,7 @@ ProcShapeCombine(ClientPtr client)
if (result != Success)
return result;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
stuff->dest = win->info[j].id;
stuff->src = win2->info[j].id;
result = ShapeCombine(client, stuff);
@ -600,7 +602,7 @@ ProcShapeOffset(ClientPtr client)
if (result != Success)
return result;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
stuff->dest = win->info[j].id;
result = ShapeOffset(client, stuff);
if (result != Success)
@ -752,7 +754,7 @@ ProcShapeSelectInput(ClientPtr client)
}
/* build the entry */
pNewShapeEvent = malloc(sizeof(ShapeEventRec));
pNewShapeEvent = calloc(1, sizeof(ShapeEventRec));
if (!pNewShapeEvent)
return BadAlloc;
pNewShapeEvent->next = 0;
@ -773,7 +775,7 @@ ProcShapeSelectInput(ClientPtr client)
* done through the resource database.
*/
if (!pHead) {
pHead = malloc(sizeof(ShapeEventPtr));
pHead = calloc(1, sizeof(ShapeEventPtr));
if (!pHead ||
!AddResource(pWin->drawable.id, ShapeEventType,
(void *) pHead)) {
@ -938,7 +940,7 @@ ProcShapeGetRectangles(ClientPtr client)
REQUEST(xShapeGetRectanglesReq);
WindowPtr pWin;
xShapeGetRectanglesReply rep;
xRectangle *rects;
xRectangle *rects = NULL;
int nrects, i, rc;
RegionPtr region;
@ -962,7 +964,7 @@ ProcShapeGetRectangles(ClientPtr client)
}
if (!region) {
nrects = 1;
rects = malloc(sizeof(xRectangle));
rects = calloc(1, sizeof(xRectangle));
if (!rects)
return BadAlloc;
switch (stuff->kind) {
@ -991,14 +993,16 @@ ProcShapeGetRectangles(ClientPtr client)
nrects = RegionNumRects(region);
box = RegionRects(region);
rects = xallocarray(nrects, sizeof(xRectangle));
if (!rects && nrects)
return BadAlloc;
for (i = 0; i < nrects; i++, box++) {
rects[i].x = box->x1;
rects[i].y = box->y1;
rects[i].width = box->x2 - box->x1;
rects[i].height = box->y2 - box->y1;
if (nrects) {
rects = calloc(nrects, sizeof(xRectangle));
if (!rects)
return BadAlloc;
for (i = 0; i < nrects; i++, box++) {
rects[i].x = box->x1;
rects[i].y = box->y1;
rects[i].width = box->x2 - box->x1;
rects[i].height = box->y2 - box->y1;
}
}
}
rep = (xShapeGetRectanglesReply) {

View File

@ -43,11 +43,15 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xfuncproto.h>
#include "dix/dix_priv.h"
#include "dix/screen_hooks_priv.h"
#include "miext/extinit_priv.h"
#include "os/auth.h"
#include "os/busfault.h"
#include "os/client_priv.h"
#include "os/log_priv.h"
#include "os/osdep.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "os.h"
@ -90,28 +94,21 @@ in this Software without prior written authorization from The Open Group.
#define SHMPERM_MODE(p) p->mode
#endif
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif /* XINERAMA */
typedef struct _ShmScrPrivateRec {
CloseScreenProcPtr CloseScreen;
ShmFuncsPtr shmFuncs;
DestroyPixmapProcPtr destroyPixmap;
} ShmScrPrivateRec;
Bool noMITShmExtension = FALSE;
static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
static int ShmDetachSegment(void *value, XID shmseg);
static void ShmResetProc(ExtensionEntry *extEntry);
static void SShmCompletionEvent(xShmCompletionEvent *from,
xShmCompletionEvent *to);
static Bool ShmDestroyPixmap(PixmapPtr pPixmap);
static int ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff);
Bool noMITShmExtension = FALSE;
static unsigned char ShmReqCode;
int ShmCompletionCode;
int BadShmSegCode;
@ -196,15 +193,13 @@ CheckForShmSyscall(void)
#endif
static Bool
ShmCloseScreen(ScreenPtr pScreen)
static void
ShmScreenClose(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
{
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
pScreen->CloseScreen = screen_priv->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
free(screen_priv);
return (*pScreen->CloseScreen) (pScreen);
}
static ShmScrPrivateRec *
@ -214,9 +209,8 @@ ShmInitScreenPriv(ScreenPtr pScreen)
if (!screen_priv) {
screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
screen_priv->CloseScreen = pScreen->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
pScreen->CloseScreen = ShmCloseScreen;
dixScreenHookClose(pScreen, ShmScreenClose);
}
return screen_priv;
}
@ -248,27 +242,6 @@ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
ShmInitScreenPriv(pScreen)->shmFuncs = funcs;
}
static Bool
ShmDestroyPixmap(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
void *shmdesc = NULL;
Bool ret;
if (pPixmap->refcnt == 1)
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
ret = (*pScreen->DestroyPixmap) (pPixmap);
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
pScreen->DestroyPixmap = ShmDestroyPixmap;
if (shmdesc)
ShmDetachSegment(shmdesc, 0);
return ret;
}
void
ShmRegisterFbFuncs(ScreenPtr pScreen)
@ -398,7 +371,7 @@ ProcShmAttach(ClientPtr client)
shmdesc->refcnt++;
}
else {
shmdesc = malloc(sizeof(ShmDescRec));
shmdesc = calloc(1, sizeof(ShmDescRec));
if (!shmdesc)
return BadAlloc;
#ifdef SHM_FD_PASSING
@ -440,6 +413,9 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
ShmDescPtr shmdesc = (ShmDescPtr) value;
ShmDescPtr *prev;
if (!shmdesc)
return Success;
if (--shmdesc->refcnt)
return TRUE;
#if SHM_FD_PASSING
@ -518,7 +494,7 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
else
(void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0,
sw, sh, dx, dy);
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pPixmap, 0);
}
}
@ -767,7 +743,7 @@ ProcShmPutImage(ClientPtr client)
orig_y = stuff->dstY;
sendEvent = stuff->sendEvent;
stuff->sendEvent = 0;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
if (!j)
stuff->sendEvent = sendEvent;
stuff->drawable = draw->info[j].id;
@ -797,7 +773,6 @@ ProcShmGetImage(ClientPtr client)
#ifdef XINERAMA
PanoramiXRes *draw;
DrawablePtr *drawables;
DrawablePtr pDraw;
xShmGetImageReply xgi;
ShmDescPtr shmdesc;
@ -871,7 +846,7 @@ ProcShmGetImage(ClientPtr client)
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr));
DrawablePtr *drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr));
if (!drawables)
return BadAlloc;
@ -1001,7 +976,7 @@ ProcShmCreatePixmap(ClientPtr client)
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
if (!(newPix = malloc(sizeof(PanoramiXRes))))
if (!(newPix = calloc(1, sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
@ -1010,7 +985,7 @@ ProcShmCreatePixmap(ClientPtr client)
result = Success;
FOR_NSCREENS(j) {
FOR_NSCREENS_BACKWARD(j) {
ShmScrPrivateRec *screen_priv;
pScreen = screenInfo.screens[j];
@ -1027,7 +1002,7 @@ ProcShmCreatePixmap(ClientPtr client)
result = XaceHookResourceAccess(client, stuff->pid,
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (result != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
dixDestroyPixmap(pMap, 0);
break;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1073,7 +1048,7 @@ fbShmCreatePixmap(ScreenPtr pScreen,
BitsPerPixel(depth),
PixmapBytePad(width, depth),
(void *) addr)) {
(*pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pPixmap, 0);
return NullPixmap;
}
return pPixmap;
@ -1141,7 +1116,7 @@ ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
dixDestroyPixmap(pMap, 0);
return rc;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1182,14 +1157,13 @@ ProcShmAttachFd(ClientPtr client)
ShmDescPtr shmdesc;
struct stat statb;
SetReqFds(client, 1);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
return BadValue;
}
fd = client->recv_fd_list[0];
client->recv_fd_list[0] = -1;
fd = ReadFdFromClient(client);
if (fd < 0)
return BadMatch;
@ -1198,7 +1172,7 @@ ProcShmAttachFd(ClientPtr client)
return BadMatch;
}
shmdesc = malloc(sizeof(ShmDescRec));
shmdesc = calloc(1, sizeof(ShmDescRec));
if (!shmdesc) {
close(fd);
return BadAlloc;
@ -1319,7 +1293,7 @@ ProcShmCreateSegment(ClientPtr client)
close(fd);
return BadAlloc;
}
shmdesc = malloc(sizeof(ShmDescRec));
shmdesc = calloc(1, sizeof(ShmDescRec));
if (!shmdesc) {
close(fd);
return BadAlloc;
@ -1481,6 +1455,7 @@ static int _X_COLD
SProcShmAttachFd(ClientPtr client)
{
REQUEST(xShmAttachFdReq);
SetReqFds(client, 1);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
swapl(&stuff->shmseg);
return ProcShmAttachFd(client);
@ -1526,6 +1501,14 @@ SProcShmDispatch(ClientPtr client)
}
}
static void ShmPixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr pPixmap)
{
ShmDetachSegment(
dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey),
0);
dixSetPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey, NULL);
}
void
ShmExtensionInit(void)
{
@ -1548,19 +1531,16 @@ ShmExtensionInit(void)
for (i = 0; i < screenInfo.numScreens; i++) {
ShmScrPrivateRec *screen_priv =
ShmInitScreenPriv(screenInfo.screens[i]);
if (!screen_priv)
continue;
if (!screen_priv->shmFuncs)
screen_priv->shmFuncs = &miFuncs;
if (!screen_priv->shmFuncs->CreatePixmap)
sharedPixmaps = xFalse;
}
if (sharedPixmaps)
for (i = 0; i < screenInfo.numScreens; i++) {
ShmScrPrivateRec *screen_priv =
ShmGetScreenPriv(screenInfo.screens[i]);
screen_priv->destroyPixmap =
screenInfo.screens[i]->DestroyPixmap;
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
}
for (i = 0; i < screenInfo.numScreens; i++)
dixScreenHookPixmapDestroy(screenInfo.screens[i], ShmPixmapDestroy);
}
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
if (ShmSegType &&

View File

@ -72,7 +72,7 @@ ClientSleepUntil(ClientPtr client,
TimeStamp *revive,
void (*notifyFunc) (ClientPtr, void *), void *closure)
{
SertafiedPtr pRequest, pReq, pPrev;
SertafiedPtr pReq, pPrev;
if (SertafiedGeneration != serverGeneration) {
SertafiedResType = CreateNewResourceType(SertafiedDelete,
@ -82,7 +82,8 @@ ClientSleepUntil(ClientPtr client,
SertafiedGeneration = serverGeneration;
BlockHandlerRegistered = FALSE;
}
pRequest = malloc(sizeof(SertafiedRec));
SertafiedPtr pRequest = calloc(1, sizeof(SertafiedRec));
if (!pRequest)
return FALSE;
pRequest->pClient = client;

View File

@ -24,9 +24,7 @@
* XFree86 Project.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _SLEEPUNTIL_H_
#define _SLEEPUNTIL_H_ 1

View File

@ -60,6 +60,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/bug_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
@ -199,8 +200,8 @@ SyncAddTriggerToSyncObject(SyncTrigger * pTrigger)
return Success;
}
if (!(pCur = malloc(sizeof(SyncTriggerList))))
return BadAlloc;
/* Failure is not an option, it's succeed or burst! */
pCur = XNFalloc(sizeof(SyncTriggerList));
pCur->pTrigger = pTrigger;
pCur->next = pTrigger->pSync->pTriglist;
@ -310,6 +311,35 @@ SyncCheckTriggerFence(SyncTrigger * pTrigger, int64_t unused)
return (pFence == NULL || pFence->funcs.CheckTriggered(pFence));
}
static inline Bool
checked_int64_add(int64_t *out, int64_t a, int64_t b)
{
/* Do the potentially overflowing math as uint64_t, as signed
* integers in C are undefined on overflow (and the compiler may
* optimize out our overflow check below, otherwise)
*/
int64_t result = (uint64_t)a + (uint64_t)b;
/* signed addition overflows if operands have the same sign, and
* the sign of the result doesn't match the sign of the inputs.
*/
Bool overflow = (a < 0) == (b < 0) && (a < 0) != (result < 0);
*out = result;
return overflow;
}
static inline Bool
checked_int64_subtract(int64_t *out, int64_t a, int64_t b)
{
int64_t result = (uint64_t)a - (uint64_t)b;
Bool overflow = (a < 0) != (b < 0) && (a < 0) != (result < 0);
*out = result;
return overflow;
}
static int
SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
RESTYPE resType, Mask changes)
@ -329,11 +359,6 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
client->errorValue = syncObject;
return rc;
}
if (pSync != pTrigger->pSync) { /* new counter for trigger */
SyncDeleteTriggerFromSyncObject(pTrigger);
pTrigger->pSync = pSync;
newSyncObject = TRUE;
}
}
/* if system counter, ask it what the current value is */
@ -355,6 +380,24 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
}
}
if (changes & (XSyncCAValueType | XSyncCAValue)) {
if (pTrigger->value_type == XSyncAbsolute)
pTrigger->test_value = pTrigger->wait_value;
else { /* relative */
Bool overflow;
if (pCounter == NULL)
return BadMatch;
overflow = checked_int64_add(&pTrigger->test_value,
pCounter->value, pTrigger->wait_value);
if (overflow) {
client->errorValue = pTrigger->wait_value >> 32;
return BadValue;
}
}
}
if (changes & XSyncCATestType) {
if (pSync && SYNC_FENCE == pSync->type) {
@ -383,21 +426,11 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
}
}
if (changes & (XSyncCAValueType | XSyncCAValue)) {
if (pTrigger->value_type == XSyncAbsolute)
pTrigger->test_value = pTrigger->wait_value;
else { /* relative */
Bool overflow;
if (pCounter == NULL)
return BadMatch;
overflow = checked_int64_add(&pTrigger->test_value,
pCounter->value, pTrigger->wait_value);
if (overflow) {
client->errorValue = pTrigger->wait_value >> 32;
return BadValue;
}
if (changes & XSyncCACounter) {
if (pSync != pTrigger->pSync) { /* new counter for trigger */
SyncDeleteTriggerFromSyncObject(pTrigger);
pTrigger->pSync = pSync;
newSyncObject = TRUE;
}
}
@ -405,8 +438,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
* a new counter on a trigger
*/
if (newSyncObject) {
if ((rc = SyncAddTriggerToSyncObject(pTrigger)) != Success)
return rc;
SyncAddTriggerToSyncObject(pTrigger);
}
else if (pCounter && IsSystemCounter(pCounter)) {
SyncComputeBracketValues(pCounter);
@ -617,7 +649,7 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger)
pAwaitUnion = (SyncAwaitUnion *) pAwait->pHeader;
numwaits = pAwaitUnion->header.num_waitconditions;
ppAwait = xallocarray(numwaits, sizeof(SyncAwait *));
ppAwait = calloc(numwaits, sizeof(SyncAwait *));
if (!ppAwait)
goto bail;
@ -731,8 +763,6 @@ SyncChangeCounter(SyncCounter * pCounter, int64_t newval)
static Bool
SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents)
{
SyncAlarmClientList *pClients;
if (client == pAlarm->client) { /* alarm owner */
pAlarm->events = wantevents;
return Success;
@ -740,7 +770,8 @@ SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents)
/* see if the client is already on the list (has events selected) */
for (pClients = pAlarm->pEventClients; pClients; pClients = pClients->next) {
for (SyncAlarmClientList *pClients = pClients = pAlarm->pEventClients;
pClients; pClients = pClients->next) {
if (pClients->client == client) {
/* client's presence on the list indicates desire for
* events. If the client doesn't want events, remove it
@ -766,7 +797,7 @@ SyncEventSelectForAlarm(SyncAlarm * pAlarm, ClientPtr client, Bool wantevents)
/* add new client to pAlarm->pEventClients */
pClients = malloc(sizeof(SyncAlarmClientList));
SyncAlarmClientList *pClients = calloc(1, sizeof(SyncAlarmClientList));
if (!pClients)
return BadAlloc;
@ -797,8 +828,14 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
int status;
XSyncCounter counter;
Mask origmask = mask;
SyncTrigger trigger;
Bool select_events_changed = FALSE;
Bool select_events_value = FALSE;
int64_t delta;
counter = pAlarm->trigger.pSync ? pAlarm->trigger.pSync->id : None;
trigger = pAlarm->trigger;
delta = pAlarm->delta;
counter = trigger.pSync ? trigger.pSync->id : None;
while (mask) {
int index2 = lowbit(mask);
@ -814,24 +851,24 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
case XSyncCAValueType:
mask &= ~XSyncCAValueType;
/* sanity check in SyncInitTrigger */
pAlarm->trigger.value_type = *values++;
trigger.value_type = *values++;
break;
case XSyncCAValue:
mask &= ~XSyncCAValue;
pAlarm->trigger.wait_value = ((int64_t)values[0] << 32) | values[1];
trigger.wait_value = ((int64_t)values[0] << 32) | values[1];
values += 2;
break;
case XSyncCATestType:
mask &= ~XSyncCATestType;
/* sanity check in SyncInitTrigger */
pAlarm->trigger.test_type = *values++;
trigger.test_type = *values++;
break;
case XSyncCADelta:
mask &= ~XSyncCADelta;
pAlarm->delta = ((int64_t)values[0] << 32) | values[1];
delta = ((int64_t)values[0] << 32) | values[1];
values += 2;
break;
@ -841,10 +878,8 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
client->errorValue = *values;
return BadValue;
}
status = SyncEventSelectForAlarm(pAlarm, client,
(Bool) (*values++));
if (status != Success)
return status;
select_events_value = (Bool) (*values++);
select_events_changed = TRUE;
break;
default:
@ -853,25 +888,33 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
}
}
if (select_events_changed) {
status = SyncEventSelectForAlarm(pAlarm, client, select_events_value);
if (status != Success)
return status;
}
/* "If the test-type is PositiveComparison or PositiveTransition
* and delta is less than zero, or if the test-type is
* NegativeComparison or NegativeTransition and delta is
* greater than zero, a Match error is generated."
*/
if (origmask & (XSyncCADelta | XSyncCATestType)) {
if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) ||
(pAlarm->trigger.test_type == XSyncPositiveTransition))
&& pAlarm->delta < 0)
if ((((trigger.test_type == XSyncPositiveComparison) ||
(trigger.test_type == XSyncPositiveTransition))
&& delta < 0)
||
(((pAlarm->trigger.test_type == XSyncNegativeComparison) ||
(pAlarm->trigger.test_type == XSyncNegativeTransition))
&& pAlarm->delta > 0)
(((trigger.test_type == XSyncNegativeComparison) ||
(trigger.test_type == XSyncNegativeTransition))
&& delta > 0)
) {
return BadMatch;
}
}
/* postpone this until now, when we're sure nothing else can go wrong */
pAlarm->delta = delta;
pAlarm->trigger = trigger;
if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter,
origmask & XSyncCAAllTrigger)) != Success)
return status;
@ -889,7 +932,7 @@ SyncCreate(ClientPtr client, XID id, unsigned char type)
switch (type) {
case SYNC_COUNTER:
pSync = malloc(sizeof(SyncCounter));
pSync = calloc(1, sizeof(SyncCounter));
resType = RTCounter;
break;
case SYNC_FENCE:
@ -982,12 +1025,10 @@ SyncCreateSystemCounter(const char *name,
SyncSystemCounterBracketValues BracketValues
)
{
SyncCounter *pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
SyncCounter *pCounter = SyncCreateCounter(NULL, dixAllocServerXID(), initial);
if (pCounter) {
SysCounterInfo *psci;
psci = malloc(sizeof(SysCounterInfo));
SysCounterInfo *psci = calloc(1, sizeof(SysCounterInfo));
if (!psci) {
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
return pCounter;
@ -1266,7 +1307,7 @@ ProcSyncListSystemCounters(ClientPtr client)
}
if (len) {
walklist = list = malloc(len);
walklist = list = calloc(1, len);
if (!list)
return BadAlloc;
}
@ -1313,7 +1354,8 @@ ProcSyncListSystemCounters(ClientPtr client)
}
/*
* ** Set client Priority
* Set the priority of the client owning given resource.
* If the resource ID is None then set the priority of calling client.
*/
static int
ProcSyncSetPriority(ClientPtr client)
@ -1327,7 +1369,7 @@ ProcSyncSetPriority(ClientPtr client)
if (stuff->id == None)
priorityclient = client;
else {
rc = dixLookupClient(&priorityclient, stuff->id, client,
rc = dixLookupResourceOwner(&priorityclient, stuff->id, client,
DixSetAttrAccess);
if (rc != Success)
return rc;
@ -1347,7 +1389,8 @@ ProcSyncSetPriority(ClientPtr client)
}
/*
* ** Get client Priority
* Retrieve the priority of the client owning given resource.
* If the resource ID is None then retrieve the priority of calling client.
*/
static int
ProcSyncGetPriority(ClientPtr client)
@ -1362,7 +1405,7 @@ ProcSyncGetPriority(ClientPtr client)
if (stuff->id == None)
priorityclient = client;
else {
rc = dixLookupClient(&priorityclient, stuff->id, client,
rc = dixLookupResourceOwner(&priorityclient, stuff->id, client,
DixGetAttrAccess);
if (rc != Success)
return rc;
@ -1502,7 +1545,7 @@ SyncAwaitPrologue(ClientPtr client, int items)
/* all the memory for the entire await list is allocated
* here in one chunk
*/
pAwaitUnion = xallocarray(items + 1, sizeof(SyncAwaitUnion));
pAwaitUnion = calloc(items + 1, sizeof(SyncAwaitUnion));
if (!pAwaitUnion)
return NULL;
@ -1694,7 +1737,7 @@ ProcSyncCreateAlarm(ClientPtr client)
if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue | XSyncCADelta))))
return BadLength;
if (!(pAlarm = malloc(sizeof(SyncAlarm)))) {
if (!(pAlarm = calloc(1, sizeof(SyncAlarm)))) {
return BadAlloc;
}
@ -2602,16 +2645,15 @@ typedef struct {
static void
IdleTimeQueryValue(void *pCounter, int64_t *pValue_return)
{
int deviceid;
int deviceid = XIAllDevices;
CARD32 idle;
if (pCounter) {
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
deviceid = priv->deviceid;
if (priv)
deviceid = priv->deviceid;
}
else
deviceid = XIAllDevices;
idle = GetTimeInMillis() - LastEventTime(deviceid).milliseconds;
*pValue_return = idle;
}
@ -2621,6 +2663,8 @@ IdleTimeBlockHandler(void *pCounter, void *wt)
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
if (!priv)
return;
int64_t *less = priv->value_less;
int64_t *greater = priv->value_greater;
int64_t idle, old_idle;
@ -2711,6 +2755,8 @@ IdleTimeWakeupHandler(void *pCounter, int rc)
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
if (!priv)
return;
int64_t *less = priv->value_less;
int64_t *greater = priv->value_greater;
int64_t idle;
@ -2744,6 +2790,8 @@ IdleTimeBracketValues(void *pCounter, int64_t *pbracket_less,
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
if (!priv)
return;
int64_t *less = priv->value_less;
int64_t *greater = priv->value_greater;
Bool registered = (less || greater);
@ -2773,20 +2821,24 @@ init_system_idle_counter(const char *name, int deviceid)
IdleTimeQueryValue(NULL, &idle);
IdleCounterPriv *priv = calloc(1, sizeof(IdleCounterPriv));
if (!priv)
return NULL;
idle_time_counter = SyncCreateSystemCounter(name, idle, resolution,
XSyncCounterUnrestricted,
IdleTimeQueryValue,
IdleTimeBracketValues);
if (idle_time_counter != NULL) {
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
priv->value_less = priv->value_greater = NULL;
priv->deviceid = deviceid;
idle_time_counter->pSysCounterInfo->private = priv;
if (!idle_time_counter) {
free(priv);
return NULL;
}
priv->value_less = priv->value_greater = NULL;
priv->deviceid = deviceid;
idle_time_counter->pSysCounterInfo->private = priv;
return idle_time_counter;
}

View File

@ -44,7 +44,6 @@ from Kaleb S. KEITHLEY
#include "extnsionst.h"
#include "scrnintstr.h"
#include "servermd.h"
#include "swaprep.h"
#include "vidmodestr.h"
#include "globals.h"
#include "protocol-versions.h"
@ -78,9 +77,7 @@ typedef struct {
static DisplayModePtr
VidModeCreateMode(void)
{
DisplayModePtr mode;
mode = malloc(sizeof(DisplayModeRec));
DisplayModePtr mode = calloc(1, sizeof(DisplayModeRec));
if (mode != NULL) {
mode->name = "";
mode->VScan = 1; /* divides refresh rate. default = 1 */
@ -316,6 +313,72 @@ ProcVidModeGetModeLine(ClientPtr client)
return Success;
}
static char *fillModeInfoV1(ClientPtr client, char *buf, int dotClock, DisplayModePtr mode)
{
xXF86OldVidModeModeInfo info = {
.dotclock = dotClock,
.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL),
.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS),
};
if (client->swapped) {
swapl(&info.dotclock);
swaps(&info.hdisplay);
swaps(&info.hsyncstart);
swaps(&info.hsyncend);
swaps(&info.htotal);
swaps(&info.vdisplay);
swaps(&info.vsyncstart);
swaps(&info.vsyncend);
swaps(&info.vtotal);
swapl(&info.flags);
}
memcpy(buf, &info, sizeof(info));
return buf + sizeof(info);
}
static char *fillModeInfoV2(ClientPtr client, char *buf, int dotClock, DisplayModePtr mode)
{
xXF86VidModeModeInfo info = {
.dotclock = dotClock,
.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL),
.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW),
.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS),
};
if (client->swapped) {
swapl(&info.dotclock);
swaps(&info.hdisplay);
swaps(&info.hsyncstart);
swaps(&info.hsyncend);
swaps(&info.htotal);
swapl(&info.hskew);
swaps(&info.vdisplay);
swaps(&info.vsyncstart);
swaps(&info.vsyncend);
swaps(&info.vtotal);
swapl(&info.flags);
}
memcpy(buf, &info, sizeof(info));
return buf + sizeof(info);
}
static int
ProcVidModeGetAllModeLines(ClientPtr client)
{
@ -345,14 +408,13 @@ ProcVidModeGetAllModeLines(ClientPtr client)
if (!pVidMode->GetFirstModeline(pScreen, &mode, &dotClock))
return BadValue;
int payload_len = ((ver < 2) ?
((modecount * sizeof(xXF86OldVidModeModeInfo)) >> 2) :
((modecount * sizeof(xXF86VidModeModeInfo)) >> 2));
int payload_len = modecount * ((ver < 2) ? sizeof(xXF86OldVidModeModeInfo)
: sizeof(xXF86VidModeModeInfo));
xXF86VidModeGetAllModeLinesReply rep = {
.type = X_Reply,
.length = sizeof(xXF86VidModeGetAllModeLinesReply) -
sizeof(xGenericReply) + payload_len,
.length = bytes_to_int32(sizeof(xXF86VidModeGetAllModeLinesReply) -
sizeof(xGenericReply) + payload_len),
.sequenceNumber = client->sequence,
.modecount = modecount
};
@ -362,59 +424,22 @@ ProcVidModeGetAllModeLines(ClientPtr client)
swapl(&rep.length);
swapl(&rep.modecount);
}
WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), &rep);
char *payload = calloc(1, payload_len);
if (!payload)
return BadAlloc;
char *walk = payload;
do {
xXF86VidModeModeInfo mdinf = {
.dotclock = dotClock,
.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL),
.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW),
.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS),
.privsize = 0
};
if (client->swapped) {
swapl(&mdinf.dotclock);
swaps(&mdinf.hdisplay);
swaps(&mdinf.hsyncstart);
swaps(&mdinf.hsyncend);
swaps(&mdinf.htotal);
swapl(&mdinf.hskew);
swaps(&mdinf.vdisplay);
swaps(&mdinf.vsyncstart);
swaps(&mdinf.vsyncend);
swaps(&mdinf.vtotal);
swapl(&mdinf.flags);
swapl(&mdinf.privsize);
}
if (ver < 2) {
xXF86OldVidModeModeInfo oldmdinf = {
.dotclock = mdinf.dotclock,
.hdisplay = mdinf.hdisplay,
.hsyncstart = mdinf.hsyncstart,
.hsyncend = mdinf.hsyncend,
.htotal = mdinf.htotal,
.vdisplay = mdinf.vdisplay,
.vsyncstart = mdinf.vsyncstart,
.vsyncend = mdinf.vsyncend,
.vtotal = mdinf.vtotal,
.flags = mdinf.flags,
.privsize = mdinf.privsize
};
WriteToClient(client, sizeof(xXF86OldVidModeModeInfo), &oldmdinf);
}
else {
WriteToClient(client, sizeof(xXF86VidModeModeInfo), &mdinf);
}
walk = (ver < 2) ? fillModeInfoV1(client, walk, dotClock, mode)
: fillModeInfoV2(client, walk, dotClock, mode);
} while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), &rep);
WriteToClient(client, payload_len, payload);
free(payload);
return Success;
}
@ -754,8 +779,6 @@ VidModeModModeLine(ClientPtr client, xXF86VidModeModModeLineReq *stuff);
static int
ProcVidModeModModeLine(ClientPtr client)
{
int len;
/* limited to local-only connections */
if (!VidModeAllowNonLocal && !client->local)
return VidModeErrorBase + XF86VidModeClientNotLocal;
@ -765,7 +788,7 @@ ProcVidModeModModeLine(ClientPtr client)
if (ClientMajorVersion(client) < 2) {
REQUEST(xXF86OldVidModeModModeLineReq)
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
len =
int len =
client->req_len -
bytes_to_int32(sizeof(xXF86OldVidModeModModeLineReq));
if (len != stuff->privsize)
@ -792,7 +815,7 @@ ProcVidModeModModeLine(ClientPtr client)
else {
REQUEST(xXF86VidModeModModeLineReq);
REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
len =
int len =
client->req_len -
bytes_to_int32(sizeof(xXF86VidModeModModeLineReq));
if (len != stuff->privsize)
@ -806,7 +829,7 @@ VidModeModModeLine(ClientPtr client, xXF86VidModeModModeLineReq *stuff)
{
ScreenPtr pScreen;
VidModePtr pVidMode;
DisplayModePtr mode, modetmp;
DisplayModePtr mode;
int dotClock;
DebugF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
@ -834,7 +857,10 @@ VidModeModModeLine(ClientPtr client, xXF86VidModeModModeLineReq *stuff)
if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
modetmp = VidModeCreateMode();
DisplayModePtr modetmp = VidModeCreateMode();
if (!modetmp)
return BadAlloc;
VidModeCopyMode(mode, modetmp);
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
@ -982,6 +1008,9 @@ VidModeValidateModeLine(ClientPtr client, xXF86VidModeValidateModeLineReq *stuff
return BadValue;
modetmp = VidModeCreateMode();
if (!modetmp)
return BadAlloc;
VidModeCopyMode(mode, modetmp);
VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
@ -1200,14 +1229,20 @@ ProcVidModeLockModeSwitch(ClientPtr client)
return Success;
}
static inline CARD32 _combine_f(vidMonitorValue a, vidMonitorValue b, Bool swapped)
{
CARD32 buf =
((unsigned short) a.f) |
((unsigned short) b.f << 16);
if (swapped)
swapl(&buf);
return buf;
}
static int
ProcVidModeGetMonitor(ClientPtr client)
{
REQUEST(xXF86VidModeGetMonitorReq);
CARD32 *hsyncdata, *vsyncdata;
ScreenPtr pScreen;
VidModePtr pVidMode;
int i, nHsync, nVrefresh, vendorLength = 0, modelLength = 0;
DEBUG_P("XF86VidModeGetMonitor");
@ -1215,24 +1250,23 @@ ProcVidModeGetMonitor(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
pScreen = screenInfo.screens[stuff->screen];
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
pVidMode = VidModeGetPtr(pScreen);
VidModePtr pVidMode = VidModeGetPtr(pScreen);
if (pVidMode == NULL)
return BadImplementation;
nHsync = pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_NHSYNC, 0).i;
nVrefresh = pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_NVREFRESH, 0).i;
const int nHsync = pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_NHSYNC, 0).i;
const int nVrefresh = pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_NVREFRESH, 0).i;
if ((char *) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0)).ptr)
vendorLength = strlen((char *) (pVidMode->GetMonitorValue(pScreen,
VIDMODE_MON_VENDOR,
0)).ptr);
const char *vendorStr = (const char*)pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0).ptr;
const char *modelStr = (const char*)pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0).ptr;
if ((char *) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0)).ptr)
modelLength = strlen((char *) (pVidMode->GetMonitorValue(pScreen,
VIDMODE_MON_MODEL,
0)).ptr);
const int vendorLength = (vendorStr ? strlen(vendorStr) : 0);
const int modelLength = (modelStr ? strlen(modelStr) : 0);
const int nVendorItems = bytes_to_int32(pad_to_int32(vendorLength));
const int nModelItems = bytes_to_int32(pad_to_int32(modelLength));
xXF86VidModeGetMonitorReply rep = {
.type = X_Reply,
@ -1242,58 +1276,51 @@ ProcVidModeGetMonitor(ClientPtr client)
.vendorLength = vendorLength,
.modelLength = modelLength,
.length = bytes_to_int32(sizeof(xXF86VidModeGetMonitorReply) -
sizeof(xGenericReply) +
(nHsync + nVrefresh) * sizeof(CARD32) +
pad_to_int32(vendorLength) +
pad_to_int32(modelLength)),
sizeof(xGenericReply))
+ nHsync + nVrefresh + nVendorItems + nModelItems
};
hsyncdata = xallocarray(nHsync, sizeof(CARD32));
if (!hsyncdata) {
return BadAlloc;
}
vsyncdata = xallocarray(nVrefresh, sizeof(CARD32));
const int buflen = nHsync + nVrefresh + nVendorItems + nModelItems;
if (!vsyncdata) {
free(hsyncdata);
CARD32 *sendbuf = calloc(buflen, sizeof(CARD32));
if (!sendbuf)
return BadAlloc;
CARD32 *bufwalk = sendbuf;
for (int i = 0; i < nHsync; i++) {
*bufwalk = _combine_f(pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_HSYNC_LO, i),
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_HSYNC_HI, i),
client->swapped);
bufwalk++;
}
for (i = 0; i < nHsync; i++) {
hsyncdata[i] = (unsigned short) (pVidMode->GetMonitorValue(pScreen,
VIDMODE_MON_HSYNC_LO,
i)).f |
(unsigned
short) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_HSYNC_HI,
i)).f << 16;
}
for (i = 0; i < nVrefresh; i++) {
vsyncdata[i] = (unsigned short) (pVidMode->GetMonitorValue(pScreen,
VIDMODE_MON_VREFRESH_LO,
i)).f |
(unsigned
short) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VREFRESH_HI,
i)).f << 16;
for (int i = 0; i < nVrefresh; i++) {
*bufwalk = _combine_f(pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VREFRESH_LO, i),
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VREFRESH_HI, i),
client->swapped);
bufwalk++;
}
memcpy(bufwalk,
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0).ptr,
vendorLength);
bufwalk += nVendorItems;
memcpy(bufwalk,
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0).ptr,
modelLength);
bufwalk += nModelItems;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), &rep);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nHsync * sizeof(CARD32), hsyncdata);
WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32), vsyncdata);
if (rep.vendorLength)
WriteToClient(client, rep.vendorLength,
(pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0)).ptr);
if (rep.modelLength)
WriteToClient(client, rep.modelLength,
(pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0)).ptr);
free(hsyncdata);
free(vsyncdata);
WriteToClient(client, sizeof(xXF86VidModeGetMonitorReply), &rep);
WriteToClient(client, buflen * sizeof(CARD32), sendbuf);
free(sendbuf);
return Success;
}
@ -1419,15 +1446,10 @@ ProcVidModeGetDotClocks(ClientPtr client)
swapl(&rep.flags);
}
WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), &rep);
if (!ClockProg) {
if (!ClockProg && Clocks) {
for (n = 0; n < numClocks; n++) {
dotclock = Clocks[n];
if (client->swapped) {
WriteSwappedDataToClient(client, 4, (char *) &dotclock);
}
else {
WriteToClient(client, 4, &dotclock);
}
WriteSwappedDataToClient(client, 4, (char *) &dotclock);
}
}
@ -1552,30 +1574,26 @@ static int
ProcVidModeGetGammaRamp(ClientPtr client)
{
CARD16 *ramp = NULL;
int length;
size_t ramplen = 0;
ScreenPtr pScreen;
VidModePtr pVidMode;
REQUEST(xXF86VidModeGetGammaRampReq);
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
pScreen = screenInfo.screens[stuff->screen];
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
pVidMode = VidModeGetPtr(pScreen);
VidModePtr pVidMode = VidModeGetPtr(pScreen);
if (pVidMode == NULL)
return BadImplementation;
if (stuff->size != pVidMode->GetGammaRampSize(pScreen))
return BadValue;
length = (stuff->size + 1) & ~1;
const int length = (stuff->size + 1) & ~1;
if (stuff->size) {
if (!(ramp = xallocarray(length, 3 * sizeof(CARD16))))
if (!(ramp = calloc(length, 3 * sizeof(CARD16))))
return BadAlloc;
ramplen = length * 3 * sizeof(CARD16);
@ -1589,7 +1607,7 @@ ProcVidModeGetGammaRamp(ClientPtr client)
xXF86VidModeGetGammaRampReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = (length >> 1) * 3,
.length = bytes_to_int32(ramplen),
.size = stuff->size
};
if (client->swapped) {
@ -1599,11 +1617,8 @@ ProcVidModeGetGammaRamp(ClientPtr client)
SwapShorts((short *) ramp, length * 3);
}
WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), &rep);
if (stuff->size) {
WriteToClient(client, ramplen, ramp);
free(ramp);
}
WriteToClient(client, ramplen, ramp);
free(ramp);
return Success;
}
@ -1681,7 +1696,7 @@ ProcVidModeSetClientVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
if ((pPriv = VM_GETPRIV(client)) == NULL) {
pPriv = malloc(sizeof(VidModePrivRec));
pPriv = calloc(1, sizeof(VidModePrivRec));
if (!pPriv)
return BadAlloc;
VM_SETPRIV(client, pPriv);

View File

@ -20,6 +20,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <dix-config.h>
#include <stdarg.h>
#include "os/client_priv.h"
#include "scrnintstr.h"
#include "extnsionst.h"
#include "pixmapstr.h"
@ -201,7 +204,6 @@ XaceCensorImage(ClientPtr client,
if (nRects > 0) { /* we have something to censor */
GCPtr pScratchGC = NULL;
PixmapPtr pPix = NULL;
xRectangle *pRects = NULL;
Bool failed = FALSE;
int depth = 1;
int bitsPerPixel = 1;
@ -210,7 +212,7 @@ XaceCensorImage(ClientPtr client,
/* convert region to list-of-rectangles for PolyFillRect */
pRects = malloc(nRects * sizeof(xRectangle));
xRectangle *pRects = calloc(1, nRects * sizeof(xRectangle));
if (!pRects) {
failed = TRUE;
goto failSafe;

View File

@ -39,7 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* security hooks */
/* Constants used to identify the available security hooks
*/
#define XACE_CORE_DISPATCH 0
#define XACE_EXT_DISPATCH 1
#define XACE_RESOURCE_ACCESS 2
#define XACE_DEVICE_ACCESS 3
@ -61,7 +60,6 @@ extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
/* Entry point for hook functions. Called by Xserver.
* Required by several modules
*/
_X_EXPORT int XaceHook(int hook, ... /* appropriate args for hook */);
_X_EXPORT Bool XaceRegisterCallback(int hook, CallbackProcPtr callback, void *data);
_X_EXPORT Bool XaceDeleteCallback(int hook, CallbackProcPtr callback, void *data);
@ -80,7 +78,7 @@ int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr *ppProp,
Mask access_mode);
int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel, Mask access_mode);
/* needs to be exported for in-tree modsetting, but not part of public API */
/* needs to be exported for in-tree modesetting, but not part of public API */
_X_EXPORT int XaceHookResourceAccess(ClientPtr client, XID id, RESTYPE rtype, void *res,
RESTYPE ptype, void *parent, Mask access_mode);

View File

@ -30,12 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "property.h"
#include "xace.h"
/* XACE_CORE_DISPATCH */
typedef struct {
ClientPtr client;
int status;
} XaceCoreDispatchRec;
/* XACE_RESOURCE_ACCESS */
typedef struct {
ClientPtr client;

View File

@ -33,6 +33,7 @@ from The Open Group.
#include <X11/Xproto.h>
#include <X11/extensions/xcmiscproto.h>
#include "dix/resource_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
@ -100,7 +101,7 @@ ProcXCMiscGetXIDList(ClientPtr client)
if (stuff->count > UINT32_MAX / sizeof(XID))
return BadAlloc;
pids = xallocarray(stuff->count, sizeof(XID));
pids = calloc(stuff->count, sizeof(XID));
if (!pids) {
return BadAlloc;
}

View File

@ -53,6 +53,8 @@
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/xf86bigfproto.h>
#include <X11/fonts/fontstruct.h>
#include <X11/fonts/libxfont2.h>
#include "miext/extinit_priv.h"
@ -144,7 +146,6 @@ static ShmDescPtr ShmList = (ShmDescPtr) NULL;
static ShmDescPtr
shmalloc(unsigned int size)
{
ShmDescPtr pDesc;
int shmid;
char *addr;
@ -162,7 +163,7 @@ shmalloc(unsigned int size)
if (size < 3500)
return (ShmDescPtr) NULL;
pDesc = malloc(sizeof(ShmDescRec));
ShmDescPtr pDesc = calloc(1, sizeof(ShmDescRec));
if (!pDesc)
return (ShmDescPtr) NULL;
@ -382,7 +383,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
}
else {
#endif
pCI = xallocarray(nCharInfos, sizeof(xCharInfo));
pCI = calloc(nCharInfos, sizeof(xCharInfo));
if (!pCI)
return BadAlloc;
#ifdef MITSHM
@ -444,7 +445,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
if (hashModulus > nCharInfos + 1)
hashModulus = nCharInfos + 1;
tmp = xallocarray(4 * nCharInfos + 1, sizeof(CARD16));
tmp = calloc(4 * nCharInfos + 1, sizeof(CARD16));
if (!tmp) {
if (!pDesc)
free(pCI);
@ -531,8 +532,9 @@ ProcXF86BigfontQueryFont(ClientPtr client)
: 0);
xXF86BigfontQueryFontReply rep = {
.type = X_Reply;
.length = bytes_to_int32(buflength),
.type = X_Reply,
.length = bytes_to_int32(sizeof(xXF86BigfontQueryFontReply)
- sizeof(xGenericReply) + rlength),
.sequenceNumber = client->sequence,
.minBounds = pFont->info.ink_minbounds,
.maxBounds = pFont->info.ink_maxbounds,
@ -645,7 +647,6 @@ ProcXF86BigfontDispatch(ClientPtr client)
static int _X_COLD
SProcXF86BigfontQueryVersion(ClientPtr client)
{
REQUEST(xXF86BigfontQueryVersionReq);
return ProcXF86BigfontQueryVersion(client);
}

View File

@ -12,8 +12,10 @@
#include <X11/extensions/XResproto.h>
#include "dix/registry_priv.h"
#include "miext/extinit_priv.h"
#include "dix/resource_priv.h"
#include "os/client_priv.h"
#include "miext/extinit_priv.h"
#include "Xext/xace.h"
#include "misc.h"
#include "os.h"
@ -28,10 +30,7 @@
#include "misc.h"
#include "hashtable.h"
#include "picturestr.h"
#ifdef COMPOSITE
#include "compint.h"
#endif
Bool noResExtension = FALSE;
@ -102,7 +101,7 @@ typedef struct {
static void *
AddFragment(struct xorg_list *frags, int bytes)
{
FragmentList *f = malloc(sizeof(FragmentList) + bytes);
FragmentList *f = calloc(1, sizeof(FragmentList) + bytes);
if (!f) {
return NULL;
} else {
@ -120,9 +119,11 @@ static void
DestroyFragments(struct xorg_list *frags)
{
FragmentList *it, *tmp;
xorg_list_for_each_entry_safe(it, tmp, frags, l) {
xorg_list_del(&it->l);
free(it);
if (!xorg_list_is_empty(frags)) {
xorg_list_for_each_entry_safe(it, tmp, frags, l) {
xorg_list_del(&it->l);
free(it);
}
}
}
@ -201,16 +202,19 @@ ProcXResQueryVersion(ClientPtr client)
static int
ProcXResQueryClients(ClientPtr client)
{
int i, num_clients = 0;
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
int current_clients[currentMaxClients];
int *current_clients = calloc(currentMaxClients, sizeof(int));
if (!current_clients)
return BadAlloc;
for (i = 0; i < currentMaxClients; i++) {
int num_clients = 0;
for (int i = 0; i < currentMaxClients; i++) {
if (clients[i]) {
current_clients[num_clients] = i;
num_clients++;
if (XaceHookClientAccess(client, clients[i], DixReadAccess) == Success) {
current_clients[num_clients] = i;
num_clients++;
}
}
}
@ -225,12 +229,17 @@ ProcXResQueryClients(ClientPtr client)
swapl(&rep.length);
swapl(&rep.num_clients);
}
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
xXResClient scratch[num_clients];
xXResClient *scratch = NULL;
if (num_clients) {
for (i = 0; i < num_clients; i++) {
scratch = calloc(sizeof(xXResClient), num_clients);
if (!scratch) {
free(current_clients);
return BadAlloc;
}
for (int i = 0; i < num_clients; i++) {
scratch[i].resource_base = clients[current_clients[i]]->clientAsMask;
scratch[i].resource_mask = RESOURCE_ID_MASK;
@ -241,8 +250,10 @@ ProcXResQueryClients(ClientPtr client)
}
}
WriteToClient(client, sizeof(scratch), scratch);
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
WriteToClient(client, sizeof(xXResClient) * num_clients, scratch);
free(current_clients);
free(scratch);
return Success;
}
@ -278,27 +289,25 @@ ProcXResQueryClientResources(ClientPtr client)
REQUEST(xXResQueryClientResourcesReq);
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
int i, clientID, num_types = 0;
ClientPtr resClient = dixClientForXID(stuff->xid);
clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) {
if ((!resClient) ||
(XaceHookClientAccess(client, resClient, DixReadAccess)
!= Success)) {
client->errorValue = stuff->xid;
return BadValue;
}
int counts[lastResourceType + 1];
memset(counts, 0, sizeof(counts));
int *counts = calloc(lastResourceType + 1, sizeof(int));
if (!counts)
return BadAlloc;
FindAllClientResources(clients[clientID], ResFindAllRes, counts);
FindAllClientResources(resClient, ResFindAllRes, counts);
int cnt[lastResourceType + 1];
for (i = 0; i <= lastResourceType; i++) {
if (counts[i]) {
cnt[num_types] = counts[i];
int num_types = 0;
for (int i = 0; i <= lastResourceType; i++) {
if (counts[i])
num_types++;
}
}
xXResQueryClientResourcesReply rep = {
@ -313,11 +322,15 @@ ProcXResQueryClientResources(ClientPtr client)
swapl(&rep.num_types);
}
xXResType scratch[num_types];
xXResType *scratch = calloc(sizeof(xXResType), num_types);
if (!scratch) {
free(counts);
return BadAlloc;
}
for (i = 0; i < num_types; i++) {
for (int i = 0; i < num_types; i++) {
scratch[i].resource_type = resourceTypeAtom(i + 1);
scratch[i].count = cnt[i];
scratch[i].count = counts[i];
if (client->swapped) {
swapl(&scratch[i].resource_type);
@ -325,8 +338,11 @@ ProcXResQueryClientResources(ClientPtr client)
}
}
free(counts);
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
WriteToClient(client, sizeof(scratch), scratch);
WriteToClient(client, num_types * sizeof(xXResType), scratch);
free(scratch);
return Success;
}
@ -347,17 +363,16 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
REQUEST(xXResQueryClientPixmapBytesReq);
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
int clientID;
unsigned long bytes = 0;
clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) {
ClientPtr owner = dixClientForXID(stuff->xid);
if ((!owner) ||
(XaceHookClientAccess(client, owner, DixReadAccess)
!= Success)) {
client->errorValue = stuff->xid;
return BadValue;
}
FindAllClientResources(clients[clientID], ResFindResourcePixmaps,
unsigned long bytes = 0;
FindAllClientResources(owner, ResFindResourcePixmaps,
(void *) (&bytes));
xXResQueryClientPixmapBytesReply rep = {
@ -495,13 +510,13 @@ ConstructClientIds(ClientPtr client,
int numSpecs, xXResClientIdSpec* specs,
ConstructClientIdCtx *ctx)
{
int specIdx;
for (specIdx = 0; specIdx < numSpecs; ++specIdx) {
for (int specIdx = 0; specIdx < numSpecs; ++specIdx) {
if (specs[specIdx].client == 0) {
int c;
for (c = 0; c < currentMaxClients; ++c) {
if (clients[c]) {
if (clients[c] &&
(XaceHookClientAccess(client, clients[c], DixReadAccess)
== Success)) {
if (!ConstructClientIdValue(client, clients[c],
specs[specIdx].mask, ctx)) {
return BadAlloc;
@ -509,10 +524,11 @@ ConstructClientIds(ClientPtr client,
}
}
} else {
int clientID = CLIENT_ID(specs[specIdx].client);
if ((clientID < currentMaxClients) && clients[clientID]) {
if (!ConstructClientIdValue(client, clients[clientID],
ClientPtr owner = dixClientForXID(specs[specIdx].client);
if (owner &&
(XaceHookClientAccess(client, owner, DixReadAccess)
== Success)) {
if (!ConstructClientIdValue(client, owner,
specs[specIdx].mask, ctx)) {
return BadAlloc;
}
@ -537,7 +553,6 @@ ProcXResQueryClientIds (ClientPtr client)
REQUEST(xXResQueryClientIdsReq);
xXResClientIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
int rc;
ConstructClientIdCtx ctx;
InitConstructClientIdCtx(&ctx);
@ -546,7 +561,7 @@ ProcXResQueryClientIds (ClientPtr client)
REQUEST_FIXED_SIZE(xXResQueryClientIdsReq,
stuff->numSpecs * sizeof(specs[0]));
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
int rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
if (rc == Success) {
char *buf = calloc(1, ctx.resultBytes);
@ -617,12 +632,11 @@ static void
SwapXResQueryResourceBytes(struct xorg_list *response)
{
struct xorg_list *it = response->next;
int c;
while (it != response) {
xXResResourceSizeValue *value = FRAGMENT_DATA(it);
it = it->next;
for (c = 0; c < value->numCrossReferences; ++c) {
for (int c = 0; c < value->numCrossReferences; ++c) {
xXResResourceSizeSpec *spec = FRAGMENT_DATA(it);
SwapXResResourceSizeSpec(spec);
it = it->next;
@ -825,8 +839,7 @@ static void
ConstructClientResourceBytes(ClientPtr aboutClient,
ConstructResourceBytesCtx *ctx)
{
int specIdx;
for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) {
for (int specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) {
xXResResourceIdSpec* spec = ctx->specs + specIdx;
if (spec->resource) {
/* these specs are handled elsewhere */
@ -858,20 +871,15 @@ ConstructClientResourceBytes(ClientPtr aboutClient,
static void
ConstructResourceBytesByResource(XID aboutClient, ConstructResourceBytesCtx *ctx)
{
int specIdx;
for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) {
for (int specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) {
xXResResourceIdSpec *spec = ctx->specs + specIdx;
if (spec->resource) {
int cid = CLIENT_ID(spec->resource);
if (cid < currentMaxClients &&
(aboutClient == None || cid == aboutClient)) {
ClientPtr client = clients[cid];
if (client) {
ctx->curSpec = spec;
FindAllClientResources(client,
AddResourceSizeValueByResource,
ctx);
}
ClientPtr client = dixClientForXID(spec->resource);
if (client && (aboutClient == None || aboutClient == client->index)) {
ctx->curSpec = spec;
FindAllClientResources(client,
AddResourceSizeValueByResource,
ctx);
}
}
}
@ -890,16 +898,12 @@ ConstructResourceBytes(XID aboutClient,
ConstructResourceBytesCtx *ctx)
{
if (aboutClient) {
int clientIdx = CLIENT_ID(aboutClient);
ClientPtr client = NullClient;
if ((clientIdx >= currentMaxClients) || !clients[clientIdx]) {
ClientPtr client = dixClientForXID(aboutClient);
if (!client) {
ctx->sendClient->errorValue = aboutClient;
return BadValue;
}
client = clients[clientIdx];
ConstructClientResourceBytes(client, ctx);
ConstructResourceBytesByResource(aboutClient, ctx);
} else {
@ -929,9 +933,7 @@ ProcXResQueryResourceBytes (ClientPtr client)
REQUEST(xXResQueryResourceBytesReq);
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
int rc;
ConstructResourceBytesCtx ctx;
ConstructResourceBytesCtx ctx;
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
return BadLength;
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
@ -944,7 +946,7 @@ ProcXResQueryResourceBytes (ClientPtr client)
return BadAlloc;
}
rc = ConstructResourceBytes(stuff->client, &ctx);
int rc = ConstructResourceBytes(stuff->client, &ctx);
if (rc == Success) {
xXResQueryResourceBytesReply rep = {

View File

@ -55,7 +55,7 @@ int selinuxEnforcingState = SELINUX_MODE_DEFAULT;
static char *
SELinuxCopyContext(char *ptr, unsigned len)
{
char *copy = malloc(len + 1);
char *copy = calloc(1, len + 1);
if (!copy)
return NULL;
@ -70,7 +70,6 @@ ProcSELinuxQueryVersion(ClientPtr client)
SELinuxQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.server_major = SELINUX_MAJOR_VERSION,
.server_minor = SELINUX_MINOR_VERSION
};
@ -87,7 +86,6 @@ ProcSELinuxQueryVersion(ClientPtr client)
static int
SELinuxSendContextReply(ClientPtr client, security_id_t sid)
{
SELinuxGetContextReply rep;
char *ctx = NULL;
int len = 0;
@ -97,7 +95,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
len = strlen(ctx) + 1;
}
rep = (SELinuxGetContextReply) {
SELinuxGetContextReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(len),
@ -300,7 +298,7 @@ ProcSELinuxGetClientContext(ClientPtr client)
REQUEST(SELinuxGetContextReq);
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
rc = dixLookupClient(&target, stuff->id, client, DixGetAttrAccess);
rc = dixLookupResourceOwner(&target, stuff->id, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@ -315,6 +313,8 @@ SELinuxPopulateItem(SELinuxListItemRec * i, PrivateRec ** privPtr, CARD32 id,
SELinuxObjectRec *obj = dixLookupPrivate(privPtr, objectKey);
SELinuxObjectRec *data = dixLookupPrivate(privPtr, dataKey);
if (!i)
return BadValue;
if (avc_sid_to_context_raw(obj->sid, &i->octx) < 0)
return BadValue;
if (avc_sid_to_context_raw(data->sid, &i->dctx) < 0)
@ -333,6 +333,9 @@ SELinuxFreeItems(SELinuxListItemRec * items, int count)
{
int k;
if (!items)
return;
for (k = 0; k < count; k++) {
freecon(items[k].octx);
freecon(items[k].dctx);
@ -344,16 +347,15 @@ static int
SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
int size, int count)
{
int rc, k, pos = 0;
SELinuxListItemsReply rep;
CARD32 *buf;
buf = calloc(size, sizeof(CARD32));
int rc = BadAlloc, k, pos = 0;
CARD32 *buf = calloc(size, sizeof(CARD32));
if (size && !buf) {
rc = BadAlloc;
goto out;
}
if (!buf) // silence analyzer warning
goto sendreply;
/* Fill in the buffer */
for (k = 0; k < count; k++) {
buf[pos] = items[k].id;
@ -377,8 +379,9 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
pos += items[k].dctx_len;
}
sendreply: ;
/* Send reply to client */
rep = (SELinuxListItemsReply) {
SELinuxListItemsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = size,
@ -420,7 +423,7 @@ ProcSELinuxListProperties(ClientPtr client)
/* Count the number of properties and allocate items */
count = 0;
for (pProp = wUserProps(pWin); pProp; pProp = pProp->next)
for (pProp = pWin->properties; pProp; pProp = pProp->next)
count++;
items = calloc(count, sizeof(SELinuxListItemRec));
if (count && !items)
@ -429,7 +432,7 @@ ProcSELinuxListProperties(ClientPtr client)
/* Fill in the items and calculate size */
i = 0;
size = 0;
for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) {
for (pProp = pWin->properties; pProp; pProp = pProp->next) {
id = pProp->propertyName;
rc = SELinuxPopulateItem(items + i, &pProp->devPrivates, id, &size);
if (rc != Success) {

View File

@ -32,7 +32,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xatom.h>
#include <X11/Xfuncproto.h>
#include "dix/input_priv.h"
#include "dix/registry_priv.h"
#include "dix/resource_priv.h"
#include "dix/selection_priv.h"
#include "os/client_priv.h"
@ -630,7 +632,10 @@ SELinuxResource(CallbackListPtr *pcbl, void *unused, void *calldata)
if (offset < 0) {
/* No: use the SID of the owning client */
class = SECCLASS_X_RESOURCE;
privatePtr = &clients[CLIENT_ID(rec->id)]->devPrivates;
ClientPtr owner = dixClientForXID(rec->id);
if (!owner)
return;
privatePtr = &owner->devPrivates;
obj = dixLookupPrivate(privatePtr, objectKey);
}
else {
@ -771,7 +776,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
return;
pWin = (WindowPtr) rec->value;
subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey);
subj = dixLookupPrivate(&dixClientForWindow(pWin)->devPrivates, subjectKey);
if (subj->sid) {
char *ctx;

View File

@ -38,8 +38,13 @@
#include "dix/input_priv.h"
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "mi/mi_priv.h"
#include "mi/mipointer_priv.h"
#include "miext/extinit_priv.h"
#include "os/client_priv.h"
#include "os/osdep.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "os.h"
@ -48,9 +53,7 @@
#include "windowstr.h"
#include "inputstr.h"
#include "scrnintstr.h"
#include "dixevents.h"
#include "sleepuntil.h"
#include "mi.h"
#include "xkbsrv.h"
#include "xkbstr.h"
#include "exglobals.h"
@ -79,11 +82,6 @@ static InternalEvent *xtest_evlist;
*/
DeviceIntPtr xtestpointer, xtestkeyboard;
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif /* XINERAMA */
static int XTestSwapFakeInput(ClientPtr /* client */ ,
xReq * /* req */
);
@ -130,7 +128,7 @@ ProcXTestCompareCursor(ClientPtr client)
if (stuff->cursor == None)
pCursor = NullCursor;
else if (stuff->cursor == XTestCurrentCursor)
pCursor = GetSpriteCursor(ptr);
pCursor = InputDevGetSpriteCursor(ptr);
else {
rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor,
X11_RESTYPE_CURSOR, client, DixReadAccess);
@ -383,7 +381,7 @@ ProcXTestFakeInput(ClientPtr client)
switch (type) {
case KeyPress:
case KeyRelease:
if (!dev->key)
if ((!dev) || (!dev->key))
return BadDevice;
if (ev->u.u.detail < dev->key->xkbInfo->desc->min_key_code ||
@ -395,7 +393,7 @@ ProcXTestFakeInput(ClientPtr client)
need_ptr_update = 0;
break;
case MotionNotify:
if (!dev->valuator)
if (!dev || !dev->valuator)
return BadDevice;
if (!(extension || ev->u.keyButtonPointer.root == None)) {
@ -426,7 +424,7 @@ ProcXTestFakeInput(ClientPtr client)
break;
case ButtonPress:
case ButtonRelease:
if (!dev->button)
if (!dev || !dev->button)
return BadDevice;
if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons) {
@ -440,7 +438,7 @@ ProcXTestFakeInput(ClientPtr client)
valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
if (dev->sendEventsProc)
if (dev && dev->sendEventsProc)
(*dev->sendEventsProc) (dev, type, ev->u.u.detail, flags, &mask);
if (need_ptr_update)
@ -649,7 +647,7 @@ AllocXTestDevice(ClientPtr client, const char *name,
BOOL
IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master)
{
if (IsMaster(dev))
if (InputDevIsMaster(dev))
return FALSE;
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest

View File

@ -32,6 +32,8 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "Xext/xvdix_priv.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "misc.h"
#include "scrnintstr.h"
@ -49,9 +51,6 @@ SOFTWARE.
#include "xvdisp.h"
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
unsigned long XvXRTPort;
#endif /* XINERAMA */
@ -1019,9 +1018,8 @@ ProcXvQueryImageAttributes(ClientPtr client)
CARD16 width, height;
XvImagePtr pImage = NULL;
XvPortPtr pPort;
int *offsets;
int *pitches;
int planeLength;
int32_t *offsets;
int32_t *pitches;
REQUEST(xvQueryImageAttributesReq);
@ -1046,7 +1044,9 @@ ProcXvQueryImageAttributes(ClientPtr client)
num_planes = pImage->num_planes;
if (!(offsets = malloc(num_planes << 3)))
// allocating for `offsets` as well as `pitches` in one block
// both having CARD32 * num_planes (actually int32_t put into CARD32)
if (!(offsets = calloc(num_planes*2, sizeof(CARD32))))
return BadAlloc;
pitches = offsets + num_planes;
@ -1060,7 +1060,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
rep = (xvQueryImageAttributesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = planeLength = num_planes << 1,
.length = num_planes * 2, // in 32bit units
.num_planes = num_planes,
.width = width,
.height = height,
@ -1069,8 +1069,8 @@ ProcXvQueryImageAttributes(ClientPtr client)
_WriteQueryImageAttributesReply(client, &rep);
if (client->swapped)
SwapLongs((CARD32 *) offsets, planeLength);
WriteToClient(client, planeLength << 2, offsets);
SwapLongs((CARD32 *) offsets, rep.length);
WriteToClient(client, rep.length * sizeof(CARD32), offsets);
free(offsets);
@ -1836,12 +1836,12 @@ XineramifyXv(void)
/* now create a resource for each port */
for (j = 0; j < refAdapt->nPorts; j++) {
PanoramiXRes *port = malloc(sizeof(PanoramiXRes));
PanoramiXRes *port = calloc(1, sizeof(PanoramiXRes));
if (!port)
break;
FOR_NSCREENS(k) {
FOR_NSCREENS_BACKWARD(k) {
if (MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j))
port->info[k].id = MatchingAdaptors[k]->base_id + j;
else

View File

@ -1,2 +1,7 @@
#ifndef XSERVER_XVDISP_H
#define XSERVER_XVDISP_H
extern void XineramifyXv(void);
extern int xvUseXinerama;
#endif /* XSERVER_XVDISP_H */

View File

@ -173,9 +173,9 @@ typedef struct {
int version, revision;
int nAdaptors;
XvAdaptorPtr pAdaptors;
DestroyWindowProcPtr DestroyWindow;
DestroyPixmapProcPtr DestroyPixmap;
CloseScreenProcPtr CloseScreen;
void *_dummy1; // required in place of a removed field for ABI compatibility
void *_dummy2; // required in place of a removed field for ABI compatibility
void *_dummy3; // required in place of a removed field for ABI compatibility
} XvScreenRec, *XvScreenPtr;
extern _X_EXPORT int XvScreenInit(ScreenPtr);

View File

@ -2,7 +2,9 @@
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XORG_XVDIX_PRIV_H
#define _XORG_XVDIX_PRIV_H
#include <X11/Xdefs.h>

View File

@ -81,7 +81,10 @@ SOFTWARE.
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvproto.h>
#include "dix/screen_hooks_priv.h"
#include "miext/extinit_priv.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#include "Xext/xvdix_priv.h"
#include "misc.h"
@ -95,11 +98,6 @@ SOFTWARE.
#include "resource.h"
#include "opaque.h"
#include "input.h"
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif /* XINERAMA */
#include "xvdisp.h"
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
@ -143,9 +141,7 @@ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
static Bool CreateResourceTypes(void);
static Bool XvCloseScreen(ScreenPtr);
static Bool XvDestroyPixmap(PixmapPtr);
static Bool XvDestroyWindow(WindowPtr);
static void XvScreenClose(CallbackListPtr *pcbl, ScreenPtr, void *arg);
static void XvResetProc(ExtensionEntry *);
static int XvdiDestroyGrab(void *, XID);
static int XvdiDestroyEncoding(void *, XID);
@ -154,6 +150,7 @@ static int XvdiDestroyPortNotify(void *, XID);
static int XvdiDestroyVideoNotifyList(void *, XID);
static int XvdiDestroyPort(void *, XID);
static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
static void XvStopAdaptors(DrawablePtr pDrawable);
/*
** XvExtensionInit
@ -259,11 +256,19 @@ CreateResourceTypes(void)
}
static void XvWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin)
{
XvStopAdaptors(&pWin->drawable);
}
static void XvPixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr pPixmap)
{
XvStopAdaptors(&pPixmap->drawable);
}
int
XvScreenInit(ScreenPtr pScreen)
{
XvScreenPtr pxvs;
if (XvScreenGeneration != serverGeneration) {
if (!CreateResourceTypes()) {
ErrorF("XvScreenInit: Unable to allocate resource types\n");
@ -284,7 +289,7 @@ XvScreenInit(ScreenPtr pScreen)
/* ALLOCATE SCREEN PRIVATE RECORD */
pxvs = malloc(sizeof(XvScreenRec));
XvScreenPtr pxvs = calloc(1, sizeof(XvScreenRec));
if (!pxvs) {
ErrorF("XvScreenInit: Unable to allocate screen private structure\n");
return BadAlloc;
@ -292,34 +297,26 @@ XvScreenInit(ScreenPtr pScreen)
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
pxvs->DestroyWindow = pScreen->DestroyWindow;
pxvs->CloseScreen = pScreen->CloseScreen;
pScreen->DestroyPixmap = XvDestroyPixmap;
pScreen->DestroyWindow = XvDestroyWindow;
pScreen->CloseScreen = XvCloseScreen;
dixScreenHookWindowDestroy(pScreen, XvWindowDestroy);
dixScreenHookClose(pScreen, XvScreenClose);
dixScreenHookPixmapDestroy(pScreen, XvPixmapDestroy);
return Success;
}
static Bool
XvCloseScreen(ScreenPtr pScreen)
static void XvScreenClose(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
{
XvScreenPtr pxvs;
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
pScreen->DestroyWindow = pxvs->DestroyWindow;
pScreen->CloseScreen = pxvs->CloseScreen;
dixScreenUnhookWindowDestroy(pScreen, XvWindowDestroy);
dixScreenUnhookClose(pScreen, XvScreenClose);
dixScreenUnhookPixmapDestroy(pScreen, XvPixmapDestroy);
free(pxvs);
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
return (*pScreen->CloseScreen) (pScreen);
}
static void
@ -353,7 +350,7 @@ XvStopAdaptors(DrawablePtr pDrawable)
XvPortPtr pp = pa->pPorts;
int np = pa->nPorts;
while (np--) {
while ((np--) && (pp)) {
if (pp->pDraw == pDrawable) {
XvdiSendVideoNotify(pp, pDrawable, XvPreempted);
@ -369,39 +366,6 @@ XvStopAdaptors(DrawablePtr pDrawable)
}
}
static Bool
XvDestroyPixmap(PixmapPtr pPix)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
Bool status;
if (pPix->refcnt == 1)
XvStopAdaptors(&pPix->drawable);
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
status = (*pScreen->DestroyPixmap) (pPix);
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
return status;
}
static Bool
XvDestroyWindow(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
Bool status;
XvStopAdaptors(&pWin->drawable);
SCREEN_PROLOGUE(pScreen, DestroyWindow);
status = (*pScreen->DestroyWindow) (pWin);
SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
return status;
}
static int
XvdiDestroyPort(void *pPort, XID id)
{
@ -810,7 +774,7 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
WILL BE DELETED WHEN THE DRAWABLE IS DESTROYED */
if (!pn) {
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
if (!(tpn = calloc(1, sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = NULL;
tpn->client = NULL;
@ -846,7 +810,7 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
tpn = fpn;
}
else {
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
if (!(tpn = calloc(1, sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = pn->next;
pn->next = tpn;
@ -900,7 +864,7 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */
if (!tpn) {
if (!(tpn = malloc(sizeof(XvPortNotifyRec))))
if (!(tpn = calloc(1, sizeof(XvPortNotifyRec))))
return BadAlloc;
tpn->next = pPort->pNotify;
pPort->pNotify = tpn;
@ -1084,7 +1048,7 @@ XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region)
(void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval);
ValidateGC(pDraw, gc);
rects = xallocarray(nbox, sizeof(xRectangle));
rects = calloc(nbox, sizeof(xRectangle));
if (rects) {
for (i = 0; i < nbox; i++, pbox++) {
rects[i].x = pbox->x1 - pDraw->x;

View File

@ -9,6 +9,7 @@
#include <X11/extensions/Xvproto.h>
#include <X11/extensions/XvMCproto.h>
#include "dix/screen_hooks_priv.h"
#include "miext/extinit_priv.h"
#include "Xext/xvdix_priv.h"
@ -48,7 +49,6 @@ static RESTYPE XvMCRTSubpicture;
typedef struct {
int num_adaptors;
XvMCAdaptorPtr adaptors;
CloseScreenProcPtr CloseScreen;
char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE];
char busID[DR_BUSID_SIZE];
int major;
@ -112,7 +112,6 @@ ProcXvMCQueryVersion(ClientPtr client)
xvmcQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.major = SERVER_XVMC_MAJOR_VERSION,
.minor = SERVER_XVMC_MINOR_VERSION
};
@ -128,13 +127,8 @@ static int
ProcXvMCListSurfaceTypes(ClientPtr client)
{
XvPortPtr pPort;
int i;
XvMCScreenPtr pScreenPriv;
xvmcListSurfaceTypesReply rep;
xvmcSurfaceInfo info;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface;
int num_surfaces;
REQUEST(xvmcListSurfaceTypesReq);
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
@ -145,7 +139,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
if ((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
for (i = 0; i < pScreenPriv->num_adaptors; i++) {
for (int i = 0; i < pScreenPriv->num_adaptors; i++) {
if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
break;
@ -154,28 +148,36 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
}
}
num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
rep = (xvmcListSurfaceTypesReply) {
int num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
xvmcSurfaceInfo *info = NULL;
if (num_surfaces) {
info = calloc(sizeof(xvmcSurfaceInfo), num_surfaces);
if (!info)
return BadAlloc;
for (int i = 0; i < num_surfaces; i++) {
XvMCSurfaceInfoPtr surface = adaptor->surfaces[i];
info[i].surface_type_id = surface->surface_type_id;
info[i].chroma_format = surface->chroma_format;
info[i].max_width = surface->max_width;
info[i].max_height = surface->max_height;
info[i].subpicture_max_width = surface->subpicture_max_width;
info[i].subpicture_max_height = surface->subpicture_max_height;
info[i].mc_type = surface->mc_type;
info[i].flags = surface->flags;
}
}
xvmcListSurfaceTypesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num = num_surfaces,
.length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)),
.length = bytes_to_int32(sizeof(xvmcSurfaceInfo) * num_surfaces),
};
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
for (i = 0; i < num_surfaces; i++) {
surface = adaptor->surfaces[i];
info.surface_type_id = surface->surface_type_id;
info.chroma_format = surface->chroma_format;
info.max_width = surface->max_width;
info.max_height = surface->max_height;
info.subpicture_max_width = surface->subpicture_max_width;
info.subpicture_max_height = surface->subpicture_max_height;
info.mc_type = surface->mc_type;
info.flags = surface->flags;
WriteToClient(client, sizeof(xvmcSurfaceInfo), &info);
}
WriteToClient(client, sizeof(xvmcSurfaceInfo) * num_surfaces, info);
free(info);
return Success;
}
@ -186,13 +188,12 @@ ProcXvMCCreateContext(ClientPtr client)
XvPortPtr pPort;
CARD32 *data = NULL;
int dwords = 0;
int i, result, adapt_num = -1;
int result, adapt_num = -1;
ScreenPtr pScreen;
XvMCContextPtr pContext;
XvMCScreenPtr pScreenPriv;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface = NULL;
xvmcCreateContextReply rep;
REQUEST(xvmcCreateContextReq);
REQUEST_SIZE_MATCH(xvmcCreateContextReq);
@ -207,7 +208,7 @@ ProcXvMCCreateContext(ClientPtr client)
if (!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
return BadMatch;
for (i = 0; i < pScreenPriv->num_adaptors; i++) {
for (int i = 0; i < pScreenPriv->num_adaptors; i++) {
if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
adapt_num = i;
@ -218,7 +219,7 @@ ProcXvMCCreateContext(ClientPtr client)
if (adapt_num < 0) /* none this port */
return BadMatch;
for (i = 0; i < adaptor->num_surfaces; i++) {
for (int i = 0; i < adaptor->num_surfaces; i++) {
if (adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
surface = adaptor->surfaces[i];
break;
@ -233,7 +234,7 @@ ProcXvMCCreateContext(ClientPtr client)
(stuff->height > surface->max_height))
return BadValue;
if (!(pContext = malloc(sizeof(XvMCContextRec)))) {
if (!(pContext = calloc(1, sizeof(XvMCContextRec)))) {
return BadAlloc;
}
@ -257,7 +258,7 @@ ProcXvMCCreateContext(ClientPtr client)
return BadAlloc;
}
rep = (xvmcCreateContextReply) {
xvmcCreateContextReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = dwords,
@ -303,7 +304,6 @@ ProcXvMCCreateSurface(ClientPtr client)
XvMCContextPtr pContext;
XvMCSurfacePtr pSurface;
XvMCScreenPtr pScreenPriv;
xvmcCreateSurfaceReply rep;
REQUEST(xvmcCreateSurfaceReq);
REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq);
@ -315,7 +315,7 @@ ProcXvMCCreateSurface(ClientPtr client)
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
if (!(pSurface = malloc(sizeof(XvMCSurfaceRec))))
if (!(pSurface = calloc(1, sizeof(XvMCSurfaceRec))))
return BadAlloc;
pSurface->surface_id = stuff->surface_id;
@ -336,7 +336,7 @@ ProcXvMCCreateSurface(ClientPtr client)
return BadAlloc;
}
rep = (xvmcCreateSurfaceReply) {
xvmcCreateSurfaceReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = dwords
@ -377,11 +377,10 @@ ProcXvMCCreateSubpicture(ClientPtr client)
{
Bool image_supported = FALSE;
CARD32 *data = NULL;
int i, result, dwords = 0;
int result, dwords = 0;
XvMCContextPtr pContext;
XvMCSubpicturePtr pSubpicture;
XvMCScreenPtr pScreenPriv;
xvmcCreateSubpictureReply rep;
XvMCAdaptorPtr adaptor;
XvMCSurfaceInfoPtr surface = NULL;
@ -398,7 +397,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
adaptor = &(pScreenPriv->adaptors[pContext->adapt_num]);
/* find which surface this context supports */
for (i = 0; i < adaptor->num_surfaces; i++) {
for (int i = 0; i < adaptor->num_surfaces; i++) {
if (adaptor->surfaces[i]->surface_type_id == pContext->surface_type_id) {
surface = adaptor->surfaces[i];
break;
@ -412,7 +411,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
if (!surface->compatible_subpictures)
return BadMatch;
for (i = 0; i < surface->compatible_subpictures->num_xvimages; i++) {
for (int i = 0; i < surface->compatible_subpictures->num_xvimages; i++) {
if (surface->compatible_subpictures->xvimage_ids[i] ==
stuff->xvimage_id) {
image_supported = TRUE;
@ -428,7 +427,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
(stuff->height > surface->subpicture_max_height))
return BadValue;
if (!(pSubpicture = malloc(sizeof(XvMCSubpictureRec))))
if (!(pSubpicture = calloc(1, sizeof(XvMCSubpictureRec))))
return BadAlloc;
pSubpicture->subpicture_id = stuff->subpicture_id;
@ -456,7 +455,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
return BadAlloc;
}
rep = (xvmcCreateSubpictureReply) {
xvmcCreateSubpictureReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = dwords,
@ -504,14 +503,11 @@ static int
ProcXvMCListSubpictureTypes(ClientPtr client)
{
XvPortPtr pPort;
xvmcListSubpictureTypesReply rep;
XvMCScreenPtr pScreenPriv;
ScreenPtr pScreen;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface = NULL;
xvImageFormatInfo info;
XvImagePtr pImage;
int i, j;
REQUEST(xvmcListSubpictureTypesReq);
REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq);
@ -526,7 +522,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
if (!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return BadMatch; /* None this screen */
for (i = 0; i < pScreenPriv->num_adaptors; i++) {
for (int i = 0; i < pScreenPriv->num_adaptors; i++) {
if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
break;
@ -536,7 +532,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
if (!adaptor)
return BadMatch;
for (i = 0; i < adaptor->num_surfaces; i++) {
for (int i = 0; i < adaptor->num_surfaces; i++) {
if (adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
surface = adaptor->surfaces[i];
break;
@ -546,62 +542,70 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
if (!surface)
return BadMatch;
rep = (xvmcListSubpictureTypesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num = 0
};
if (surface->compatible_subpictures)
rep.num = surface->compatible_subpictures->num_xvimages;
int num = (surface->compatible_subpictures ?
surface->compatible_subpictures->num_xvimages : 0);
rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo));
xvImageFormatInfo *info = NULL;
if (num) {
info = calloc(sizeof(xvImageFormatInfo), num);
if (!info)
return BadAlloc;
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep);
for (i = 0; i < rep.num; i++) {
pImage = NULL;
for (j = 0; j < adaptor->num_subpictures; j++) {
if (surface->compatible_subpictures->xvimage_ids[i] ==
adaptor->subpictures[j]->id) {
pImage = adaptor->subpictures[j];
break;
for (int i = 0; i < num; i++) {
pImage = NULL;
for (int j = 0; j < adaptor->num_subpictures; j++) {
if (surface->compatible_subpictures->xvimage_ids[i] ==
adaptor->subpictures[j]->id) {
pImage = adaptor->subpictures[j];
break;
}
}
if (!pImage) {
free(info);
return BadImplementation;
}
}
if (!pImage)
return BadImplementation;
info.id = pImage->id;
info.type = pImage->type;
info.byte_order = pImage->byte_order;
memcpy(&info.guid, pImage->guid, 16);
info.bpp = pImage->bits_per_pixel;
info.num_planes = pImage->num_planes;
info.depth = pImage->depth;
info.red_mask = pImage->red_mask;
info.green_mask = pImage->green_mask;
info.blue_mask = pImage->blue_mask;
info.format = pImage->format;
info.y_sample_bits = pImage->y_sample_bits;
info.u_sample_bits = pImage->u_sample_bits;
info.v_sample_bits = pImage->v_sample_bits;
info.horz_y_period = pImage->horz_y_period;
info.horz_u_period = pImage->horz_u_period;
info.horz_v_period = pImage->horz_v_period;
info.vert_y_period = pImage->vert_y_period;
info.vert_u_period = pImage->vert_u_period;
info.vert_v_period = pImage->vert_v_period;
memcpy(&info.comp_order, pImage->component_order, 32);
info.scanline_order = pImage->scanline_order;
WriteToClient(client, sizeof(xvImageFormatInfo), &info);
info[i].id = pImage->id;
info[i].type = pImage->type;
info[i].byte_order = pImage->byte_order;
memcpy(&info[i].guid, pImage->guid, 16);
info[i].bpp = pImage->bits_per_pixel;
info[i].num_planes = pImage->num_planes;
info[i].depth = pImage->depth;
info[i].red_mask = pImage->red_mask;
info[i].green_mask = pImage->green_mask;
info[i].blue_mask = pImage->blue_mask;
info[i].format = pImage->format;
info[i].y_sample_bits = pImage->y_sample_bits;
info[i].u_sample_bits = pImage->u_sample_bits;
info[i].v_sample_bits = pImage->v_sample_bits;
info[i].horz_y_period = pImage->horz_y_period;
info[i].horz_u_period = pImage->horz_u_period;
info[i].horz_v_period = pImage->horz_v_period;
info[i].vert_y_period = pImage->vert_y_period;
info[i].vert_u_period = pImage->vert_u_period;
info[i].vert_v_period = pImage->vert_v_period;
memcpy(&info[i].comp_order, pImage->component_order, 32);
info[i].scanline_order = pImage->scanline_order;
}
}
xvmcListSubpictureTypesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num = num,
.length = bytes_to_int32(num * sizeof(xvImageFormatInfo)),
};
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep);
WriteToClient(client, sizeof(xvImageFormatInfo) * num, info);
free(info);
return Success;
}
static int
ProcXvMCGetDRInfo(ClientPtr client)
{
xvmcGetDRInfoReply rep;
XvPortPtr pPort;
ScreenPtr pScreen;
XvMCScreenPtr pScreenPriv;
@ -618,21 +622,30 @@ ProcXvMCGetDRInfo(ClientPtr client)
pScreen = pPort->pAdaptor->pScreen;
pScreenPriv = XVMC_GET_PRIVATE(pScreen);
rep = (xvmcGetDRInfoReply) {
int nameLen = strlen(pScreenPriv->clientDriverName) + 1;
int busIDLen = strlen(pScreenPriv->busID) + 1;
// buffer holds two zero-terminated strings, padded to 4-byte ints
const size_t buflen = pad_to_int32(nameLen+busIDLen);
char *buf = calloc(1, buflen);
if (!buf)
return BadAlloc;
memcpy(buf, pScreenPriv->clientDriverName, nameLen);
memcpy(buf+nameLen, pScreenPriv->busID, busIDLen);
xvmcGetDRInfoReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.major = pScreenPriv->major,
.minor = pScreenPriv->minor,
.patchLevel = pScreenPriv->patchLevel,
.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1),
.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1),
.nameLen = nameLen,
.busIDLen = busIDLen,
.length = bytes_to_int32(sizeof(buf)),
.isLocal = 1
};
rep.length = rep.nameLen + rep.busIDLen;
rep.nameLen <<= 2;
rep.busIDLen <<= 2;
/*
* Read back to the client what she has put in the shared memory
* segment she prepared for us.
@ -660,33 +673,40 @@ ProcXvMCGetDRInfo(ClientPtr client)
#endif /* HAS_XVMCSHM */
WriteToClient(client, sizeof(xvmcGetDRInfoReply), &rep);
if (rep.length) {
WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName);
WriteToClient(client, rep.busIDLen, pScreenPriv->busID);
}
WriteToClient(client, buflen, buf);
free(buf);
return Success;
}
int (*ProcXvMCVector[xvmcNumRequest]) (ClientPtr) = {
ProcXvMCQueryVersion,
ProcXvMCListSurfaceTypes,
ProcXvMCCreateContext,
ProcXvMCDestroyContext,
ProcXvMCCreateSurface,
ProcXvMCDestroySurface,
ProcXvMCCreateSubpicture,
ProcXvMCDestroySubpicture,
ProcXvMCListSubpictureTypes, ProcXvMCGetDRInfo};
static int
ProcXvMCDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data < xvmcNumRequest)
return (*ProcXvMCVector[stuff->data]) (client);
else
return BadRequest;
switch (stuff->data)
{
case xvmc_QueryVersion:
return ProcXvMCQueryVersion(client);
case xvmc_ListSurfaceTypes:
return ProcXvMCListSurfaceTypes(client);
case xvmc_CreateContext:
return ProcXvMCCreateContext(client);
case xvmc_DestroyContext:
return ProcXvMCDestroyContext(client);
case xvmc_CreateSurface:
return ProcXvMCCreateSurface(client);
case xvmc_DestroySurface:
return ProcXvMCDestroySurface(client);
case xvmc_CreateSubpicture:
return ProcXvMCCreateSubpicture(client);
case xvmc_DestroySubpicture:
return ProcXvMCDestroySubpicture(client);
case xvmc_ListSubpictureTypes:
return ProcXvMCListSubpictureTypes(client);
case xvmc_GetDRInfo:
return ProcXvMCGetDRInfo(client);
default:
return BadRequest;
}
}
static int _X_COLD
@ -733,16 +753,12 @@ XvMCExtensionInit(void)
extEntry->errorBase + XvMCBadSubpicture);
}
static Bool
XvMCCloseScreen(ScreenPtr pScreen)
static void XvMCScreenClose(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
{
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
free(pScreenPriv);
return (*pScreen->CloseScreen) (pScreen);
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, NULL);
dixScreenUnhookClose(pScreen, XvMCScreenClose);
}
int
@ -753,13 +769,12 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
if (!dixRegisterPrivateKey(&XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
return BadAlloc;
if (!(pScreenPriv = malloc(sizeof(XvMCScreenRec))))
if (!(pScreenPriv = calloc(1, sizeof(XvMCScreenRec))))
return BadAlloc;
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = XvMCCloseScreen;
dixScreenHookClose(pScreen, XvMCScreenClose);
pScreenPriv->num_adaptors = num;
pScreenPriv->adaptors = pAdapt;
@ -781,7 +796,6 @@ XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
XvMCScreenPtr pScreenPriv;
XvMCAdaptorPtr adaptor = NULL;
int i;
if (!dixPrivateKeyRegistered(XvMCScreenKey))
return NULL;
@ -789,7 +803,7 @@ XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
if (!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return NULL;
for (i = 0; i < pScreenPriv->num_adaptors; i++) {
for (int i = 0; i < pScreenPriv->num_adaptors; i++) {
if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
break;
@ -799,7 +813,7 @@ XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
if (!adaptor)
return NULL;
for (i = 0; i < adaptor->num_subpictures; i++) {
for (int i = 0; i < adaptor->num_subpictures; i++) {
if (adaptor->subpictures[i]->id == id) {
pImage = adaptor->subpictures[i];
break;

View File

@ -57,10 +57,10 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "exglobals.h"
#include "allowev.h"
#include "dixevents.h"
/***********************************************************************
*
@ -100,22 +100,22 @@ ProcXAllowDeviceEvents(ClientPtr client)
switch (stuff->mode) {
case ReplayThisDevice:
AllowSome(client, time, thisdev, NOT_GRABBED);
AllowSome(client, time, thisdev, GRAB_STATE_NOT_GRABBED);
break;
case SyncThisDevice:
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
AllowSome(client, time, thisdev, GRAB_STATE_FREEZE_NEXT_EVENT);
break;
case AsyncThisDevice:
AllowSome(client, time, thisdev, THAWED);
AllowSome(client, time, thisdev, GRAB_STATE_THAWED);
break;
case AsyncOtherDevices:
AllowSome(client, time, thisdev, THAW_OTHERS);
AllowSome(client, time, thisdev, GRAB_STATE_THAW_OTHERS);
break;
case SyncAll:
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
AllowSome(client, time, thisdev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT);
break;
case AsyncAll:
AllowSome(client, time, thisdev, THAWED_BOTH);
AllowSome(client, time, thisdev, GRAB_STATE_THAWED_BOTH);
break;
default:
client->errorValue = stuff->mode;

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "XIstubs.h"
@ -107,7 +108,6 @@ ProcXChangeDeviceControl(ClientPtr client)
int i, status, ret = BadValue;
DeviceIntPtr dev;
xDeviceResolutionCtl *r;
xChangeDeviceControlReply rep;
AxisInfoPtr a;
CARD32 *resolution;
xDeviceEnableCtl *e;
@ -126,11 +126,9 @@ ProcXChangeDeviceControl(ClientPtr client)
goto out;
}
rep = (xChangeDeviceControlReply) {
.repType = X_Reply,
xChangeDeviceControlReply rep = {
.RepType = X_ChangeDeviceControl,
.sequenceNumber = client->sequence,
.length = 0,
.status = Success,
};
@ -232,24 +230,11 @@ ProcXChangeDeviceControl(ClientPtr client)
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
(xEvent *) &dpn, 1);
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xChangeDeviceControlReply), &rep);
}
return ret;
}
/***********************************************************************
*
* This procedure writes the reply for the xChangeDeviceControl function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}

View File

@ -36,9 +36,4 @@ int SProcXChangeDeviceControl(ClientPtr /* client */
int ProcXChangeDeviceControl(ClientPtr /* client */
);
void SRepXChangeDeviceControl(ClientPtr /* client */ ,
int /* size */ ,
xChangeDeviceControlReply * /* rep */
);
#endif /* CHGDCTL_H */

View File

@ -59,7 +59,6 @@ SOFTWARE.
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include "dixevents.h"
#include "exevents.h"
#include "exglobals.h"

View File

@ -52,11 +52,14 @@ SOFTWARE.
#include <dix-config.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "XIstubs.h"
#include "exglobals.h"

View File

@ -81,6 +81,7 @@ SOFTWARE.
#include <dix-config.h>
#include "dix/cursor_priv.h"
#include "os/bug_priv.h"
#include <X11/X.h>
#include <X11/Xproto.h>
@ -95,7 +96,11 @@ SOFTWARE.
#include "dix/eventconvert.h"
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/resource_priv.h"
#include "dix/window_priv.h"
#include "mi/mi_priv.h"
#include "os/log_priv.h"
#include "xkb/xkbsrv_priv.h"
#include "inputstr.h"
#include "windowstr.h"
@ -104,15 +109,12 @@ SOFTWARE.
#include "extnsionst.h"
#include "exglobals.h"
#include "eventstr.h"
#include "dixevents.h" /* DeliverFocusedEvent */
#include "scrnintstr.h"
#include "listdev.h" /* for CopySwapXXXClass */
#include "xace.h"
#include "xiquerydevice.h" /* For List*Info */
#include "eventstr.h"
#include "inpututils.h"
#include "mi.h"
#include "xkbsrv.h"
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
#define AllModifiersMask ( \
@ -491,6 +493,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
if (!k->xkb_sli)
continue;
if (k->xkb_sli->flags & XkbSLI_IsDefault) {
assert(to->key);
k->xkb_sli->names = to->key->xkbInfo->desc->names->indicators;
k->xkb_sli->maps = to->key->xkbInfo->desc->indicators->maps;
}
@ -772,7 +775,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
int rc;
/* For now, we don't have devices that change physically. */
if (!IsMaster(device))
if (!InputDevIsMaster(device))
return;
rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess);
@ -780,10 +783,10 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
if (rc != Success)
return; /* Device has disappeared */
if (IsMaster(slave))
if (InputDevIsMaster(slave))
return;
if (IsFloating(slave))
if (InputDevIsFloating(slave))
return; /* set floating since the event */
if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid)
@ -967,7 +970,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
if (!button_is_down(device, key, BUTTON_PROCESSED))
return DONT_PROCESS;
if (IsMaster(device)) {
if (InputDevIsMaster(device)) {
DeviceIntPtr sd;
/*
@ -976,7 +979,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
* event being delivered through the slave first
*/
for (sd = inputInfo.devices; sd; sd = sd->next) {
if (IsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device)
if (InputDevIsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device)
continue;
if (!sd->button)
continue;
@ -1044,8 +1047,9 @@ TouchClientWantsOwnershipEvents(ClientPtr client, DeviceIntPtr dev,
{
InputClients *iclient;
assert(wOtherInputMasks(win));
nt_list_for_each_entry(iclient, wOtherInputMasks(win)->inputClients, next) {
if (rClient(iclient) != client)
if (dixClientForInputClients(iclient) != client)
continue;
return xi2mask_isset(iclient->xi2mask, dev, XI_TouchOwnership);
@ -1098,7 +1102,7 @@ DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti,
filter = GetEventFilter(dev, xi2);
if (XaceHookReceiveAccess(client, win, xi2, 1) != Success)
return FALSE;
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
free(xi2);
/* Returning the value from TryClientEvents isn't useful, since all our
@ -1117,7 +1121,7 @@ ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti)
ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB);
BUG_RETURN(!grab);
client = rClient(grab);
client = dixClientForGrab(grab);
if (TouchAcceptReject(client, dev, XIAcceptTouch, ti->client_id,
ti->listeners[0].window->drawable.id, &error) != Success)
@ -1369,7 +1373,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
BUG_RETURN_VAL(!*grab, FALSE);
*client = rClient(*grab);
*client = dixClientForGrab(*grab);
*win = (*grab)->window;
*mask = (*grab)->xi2mask;
}
@ -1389,6 +1393,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
else
evtype = GetXI2Type(ev->any.type);
assert(iclients);
assert(wOtherInputMasks(*win));
nt_list_for_each_entry(iclients,
wOtherInputMasks(*win)->inputClients, next)
if (xi2mask_isset(iclients->xi2mask, dev, evtype))
@ -1397,19 +1403,20 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
BUG_RETURN_VAL(!iclients, FALSE);
*mask = iclients->xi2mask;
*client = rClient(iclients);
*client = dixClientForInputClients(iclients);
}
else if (listener->level == XI) {
int xi_type = GetXIType(TouchGetPointerEventType(ev));
Mask xi_filter = event_get_filter_from_type(dev, xi_type);
assert(wOtherInputMasks(*win));
nt_list_for_each_entry(iclients,
wOtherInputMasks(*win)->inputClients, next)
if (iclients->mask[dev->id] & xi_filter)
break;
BUG_RETURN_VAL(!iclients, FALSE);
*client = rClient(iclients);
*client = dixClientForInputClients(iclients);
}
else {
int coretype = GetCoreType(TouchGetPointerEventType(ev));
@ -1423,7 +1430,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
break;
/* if owner selected, oclients is NULL */
*client = oclients ? rClient(oclients) : wClient(*win);
*client = oclients ? dixClientForOtherClients(oclients) : dixClientForWindow(*win);
}
*grab = NULL;
@ -1449,7 +1456,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (grab) {
win = grab->window;
xi2mask = grab->xi2mask;
client = rClient(grab);
client = dixClientForGrab(grab);
}
}
@ -1561,7 +1568,7 @@ static void
DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
InternalEvent *ev)
{
DeviceEvent motion;
InternalEvent motion;
if (ti->num_listeners) {
ClientPtr client;
@ -1573,27 +1580,27 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB)
return;
motion = ev->device_event;
motion.type = ET_TouchUpdate;
motion.detail.button = 0;
motion.device_event = ev->device_event;
motion.device_event.type = ET_TouchUpdate;
motion.device_event.detail.button = 0;
if (!RetrieveTouchDeliveryData(dev, ti, (InternalEvent*)&motion,
if (!RetrieveTouchDeliveryData(dev, ti, &motion,
&ti->listeners[0], &client, &win, &grab,
&mask))
return;
DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
DeliverTouchEmulatedEvent(dev, ti, &motion, &ti->listeners[0], client,
win, grab, mask);
}
else {
InternalEvent button;
int converted;
converted = TouchConvertToPointerEvent(ev, (InternalEvent*)&motion, &button);
converted = TouchConvertToPointerEvent(ev, &motion, &button);
BUG_WARN(converted == 0);
if (converted)
ProcessOtherEvent((InternalEvent*)&motion, dev);
ProcessOtherEvent(&motion, dev);
}
}
@ -1677,7 +1684,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
(ev->any.type == ET_TouchEnd && ti->num_listeners > 0)))
DeliverEmulatedMotionEvent(dev, ti, ev);
if (emulate_pointer && IsMaster(dev))
if (emulate_pointer && InputDevIsMaster(dev))
CheckMotion(&ev->device_event, dev);
kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
@ -1717,7 +1724,7 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
int rc;
GrabPtr grab = dev->deviceGrab.grab;
if (!IsMaster(dev))
if (!InputDevIsMaster(dev))
return;
if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success)
@ -1738,7 +1745,7 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
Otherwise, deliver normally to the client.
*/
if (grab &&
CLIENT_ID(be->barrierid) == CLIENT_ID(grab->resource) &&
dixClientIdForXID(be->barrierid) == dixClientIdForXID(grab->resource) &&
grab->window->drawable.id == be->window) {
DeliverGrabbedEvent(e, dev, FALSE);
} else {
@ -1778,7 +1785,7 @@ ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev)
if (!dev->gesture)
return;
if (IsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
if (InputDevIsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
return;
if (IsGestureBeginEvent(ev))
@ -1853,7 +1860,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
b = device->button;
if (IsMaster(device) || IsFloating(device))
if (InputDevIsMaster(device) || InputDevIsFloating(device))
CheckMotion(event, device);
switch (event->type) {
@ -1947,16 +1954,16 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
deactivateDeviceGrab);
else if (device->focus && !IsPointerEvent(ev))
DeliverFocusedEvent(device, (InternalEvent *) event,
GetSpriteWindow(device));
InputDevSpriteWindow(device));
else
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
DeliverDeviceEvents(InputDevSpriteWindow(device), (InternalEvent *) event,
NullGrab, NullWindow, device);
}
if (deactivateDeviceGrab == TRUE) {
(*device->deviceGrab.DeactivateGrab) (device);
if (!IsMaster (device) && !IsFloating (device)) {
if (!InputDevIsMaster (device) && !InputDevIsFloating (device)) {
int flags, num_events = 0;
InternalEvent dce;
@ -2244,7 +2251,7 @@ DeliverOneGestureEvent(ClientPtr client, DeviceIntPtr dev, GestureInfoPtr gi,
filter = GetEventFilter(dev, xi2);
if (XaceHookReceiveAccess(client, win, xi2, 1) != Success)
return FALSE;
err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
free(xi2);
/* Returning the value from TryClientEvents isn't useful, since all our
@ -2279,7 +2286,7 @@ RetrieveGestureDeliveryData(DeviceIntPtr dev, InternalEvent *ev, GestureListener
BUG_RETURN_VAL(!*grab, FALSE);
*client = rClient(*grab);
*client = dixClientForGrab(*grab);
*win = (*grab)->window;
}
else {
@ -2292,13 +2299,14 @@ RetrieveGestureDeliveryData(DeviceIntPtr dev, InternalEvent *ev, GestureListener
listener->type == GESTURE_LISTENER_REGULAR */
evtype = GetXI2Type(ev->any.type);
assert(wOtherInputMasks(*win));
nt_list_for_each_entry(iclients, wOtherInputMasks(*win)->inputClients, next)
if (xi2mask_isset(iclients->xi2mask, dev, evtype))
break;
BUG_RETURN_VAL(!iclients, FALSE);
*client = rClient(iclients);
*client = dixClientForInputClients(iclients);
}
return TRUE;
@ -2330,12 +2338,10 @@ DeliverGestureEventToOwner(DeviceIntPtr dev, GestureInfoPtr gi, InternalEvent *e
int
InitProximityClassDeviceStruct(DeviceIntPtr dev)
{
ProximityClassPtr proxc;
BUG_RETURN_VAL(dev == NULL, FALSE);
BUG_RETURN_VAL(dev->proximity != NULL, FALSE);
proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec));
ProximityClassPtr proxc = calloc(1, sizeof(ProximityClassRec));
if (!proxc)
return FALSE;
proxc->sourceid = dev->id;
@ -2528,7 +2534,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
else if (grabtype == XI2)
type = XI_ButtonPress;
grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype,
grab = CreateGrab(client, dev, modifier_device, pWin, grabtype,
mask, param, type, button, confineTo, cursor);
if (!grab)
return BadAlloc;
@ -2576,7 +2582,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
if (rc != Success)
return rc;
grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype,
grab = CreateGrab(client, dev, modifier_device, pWin, grabtype,
mask, param, type, key, NULL, NULL);
if (!grab)
return BadAlloc;
@ -2619,7 +2625,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
if (rc != Success)
return rc;
grab = CreateGrab(client->index, dev, dev, pWin, XI2,
grab = CreateGrab(client, dev, dev, pWin, XI2,
mask, param,
(type == XIGrabtypeEnter) ? XI_Enter : XI_FocusIn, 0,
NULL, cursor);
@ -2650,7 +2656,7 @@ GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev,
if (rc != Success)
return rc;
grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2,
grab = CreateGrab(client, dev, mod_dev, pWin, XI2,
mask, param, type, 0, NullWindow, NullCursor);
if (!grab)
return BadAlloc;
@ -2681,6 +2687,7 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
return BadAccess;
}
}
assert(wOtherInputMasks(pWin));
for (others = wOtherInputMasks(pWin)->inputClients; others;
others = others->next) {
if (SameClient(others, client)) {
@ -2733,7 +2740,7 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx)
{
InputClientsPtr others;
if (!pWin->optional && !MakeWindowOptional(pWin))
if (!MakeWindowOptional(pWin))
return BadAlloc;
others = AllocInputClient();
if (!others)
@ -2853,7 +2860,7 @@ InputClientGone(WindowPtr pWin, XID id)
FreeInputClient(&other);
}
else {
other->resource = FakeClientID(0);
other->resource = dixAllocServerXID();
if (!AddResource(other->resource, RT_INPUTCLIENT,
(void *) pWin))
return BadAlloc;
@ -2908,7 +2915,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
{
WindowPtr pWin;
WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
WindowPtr spriteWin = GetSpriteWindow(d);
WindowPtr spriteWin = InputDevSpriteWindow(d);
if (dest == PointerWindow)
pWin = spriteWin;
@ -2929,9 +2936,9 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
/* If the input focus is PointerRootWin, send the event to where
* the pointer is if possible, then perhaps propagate up to root. */
if (inputFocus == PointerRootWin)
inputFocus = GetCurrentRootWindow(d);
inputFocus = InputDevCurrentRootWindow(d);
if (IsParent(inputFocus, spriteWin)) {
if (WindowIsParent(inputFocus, spriteWin)) {
effectiveFocus = inputFocus;
pWin = spriteWin;
}
@ -3242,8 +3249,11 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
inputMasks->dontPropagateMask[maskndx] = mask;
}
RecalculateDeviceDeliverableEvents(pWin);
if (ShouldFreeInputMasks(pWin, FALSE))
if (ShouldFreeInputMasks(pWin, FALSE)) {
BUG_RETURN_VAL(!inputMasks, BadImplementation);
BUG_RETURN_VAL(!inputMasks->inputClients, BadImplementation);
FreeResource(inputMasks->inputClients->resource, X11_RESTYPE_NONE);
}
return Success;
}
@ -3337,6 +3347,7 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
if (len && !others) {
if (AddExtensionClient(win, client, 0, 0) != Success)
return BadAlloc;
assert(wOtherInputMasks(win));
others = wOtherInputMasks(win)->inputClients;
}
@ -3346,6 +3357,7 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
}
if (len) {
assert(others);
xi2mask_set_one_mask(others->xi2mask, dev->id, mask, len);
}

View File

@ -36,7 +36,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef EXGLOBALS_H
#define EXGLOBALS_H 1
extern int IReqCode;
extern int IEventBase;
extern int BadDevice;
extern int BadMode;

View File

@ -53,20 +53,23 @@ SOFTWARE.
#include <dix-config.h>
#include <assert.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include <X11/extensions/XI2proto.h>
#include <X11/extensions/geproto.h>
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "dix/exevents_priv.h"
#include "dix/extension_priv.h"
#include "miext/extinit_priv.h"
#include "Xext/geext_priv.h"
#include "inputstr.h"
#include "gcstruct.h" /* pointer for extnsionst.h */
#include "extnsionst.h" /* extension entry */
#include "geext.h" /* extension interfaces for ge */
#include "dixevents.h"
#include "exglobals.h"
#include "swaprep.h"
#include "privates.h"
@ -179,150 +182,12 @@ XExtEventInfo EventInfo[32];
static DeviceIntRec xi_all_devices;
static DeviceIntRec xi_all_master_devices;
/**
* Dispatch vector. Functions defined in here will be called when the matching
* request arrives.
*/
static int (*ProcIVector[]) (ClientPtr) = {
NULL, /* 0 */
ProcXGetExtensionVersion, /* 1 */
ProcXListInputDevices, /* 2 */
ProcXOpenDevice, /* 3 */
ProcXCloseDevice, /* 4 */
ProcXSetDeviceMode, /* 5 */
ProcXSelectExtensionEvent, /* 6 */
ProcXGetSelectedExtensionEvents, /* 7 */
ProcXChangeDeviceDontPropagateList, /* 8 */
ProcXGetDeviceDontPropagateList, /* 9 */
ProcXGetDeviceMotionEvents, /* 10 */
ProcXChangeKeyboardDevice, /* 11 */
ProcXChangePointerDevice, /* 12 */
ProcXGrabDevice, /* 13 */
ProcXUngrabDevice, /* 14 */
ProcXGrabDeviceKey, /* 15 */
ProcXUngrabDeviceKey, /* 16 */
ProcXGrabDeviceButton, /* 17 */
ProcXUngrabDeviceButton, /* 18 */
ProcXAllowDeviceEvents, /* 19 */
ProcXGetDeviceFocus, /* 20 */
ProcXSetDeviceFocus, /* 21 */
ProcXGetFeedbackControl, /* 22 */
ProcXChangeFeedbackControl, /* 23 */
ProcXGetDeviceKeyMapping, /* 24 */
ProcXChangeDeviceKeyMapping, /* 25 */
ProcXGetDeviceModifierMapping, /* 26 */
ProcXSetDeviceModifierMapping, /* 27 */
ProcXGetDeviceButtonMapping, /* 28 */
ProcXSetDeviceButtonMapping, /* 29 */
ProcXQueryDeviceState, /* 30 */
ProcXSendExtensionEvent, /* 31 */
ProcXDeviceBell, /* 32 */
ProcXSetDeviceValuators, /* 33 */
ProcXGetDeviceControl, /* 34 */
ProcXChangeDeviceControl, /* 35 */
/* XI 1.5 */
ProcXListDeviceProperties, /* 36 */
ProcXChangeDeviceProperty, /* 37 */
ProcXDeleteDeviceProperty, /* 38 */
ProcXGetDeviceProperty, /* 39 */
/* XI 2 */
ProcXIQueryPointer, /* 40 */
ProcXIWarpPointer, /* 41 */
ProcXIChangeCursor, /* 42 */
ProcXIChangeHierarchy, /* 43 */
ProcXISetClientPointer, /* 44 */
ProcXIGetClientPointer, /* 45 */
ProcXISelectEvents, /* 46 */
ProcXIQueryVersion, /* 47 */
ProcXIQueryDevice, /* 48 */
ProcXISetFocus, /* 49 */
ProcXIGetFocus, /* 50 */
ProcXIGrabDevice, /* 51 */
ProcXIUngrabDevice, /* 52 */
ProcXIAllowEvents, /* 53 */
ProcXIPassiveGrabDevice, /* 54 */
ProcXIPassiveUngrabDevice, /* 55 */
ProcXIListProperties, /* 56 */
ProcXIChangeProperty, /* 57 */
ProcXIDeleteProperty, /* 58 */
ProcXIGetProperty, /* 59 */
ProcXIGetSelectedEvents, /* 60 */
ProcXIBarrierReleasePointer /* 61 */
};
/* For swapped clients */
static int (*SProcIVector[]) (ClientPtr) = {
NULL, /* 0 */
SProcXGetExtensionVersion, /* 1 */
ProcXListInputDevices, /* 2 */
ProcXOpenDevice, /* 3 */
ProcXCloseDevice, /* 4 */
ProcXSetDeviceMode, /* 5 */
SProcXSelectExtensionEvent, /* 6 */
SProcXGetSelectedExtensionEvents, /* 7 */
SProcXChangeDeviceDontPropagateList, /* 8 */
SProcXGetDeviceDontPropagateList, /* 9 */
SProcXGetDeviceMotionEvents, /* 10 */
ProcXChangeKeyboardDevice, /* 11 */
ProcXChangePointerDevice, /* 12 */
SProcXGrabDevice, /* 13 */
SProcXUngrabDevice, /* 14 */
SProcXGrabDeviceKey, /* 15 */
SProcXUngrabDeviceKey, /* 16 */
SProcXGrabDeviceButton, /* 17 */
SProcXUngrabDeviceButton, /* 18 */
SProcXAllowDeviceEvents, /* 19 */
ProcXGetDeviceFocus, /* 20 */
SProcXSetDeviceFocus, /* 21 */
ProcXGetFeedbackControl, /* 22 */
SProcXChangeFeedbackControl, /* 23 */
ProcXGetDeviceKeyMapping, /* 24 */
SProcXChangeDeviceKeyMapping, /* 25 */
ProcXGetDeviceModifierMapping, /* 26 */
ProcXSetDeviceModifierMapping, /* 27 */
ProcXGetDeviceButtonMapping, /* 28 */
ProcXSetDeviceButtonMapping, /* 29 */
ProcXQueryDeviceState, /* 30 */
SProcXSendExtensionEvent, /* 31 */
ProcXDeviceBell, /* 32 */
ProcXSetDeviceValuators, /* 33 */
SProcXGetDeviceControl, /* 34 */
SProcXChangeDeviceControl, /* 35 */
ProcXListDeviceProperties, /* 36 */
SProcXChangeDeviceProperty, /* 37 */
SProcXDeleteDeviceProperty, /* 38 */
SProcXGetDeviceProperty, /* 39 */
SProcXIQueryPointer, /* 40 */
SProcXIWarpPointer, /* 41 */
SProcXIChangeCursor, /* 42 */
ProcXIChangeHierarchy, /* 43 */
SProcXISetClientPointer, /* 44 */
SProcXIGetClientPointer, /* 45 */
SProcXISelectEvents, /* 46 */
SProcXIQueryVersion, /* 47 */
SProcXIQueryDevice, /* 48 */
SProcXISetFocus, /* 49 */
SProcXIGetFocus, /* 50 */
SProcXIGrabDevice, /* 51 */
SProcXIUngrabDevice, /* 52 */
SProcXIAllowEvents, /* 53 */
SProcXIPassiveGrabDevice, /* 54 */
SProcXIPassiveUngrabDevice, /* 55 */
SProcXIListProperties, /* 56 */
SProcXIChangeProperty, /* 57 */
SProcXIDeleteProperty, /* 58 */
SProcXIGetProperty, /* 59 */
SProcXIGetSelectedEvents, /* 60 */
SProcXIBarrierReleasePointer /* 61 */
};
/*****************************************************************
*
* Globals referenced elsewhere in the server.
*
*/
int IReqCode = 0;
int IEventBase = 0;
int BadDevice = 0;
static int BadEvent = 1;
@ -383,11 +248,137 @@ static int
ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
return BadRequest;
UpdateCurrentTimeIf();
return (*ProcIVector[stuff->data]) (client);
switch (stuff->data) {
case X_GetExtensionVersion:
return ProcXGetExtensionVersion(client);
case X_ListInputDevices:
return ProcXListInputDevices(client);
case X_OpenDevice:
return ProcXOpenDevice(client);
case X_CloseDevice:
return ProcXCloseDevice(client);
case X_SetDeviceMode:
return ProcXSetDeviceMode(client);
case X_SelectExtensionEvent:
return ProcXSelectExtensionEvent(client);
case X_GetSelectedExtensionEvents:
return ProcXGetSelectedExtensionEvents(client);
case X_ChangeDeviceDontPropagateList:
return ProcXChangeDeviceDontPropagateList(client);
case X_GetDeviceDontPropagateList:
return ProcXGetDeviceDontPropagateList(client);
case X_GetDeviceMotionEvents:
return ProcXGetDeviceMotionEvents(client);
case X_ChangeKeyboardDevice:
return ProcXChangeKeyboardDevice(client);
case X_ChangePointerDevice:
return ProcXChangePointerDevice(client);
case X_GrabDevice:
return ProcXGrabDevice(client);
case X_UngrabDevice:
return ProcXUngrabDevice(client);
case X_GrabDeviceKey:
return ProcXGrabDeviceKey(client);
case X_UngrabDeviceKey:
return ProcXUngrabDeviceKey(client);
case X_GrabDeviceButton:
return ProcXGrabDeviceButton(client);
case X_UngrabDeviceButton:
return ProcXUngrabDeviceButton(client);
case X_AllowDeviceEvents:
return ProcXAllowDeviceEvents(client);
case X_GetDeviceFocus:
return ProcXGetDeviceFocus(client);
case X_SetDeviceFocus:
return ProcXSetDeviceFocus(client);
case X_GetFeedbackControl:
return ProcXGetFeedbackControl(client);
case X_ChangeFeedbackControl:
return ProcXChangeFeedbackControl(client);
case X_GetDeviceKeyMapping:
return ProcXGetDeviceKeyMapping(client);
case X_ChangeDeviceKeyMapping:
return ProcXChangeDeviceKeyMapping(client);
case X_GetDeviceModifierMapping:
return ProcXGetDeviceModifierMapping(client);
case X_SetDeviceModifierMapping:
return ProcXSetDeviceModifierMapping(client);
case X_GetDeviceButtonMapping:
return ProcXGetDeviceButtonMapping(client);
case X_SetDeviceButtonMapping:
return ProcXSetDeviceButtonMapping(client);
case X_QueryDeviceState:
return ProcXQueryDeviceState(client);
case X_SendExtensionEvent:
return ProcXSendExtensionEvent(client);
case X_DeviceBell:
return ProcXDeviceBell(client);
case X_SetDeviceValuators:
return ProcXSetDeviceValuators(client);
case X_GetDeviceControl:
return ProcXGetDeviceControl(client);
case X_ChangeDeviceControl:
return ProcXChangeDeviceControl(client);
/* XI 1.5 */
case X_ListDeviceProperties:
return ProcXListDeviceProperties(client);
case X_ChangeDeviceProperty:
return ProcXChangeDeviceProperty(client);
case X_DeleteDeviceProperty:
return ProcXDeleteDeviceProperty(client);
case X_GetDeviceProperty:
return ProcXGetDeviceProperty(client);
/* XI 2 */
case X_XIQueryPointer:
return ProcXIQueryPointer(client);
case X_XIWarpPointer:
return ProcXIWarpPointer(client);
case X_XIChangeCursor:
return ProcXIChangeCursor(client);
case X_XIChangeHierarchy:
return ProcXIChangeHierarchy(client);
case X_XISetClientPointer:
return ProcXISetClientPointer(client);
case X_XIGetClientPointer:
return ProcXIGetClientPointer(client);
case X_XISelectEvents:
return ProcXISelectEvents(client);
case X_XIQueryVersion:
return ProcXIQueryVersion(client);
case X_XIQueryDevice:
return ProcXIQueryDevice(client);
case X_XISetFocus:
return ProcXISetFocus(client);
case X_XIGetFocus:
return ProcXIGetFocus(client);
case X_XIGrabDevice:
return ProcXIGrabDevice(client);
case X_XIUngrabDevice:
return ProcXIUngrabDevice(client);
case X_XIAllowEvents:
return ProcXIAllowEvents(client);
case X_XIPassiveGrabDevice:
return ProcXIPassiveGrabDevice(client);
case X_XIPassiveUngrabDevice:
return ProcXIPassiveUngrabDevice(client);
case X_XIListProperties:
return ProcXIListProperties(client);
case X_XIChangeProperty:
return ProcXIChangeProperty(client);
case X_XIDeleteProperty:
return ProcXIDeleteProperty(client);
case X_XIGetProperty:
return ProcXIGetProperty(client);
case X_XIGetSelectedEvents:
return ProcXIGetSelectedEvents(client);
case X_XIBarrierReleasePointer:
return ProcXIBarrierReleasePointer(client);
default:
return BadRequest;
}
}
/*******************************************************************************
@ -403,102 +394,136 @@ static int _X_COLD
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
return BadRequest;
UpdateCurrentTimeIf();
return (*SProcIVector[stuff->data]) (client);
}
/**********************************************************************
*
* SReplyIDispatch
* Swap any replies defined in this extension.
*
*/
static void _X_COLD
SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
{
/* All we look at is the type field */
/* This is common to all replies */
if (rep->RepType == X_GetExtensionVersion)
SRepXGetExtensionVersion(client, len,
(xGetExtensionVersionReply *) rep);
else if (rep->RepType == X_ListInputDevices)
SRepXListInputDevices(client, len, (xListInputDevicesReply *) rep);
else if (rep->RepType == X_OpenDevice)
SRepXOpenDevice(client, len, (xOpenDeviceReply *) rep);
else if (rep->RepType == X_SetDeviceMode)
SRepXSetDeviceMode(client, len, (xSetDeviceModeReply *) rep);
else if (rep->RepType == X_GetSelectedExtensionEvents)
SRepXGetSelectedExtensionEvents(client, len,
(xGetSelectedExtensionEventsReply *)
rep);
else if (rep->RepType == X_GetDeviceDontPropagateList)
SRepXGetDeviceDontPropagateList(client, len,
(xGetDeviceDontPropagateListReply *)
rep);
else if (rep->RepType == X_GetDeviceMotionEvents)
SRepXGetDeviceMotionEvents(client, len,
(xGetDeviceMotionEventsReply *) rep);
else if (rep->RepType == X_GrabDevice)
SRepXGrabDevice(client, len, (xGrabDeviceReply *) rep);
else if (rep->RepType == X_GetDeviceFocus)
SRepXGetDeviceFocus(client, len, (xGetDeviceFocusReply *) rep);
else if (rep->RepType == X_GetFeedbackControl)
SRepXGetFeedbackControl(client, len, (xGetFeedbackControlReply *) rep);
else if (rep->RepType == X_GetDeviceKeyMapping)
SRepXGetDeviceKeyMapping(client, len,
(xGetDeviceKeyMappingReply *) rep);
else if (rep->RepType == X_GetDeviceModifierMapping)
SRepXGetDeviceModifierMapping(client, len,
(xGetDeviceModifierMappingReply *) rep);
else if (rep->RepType == X_SetDeviceModifierMapping)
SRepXSetDeviceModifierMapping(client, len,
(xSetDeviceModifierMappingReply *) rep);
else if (rep->RepType == X_GetDeviceButtonMapping)
SRepXGetDeviceButtonMapping(client, len,
(xGetDeviceButtonMappingReply *) rep);
else if (rep->RepType == X_SetDeviceButtonMapping)
SRepXSetDeviceButtonMapping(client, len,
(xSetDeviceButtonMappingReply *) rep);
else if (rep->RepType == X_QueryDeviceState)
SRepXQueryDeviceState(client, len, (xQueryDeviceStateReply *) rep);
else if (rep->RepType == X_SetDeviceValuators)
SRepXSetDeviceValuators(client, len, (xSetDeviceValuatorsReply *) rep);
else if (rep->RepType == X_GetDeviceControl)
SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep);
else if (rep->RepType == X_ChangeDeviceControl)
SRepXChangeDeviceControl(client, len,
(xChangeDeviceControlReply *) rep);
else if (rep->RepType == X_ListDeviceProperties)
SRepXListDeviceProperties(client, len,
(xListDevicePropertiesReply *) rep);
else if (rep->RepType == X_GetDeviceProperty)
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
else if (rep->RepType == X_XIQueryPointer)
SRepXIQueryPointer(client, len, (xXIQueryPointerReply *) rep);
else if (rep->RepType == X_XIGetClientPointer)
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply *) rep);
else if (rep->RepType == X_XIQueryVersion)
SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep);
else if (rep->RepType == X_XIQueryDevice)
SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep);
else if (rep->RepType == X_XIGrabDevice)
SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep);
else if (rep->RepType == X_XIPassiveGrabDevice)
SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep);
else if (rep->RepType == X_XIListProperties)
SRepXIListProperties(client, len, (xXIListPropertiesReply *) rep);
else if (rep->RepType == X_XIGetProperty)
SRepXIGetProperty(client, len, (xXIGetPropertyReply *) rep);
else if (rep->RepType == X_XIGetSelectedEvents)
SRepXIGetSelectedEvents(client, len, (xXIGetSelectedEventsReply *) rep);
else if (rep->RepType == X_XIGetFocus)
SRepXIGetFocus(client, len, (xXIGetFocusReply *) rep);
else {
FatalError("XINPUT confused sending swapped reply");
switch (stuff->data) {
case X_GetExtensionVersion:
return SProcXGetExtensionVersion(client);
case X_ListInputDevices:
return ProcXListInputDevices(client);
case X_OpenDevice:
return ProcXOpenDevice(client);
case X_CloseDevice:
return ProcXCloseDevice(client);
case X_SetDeviceMode:
return ProcXSetDeviceMode(client);
case X_SelectExtensionEvent:
return SProcXSelectExtensionEvent(client);
case X_GetSelectedExtensionEvents:
return SProcXGetSelectedExtensionEvents(client);
case X_ChangeDeviceDontPropagateList:
return SProcXChangeDeviceDontPropagateList(client);
case X_GetDeviceDontPropagateList:
return SProcXGetDeviceDontPropagateList(client);
case X_GetDeviceMotionEvents:
return SProcXGetDeviceMotionEvents(client);
case X_ChangeKeyboardDevice:
return ProcXChangeKeyboardDevice(client);
case X_ChangePointerDevice:
return ProcXChangePointerDevice(client);
case X_GrabDevice:
return SProcXGrabDevice(client);
case X_UngrabDevice:
return SProcXUngrabDevice(client);
case X_GrabDeviceKey:
return SProcXGrabDeviceKey(client);
case X_UngrabDeviceKey:
return SProcXUngrabDeviceKey(client);
case X_GrabDeviceButton:
return SProcXGrabDeviceButton(client);
case X_UngrabDeviceButton:
return SProcXUngrabDeviceButton(client);
case X_AllowDeviceEvents:
return SProcXAllowDeviceEvents(client);
case X_GetDeviceFocus:
return ProcXGetDeviceFocus(client);
case X_SetDeviceFocus:
return SProcXSetDeviceFocus(client);
case X_GetFeedbackControl:
return ProcXGetFeedbackControl(client);
case X_ChangeFeedbackControl:
return SProcXChangeFeedbackControl(client);
case X_GetDeviceKeyMapping:
return ProcXGetDeviceKeyMapping(client);
case X_ChangeDeviceKeyMapping:
return SProcXChangeDeviceKeyMapping(client);
case X_GetDeviceModifierMapping:
return ProcXGetDeviceModifierMapping(client);
case X_SetDeviceModifierMapping:
return ProcXSetDeviceModifierMapping(client);
case X_GetDeviceButtonMapping:
return ProcXGetDeviceButtonMapping(client);
case X_SetDeviceButtonMapping:
return ProcXSetDeviceButtonMapping(client);
case X_QueryDeviceState:
return ProcXQueryDeviceState(client);
case X_SendExtensionEvent:
return SProcXSendExtensionEvent(client);
case X_DeviceBell:
return ProcXDeviceBell(client);
case X_SetDeviceValuators:
return ProcXSetDeviceValuators(client);
case X_GetDeviceControl:
return SProcXGetDeviceControl(client);
case X_ChangeDeviceControl:
return SProcXChangeDeviceControl(client);
/* XI 1.5 */
case X_ListDeviceProperties:
return ProcXListDeviceProperties(client);
case X_ChangeDeviceProperty:
return SProcXChangeDeviceProperty(client);
case X_DeleteDeviceProperty:
return SProcXDeleteDeviceProperty(client);
case X_GetDeviceProperty:
return SProcXGetDeviceProperty(client);
/* XI 2 */
case X_XIQueryPointer:
return SProcXIQueryPointer(client);
case X_XIWarpPointer:
return SProcXIWarpPointer(client);
case X_XIChangeCursor:
return SProcXIChangeCursor(client);
case X_XIChangeHierarchy:
return ProcXIChangeHierarchy(client);
case X_XISetClientPointer:
return SProcXISetClientPointer(client);
case X_XIGetClientPointer:
return SProcXIGetClientPointer(client);
case X_XISelectEvents:
return SProcXISelectEvents(client);
case X_XIQueryVersion:
return SProcXIQueryVersion(client);
case X_XIQueryDevice:
return SProcXIQueryDevice(client);
case X_XISetFocus:
return SProcXISetFocus(client);
case X_XIGetFocus:
return SProcXIGetFocus(client);
case X_XIGrabDevice:
return SProcXIGrabDevice(client);
case X_XIUngrabDevice:
return SProcXIUngrabDevice(client);
case X_XIAllowEvents:
return SProcXIAllowEvents(client);
case X_XIPassiveGrabDevice:
return SProcXIPassiveGrabDevice(client);
case X_XIPassiveUngrabDevice:
return SProcXIPassiveUngrabDevice(client);
case X_XIListProperties:
return SProcXIListProperties(client);
case X_XIChangeProperty:
return SProcXIChangeProperty(client);
case X_XIDeleteProperty:
return SProcXIDeleteProperty(client);
case X_XIGetProperty:
return SProcXIGetProperty(client);
case X_XIGetSelectedEvents:
return SProcXIGetSelectedEvents(client);
case X_XIBarrierReleasePointer:
return SProcXIBarrierReleasePointer(client);
default:
return BadRequest;
}
}
@ -1122,7 +1147,6 @@ RestoreExtensionEvents(void)
{
int i, j;
IReqCode = 0;
IEventBase = 0;
for (i = 0; i < ExtEventIndex - 1; i++) {
@ -1171,7 +1195,6 @@ RestoreExtensionEvents(void)
static void
IResetProc(ExtensionEntry * unused)
{
ReplySwapVector[IReqCode] = ReplyNotSwappd;
EventSwapVector[DeviceValuator] = NotImplemented;
EventSwapVector[DeviceKeyPress] = NotImplemented;
EventSwapVector[DeviceKeyRelease] = NotImplemented;
@ -1324,7 +1347,8 @@ XInputExtensionInit(void)
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
SProcIDispatch, IResetProc, StandardMinorOpcode);
if (extEntry) {
IReqCode = extEntry->base;
assert(extEntry->base == EXTENSION_MAJOR_XINPUT);
IEventBase = extEntry->eventBase;
XIVersion = thisversion;
MakeDeviceTypeAtoms();
@ -1333,7 +1357,6 @@ XInputExtensionInit(void)
if (!RT_INPUTCLIENT)
FatalError("Failed to add resource type for XI.\n");
FixExtensionEvents(extEntry);
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
EventSwapVector[DeviceValuator] = SEventIDispatch;
EventSwapVector[DeviceKeyPress] = SEventIDispatch;
EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
@ -1351,7 +1374,7 @@ XInputExtensionInit(void)
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
EventSwapVector[DevicePresenceNotify] = SEventIDispatch;
GERegisterExtension(IReqCode, XI2EventSwap);
GERegisterExtension(EXTENSION_MAJOR_XINPUT, XI2EventSwap);
memset(&xi_all_devices, 0, sizeof(xi_all_devices));
memset(&xi_all_master_devices, 0, sizeof(xi_all_master_devices));

View File

@ -69,21 +69,12 @@ int
ProcXGetDeviceButtonMapping(ClientPtr client)
{
DeviceIntPtr dev;
xGetDeviceButtonMappingReply rep;
ButtonClassPtr b;
int rc;
REQUEST(xGetDeviceButtonMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
rep = (xGetDeviceButtonMappingReply) {
.repType = X_Reply,
.RepType = X_GetDeviceButtonMapping,
.sequenceNumber = client->sequence,
.nElts = 0,
.length = 0
};
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@ -92,25 +83,19 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
if (b == NULL)
return BadMatch;
rep.nElts = b->numButtons;
rep.length = bytes_to_int32(rep.nElts);
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
xGetDeviceButtonMappingReply rep = {
.repType = X_Reply,
.RepType = X_GetDeviceButtonMapping,
.sequenceNumber = client->sequence,
.nElts = b->numButtons,
.length = bytes_to_int32(b->numButtons),
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
WriteToClient(client, rep.nElts, &b->map[1]);
return Success;
}
/***********************************************************************
*
* This procedure writes the reply for the XGetDeviceButtonMapping function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
xGetDeviceButtonMappingReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}

View File

@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
);
void SRepXGetDeviceButtonMapping(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceButtonMappingReply * /* rep */
);
#endif /* GETBMAP_H */

View File

@ -143,21 +143,6 @@ CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf)
}
}
/***********************************************************************
*
* This procedure writes the reply for the xGetDeviceControl function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
/***********************************************************************
*
* Get the state of the specified device control.
@ -168,9 +153,8 @@ int
ProcXGetDeviceControl(ClientPtr client)
{
int rc, total_length = 0;
char *buf, *savbuf;
char *savbuf;
DeviceIntPtr dev;
xGetDeviceControlReply rep;
REQUEST(xGetDeviceControlReq);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
@ -179,13 +163,6 @@ ProcXGetDeviceControl(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetDeviceControlReply) {
.repType = X_Reply,
.RepType = X_GetDeviceControl,
.sequenceNumber = client->sequence,
.length = 0
};
switch (stuff->control) {
case DEVICE_RESOLUTION:
if (!dev->valuator)
@ -206,7 +183,7 @@ ProcXGetDeviceControl(ClientPtr client)
return BadValue;
}
buf = (char *) malloc(total_length);
char *buf = calloc(1, total_length);
if (!buf)
return BadAlloc;
savbuf = buf;
@ -225,8 +202,18 @@ ProcXGetDeviceControl(ClientPtr client)
break;
}
rep.length = bytes_to_int32(total_length);
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
xGetDeviceControlReply rep = {
.repType = X_Reply,
.RepType = X_GetDeviceControl,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(total_length),
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xGetDeviceControlReply), &rep);
WriteToClient(client, total_length, savbuf);
free(savbuf);
return Success;

View File

@ -36,9 +36,4 @@ int SProcXGetDeviceControl(ClientPtr /* client */
int ProcXGetDeviceControl(ClientPtr /* client */
);
void SRepXGetDeviceControl(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceControlReply * /* rep */
);
#endif /* GETDCTL_H */

View File

@ -234,23 +234,6 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
*buf += sizeof(xBellFeedbackState);
}
/***********************************************************************
*
* This procedure writes the reply for the xGetFeedbackControl function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXGetFeedbackControl(ClientPtr client, int size,
xGetFeedbackControlReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->num_feedbacks);
WriteToClient(client, size, rep);
}
/***********************************************************************
*
* Get the feedback control state.
@ -261,7 +244,7 @@ int
ProcXGetFeedbackControl(ClientPtr client)
{
int rc, total_length = 0;
char *buf, *savbuf;
char *savbuf;
DeviceIntPtr dev;
KbdFeedbackPtr k;
PtrFeedbackPtr p;
@ -269,7 +252,6 @@ ProcXGetFeedbackControl(ClientPtr client)
StringFeedbackPtr s;
BellFeedbackPtr b;
LedFeedbackPtr l;
xGetFeedbackControlReply rep;
REQUEST(xGetFeedbackControlReq);
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
@ -278,12 +260,10 @@ ProcXGetFeedbackControl(ClientPtr client)
if (rc != Success)
return rc;
rep = (xGetFeedbackControlReply) {
xGetFeedbackControlReply rep = {
.repType = X_Reply,
.RepType = X_GetFeedbackControl,
.sequenceNumber = client->sequence,
.length = 0,
.num_feedbacks = 0
};
for (k = dev->kbdfeed; k; k = k->next) {
@ -315,7 +295,7 @@ ProcXGetFeedbackControl(ClientPtr client)
if (total_length == 0)
return BadMatch;
buf = (char *) malloc(total_length);
char *buf = (char *) calloc(1, total_length);
if (!buf)
return BadAlloc;
savbuf = buf;
@ -334,7 +314,13 @@ ProcXGetFeedbackControl(ClientPtr client)
CopySwapBellFeedback(client, b, &buf);
rep.length = bytes_to_int32(total_length);
WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.num_feedbacks);
}
WriteToClient(client, sizeof(xGetFeedbackControlReply), &rep);
WriteToClient(client, total_length, savbuf);
free(savbuf);
return Success;

View File

@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
int ProcXGetFeedbackControl(ClientPtr /* client */
);
void SRepXGetFeedbackControl(ClientPtr /* client */ ,
int /* size */ ,
xGetFeedbackControlReply * /* rep */
);
#endif /* GETFCTL_H */

View File

@ -71,7 +71,6 @@ ProcXGetDeviceFocus(ClientPtr client)
{
DeviceIntPtr dev;
FocusClassPtr focus;
xGetDeviceFocusReply rep;
int rc;
REQUEST(xGetDeviceFocusReq);
@ -83,15 +82,16 @@ ProcXGetDeviceFocus(ClientPtr client)
if (!dev->focus)
return BadDevice;
rep = (xGetDeviceFocusReply) {
focus = dev->focus;
xGetDeviceFocusReply rep = {
.repType = X_Reply,
.RepType = X_GetDeviceFocus,
.sequenceNumber = client->sequence,
.length = 0
.time = focus->time.milliseconds,
.revertTo = focus->revert,
};
focus = dev->focus;
if (focus->win == NoneWin)
rep.focus = None;
else if (focus->win == PointerRootWin)
@ -101,25 +101,12 @@ ProcXGetDeviceFocus(ClientPtr client)
else
rep.focus = focus->win->drawable.id;
rep.time = focus->time.milliseconds;
rep.revertTo = focus->revert;
WriteReplyToClient(client, sizeof(xGetDeviceFocusReply), &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.focus);
swapl(&rep.time);
}
WriteToClient(client, sizeof(xGetDeviceFocusReply), &rep);
return Success;
}
/***********************************************************************
*
* This procedure writes the reply for the GetDeviceFocus function,
* if the client and server have a different byte ordering.
*
*/
void _X_COLD
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->focus);
swapl(&rep->time);
WriteToClient(client, size, rep);
}

View File

@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
int ProcXGetDeviceFocus(ClientPtr /* client */
);
void SRepXGetDeviceFocus(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceFocusReply * /* rep */
);
#endif /* GETFOCUS_H */

Some files were not shown because too many files have changed in this diff Show More