Commit Graph

19287 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult cf29ad9400 wip 2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 7b49f3e94f os: unexport client connection handling functions from public module API
These functions aren't used by any known driver and it doesn't make much sense
calling them from there. So it's better to unexport them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 9bd17b947b xfree86: common: move non-public defs out of xf86platformBus.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>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 32166efdad xfree86: common: move non-public defs out of xf86platformBus.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>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 5fa75a7bf4 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>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 79b0831f1c dix: unexport XineramaGetCursorScreen()
It's only used for record extension, no external callers, thus
doesn't need to be exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 089e9ea644 Revert "fixup"
This reverts commit 2788042b4f27cbf9a20201429d3a1522f09d48ad.
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 4d130d0d84 1 2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult df2a7f4bca fixup 2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 48c0040dac WIP: fix missing ScreenSaverTime, screenSaverSuspended, ScreenSaverInterval 2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 50129cf560 rebase diff 2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 05c63aeecd 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>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult ca46ff2845 (submit/drop-hal) xfree86: consolidate dbus and systemd-logind probing
dbus is only needed for systemd-logind support, so no need for
having separate symbols.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult 8d5ad4aafb (submit/drop-hal) xfree86: drop obsolete libhal support
HAL had been obsoleted by udev many years ago (and also was Linux-specific).
No need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 16:22:41 +02:00
Enrico Weigelt, metux IT consult a8cc3edec8 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>
2024-09-24 16:18:39 +02:00
Enrico Weigelt, metux IT consult 0b345e49c5 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>
2024-09-24 15:16:12 +02:00
Doug Brown 302e21533e 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
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult f8a215b3dc 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult dde9fc0204 (!1700) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult daefa71a42 dix: lookup function for WindowPtr by XID
This new lookup function retrieves a pointer to WindowRec structure by
associated XID. Unlike dixLookupWindow(), this one works globally, instead
of just on one specific client, and it doesn't do any XACE calls.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 3b1d5fcffd ci: always build with drivers 2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 2cf26a4d00 ci: freebsd: fix missing xcb-aux and xcb-util-wm
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult f55fa7f940 bsd: drop PCCONS support
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones, 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 15a8d69584 os: replace GenerateRandomData() by custom arc4random_buf() on platforms that missing it
arc4random_buf() is a pretty standard libc function on Unix'oid platforms,
but not all our targets have it, thus we need a fallback there. Currently we
have GenerateRandomData(), which either just wraps arc4random_buf() or provides
some fallback implementation.

For those cases it's easier to just implement missing functions directly
instead of having custom wrapper functions. So, drop GenerateRandomData()
in favor of arc4random_buf() and provide fallback implementation for where
it is missing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult f0a23f1fb0 WIP: reorder includes
(submit/cursor-api) dix: drop superfluous XineramaGetCursorScreen()

It's only used for record extension, no external callers, thus doesn't
need to be exported. Since it's just for retrieving one struct value,
it's not needed at all - we can do this directly (just like we do in
many other places)

Note: the check on noPanoramixExtensions is superfluous, since the only
call site already does it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult df066cef88 (!1695) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult fd42d73016 (!1694) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 9977651eee (!1693) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult b30bcee0e9 (!1692) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult d930b6cc17 (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult dfacf8cab8 (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 62b4f4d2db (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 04f5555ea8 (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult e6ac7eaa5a (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult af9c7bb8f0 (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 51e2a975a7 (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult e22b624eaa (!1691) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult f6926bc94f (!1690) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult a0041d2c4a (!1689) pseudoramix: replace PseudoramiXTrace() and 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult bef375c733 (!1688) xfree86: man: add -syslogverbse flag
Document the newly added -syslogverbose command line flag.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 1e744e67b0 (!1688) os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult af74502bcf (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 8a5e5b8e4d (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 3c5f80aafa (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 2d0c4f0a8e (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult a034cc2c00 (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 43c528494f (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 8c04c790e8 (!1688) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult f238a4f6bd (!1680) 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>
2024-09-24 15:16:12 +02:00
Enrico Weigelt, metux IT consult 762879e77c (!1679) 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>
2024-09-24 15:16:12 +02:00