The autoconf build hard-codes XCONFIGFILE to just 'xorg.conf':
XF86CONFIGFILE="xorg.conf"
AC_DEFINE_DIR(XCONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
Later, the X server passes that into DoSubstitution() which expands the path:
DoSubstitution(template="/etc/X11/%X", ..., XConfigFile="xorg.conf")
This returns "/etc/X11/xorg.conf".
The Meson build, on the other hand, sets XCONFIGFILE to
join_paths(get_option('sysconfdir'), 'xorg.conf'). If sysconfdir is /etc, this
results in '/etc/xorg.conf', resulting in DoSubstitution returning
'/etc/X11/etc/xorg.conf'.
Fix this by just hard-coding XCONFIGFILE to 'xorg.conf'.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
'libdir' defaults to 'lib', so running X -showDefaultLibPath just prints 'lib'
instead of '/usr/lib' or '/usr/local/lib'. Use joint_paths() to get the correct
full path.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
This adds initial support for displaying Xwayland applications through
the use of EGLStreams and nvidia's custom wayland protocol by adding
another egl_backend driver. This also adds some additional egl_backend
hooks that are required to make things work properly.
EGLStreams work a lot differently then the traditional way of handling
buffers with wayland. Unfortunately, there are also a LOT of various
pitfalls baked into it's design that need to be explained.
This has a very large and unfortunate implication: direct rendering is,
for the time being at least, impossible to do through EGLStreams. The
main reason being that the EGLStream spec mandates that we lose the
entire color buffer contents with each eglSwapBuffers(), which goes
against X's requirement of not losing data with pixmaps. no way to use
an allocated EGLSurface as the storage for glamor rendering like we do
with GBM, we have to rely on blitting each pixmap to it's respective
EGLSurface producer each frame. In order to pull this off, we add two
different additional egl_backend hooks that GBM opts out of
implementing:
- egl_backend.allow_commits for holding off displaying any EGLStream
backed pixmaps until the point where it's stream is completely
initialized and ready for use
- egl_backend.post_damage for blitting the content of the EGLStream
surface producer before Xwayland actually damages and commits the
wl_surface to the screen.
The other big pitfall here is that using nvidia's wayland-eglstreams
helper library is also not possible for the most part. All of it's API
for creating and destroying streams rely on being able to perform a
roundtrip in order to bring each stream to completion since the wayland
compositor must perform it's job of connecting a consumer to each
EGLstream. Because Xwayland has to potentially handle both responding to
the wayland compositor and it's own X clients, the situation of the
wayland compositor being one of our X clients must be considered. If we
perform a roundtrip with the Wayland compositor, it's possible that the
wayland compositor might currently be connected to us as an X client and
thus hang while both Xwayland and the wayland compositor await responses
from eachother. To avoid this, we work directly with the wayland
protocol and use wl_display_sync() events along with release() events to
set up and destroy EGLStreams asynchronously alongside handling X
clients.
Additionally, since setting up EGLStreams is not an atomic operation we
have to take into consideration the fact that an EGLStream can
potentially be created in response to a window resize, then immediately
deleted due to another pending window resize in the same X client's
pending reqests before Xwayland hits the part of it's event loop where
we read from the wayland compositor. To make this even more painful, we
also have to take into consideration that since EGLStreams are not
atomic that it's possible we could delete wayland resources for an
EGLStream before the compositor even finishes using them and thus run
into errors. So, we use quite a bit of tracking logic to keep EGLStream
objects alive until we know the compositor isn't using them (even if
this means the stream outlives the pixmap it backed).
While the default backend for glamor remains GBM, this patch exists for
users who have had to deal with the reprecussion of their GPU
manufacturers ignoring the advice of upstream and the standardization of
GBM across most major GPU manufacturers. It is not intended to be a
final solution to the GBM debate, but merely a baindaid so our users
don't have to suffer from the consequences of companies avoiding working
upstream. New drivers are strongly encouraged not to use this as a
backend, and use GBM like everyone else. We even spit this out as an
error from Xwayland when using the eglstream backend.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Just a small autogenerated header that will soon contain more then just
one macro.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Install missing headers to the SDK directory to allow external modules
to properly build against the SDK. After this commit, the list of files
installed in the SDK include directory is the same as the list of files
installed by the autotools-based build.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Provide more values for the definitions in xorg-server.h for Meson
builds. The only missing defines left after this are _BSD_SOURCE,
_POSIX_SOURCE and _XOPEN_SOURCE, but Meson seems to already define
these via the command-line if necessary.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Some drivers (such as xf86-input-libinput) require the xorg-server.h to
build. Generate it and install it so that it can be used by users.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Xdmcp is an optional dependency, so make sure the build succeeds if it
is missing.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
The autotools build gets this from some macros in fontutil, but they're
just wrappers around pkgconfig.
v2: Use same default as autotools (Keith Packard)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This is based on an out-of-tree module written by Kyle:
https://github.com/kbrenneman/libglvnd/tree/server-libglx
I (ajax) did a bunch of cosmetic fixes, ported it off xfree86 API,
added request length checks, and fixed a minor bug or two.
v2: Use separate functions to set/get a context tag's private data, and
call the backend's MakeCurrent when a client disconnects to unbind the
context. (Kyle Brenneman)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Just mimic autoconf file for xf86bigfont, screensaver,
xres, xace and xinerama extensions
Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Just mimic autoconf file, DPMS is disabled with Xquartz
Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Formerly used by the rgb database code, which hasn't been a thing in
over a decade.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
x11perf -noop with 200 xlogos connected is slightly faster with ports:
before after Operation
---------- ----------------- --------------------
18400000.0 19200000.0 (1.04) X protocol NoOperation
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
AIX's poll only allows FD_SETSIZE entries in the fd list, which is
insufficient for expanded MaxClients.
As a bonus, x11perf -noop with ~250 xlogos connected is slightly faster
with pollset:
before after Operation
--------- ---------------- --------------------
5750000.0 5990000.0 (1.04) X protocol NoOperation
Signed-off-by: Peter Harris <pharris@opentext.com>
Acked-by: Keith Packard <keithp@keithp.com>
Changes since v2:
- Don't enable by default for debugoptimized builds
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Now that we can actually configure all of the directories xkb uses for
finding things, we can (finally, but only with meson) finally make it so
that with the correct meson configuration the Xserver will "just work"
without any additional changes to the installation prefix after
building.
For the people like me who have since scripted this part out of their
build process and forgotten about it, building and installing the X
server into a non-standard prefix has always required the following (or
something else that makes sure that X has a valid xkbcomp configuration)
commands be run right after doing the installation:
# start in root of prefix you installed X to
mkdir -pv share/X11/xkb/rules
ln -s /usr/share/X11/xkb/rules/evdev share/X11/xkb/rules/
rm -f bin/xkbcomp
ln -s /usr/bin/xkbcomp bin/
The one last piece of getting rid of this post-install junk is making
sure that we can control the directory that X uses for finding the
xkbcomp binary from meson so we can point it at the system provided
xkbcomp (/usr/bin/xkbcomp or similar). So, this patch adds a
configuration option for controlling this called xkb_bin_dir.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Without this, exa's gc swap macros trigger gcc's -Wdiscarded-qualifiers.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Setting glx_align64 to '' gives a null string in the arguments list passed
to the compiler. This is taken as an input filename, leading to:
"cc: error: : No such file or directory"
Instead, assign an empty list to glx_align64, which gets flattened to
nothing in the arguments list.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
We can check the version on an existing dependency, rather than spinning
up pkg-config again just to check the right version.
Signed-off-by: Daniel Stone <daniels@collabora.com>
The epoll code depends on epoll_create1, not epoll_create.
Signed-off-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
This needs a meson with PRs #1784, #1792 and #1794
Future work: remove conditionals which are always on, and simplify redundant
CYGDEBUG conditionals
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
I misspelled the enable flag, so DRI3 would throw BadImplementation
when you tried to start any GL app. Same as in
c7be7a688a, we also convert it to #ifdef
for consistency.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
C99 isn't enough on its own to get POSIX feature sets defined.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
If we're linking with libbsd anyway, we might as well use the functions
it provides instead of compiling our replacements.
Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Set HAVE_REALLOCARRAY, HAVE_SIGACTION, HAVE_STRCASESTR, HAVE_STRLCAT,
HAVE_STRLCPY, HAVE_TIMINGSAFE_MEMCMP, and BUSFAULT.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Harris <pharris@opentext.com>
Add options for DRI{1,2,3}
shmfence is required for DRI3
libdrm is required for any DRI{1,2,3}
Consolidate calls to dependency('libdrm')
Set WITH_LIBDRM when building with libdrm
v2:
Initialize libxserver_dri3 to []
Manually flatten libxserver, since meson doesn't (currently)
Use version_compare rather than circumloctions with dependency()
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
glibc would like to stop declaring major()/minor() macros in
<sys/types.h> because that header gets included absolutely everywhere
and unix device major/minor is perhaps usually not what's expected. Fair
enough. If one includes <sys/sysmacros.h> as well then glibc knows we
meant it and doesn't warn, so do that if it exists.
Signed-off-by: Adam Jackson <ajax@redhat.com>