summaryrefslogtreecommitdiff
path: root/miext
Commit message (Collapse)AuthorAgeFilesLines
* rootless: Use screen_x and screen_y instead of pixmap pointer hacksJeremy Huddleston Sequoia2023-01-203-21/+17
| | | | | | | | | This updates rootless to treat pixmaps consistently with COMPOSITE, using the screen_x and screen_y values rather than doing hacky math. This will allow for proper bounds checking on a given PixmapRec. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Dead code removal (RootlessResizeCopyWindow)Jeremy Huddleston Sequoia2023-01-201-126/+1
| | | | | | | | This should no longer be necessary since we only support implementations that handle preserving the bits across resize. We can use RootlessNoCopyWindow instead. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Remove an unnecessary memory copy when handling resize with ↵Jeremy Huddleston Sequoia2023-01-201-37/+0
| | | | | | | | gravity RL_GRAVITY_NONE (border width changes) This should no longer be necessary since we only support implementations that handle preserving the bits across resize Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Dead code removal (resize_after in StartFrameResize / ↵Jeremy Huddleston Sequoia2023-01-201-49/+24
| | | | | | FinishFrameResize) Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Remove the special case for northwest gravity in StartFrameResizeJeremy Huddleston Sequoia2023-01-201-114/+2
| | | | | | | | I don't see a reason why we would want to preserve pixels that are going to not be visible anyways. The rootless implementation already handles preserving the relevant bits for us. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Use RL_GRAVITY_NORTH_WEST for min/max/zoom resizingJeremy Huddleston Sequoia2023-01-201-1/+1
| | | | | | | If none of the four corners is fixed, we can use RL_GRAVITY_NORTH_WEST weighting for the operation to let the implementation presetve the window bits for us. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Ensure gResizeDeathPix is stored in locally-managed memory rather ↵Jeremy Huddleston Sequoia2023-01-201-15/+5
| | | | | | | | | | | | than re-using the implementation's backing store The implementation owns the pointer during RootlessStopDrawing and RootlessStartDrawing and is free to (does) change it. Rootless cannot assume ownership of this memory region. This is possibly the cause of some hard to diagnose crashes in XQuartz over the years. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Remove option to disable ROOTLESS_RESIZE_GRAVITYJeremy Huddleston Sequoia2023-01-204-18/+1
| | | | Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Fixup some format errors in debug loggingJeremy Huddleston Sequoia2023-01-203-10/+11
| | | | Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Add additional debug logging to help triage XQuartz ↵Jeremy Huddleston Sequoia2022-12-211-3/+41
| | | | | | fb/rootless/damage crashes Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* rootless: Dead code removal (ROOTLESS_REDISPLAY_DELAY is already defined)Jeremy Huddleston Sequoia2022-06-131-5/+0
| | | | Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* Remove autotools supportPovilas Kanapickas2021-10-275-89/+0
| | | | Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
* miext: Remove if check which is always truePovilas Kanapickas2021-03-261-8/+2
| | | | | | | In both cases we check for width > 0 just above, and the variable is not modified between the checks, so the condition is always true. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
* meson: hide C API if Xorg is disabled (like autotools)Jan Beich2021-03-113-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix spelling/wording issuesAlan Coopersmith2020-07-055-8/+8
| | | | | | | | 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>
* mi: Add a default no-op miSourceValidateAdam Jackson2019-10-301-4/+2
| | | | | | | | | | Slightly simplifies the callers since they don't need to check for non-NULL anymore. I do extremely hate the workarounds here to suppress misprite taking the cursor down though. Surely there's a better way. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* miext/sync: Make struct _SyncObject::initialized fully ABI compatibleMichel Dänzer2019-09-261-1/+1
| | | | | | | | | | | | | | | With a 32-bit build, putting the initialized field at the end of the struct bumped the struct size from 20 bytes to 24, changing the layout of other structs embedding struct _SyncObject. While this would be acceptable on master, it caused crashes with 1.20. Making the initialized field a char and putting it in the hole before the beingDestroyed field restores the 32-bit ABI as well. Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/892 Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Alex Goins <agoins@nvidia.com>
* miext/sync: Fix needless ABI changeAdam Jackson2019-08-211-1/+1
| | | | | | | | | | | | | | The initialized field was added in: commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a Author: Alex Goins <agoins@nvidia.com> Date: Wed Apr 10 13:48:02 2019 -0500 xsync: Add resource inside of SyncCreate, export SyncCreate But it added this field not at the end of SyncObject. It may not have been _usefully_ possible to create those from another extension prior to that commit, but that's still an ABI-incompatible change.
* meson: Build miext/sync for XwaylandOlivier Fourdan2019-08-151-1/+1
| | | | | | | | | | | | | When using the Meson build system, miext/sync would be build only for dri3. As a result, when building with Meson without DRI3 enabled, Xwayland would fail to link because `miSyncShmScreenInit()` is nowhere to be found. Make sure to build miext/sync for either DRI3 or Xwayland. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* meson: Build rootless extensionJon Turney2019-05-021-0/+13
|
* xsync: Add resource inside of SyncCreate, export SyncCreateAlex Goins2019-04-173-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* miext/damage: take care of the coordinate mode in damagePolyPointCedric Roux2018-09-251-10/+30
| | | | | | | | | | | The mode (CoordModeOrigin or CoordModePrevious) was not taken into account when computing the box. The result was a bad drawing of points in some situations (on my hardware/software configuration, calling XDrawString followed by XDrawPoints in the mode CoordModePrevious). Signed-off-by: Cedric Roux <sed@free.fr> Signed-off-by: Eric Anholt <eric@anholt.net>
* meson: Distribute more SDK headersThierry Reding2018-04-023-0/+22
| | | | | | | | | | 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>
* sync: Clean up a bit of header formatting.Eric Anholt2017-09-201-8/+5
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
* sync: Convert from "CARD64" to int64_t.Eric Anholt2017-09-202-10/+6
| | | | | | | | | | | | | | | | 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>
* Add a Meson build system alongside autotools.Eric Anholt2017-04-263-0/+58
| | | | | | | | | | | | | | | | | | 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>
* dix: Remove PRIVATE_DAMAGEAdam Jackson2017-03-212-3/+2
| | | | | | | | | None of this is actually wired up to anything, so we can also remove the devPrivates from the DamageRec. The DamageExtRec is what would need devPrivates for selinux labeling, in principle. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* damage: Validate source pictures bound to windows before unwrappingMichel Dänzer2017-02-081-0/+10
| | | | | | | | | The lower layers also do this, but no damage may be reported there, since we unwrap before calling down. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99220 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* Revert "damage: Make damageRegionProcessPending take a damage not a drawable"Adam Jackson2016-12-131-61/+60
| | | | | | | | | | | | | | | | | | | The commit message makes the assertion that the code below damage is not allowed to change whether there's a damage monitor for the drawable. That turns out not to be the case! exa's mixed code, at least, will create and destroy a damage in PrepareAccess. The destroy path can then be catastrophic, as damageRegionProcessPending will attempt to RegionEmpty memory from the middle of a freed block. I'd wanted that invariant for performance, but faster isn't worth broken, so revert it. I think what exa's doing is reasonable, so the better way to improve performance for the unmonitored case is to either revisit dynamically wrapping into the GC, or inline damage into dix. This reverts commit 4e124203f2260daaf54155f4a05fe469733e0b97. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389886 Signed-off-by: Adam Jackson <ajax@redhat.com>
* shadow: Remove unused shadowAllocAdam Jackson2016-12-123-52/+0
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
* shadow: Macro cleanupAdam Jackson2016-12-1213-19/+15
| | | | | | | | | shadowDamage is just obfuscation. The other two macros won't work outside shadow.c since the private key is in fact static there (meaning the extern decl is a lie). Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
* shadow: Remove indirection stubsAdam Jackson2016-12-124-29/+0
| | | | | | | These are no longer used in the drivers. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
* shadow: Lift 32->24 conversion from modesetting to dixAdam Jackson2016-12-123-0/+142
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
* Remove fd_set from Block/Wakeup handler APIKeith Packard2016-07-181-2/+2
| | | | | | | | This removes the last uses of fd_set from the server interfaces outside of the OS layer itself. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* Remove readmask from screen block/wakeup handlerKeith Packard2016-07-181-2/+2
| | | | | | | | With no users of the interface needing the readmask anymore, we can remove it from the argument passed to these functions. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* dix: Switch to the libXfont2 API (v2)Keith Packard2016-07-181-2/+2
| | | | | | | | | | | This new libXfont API eliminates exposing internal X server symbols to the font library, replacing those with a struct full of the entire API needed to use that library. v2: Use libXfont2 instead of libXfont_2 Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* dix: Call screen block/wakeup handlers closest to blocking [v3]Keith Packard2016-06-202-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The screen block and wakeup handlers are the only ones which provide a well known ordering between the wrapping layers; placing these as close as possible to the server blocking provides a way for the driver to control the flow of execution correctly. Switch the shadow code to run in the screen block handler so that it now occurrs just before the server goes to sleep. Switch glamor to call down to the driver after it has executed its own block handler piece, in case the driver needs to perform additional flushing work after glamor has called glFlush. These changes ensure that the following modules update the screen in the correct order: animated cursors (uses RegisterBlockAndWakeupHandlers dynamically) composite (dynamic wrapping) misprite (dynamic wrapping) shadow (static wrapping) glamor (static wrapping) driver (static wrapping) It looks like there's still a bit of confusion between composite and misprite; if composite updates after misprite, then it's possible you'd exit the block handler chain with the cursor left hidden. To fix that, misprite should be wrapping during ScreenInit time and not unwrapping. And composite might as well join in that fun, just to make things consistent. [v2] Unwrap BlockHandler in shadowCloseScreen (ajax) [v3] ephyr: Use screen block handler for flushing changes ephyr needs to make sure it calls glXSwapBuffers after glamor finishes its rendering. As the screen block handler is now called last, we have to use that instead of a registered block/wakeup handler to make sure the GL rendering is done before we copy it to the front buffer. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* damage: Make damageRegionProcessPending take a damage not a drawableAdam Jackson2016-05-181-60/+61
| | | | | | | | | | | | | | | | | In the case where there's no damage monitor on the drawable, we look that fact up twice: once before rendering to decide whether to compute damage, and again after to decide whether to append it. This is wasted effort, as the layer below us is effectively not allowed to change whether there's a damage monitor for the drawable, but there's no way the compiler can know that. Instead, look it up once up front, and change the check macros and damageRegionProcessPending to take a damage not a drawable. v2: Explicitly pass pDamage to the macros as well (Michel Dänzer) Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
* rootless: Fix bogus handling of broken root clipAdam Jackson2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | gcc quite correctly complains about this: In file included from ../../include/scrnintstr.h:51:0, from rootlessValTree.c:98: In function 'RegionUninit.isra.1', inlined from 'RegionEmpty' at ../../include/regionstr.h:194:5, inlined from 'RootlessMiValidateTree' at rootlessValTree.c:490:9: ../../include/regionstr.h:166:9: warning: attempt to free a non-heap object 'RegionBrokenData' [-Wfree-nonheap-object] free((_pReg)->data); So that'd crash if you ever got there. RegionNull will do almost the same thing only without the free(), so let's do that instead; it might still not be an entirely sane way to recover, but it at least won't crash. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* rootless: rename w->_w to avoid shadow warningsDave Airlie2015-08-171-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes: In file included from rootlessWindow.c:51:0: rootlessWindow.c: In function 'RootlessResizeWindow': rootlessCommon.h:198:19: warning: declaration of 'w' shadows a parameter [-Wshadow] WindowPtr w = pWin; \ ^ rootlessWindow.c:1292:9: note: in expansion of macro 'HUGE_ROOT' HUGE_ROOT(pWin); ^ rootlessWindow.c:1262:35: note: shadowed declaration is here unsigned int w, unsigned int h, WindowPtr pSib) ^ In file included from rootlessWindow.c:51:0: rootlessCommon.h:207:19: warning: declaration of 'w' shadows a parameter [-Wshadow] WindowPtr w = pWin; \ ^ rootlessWindow.c:1296:9: note: in expansion of macro 'NORMAL_ROOT' NORMAL_ROOT(pWin); ^ rootlessWindow.c:1262:35: note: shadowed declaration is here unsigned int w, unsigned int h, WindowPtr pSib) ^ Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
* rootless: fix warnings due to lack of const keeping.Dave Airlie2015-08-172-3/+3
| | | | | | Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
* dix: Restore PaintWindow screen hookAdam Jackson2015-07-084-2/+26
| | | | | | | Removes the last cpp conditional on ROOTLESS from dix code. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
* rootless: Build unconditionallyAdam Jackson2015-07-081-8/+1
| | | | | | | | It's not a lot of code, and if you're doing things to the core that affect rootless you should be alerted early. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
* rootless: Genericize the config header a bitAdam Jackson2015-07-081-15/+4
| | | | | | | | | | | | | ROOTLESS_RESIZE_GRAVITY is an optimization, so let's default it to off unless the backing window system is known to support it. ROOTLESS_PROTECT_ALPHA looks like it has different values for xquartz and win32, but hilariously rootlessGC.c merely checks if it is defined, not what the value is. It's effectively the more conservative path anyway, so let's just turn it on. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
* dix: unifdef pWin->rootlessUnhittableAdam Jackson2015-07-081-4/+4
| | | | | | | No reason to vary the dix ABI over this. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
* dix: Unexport various implementation detailsAdam Jackson2015-07-081-0/+1
| | | | | Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Convert mi & miext to new *allocarray functionsAlan Coopersmith2015-04-213-4/+4
| | | | | | | v2: remove now useless parentheses Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* Drop trailing whitespacesPeter Hutterer2014-11-127-25/+25
| | | | | | | | | sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* rootless: remove redundant RootlessShapedWindowInAdam Jackson2014-10-081-62/+3
| | | | | | | | | miShapedWindowIn is identical. Which you would expect, since neither one takes an actual WindowPtr argument, so they couldn't possibly make reference to rootlessness. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
* miext/shadow: Remove shadowInitAdam Jackson2014-07-292-24/+0
| | | | | | | | | | | This code is nonsensical. You end up creating a screen-sized pixmap that's totally detached from everything else, which you then listen for damage on, which means you'll never hear any damage, which means your shadow update hooks will never get called. Any driver using this would be sorely disappointed. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>