Commit Graph

845 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 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
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
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 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 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 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 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
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
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 cda799533f xfree86: os-support: bsd: fix missing include of xf86_OSproc.h
Missing include of xf86_OSproc.h leads to missing prototype warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1697>
2024-09-13 17:47:01 +02:00
Alan Coopersmith 62c9f52e41 Remove remnants of support for SVR4 systems other than Solaris & illumos
Most of the support for such OS'es was removed in 2010 for
xorg-server-1.10.0, but a few bits lingered on.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1667>
2024-09-01 02:14:10 +00:00
Alan Coopersmith f35951d83e Remove remnants of support for SysV versions before SVR4
Most of the support for such OS'es was removed in 2010 for
xorg-server-1.10.0, but a few bits lingered on, and a few
comments were left out-of-date.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1667>
2024-09-01 02:14:10 +00:00
Enrico Weigelt, metux IT consult f446235b71 treewide: replace xnfcalloc() calls by XNFcallocarray()
This has been nothing but an alias for two decades now (somewhere in R6.6),
so there doesn't seem to be any practical need for this indirection.

The macro still needs to remain, as long as (external) drivers still using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
2024-07-26 23:41:33 +00:00
Enrico Weigelt, metux IT consult 61233adbca treewide: replace xnfreallocarray macro call by XNFreallocarray()
The xnfreallocarray was added along (and just as an alias to) XNFreallocarray
back a decade ago. It's just used in a few places and it's only saves us from
passing the first parameter (NULL), so the actual benefit isn't really huge.

No (known) driver is using it, so the macro can be dropped entirely.

Fixes: ae75d50395
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
2024-07-26 23:41:33 +00:00
Alan Coopersmith 522f469fe9 Move sizeof to second argument in calloc calls
Clears -Wcalloc-transposed-args warnings from gcc 14.1, such as:

../dix/main.c:165:42: warning: ‘calloc’ sizes specified with ‘sizeof’ in the
 earlier argument and not in the later argument [-Wcalloc-transposed-args]
  165 |             serverClient = calloc(sizeof(ClientRec), 1);
      |                                          ^~~~~~~~~
../dix/main.c:165:42: note: earlier argument should specify number of
 elements, later size of each element

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1606>
2024-07-19 23:45:21 +00:00
Enrico Weigelt, metux IT consult 9f78d548e5 fix FTBS on NetBSD
../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86CloseConsole’:
../hw/xfree86/os-support/xf86_os_support.h:22:6: error: ‘dispatchException’ undeclared (first use in this function)
   22 |  if (dispatchException & DE_TERMINATE) { \
      |      ^~~~~~~~~~~~~~~~~
../hw/xfree86/os-support/bsd/bsd_init.c:634:13: note: in expansion of macro ‘xf86FatalError’
  634 |             xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
      |             ^~~~~~~~~~~~~~
../hw/xfree86/os-support/xf86_os_support.h:22:6: note: each undeclared identifier is reported only once for each function it appears in
   22 |  if (dispatchException & DE_TERMINATE) { \
      |      ^~~~~~~~~~~~~~~~~
../hw/xfree86/os-support/bsd/bsd_init.c:634:13: note: in expansion of macro ‘xf86FatalError’
  634 |             xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
      |             ^~~~~~~~~~~~~~
../hw/xfree86/os-support/xf86_os_support.h:22:26: error: ‘DE_TERMINATE’ undeclared (first use in this function); did you mean ‘ACTION_TERMINATE’?
   22 |  if (dispatchException & DE_TERMINATE) { \
      |                          ^~~~~~~~~~~~
../hw/xfree86/os-support/bsd/bsd_init.c:634:13: note: in expansion of macro ‘xf86FatalError’
  634 |             xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
      |             ^~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1575>
2024-07-06 19:40:10 +00:00
Enrico Weigelt, metux IT consult 487eb46826 os: move xserver_poll.h into os/ directory
This header isn't public and holds defines for code in os/ directory,
so no need to keep it in the global header dir - it's probably better
off in os/ directory - just like we already have with many others.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1389>
2024-06-21 00:53:39 +00:00
Enrico Weigelt, metux IT consult fd6fe36622 xfree86: os-support: simplify pci init
All supported platforms, except Linux, have have to call xf86InitVidMem()
from xf86scanpci(), so we can make the code much simpler.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1548>
2024-06-18 00:41:38 +00:00
Alan Coopersmith 7e119c5114 solaris: convert APM interfaces to official SRN interfaces
The sun_apm.c support was written to a draft version of the interfaces that
were integrated under a different name (SRN - Suspend/Resume Notification)
in 2007 for OpenSolaris, and what eventually became Solaris 11.0. Adopt the
official names and use the system-provided header file for these now.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1540>
2024-05-14 04:12:44 +00:00
Alan Coopersmith a4d298d855 xf86_OSlib.h: Don't need to include Solaris keyboard headers here
Left over from the builtin keyboard driver removed from the Xorg
server in 2006 (commit 3eeb62e8f5).

Requires xorg/driver/xf86-input-keyboard@40ef7d9e24987eb6708d822d0ea070
to build the current keyboard driver with this change.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1541>
2024-05-13 23:14:48 +00:00
Enrico Weigelt, metux IT consult 8982344e53 include: move dbus-core.h to config
This header is internal (not installed) and holds definitions for sources
in config/, thus it fells more clean moving it to config/, too.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1357>
2024-04-23 01:46:24 +00:00
Enrico Weigelt, metux IT consult 1e7085d143 xfree86: os-support: bsd: fix missing prototypes
Fix warnings on missing prototypes:

> ../hw/xfree86/os-support/bsd/bsd_VTsw.c:56:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86VTSwitchPending()
>                    ^
>                     void
> ../hw/xfree86/os-support/bsd/bsd_VTsw.c:67:17: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86VTSwitchAway()
>                 ^
>                  void
> ../hw/xfree86/os-support/bsd/bsd_VTsw.c:82:15: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86VTSwitchTo()
>               ^
>                void

> ../hw/xfree86/os-support/bsd/bsd_init.c:155:16: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenConsole()
>                ^
>                 void
> ../hw/xfree86/os-support/bsd/bsd_init.c:322:15: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenPccons()
>               ^
>                void
> ../hw/xfree86/os-support/bsd/bsd_init.c:347:16: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenSyscons()
>                ^
>                 void
> ../hw/xfree86/os-support/bsd/bsd_init.c:453:13: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86OpenPcvt()
>             ^
>              void
> ../hw/xfree86/os-support/bsd/bsd_init.c:596:17: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86CloseConsole()
>                 ^
>                  void
> ../hw/xfree86/os-support/bsd/bsd_init.c:673:11: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> xf86UseMsg()
>           ^
>            void

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1428>
2024-04-18 01:03:11 +00:00
Enrico Weigelt, metux IT consult 0f715b4ca4 xfree86: os-support: move hidden Solaris-specific symbols out of public header
These aren't exported at all, so no need to have 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/1456>
2024-04-18 00:40:39 +00:00
Enrico Weigelt, metux IT consult 7429f8ee8f xfree86: os-support: move xf86FatalError macro out of public header
This macro is only used inside xfree86's os-support layer, not by any
(known) drivers. Thus no need to have it exported in the public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1456>
2024-04-18 00:40:39 +00:00
Enrico Weigelt, metux IT consult 16a3790d60 xfree86: os-support: move unexported stuff out of xf86_OSproc.h
It's cleaner to have public headers only holding public stuff and
xf86_os_support seems to be much more appropriate place for this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1456>
2024-04-18 00:40:39 +00:00