Commit Graph

85 Commits

Author SHA1 Message Date
Michel Dänzer
add3df2001 Consolidate fourcc.h
Move the copy in hw/xfree86/common to include/, and remove the one in
hw/kdrive/src/.

Fixes DIX glamor code including an xfree86 DDX header.
2020-09-15 11:43:16 +02:00
Jan Beich
b5b529799a meson: split udev from udev_kms which requires systemd
DragonFly and FreeBSD can use xf86-input-libinput with config/udev.

ld: error: undefined symbol: xf86PlatformDeviceProbe
>>> referenced by xf86platformBus.c
>>>               xf86platformBus.c.o:(xf86platformProbe) in archive hw/xfree86/common/libxorg_common.a

ld: error: undefined symbol: xf86PlatformDeviceCheckBusID
>>> referenced by xf86platformBus.c
>>>               xf86platformBus.c.o:(xf86platformProbeDev) in archive hw/xfree86/common/libxorg_common.a

ld: error: undefined symbol: xf86PlatformReprobeDevice
>>> referenced by xf86platformBus.c
>>>               xf86platformBus.c.o:(xf86platformVTProbe) in archive hw/xfree86/common/libxorg_common.a

ld: error: undefined symbol: NewGPUDeviceRequest
>>> referenced by udev.c
>>>               udev.c.o:(device_added) in archive config/liblibxserver_config.a

ld: error: undefined symbol: DeleteGPUDeviceRequest
>>> referenced by udev.c
>>>               udev.c.o:(device_removed) in archive config/liblibxserver_config.a
2020-05-27 07:16:02 +00:00
Adam Jackson
ee9f6e20de meson: Add support for libunwind 2020-02-12 16:56:13 -05:00
Kenneth Graunke
195c2ef8f9 glamor: Add a function to get the driver name via EGL_MESA_query_driver
This maps to eglGetDisplayDriverName if EGL_MESA_query_render is
supported, otherwise it returns NULL.
2019-11-26 01:13:45 -08:00
Matt Turner
e6ab7f9f34 xfree86: Test presence of isastream()
isastream() was never more than a stub in glibc, and was removed in
glibc-2.30 by commit a0a0dc83173c ("Remove obsolete, never-implemented
XSI STREAMS declarations").

Bug: https://bugs.gentoo.org/700838
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-11-22 15:22:43 -05:00
Jon Turney
622eea366a meson: Add sha1 library options
v2: Set the define for xha1.c programatically, rather than using loads
of conditionals.
2019-10-30 16:58:39 +00:00
Adam Jackson
89a9927b1e include: Remove now-empty site.h 2019-10-30 16:17:04 +00:00
Alan Coopersmith
6036e84527 meson: fix builds on Solaris 11.4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-09-23 16:28:42 -07:00
Adam Jackson
7d0e660e0e meson: Add dtrace support 2019-08-27 17:38:59 -04:00
Olivier Fourdan
aed62f8fbe meson/xwayland: No libdrm nor epoxy without glamor
When building Xwayland with neither DRI nor GLamor support enabled with
the Meson build system, the resulting binary would still link against
libdrm and epoxy even though those are not used/needed.

Make sure we require and link against libdrm and epoxy only if needed.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2019-08-15 17:08:04 +00:00
Jon Turney
7b4b030df8 configure: Check for sigprocmask
MinGW defines SIG_BLOCK, but doesn't have signal masks, so rather than
checking for SIG_BLOCK, add a configure check for sigprocmask.

v2:
Also add check to meson.build
2019-05-18 14:59:38 +00:00
Jon Turney
246b729df8 configure: Force --disable-input-thread for MinGW
I don't think an input thread can ever be useful on Windows.

There is a pthread emulation, so having the thread itself isn't much of
a problem.

However, there is no device to wait on for Windows events, and even if
we were to replace select() with WFMO, Windows wants to send events for
a window to the thread which created that window.

So, disable input thread by default for MinGW

v2:
Also add similar to meson.build
2019-05-18 14:59:38 +00:00
Jon Turney
655b1eb32e meson: Convert xquartz from autotools
Differences from autotools:

* Autotools defined NO_ALLOCA for OSX builds.  I don't think we need
this anymore as Xalloc.h is no longer used anywhere in the xserver.

* X11.bin is linked with -u,miDCInitialize, and then libserver_mi
provided to satisfy (just) that.  It's been that way since the commit
which added it.  We can't write the equivalent in meson due to linker
argument ordering issues, but do we really need to?

* An explicit -Dsecure-rpc=false is required for OSX, since in meson we
don't do the checks that XTRANS_SECURE_RPC_FLAGS did for the existence
of the specific RPC functions required.
2019-05-02 15:42:58 +00:00
Jon Turney
ecf62b7ba6 meson: Build rootless extension 2019-05-02 15:42:58 +00:00
Jon Turney
504468d2cf meson: Don't use strndup() unless it's prototyped
A workaround for https://github.com/mesonbuild/meson/issues/3672

MinGW-w64 gcc has a built-in strndup, but it's not in the C library and
MinGW-w64 headers don't prototype it.

Don't try to use it, as that will cause an undefined reference if gcc
decides that an out-of-line call is appropriate.
2019-04-30 20:07:51 +00:00
Jon Turney
50b8670fdf meson: Require clock_gettime() as well for MONOTONIC_CLOCK
As configure.ac, require that clock_gettime() exists as well to use
MONOTONIC_CLOCK (MinGW provides the define, but not the function)
2019-04-30 20:07:51 +00:00
Jon Turney
d21224cd15 meson: Don't set UNIXCONN on Windows
As XTRANS_CONNECTION_FLAGS did, don't try to build unix socket support
on Windows.
2019-04-30 20:07:51 +00:00
Jon Turney
c2feeca1b0 meson: Absence of dri.pc is an error if building with GLX
Currently, this can error if dri.pc isn't found, as we can't then get
the value of pkgconfig variable from it:

include/meson.build:199:10: ERROR:  'dri' is not a pkgconfig dependency

I think we need DRI_DRIVER_PATH (only) when building GLX, even if dri2/3
isn't enabled, so we know where to load swrast_dri.so from.

(For autotools, configure.ac directly calls `pkg-config
--variable=dridriverdir dri`, the backticks swallowing any error,
causing the value of this define to be empty if dri.pc isn't present)
2019-04-30 20:07:51 +00:00
Alexander Volkov
f6753c117e shm: Use memfd_create when possible
It doesn't require shared memory dir and thus allows
to avoid cases when this dir is detected incorrectly,
as in https://bugreports.qt.io/browse/QTBUG-71440

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
2019-02-14 12:53:06 +03:00
Eric Anholt
19f6cb570b shm: Pick the shm dir at run time, not build time.
Prodding the builder's filesystem for tmp dirs doesn't necessarily
tell you anything about what the actual host's filesystem is going to
look like, so we should just try the dirs at runtime.

Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 21:36:16 +00:00
Eric Anholt
b8b64cd627 xorg: Don't log "Build Operating System: Linux 4.9.0-5-amd64 x86_64 Debian"
I don't think this is useful information to have in the log, and it's
a bunch of autotools and meson logic to produce it.

Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 13:15:04 -07:00
Eric Anholt
bfa6e84641 meson: Add configure option and autodetection of HAVE_INPUTTHREAD.
Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 13:10:29 -07:00
Eric Anholt
1fc20b985c meson: Add detection of libsystemd-daemon.
This enables Xtrans's systemd socket activation.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:42:54 -04:00
Eric Anholt
4ba7866770 meson: Get close to parity with autotools for CLIENTIDS tracking.
The client ID is only needed for XRes, and autotools build ignores the
--clientids= arg if xres is disabled.  We haven't made a meson option
for disabling tracking client ids (is it actually worth a build
option?), so just make this depend on xres.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:42:54 -04:00
Eric Anholt
e047da37be meson: Add missing setup of the NO_LOCAL_CLIENT_CRED define.
Ported from autotools.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:42:54 -04:00
Eric Anholt
049d2346ab meson: Make FALLBACK_INPUT_DRIVER configurable in meson.
This makes us match the featureset of autotools, and also fixes the
non-Linux default value to match.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:42:54 -04:00
Eric Anholt
97bd8bc9cb meson: Make xf86vidmodeproto mandatory.
This is silly to have optional based on detection of the protocol
headers, particularly now that we have a single protocol header repo
to install.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
2018-08-09 13:28:23 -04:00
Eric Anholt
db53c439ba meson: Add linking to x86 iopl libs on BSDs.
Ported from automake.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:28:21 -04:00
Eric Anholt
9869512cbf meson: Add HAVE_LIBDISPATCH define to xquartz build.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:28:19 -04:00
Eric Anholt
843e44adf1 meson: Add PIO access support for FreeBSD and NetBSD on Alpha.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 13:28:17 -04:00
Eric Anholt
c20e7b5e22 meson: Automatically detect HAVE_PTHREAD_SETNAME_NP
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-02 10:27:40 -04:00
Eric Anholt
accd32a466 xorg: Remove the XF86PM define.
We already have pm_noop.c being built most of the time for the
no-OS-PM case, so just switch to always using it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-02 10:27:37 -04:00
Eric Anholt
708ddfbda1 automake,meson: Remove HAVE_LIBUDEV define.
CONFIG_UDEV and CONFIG_UDEV_KMS are the actual defines that are used
in the C code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-02 10:27:36 -04:00
Eric Anholt
7deaf99007 meson: Automatically detect support for XTRANS_SEND_FDs.
The SCM_RIGHTS flag seems to be the thing that xtrans depends on, and
meson makes the check easy without needing a build option.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-02 10:27:33 -04:00
Laurent Carlier
2f39b2a078 meson: Add configuration of listening on tcp, unix and local
bugzilla: https://bugs.kde.org/show_bug.cgi?id=395419
bugzilla: https://bugs.archlinux.org/task/59025

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-28 15:15:49 +10:00
Aaron Plattner
f5ded22e14 meson: Set XCONFIGFILE to 'xorg.conf' instead of '/etc/xorg.conf'
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>
2018-05-07 12:25:00 -04:00
Aaron Plattner
1a3e4a2f67 meson: Define DEFAULT_LIBRARY_PATH as join_paths(get_option('prefix'), get_option('libdir'))
'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>
2018-05-07 12:23:34 -04:00
Adam Jackson
4191b59bd5 meson: Fix build with three-component version numbers
Otherwise:

include/meson.build:5:0: ERROR: Index 3 out of bounds of array of size 3.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-05-02 15:10:20 -04:00
Lyude Paul
54ac09717c xwayland: Add glamor egl_backend for EGLStreams
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>
2018-04-24 16:51:18 -04:00
Lyude Paul
994f781007 xwayland: Add xwayland-config.h
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>
2018-04-24 14:58:19 -04:00
Thierry Reding
88c7b8bf4b meson: Distribute more SDK headers
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>
2018-04-02 13:42:08 -04:00
Thierry Reding
d905e3330f meson: Fill in missing data for xorg-server.h
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>
2018-03-28 09:54:24 -04:00
Thierry Reding
0babe78ed5 meson: Generate xorg-server.h
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>
2018-03-28 09:54:22 -04:00
Thierry Reding
66402fcd82 meson: Fix build if Xdmcp is missing
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>
2018-03-28 09:54:14 -04:00
Adam Jackson
0a7dabc86c meson: Add option to set default font path (v2)
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>
2018-03-27 13:00:26 -04:00
Adam Jackson
a26195d5c1 Revert "suid touchup"
Pushed the wrong thing, sigh.

This reverts commit 73a0562615.
2018-03-27 12:58:15 -04:00
Adam Jackson
73a0562615 suid touchup 2018-03-27 12:06:38 -04:00
Adam Jackson
1e0df64738 meson: Build Xorg suid wrapper
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-03-27 10:13:18 -04:00
Emil Velikov
22b489d273 Remove always true GLAMOR_HAS_DRM_* guards
With earlier commit the required version was bumped to 2.4.89, thus the
guards always evaluate to true.

Fixes: e4e3447603 ("Add RandR leases with modesetting driver support
[v6]")
Cc: Keith Packard <keithp@keithp.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-21 10:06:12 -04:00
Louis-Francis Ratté-Boulianne
cef12efc15 glamor: Implement GetSupportedModifiers
Implement function added in DRI3 v1.1.

A newest version of libepoxy (>= 1.4.4) is required as earlier
versions use a problematic version of Khronos
EXT_image_dma_buf_import_modifiers spec.

v4: Only send scanout-supported modifiers if flipping is possible
v5: Fix memory corruption in XWayland (uninitialized pointer)

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:55 -05:00