summaryrefslogtreecommitdiff
path: root/Xext
Commit message (Collapse)AuthorAgeFilesLines
* Xext: fix invalid event type mask in XTestSwapFakeInputPeter Hutterer2022-12-191-1/+1
| | | | | | | | | | | | In commit b320ca0 the mask was inadvertently changed from octal 0177 to hexadecimal 0x177. Fixes commit b320ca0ffe4c0c872eeb3a93d9bde21f765c7c63 Xtest: disallow GenericEvents in XTestSwapFakeInput Found by Stuart Cassoff Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Xext: free the screen saver resource when replacing itPeter Hutterer2022-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes a use-after-free bug: When a client first calls ScreenSaverSetAttributes(), a struct ScreenSaverAttrRec is allocated and added to the client's resources. When the same client calls ScreenSaverSetAttributes() again, a new struct ScreenSaverAttrRec is allocated, replacing the old struct. The old struct was freed but not removed from the clients resources. Later, when the client is destroyed the resource system invokes ScreenSaverFreeAttr and attempts to clean up the already freed struct. Fix this by letting the resource system free the old attrs instead. CVE-2022-46343, ZDI-CAN 19404 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Olivier Fourdan <ofourdan@redhat.com>
* Xext: free the XvRTVideoNotify when turning off from the same clientPeter Hutterer2022-12-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a use-after-free bug: When a client first calls XvdiSelectVideoNotify() on a drawable with a TRUE onoff argument, a struct XvVideoNotifyRec is allocated. This struct is added twice to the resources: - as the drawable's XvRTVideoNotifyList. This happens only once per drawable, subsequent calls append to this list. - as the client's XvRTVideoNotify. This happens for every client. The struct keeps the ClientPtr around once it has been added for a client. The idea, presumably, is that if the client disconnects we can remove all structs from the drawable's list that match the client (by resetting the ClientPtr to NULL), but if the drawable is destroyed we can remove and free the whole list. However, if the same client then calls XvdiSelectVideoNotify() on the same drawable with a FALSE onoff argument, only the ClientPtr on the existing struct was set to NULL. The struct itself remained in the client's resources. If the drawable is now destroyed, the resource system invokes XvdiDestroyVideoNotifyList which frees the whole list for this drawable - including our struct. This function however does not free the resource for the client since our ClientPtr is NULL. Later, when the client is destroyed and the resource system invokes XvdiDestroyVideoNotify, we unconditionally set the ClientPtr to NULL. On a struct that has been freed previously. This is generally frowned upon. Fix this by calling FreeResource() on the second call instead of merely setting the ClientPtr to NULL. This removes the struct from the client resources (but not from the list), ensuring that it won't be accessed again when the client quits. Note that the assignment tpn->client = NULL; is superfluous since the XvdiDestroyVideoNotify function will do this anyway. But it's left for clarity and to match a similar invocation in XvdiSelectPortNotify. CVE-2022-46342, ZDI-CAN 19400 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Olivier Fourdan <ofourdan@redhat.com>
* Xtest: disallow GenericEvents in XTestSwapFakeInputPeter Hutterer2022-12-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | XTestSwapFakeInput assumes all events in this request are sizeof(xEvent) and iterates through these in 32-byte increments. However, a GenericEvent may be of arbitrary length longer than 32 bytes, so any GenericEvent in this list would result in subsequent events to be misparsed. Additional, the swapped event is written into a stack-allocated struct xEvent (size 32 bytes). For any GenericEvent longer than 32 bytes, swapping the event may thus smash the stack like an avocado on toast. Catch this case early and return BadValue for any GenericEvent. Which is what would happen in unswapped setups anyway since XTest doesn't support GenericEvent. CVE-2022-46340, ZDI-CAN 19265 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Olivier Fourdan <ofourdan@redhat.com>
* Xext: the check firstValuator ≤ 1 is duplicated in this branchKonstantin Kharlamov2022-04-021-1/+1
| | | | | | | | | Correctness is ensured be checking md5sum result before and after the commit (it's the same). Fixes LGTM warning: "Comparison is always true because firstValuator <= 1." Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
* Xext: Fix out of bounds access in SProcScreenSaverSuspend()Povilas Kanapickas2021-12-141-1/+1
| | | | | | | | | ZDI-CAN-14951, CVE-2021-4010 This vulnerability was discovered and the fix was suggested by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
* Remove autotools supportPovilas Kanapickas2021-10-271-120/+0
| | | | Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
* selinux: Stop using security_context_tAdam Jackson2021-08-174-18/+18
| | | | This is apparently deprecated now and is and was always just char *.
* More missing version checks in SProcsDemi Marie Obenour2021-08-081-1/+7
| | | | The bug in XFixes was also found in GenericEvent and Damage.
* meson: hide C API if Xorg is disabled (like autotools)Jan Beich2021-03-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building only Xwayland using Meson some files are always installed. This causes package conflict if Xwayland is built separately from Xorg. include/xorg/compositeext.h include/xorg/damage.h include/xorg/damagestr.h include/xorg/dbestruct.h include/xorg/dri3.h include/xorg/fb.h include/xorg/fboverlay.h include/xorg/fbpict.h include/xorg/fbrop.h include/xorg/geext.h include/xorg/geint.h include/xorg/glyphstr.h include/xorg/mi.h include/xorg/micmap.h include/xorg/micoord.h include/xorg/migc.h include/xorg/miline.h include/xorg/mioverlay.h include/xorg/mipict.h include/xorg/mipointer.h include/xorg/mipointrst.h include/xorg/mistruct.h include/xorg/misync.h include/xorg/misyncfd.h include/xorg/misyncshm.h include/xorg/misyncstr.h include/xorg/mizerarc.h include/xorg/panoramiX.h include/xorg/panoramiXsrv.h include/xorg/picture.h include/xorg/picturestr.h include/xorg/present.h include/xorg/presentext.h include/xorg/randrstr.h include/xorg/rrtransform.h include/xorg/shadow.h include/xorg/shmint.h include/xorg/syncsdk.h include/xorg/vndserver.h include/xorg/wfbrename.h include/xorg/xace.h include/xorg/xacestr.h include/xorg/xorg-server.h include/xorg/xvdix.h include/xorg/xvmcext.h share/aclocal/xorg-server.m4 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* os, shm: fcntl()'s third argument is integer, not pointerAdam Jackson2020-12-181-1/+1
| | | | | | | | | All of these uses were attempting to set FD_CLOEXEC, which happens to be (1<<0). Since flags is going to be aligned in memory, its address is never going to have the low bit set, so we were never actually setting what we meant to. Fixes: xorg/xserver#1114
* configure: Build hashtable for Xres and glvndOlivier Fourdan2020-11-091-2/+8
| | | | | | | | | | | | | | With autoconf, hashtable support is built along with Xres support. Yet, glvnd also use it, so when disabling Xres from configure, the build will fail at link time because hashtable functions are not available. Untie the build of hashtable from Xres support, just like meson build does. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1091
* Fix spelling/wording issuesAlan Coopersmith2020-07-057-16/+17
| | | | | | | | Most (but not all) of these were found by using codespell --builtin clear,rare,usage,informal,code,names but not everything reported by that was fixed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* os: Don't crash in AttendClient if the client is goneAaron Plattner2019-11-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a client is in the process of being closed down, then its client->osPrivate pointer will be set to NULL by CloseDownConnection. This can cause a crash if freeing the client's resources results in a call to AttendClient. For example, if the client has a pending sync fence: Thread 1 "X" received signal SIGSEGV, Segmentation fault. AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942 (gdb) bt #0 AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942 #1 0x00005571c3dbb865 in SyncAwaitTriggerFired (pTrigger=<optimized out>) at ../Xext/sync.c:694 #2 0x00005571c3dd5749 in miSyncDestroyFence (pFence=0x5571c5063980) at ../miext/sync/misync.c:120 #3 0x00005571c3dbbc69 in FreeFence (obj=<optimized out>, id=<optimized out>) at ../Xext/sync.c:1909 #4 0x00005571c3d7a01d in doFreeResource (res=0x5571c506e3d0, skip=skip@entry=0) at ../dix/resource.c:880 #5 0x00005571c3d7b1dc in FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1146 #6 FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1109 #7 0x00005571c3d5525f in CloseDownClient (client=0x5571c4aed9a0) at ../dix/dispatch.c:3473 #8 0x00005571c3d55eeb in Dispatch () at ../dix/dispatch.c:492 #9 0x00005571c3d59e96 in dix_main (argc=3, argv=0x7ffe7854bc28, envp=<optimized out>) at ../dix/main.c:276 #10 0x00007fea4837cb6b in __libc_start_main (main=0x5571c3d1d060 <main>, argc=3, argv=0x7ffe7854bc28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe7854bc18) at ../csu/libc-start.c:308 #11 0x00005571c3d1d09a in _start () at ../Xext/sync.c:2378 (gdb) print client->osPrivate $1 = (void *) 0x0 Since the client is about to be freed, its ignore count doesn't matter and AttendClient can simply be a no-op. Check for client->clientGone in AttendClient and remove similar checks from two callers that had them. Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
* dix: Call SourceValidate before GetImageAdam Jackson2019-10-302-0/+19
| | | | | | | | | | | | | | | | | | | | | This ensures that any prep work for the drawable we're about to read from is already done before we call down to GetImage. This should be no functional change as most of the callers with a non-trivial SourceValidate are already wrapping GetImage and doing the equivalent thing, but we'll be simplifying that shortly. More importantly this ensures that if any of that prep work would generate events - like automatic compositing flushing rendering to a parent pixmap which then triggers damage - then it happens entirely before we start writing the GetImage reply header. Note that we do not do the same for GetSpans, but that's okay. The only way to get to GetSpans is through miCopyArea or miCopyPlane - where the callers must already call SourceValidate - or miGetImage - which this commit now protects with SourceValidate. Fixes: xorg/xserver#902 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* dix: Fix undefined shift in ht_generic_hashAdam Jackson2019-10-151-1/+1
| | | | The hits keep coming.
* xsync: Add resource inside of SyncCreate, export SyncCreateAlex Goins2019-04-172-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may want to create a fence, then initialize it in their own way. This currently can't be done without adding a function directly to Xext/sync.c due to the fact that the RTFence resource type is private and there is no external interface to add to it. To facilitate other X extensions creating fences and initializing them, this change exports SyncCreate() and adds the resource directly within it. Callers no longer need to call AddResource() after SyncCreate(), they only need to initialize the SyncObject. To prevent FreeFence() and FreeCounter() from segfaulting if the call to AddResource() fails before the sync object is initialized, this adds a new 'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and FreeCounter() to skip de-initialization and simply free the object. Initialization after adding the resource shouldn't otherwise be a problem due to the single-threaded nature of X. Signed-off-by: Alex Goins <agoins@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
* shm: Use memfd_create when possibleAlexander Volkov2019-02-141-0/+12
| | | | | | | | 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>
* shm: Pick the shm dir at run time, not build time.Eric Anholt2018-09-191-19/+29
| | | | | | | | 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>
* shm: reindent shm_tmpfile to follow our standards.Eric Anholt2018-09-191-20/+20
| | | | Signed-off-by: Eric Anholt <eric@anholt.net>
* shm: move shmsize verify before allocating the drawable.Dave Airlie2018-09-121-12/+13
| | | | | | | | | Otherwise if the VERIFY_SHMSIZE macro fails we leak the drawables we allocated earlier. Noticed by coverity scan. Signed-off-by: Dave Airlie <airlied@redhat.com>
* xselinux: warning fixAdam Jackson2018-09-111-6/+3
| | | | | | | ../Xext/xselinux_ext.c: In function ‘SELinuxExtensionInit’: ../Xext/xselinux_ext.c:692:21: warning: variable ‘extEntry’ set but not used [-Wunused-but-set-variable] Signed-off-by: Adam Jackson <ajax@redhat.com>
* Xext: dynamically allocate the PanoramiXDepths[j].vids arrayPeter Hutterer2018-07-191-5/+4
| | | | | | | | | | | | | | | Control flow is: PanoramiXMaybeAddDepth() allocates an array size 240 (pDepth->numVisuals) PanoramiXMaybeAddVisual() finds up to 270 matches (pScreen->numVisuals) and writes those into the previously allocated array. This caused invalid reads/writes followed by eventually a double-free abort. Reproduced with xorg-integration-tests server test XineramaTest.ScreenCrossing/* (and a bunch of others). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
* Change the DPMS initialization to be conditional on not set from configJohn Lumby2018-06-261-4/+12
| | | | | | | | | | | | Any DPMS timeout values set in ServerFlags section of the xorg.conf are being overwritten by DPMS extension initialization. Therefore change the DPMS initialization of timeout values to be conditional on not set from config. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106963 Signed-off-by: John Lumby <johnlumby@hotmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Keith Packard <keithp@keithp.com>
* Xext/shm: Refuse to work for remote clientsAlexander Volkov2018-06-141-4/+14
| | | | | | | | | | | | Avoid access to System V shared memory segment on the X server side for clients forwarded via SSH. Also prevent them from hanging while waiting for the reply from the ShmCreateSegment request. v2: Allow ShmQueryVersion request even for remote clients Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=11080 Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Adam Jackson <ajax@redhat.com>
* meson: Ensure we always build Xext/hashtable.c for glxLyude Paul2018-04-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Seems that while glxvnd relies on some of the hashtable functions in Xext, we only build hashtable support for Xext if we're also building the res extension. This leads to some errors if you try to build glx without res enabled: glx/liblibglxvnd.a(vndcmds.c.o): In function `LookupVendorPrivDispatch': /home/lyudess/Projects/xserver/glx/vndcmds.c:65: undefined reference to `ht_find' /home/lyudess/Projects/xserver/glx/vndcmds.c:67: undefined reference to `ht_add' glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchInit': /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_compare' /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_hash' /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_create' glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchReset': /home/lyudess/Projects/xserver/glx/vndcmds.c:468: undefined reference to `ht_destroy' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. So, make sure that hashtable.c gets both for both glx and res Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
* Xext: Fix memory leaks in hashtable.Michal Srb2018-04-101-0/+3
| | | | Do not forget to delete key and value of every item and the hashtable itself.
* meson: Distribute more SDK headersThierry Reding2018-04-021-0/+12
| | | | | | | | | | 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>
* Xext/shm: Downgrade from error to debug log output about successAlexander Volkov2018-03-211-1/+1
| | | | | Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Adam Jackson <ajax@redhat.com>
* Xext/saver: Swap ScreenSaverSuspend 'suspend' field. Handle old XCB clients.Keith Packard2018-03-141-2/+12
| | | | | | | | | | | | | | | | | | | | | This field was defined as a Bool in the protocol headers and BOOL in xcb. Bool is not a valid type for protocol fields. It is defined as 'int' by Xdefs.h, which we expect to be 32-bits on all machines. The protocol headers and xcb have patches posted to switch to CARD32, which is at least well defined. This change adds the necessary byte swapping to handle other-endian clients with this 32-bit field, and then changes the request processing to compare all 32-bits against zero so that it works with both new and old clients. On MSB machines, Xlib will continue to work properly, but old XCB will not interoperate with the X server (either before or after this patch). Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Mihai Moldovan <ionic@ionic.de> Reviewed-by: Adam Jackson <ajax@redhat.com>
* shm, xwayland: prefer atomic close-on-exec without O_TMPFILEJan Beich2018-02-021-2/+7
| | | | | Signed-off-by: Jan Beich <jbeich@FreeBSD.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
* sync: Fix diffgreater comparisonDavid Weinehall2018-01-181-1/+1
| | | | | | | | | | | | | | xsync: Fix diffgreater comparison While transitioning from CARD64 to int64, the GreaterThan call was mistakenly transformed into ">=". Part of this was fixed already in commit 8060196a3e80a3c0ad2c0abbe459416821cd366c This patch fixes the remaining issue. Signed-off-by: David Weinehall <david.weinehall@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
* xres: Return the atom naming the type, not its internal type numberAdam Jackson2017-11-141-13/+21
| | | | Signed-off-by: Adam Jackson <ajax@redhat.com>
* Use ARRAY_SIZE all over the treeDaniel Martin2017-10-302-6/+3
| | | | | | | | | | Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with the ARRAY_SIZE macro from dix.h when possible. A semantic patch for coccinelle has been used first. Additionally, a few macros have been inlined as they had only one or two users. Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* XShmGetImage: fix censoringNikolay Martynov2017-10-121-6/+2
| | | | | | | | | | | | | | | | | It looks like offsets calculated during image censoring are wrong. This results in black (empty) images returns. This fix is very similar to 6c6f09aac7f1d1367a042087b7681c7fdf1d1e0f that was applied to XGetImage Visually this fixes chromium/firefox window sharing in multiscreen configurations - without this patch most of the windows on 'secodnary' screens are black. This also should fix https://bugs.freedesktop.org/show_bug.cgi?id=101730. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* hw/xfree86: unvalidated lengthsNathan Kidd2017-10-101-59/+70
| | | | | | | | | | | | This addresses: CVE-2017-12180 in XFree86-VidModeExtension CVE-2017-12181 in XFree86-DGA CVE-2017-12182 in XFree86-DRI Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Nathan Kidd <nkidd@opentext.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
* Unvalidated lengthsNathan Kidd2017-10-104-3/+10
| | | | | | | | | | | | | | | v2: Add overflow check and remove unnecessary check (Julien Cristau) This addresses: CVE-2017-12184 in XINERAMA CVE-2017-12185 in MIT-SCREEN-SAVER CVE-2017-12186 in X-Resource CVE-2017-12187 in RENDER Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Nathan Kidd <nkidd@opentext.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
* Xext/shm: Validate shmseg resource id (CVE-2017-13721)Michal Srb2017-10-041-0/+1
| | | | | | | | Otherwise it can belong to a non-existing client and abort X server with FatalError "client not in use", or overwrite existing segment of another existing client. Signed-off-by: Julien Cristau <jcristau@debian.org>
* sync: Fix delta value checkLouis-Francis Ratté-Boulianne2017-09-271-1/+1
| | | | | | | | | While transitionning from CARD64 to int64, the GreaterThan call as mistakenly been transformed into ">=". That was at least causing problems with Mutter. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* sync: Convert from "CARD64" to int64_t.Eric Anholt2017-09-202-171/+154
| | | | | | | | | | | | | | | | The extension was using the name CARD64 to represent 64-bit values, with a #define from CARD64 to XSyncValue, a struct with a pair of 32-bit values representing a signed 64-bit value. This interfered with protocol headers using CARD64 to try to actually store a uint64_t. Now that stdint.h exists, let's just use that here, instead. v2: Fix alarm delta changes. v3: Do the potentially overflowing math as uint and convert to int afterward, out of C spec paranoia. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
* dix: Remove extension aliasesAdam Jackson2017-06-201-2/+0
| | | | | | | | | | | This appears to be essentially unused. The only known client-side library for the SELinux extension is xcb, which does not look for the name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of superstition at this point, NVIDIA's driver does not expose it and Mesa does not check for it. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
* meson: Fix enabling of xshmfence.Eric Anholt2017-06-021-2/+2
| | | | | | | | | | I misspelled the enable flag, so DRI3 would throw BadImplementation when you tried to start any GL app. Same as in c7be7a688a78a34f61b90c0d95914e14b90b0cdc, 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>
* Drop workaround for pre-glibc linuxJulien Cristau2017-05-111-7/+0
| | | | | | | It seems unlikely anyone still needs to build against libc4/libc5. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
* Add a Meson build system alongside autotools.Eric Anholt2017-04-261-0/+61
| | | | | | | | | | | | | | | | | | This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest, and Xdmx so far. The outline of Xquartz/Xwin support is in tree, but hasn't been built yet. The unit tests are also not done. The intent is to build this as a complete replacement for the autotools system, then eventually replace autotools. meson is faster to generate the build, faster to run the bulid, shorter to write the build files in, and less error-prone than autotools. v2: Fix indentation nits, move version declaration to project(), use existing meson_options for version-config.h's vendor name/web. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* dpms: Consolidate a bunch of stuff into Xext/dpms.cAdam Jackson2017-03-273-11/+29
| | | | | | | | | | | | | Most of this is a legacy of the old "extmod" design where you could load _some_ extensions dynamically but only if the server had been built with support for them in the first place. Note that since we now only initialize the DPMS extension if at least one screen supports it, we no longer need DPMSCapableFlag: if it would be false, we would never read its value. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* dix: Lift DPMS to a screen hookAdam Jackson2017-03-273-50/+65
| | | | | | | | | Following on from the previous change, this adds a DPMS hook to the ScreenRec and uses that to infer DPMS support. As a result we can drop the dpms stub code from Xext. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* xfree86: Clean up DPMS supportAdam Jackson2017-03-271-1/+7
| | | | | | | | | | | | | Rather than setting up a per-screen private, just conditionally initialize ScrnInfoRec::DPMSSet based on the config options, and inspect that to determine whether DPMS is supported. We also move the "turn the screen back on at CloseScreen" logic into the DPMS extension's (new) reset hook. This would be a behavior change for the non-xfree86 servers, if any of them had non-stub DPMS support. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* xinerama: Implement graphics exposures for window->pixmap copies (v4)Adam Jackson2017-03-151-10/+60
| | | | | | | | | | | | | | | This code is using GetImage to accumulate a logical view of the window image (since the windows will be clipped to their containing screen), and then PutImage to load that back into the pixmap. What it wasn't doing was constructing a region for the obscured areas of the window and emitting graphics exposures for same. v2: Fix coordinate translation when the source is the root window v3: Create sourceBox with the right coordinates initially instead of translating (Keith Packard) v4: Clamp the region to 15 bits to avoid overflow (Keith Packard) Signed-off-by: Adam Jackson <ajax@redhat.com>
* dispatch: Mark swapped dispatch as _X_COLDAdam Jackson2017-03-0117-151/+151
| | | | | | | | | This touches everything that ends up in the Xorg binary; the big missing part is GLX since that's all generated code. Cuts about 14k from the binary on amd64. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* xace: Don't censor window bordersKeith Packard2016-09-281-7/+6
| | | | | | | | GetImage is allowed to return window border contents, so don't remove that from the returned image. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>