Commit Graph

18932 Commits

Author SHA1 Message Date
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
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
Enrico Weigelt, metux IT consult 3cbc9eda07 ci: reduce nolibdecor build to xwayland only
libdecor is only relevant for Xwayland, so no need to build all the
other DDX'es for this build test. Remvoving some unncessary load from
CI machines by disabling all DDX'es but Xwayland here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1676>
2024-09-10 13:49:30 +02:00
Alan Coopersmith 4accb821f2 meson: list required version of xproto headers in xorg-server.pc
Many of the SDK headers use the _X_* helper macros from Xfuncproto.h,
so list a dependency on them so the right path & version are used when
building out-of-tree loadable modules such as drivers.

Raises required version of meson to 0.58.0 to support format strings.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1668>
2024-09-09 07:48:07 -07:00
Alan Coopersmith 3de2e27ccc CI: update meson from 0.56.2 (bullseye) to 1.0.0 (bullseye-backports)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1668>
2024-09-09 07:47:32 -07:00
Alan Coopersmith 32adf434b7 CI: update libdecor from 0.1.0 to 0.1.1
The install_demo meson_option was added in
libdecor/libdecor@7106f5e329
which is in the 0.1.1 tag, but not 0.1.0.

If we upgrade the version of meson used in the CI to 1.0.0, then it fails
to build libdecor 0.1.0 with: ERROR: Unknown options: "install_demo"

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1668>
2024-09-09 07:44:44 -07:00
Alan Coopersmith fc8ba24413 CI: clone libdecor from fd.o instead of gnome.org
https://gitlab.gnome.org/jadahl/libdecor is archived and the README
says to use  https://gitlab.freedesktop.org/libdecor/libdecor instead.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1668>
2024-09-09 07:44:44 -07:00
Alan Coopersmith 83f553b340 CI: Update xcb util libraries to versions with working submodule URLs
The tags previously listed used anongit.fd.o URLs for their submodules
which no longer work.  Update to tags using gitlab.fd.o URL's instead.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1672>
2024-09-09 00:08:52 +00:00
Alan Coopersmith 9c9e1afeb2 dix: FindBestPixel: fix implicit fallthrough warning
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 13:27:45 -07:00
Alan Coopersmith e6fc0861d8 dix: GetPairedDevice: check if GetMaster returned NULL
Clears warning from gcc 14.1:

../dix/devices.c: In function ‘GetPairedDevice’:
../dix/devices.c:2734:15: warning: dereference of NULL ‘dev’
 [CWE-476] [-Wanalyzer-null-dereference]
 2734 |     return dev->spriteInfo? dev->spriteInfo->paired: NULL;
      |            ~~~^~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 13:21:14 -07:00
Alan Coopersmith 26a7ab09ea dix: HashResourceID: use unsigned integers for bit shifting
Clears warning from gcc 14.1:

../dix/resource.c: In function ‘HashResourceID’:
../dix/resource.c:691:44: warning: left shift of negative value
 [-Wshift-negative-value]
  691 |     return (id ^ (id >> numBits)) & ~((~0) << numBits);
      |                                            ^~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:59:07 -07:00
Alan Coopersmith 39f337fd49 dix: ProcListProperties: skip unneeded work if numProps is 0
No real harm, but clears warning from gcc 14.1:

../dix/property.c: In function ‘ProcListProperties’:
..//dix/property.c:605:27: warning: dereference of NULL ‘temppAtoms’
 [CWE-476] [-Wanalyzer-null-dereference]
  605 |             *temppAtoms++ = pProp->propertyName;
      |             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:48:18 -07:00
Alan Coopersmith 10cafd0bbe dix: dixChangeWindowProperty: don't call memcpy if malloc failed
It shouldn't matter, since it would have a length of 0, but it
clears warnings from gcc 14.1:

../dix/property.c: In function ‘dixChangeWindowProperty’:
../dix/property.c:287:9: warning: use of possibly-NULL ‘data’ where
 non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]
  287 |         memcpy(data, value, totalSize);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../dix/property.c:324:13: warning: use of possibly-NULL ‘data’ where
 non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]
  324 |             memcpy(data, value, totalSize);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:48:18 -07:00
Alan Coopersmith 462d13c2f6 dix: InitPredictableAccelerationScheme: avoid memory leak on failure
Clears warning from gcc 14.1:

../dix/ptrveloc.c: In function ‘InitPredictableAccelerationScheme’:
../dix/ptrveloc.c:149:9: warning: leak of ‘<unknown>’
 [CWE-401] [-Wanalyzer-malloc-leak]
  149 |         free(vel);
      |         ^~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:48:18 -07:00
Alan Coopersmith 7ee3a52018 dix: CreateScratchGC: avoid dereference of pointer we just set to NULL
Clears warning from gcc 14.1:

../dix/gc.c: In function ‘CreateScratchGC’:
../dix/gc.c:818:28: warning: dereference of NULL ‘pGC’
 [CWE-476] [-Wanalyzer-null-dereference]
  818 |     pGC->graphicsExposures = FALSE;

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:48:18 -07:00
Alan Coopersmith 0cb826e3d0 dix: enterleave.c: fix implicit fallthrough warnings
Clears 7 -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/1673>
2024-09-08 11:48:06 -07:00
Alan Coopersmith 1a86fba0d9 dix: SetFontPath: don't set errorValue on Success
Clears warning from gcc 14.1:

../dix/dixfonts.c: In function ‘SetFontPath’:
../dix/dixfonts.c:1697:28: warning: use of uninitialized value ‘bad’
 [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
 1697 |         client->errorValue = bad;
      |         ~~~~~~~~~~~~~~~~~~~^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:47:49 -07:00
Alan Coopersmith d78836a3a6 dix: PolyText: fully initialize local_closure
Clears warning from gcc 14.1:

../dix/dixfonts.c:1352:15: warning: use of uninitialized value ‘*c.data’
 [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
 1352 |         free(c->data);
      |              ~^~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 11:47:37 -07:00
Alan Coopersmith 25762834c9 dix: check for calloc() failure in Xi event conversion routines
Clears up 12 -Wanalyzer-possible-null-dereference warnings from gcc 14.1

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
2024-09-08 09:19:40 -07:00
Enrico Weigelt, metux IT consult 94998e3a1d ci: add FreeBSD build
Build the Xserver in FreeBSD VM.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1425>
2024-09-06 09:56:29 +10:00
Enrico Weigelt, metux IT consult c41bb2049e ci: use master branch of xf86-video-qxl driver
Need some fixes not in a tagged release yet.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1425>
2024-09-05 11:05:02 +02:00
Enrico Weigelt, metux IT consult b5a3ac9527 Xext: xf86bigfont: split reply header and payload
Split reply header and payload buffers. Making it more coherent with all the
other request handlers, and allows a lot of further simplification by using
generic macros (coming in subsequent commits).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1600>
2024-09-02 18:28:23 +00:00
Enrico Weigelt, metux IT consult 866f3261c4 Xext: xf86bigfont: code styling cleanups
* tidy up the includes into logic order.
* beautify function prototype

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1600>
2024-09-02 18:28:23 +00:00
Enrico Weigelt, metux IT consult 7735c4462c Xext: xf86bigfont: drop some dead code
There's some piece ifdef'ed code that doesn't serve any practical purpose.
Instead add a little comment telling why that funny way of dispatching
(based on request size) is necessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1600>
2024-09-02 18:28:23 +00:00
Enrico Weigelt, metux IT consult b0272692a1 dix: unexport DeleteAllWindowProperties()
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/1340>
2024-09-02 17:50:47 +00:00
Enrico Weigelt, metux IT consult fb697dd644 dix: unexport dixLookupProperty()
It's 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/1340>
2024-09-02 17:50:47 +00:00
Enrico Weigelt, metux IT consult 955cc5417b include: split out non-exported stuff from property.h
Reduce cluttering public interface with non-exported stuff, moving those
things into a separate internal header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1340>
2024-09-02 17:50:47 +00:00
Enrico Weigelt, metux IT consult 6c7c4fdc7e 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult eb81769b58 dix: unexport GetSpritePosition()
This function isn't used in any external modules, thus 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 9673886fac dix: unexport PointerConfinedToScreen()
It's not used by external 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult bd3c252710 dix: unexport NewCurrentScreen()
It's not used by external modules/drivers, 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 24d1c08441 dix: unexport CheckCursorConfinement()
This function isn't used by any external module, 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 0c354e9166 dix: unexport CursorMetricsFromGlyph()
This function isn't used by external modules, thus 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 974cd2b5f2 dix: unexport ServerBitsFromGlyph()
This function isn't used by external modules/drivers, 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 24f3c4a508 dix: unexport cursor allocation functions
These functions aren't used by external modules, so no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 4aadbeb8aa dix: unexport cursor refcounting functions
These aren't used externally (drivers/modules), thus no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult a2f72755a9 dix: unexport rootCursor
This field is only used by DIX and XI, thus 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/1345>
2024-09-02 16:43:29 +00:00
Enrico Weigelt, metux IT consult 1d7cb4b2c3 os: unexport CloseDownConnection()
Not used by any drivers, 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/1582>
2024-09-02 16:02:39 +00:00
Olivier Fourdan 8fe15a60c5 build: Fix DRI3 on DragonFly and OpenBSD
Commit 96bdc156 added a check for <sys/eventfd.h> to enable DRI3.

DragonFly and OpenBSD however rely on epoll-shim for <sys/eventfd.h>,
so that must be added as a dependency for the <sys/eventfd.h> check.

Fixes: commit 96bdc156 - xwayland: Do not enable DRI3 without eventfd
Suggested-by: Jan Beich <jbeich@freebsd.org>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1642>
2024-09-02 11:52:26 +00:00
Olivier Fourdan 7bcf2bcafc build: Add epoll to Xwayland for DragonFly and OpenBSD
DragonFly and OpenBSD rely on epoll-shim for <sys/eventfd>, add a
optional dependency to build Xwayland.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1642>
2024-09-02 11:52:26 +00:00