summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2019-11-22xfree86: Test presence of isastream()Matt Turner2-0/+4
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> (cherry picked from commit e6ab7f9f342f463092c45226f3294074351fdd5e)
2019-10-29shm: Use memfd_create when possibleAlexander Volkov2-0/+4
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> (cherry picked from commit f6753c117ef0f83499d5e2d6dda226fec9ddf803)
2019-10-29shm: Pick the shm dir at run time, not build time.Eric Anholt2-8/+0
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> (cherry picked from commit 19f6cb570becbc4e355807199c6e251fc7935132)
2019-08-13GLX: Add a function to change a clients vendor list.Kyle Brenneman1-1/+12
Add a new function, GlxServerExports::setClientScreenVendor, which will change the vendor that handles GLX requests for a screen, but only for requests from a specific client. v2: Increment the GLXVND minor version number. v3: Note the GLXVND version requirement for setClientScreenVendor. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 56c0a71fdd94a008e5d746261f70a713c4767f93)
2019-03-21dix: ensure work queues are cleared on resetRay Strode1-0/+2
If the server resets, most client workqueues are cleaned up as the clients are killed. The one exception is the server's client, which is exempt from the killing spree. If that client has a queued work procedure active, it won't get cleared on reset. This commit ensures it gets cleared too. (cherry picked from commit 8738ce85df535bdfdfecfce1c0d64e209cc6e508) Fixes: xorg/xserver#670
2019-02-20Fix typo in error messageMaya Rashish1-1/+1
(cherry picked from commit bf2a7bb4ffbd199882fe4bd183561469833a9e6b)
2019-02-20automake: Distribute meson's configure header templatesAdam Jackson1-0/+3
Fixes: xorg/xserver#17 (cherry picked from commit 82ed89c0f8b18d8214430580dc80c8d3e37bef33)
2018-08-01meson: Add configuration of listening on tcp, unix and localLaurent Carlier1-3/+3
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> (cherry picked from commit 2f39b2a07805194fdd7def30d941666963d6e670)
2018-05-07meson: Set XCONFIGFILE to 'xorg.conf' instead of '/etc/xorg.conf'Aaron Plattner1-2/+2
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-07meson: Define DEFAULT_LIBRARY_PATH as join_paths(get_option('prefix'), ↵Aaron Plattner1-1/+1
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-02meson: Fix build with three-component version numbersAdam Jackson1-1/+5
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-04-24xwayland: Add glamor egl_backend for EGLStreamsLyude Paul3-3/+10
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-24xwayland: Add xwayland-config.hLyude Paul3-0/+25
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-02meson: Distribute more SDK headersThierry Reding1-0/+1
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-03-28meson: Fill in missing data for xorg-server.hThierry Reding1-0/+55
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-28meson: Generate xorg-server.hThierry Reding3-1/+227
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-28dix: Remove unused definitions from dix-config.h.inThierry Reding1-6/+0
There is no code around that will ever define values for the WORKING_UNALIGNED_INT or XORG_RELEASE symbols, so they will always end up commented out and are therefore completely useless. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28xorg: Remove unused definitions from xorg-server.h.inThierry Reding1-9/+0
There is no code around that will ever define values for the XLOADABLE, WORKING_UNALIGNED_INT or XORG_RELEASE symbols, so they will always end up commented out and are therefore completely useless. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-28meson: Fix build if Xdmcp is missingThierry Reding1-2/+2
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-27meson: Add option to set default font path (v2)Adam Jackson1-1/+1
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-27Revert "suid touchup"Adam Jackson1-1/+1
Pushed the wrong thing, sigh. This reverts commit 73a0562615aa1adfb934b953e23b1e69b126db4f.
2018-03-27suid touchupAdam Jackson1-1/+1
2018-03-27meson: Build Xorg suid wrapperAdam Jackson1-0/+1
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2018-03-27autotools: Stop caring about XORG_DATEAdam Jackson1-3/+0
Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-03-21os: move xf86PrivsElevated hereNicolai Hähnle1-0/+3
Having different types of code all trying to check for elevated privileges is a bad idea. This implementation is the most thorough one. Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Ben Crocker <bcrocker@redhat.com> Reviewed-by: Antoine Martin <antoine@nagafix.co.uk> Tested-by: Ben Crocker <bcrocker@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-21Remove always true GLAMOR_HAS_DRM_* guardsEmil Velikov2-15/+0
With earlier commit the required version was bumped to 2.4.89, thus the guards always evaluate to true. Fixes: e4e3447603b ("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-19present: Advertise protocol version 1.2Thierry Reding1-1/+1
Everything is implemented to support protocol version 1.2. Make it official. Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-08os: Define {ReadFdFrom,WriteFdTo}Client unconditionallyAdam Jackson2-4/+0
Otherwise this is broken on cygwin: rrlease.c: In function ‘ProcRRCreateLease’: rrlease.c:305:9: error: implicit declaration of function ‘WriteFdToClient’ [-Werror=implicit-function-declaration] if (WriteFdToClient(client, fd, TRUE) < 0) { Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-05dri3: Enable DRI3 version 1.2Louis-Francis Ratté-Boulianne1-1/+1
Enable DRI3 v1.2 now that all functions have been implemented and that there is at least one backend implementing the driver hooks (modesetting/glamor). 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-05glamor: Implement GetSupportedModifiersLouis-Francis Ratté-Boulianne2-0/+5
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-05glamor: Implement PixmapFromBuffers and BuffersFromPixmapLouis-Francis Ratté-Boulianne2-0/+5
It relies on GBM >= 17.1.0 where we can import BO with multiple planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER). v2: Properly free fds in Xwayland [Also add glamor_egl_ext.h to Makefile.am for distcheck's sake - ajax] 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-05modesetting: Get supported formats/modifiers for scanoutLouis-Francis Ratté-Boulianne2-0/+5
Retrieve IN_FORMATS property from the plane. It gives the allowed formats and modifiers for BO allocation. 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-05modesetting: Use atomic modesetting API for pageflip if availableLouis-Francis Ratté-Boulianne2-0/+5
In order to flip between compressed and uncompressed buffers - something drmModePageFlip explicitly bans us from doing - we need to port use the atomic modesetting API. It's only 'fake' atomic though given we still commit for each CRTC separately and CRTC and connector properties are not set with the atomic API. The helper functions to retrieve DRM properties have been borrowed from Weston. 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-05present: Send PresentCompleteModeSuboptimalCopy appropriatelyLouis-Francis Ratté-Boulianne1-1/+1
Add 'check_flip2' hook for driver to let know the core about why flipping is not possible ('reason'). If it is because of unsupported buffer format/modifier, a PresentCompleteNotify event is sent to the client with the PresentCompleteModeSuboptimalCopy mode. v2: Check for PresentOptionSuboptimal and check driver version before using 'check_flip2'. v3: Only require one of 'check_flip' or 'check_flip2' to be implemented by the driver. Refactor reasons list to enum 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-02meson: Make SHM extension optionalLaurent Carlier1-1/+1
v2: check for header 'sys/shm.h' Signed-off-by: Laurent Carlier <lordheavym@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02meson: get rid of useless HAVE_SYSV_IPCLaurent Carlier1-1/+0
Signed-off-by: Laurent Carlier <lordheavym@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02meson: Make ACPI support optionalLaurent Carlier1-1/+2
v2: Define HAVE_ACPI in dix-config.h Signed-off-by: Laurent Carlier <lordheavym@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02meson: Make APM support optionalLaurent Carlier1-0/+3
v2: Define HAVE_APM in dix-config.h Signed-off-by: Laurent Carlier <lordheavym@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-27Add RandR leases with modesetting driver support [v6]Keith Packard1-1/+1
This adds support for RandR CRTC/Output leases through the modesetting driver, creating a lease using new kernel infrastructure and returning that to a client through an fd which will have access to only those resources. v2: Restore CRTC mode when leases terminate When a lease terminates for a crtc we have saved data for, go ahead and restore the saved mode. v3: Report RR_Rotate_0 rotations for leased crtcs. Ignore leased CRTCs when selecting screen size. Stop leasing encoders, the kernel doesn't do that anymore. Turn off crtc->enabled while leased so that modesetting ignores them. Check lease status before calling any driver mode functions When starting a lease, mark leased CRTCs as disabled and hide their cursors. Also, check to see if there are other non-leased CRTCs which are driving leased Outputs and mark them as disabled as well. Sometimes an application will lease an idle crtc instead of the one already associated with the leased output. When terminating a lease, reset any CRTCs which are driving outputs that are no longer leased so that they start working again. This required splitting the DIX level lease termination code into two pieces, one to remove the lease from the system (RRLeaseTerminated) and a new function that frees the lease data structure (RRLeaseFree). v4: Report RR_Rotate_0 rotation for leased crtcs. v5: Terminate all leases on server reset. Leases hang around after the associated client exits so that the client doesn't need to occupy an X server client slot and consume a file descriptor once it has gotten the output resources necessary. Any leases still hanging around when the X server resets or shuts down need to be cleaned up by calling the kernel to terminate the lease and freeing any DIX structures. Note that we cannot simply use the existing drmmode_terminate_lease function on each lease as that wants to also reset the video mode, and during server shut down that modesetting: Validate leases on VT enter The kernel doesn't allow any master ioctls to run when another VT is active, including simple things like listing the active leases. To deal with that, we check the list of leases whenever the X server VT is activated. xfree86: hide disabled cursors when resetting after lease termination The lessee may well have played with cursors and left one active on our screen. Just tell the kernel to turn it off. v6: Add meson build infrastructure [Also bumped libdrm requirement - ajax] Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-19meson: Make DGA extension optionalLaurent Carlier1-0/+2
Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19dga: #if XFreeXDGA → #ifdef XFreeXDGALaurent Carlier2-3/+3
../include/events.h:32:14: error: #if with no expression Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19meson: Make Xv and XvMC extensions optionalLaurent Carlier1-1/+1
Just mimic autoconf file, XvMC can't be enabled without Xv Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-14miinitext: Load GLX on the mi pathAdam Jackson2-2/+2
Add a stub for Xnest so it continues to link, but otherwise we support GLX on every server so there's no need to make every DDX add it. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14glx: Use vnd layer for dispatch (v4)Adam Jackson1-1/+4
The big change here is MakeCurrent and context tag tracking. We now delegate context tags entirely to the vnd layer, and simply store a pointer to the context state as the tag data. If a context is deleted while it's current, we allocate a fake ID for the context and move the context state there, so the tag data still points to a real context. As a result we can stop trying so hard to detach the client from contexts at disconnect time and just let resource destruction handle it. Since vnd handles all the MakeCurrent protocol now, our request handlers for it can just be return BadImplementation. We also remove a bunch of LEGAL_NEW_RESOURCE, because now by the time we're called vnd has already allocated its tracking resource on that XID. v2: Update to match v2 of the vnd import, and remove more redundant work like request length checks. v3: Add/remove the XID map from the vendor private thunk, not the backend. (Kyle Brenneman) v4: Fix deletion of ghost contexts (Kyle Brenneman) Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14glx: Import glxvnd server module (v2)Kyle Brenneman3-0/+309
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>
2018-02-14meson: Make more extensions optionalLaurent Carlier1-1/+1
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>
2018-02-14meson: Make DPMS extension optionalLaurent Carlier1-1/+1
Just mimic autoconf file, DPMS is disabled with Xquartz Signed-off-by: Laurent Carlier <lordheavym@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12Correct xorg_list_is_empty return value descriptionRoman Gilg1-1/+2
The helper xorg_list_is_empty returns True when the list is empty and not when it contains one or more elements. Signed-off-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-02shm, xwayland: prefer atomic close-on-exec without O_TMPFILEJan Beich2-0/+4
Signed-off-by: Jan Beich <jbeich@FreeBSD.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-22glx: Move provider setup interface to glx_extinit.hAdam Jackson1-0/+12
Keeps us from needing to add glx/ to the include path everywhere, since we can't add it to the dix include path because the header file names conflict with glxproxy. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>