2nd release this year:
* added syslog support
* xfree86: fixed DRI crash bug (#1053, #1534)
* bunch of little cleanups and fixes
* by default only builds Xnest DDX (others still can be enabled via options)
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This branch is specifically for just Xnest only, so disable anything else
per default. The others still can be enabled via meson options.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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>
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
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>
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>
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>
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>
(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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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>
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>
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>
Make it clear that stuff from this file really isn't supposed to be used
by dynamically loaded modules like drivers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The DDX callbacks (where core/DIX calls into DDX) aren't supposed to be
called by drivers directly, so unexport them.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
These functions shouldn't be called by drivers or extensions, thus
shouldn't be exported. Also moving it to separate header, so the
already huge ones aren't cluttered with even more things.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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>