summaryrefslogtreecommitdiff
path: root/composite
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30include: move private definitions out of extinit.hEnrico Weigelt, metux IT consult1-1/+1
Public server module API shouldn't be clobbered with private definitions, thus move them out to extinit_priv.h. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1289>
2024-04-18composite: fix duplicate typedef of ScreenPtrEnrico Weigelt, metux IT consult1-1/+1
fix warning on duplicate typedef: > ../composite/compositeext_priv.h:11:25: warning: redefinition of typedef 'ScreenPtr' is a C11 feature [-Wtypedef-redefinition] > typedef struct _Screen *ScreenPtr; > ^ > ../include/screenint.h:55:25: note: previous definition is here > typedef struct _Screen *ScreenPtr; > ^ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1430>
2024-04-16os: unexport Os*() functionsEnrico Weigelt, metux IT consult1-0/+1
These aren't called (and suited for being called) by drivers, thus drop them from the public module API. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1381>
2024-04-15rename remaining RT_* defines to X11_RESTYPE_*Enrico Weigelt, metux IT consult2-13/+16
Since we already had to rename some of them, in order to fix name clashes on win32, it's now time to rename all the remaining ones. The old ones are still present as define's to the new ones, just for backwards compatibility. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
2024-04-15prevent name clash on Windows w/ RT_* definesEnrico Weigelt, metux IT consult4-15/+15
Windows' native headers using some our RT_* define's names for other things. Since the naming isn't very nice anyways, introducing some new ones (X11_RESTYPE_NONE, X11_RESTYPE_FONT, X11_RESTYPE_CURSOR) and define the old ones as an alias to them, in case some out-of-tree code still uses them. With thins change, we don't need to be so extremely careful about include ordering and have explicit #undef's in order to prevent name clashes on Win32 targets. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
2024-04-15dix: unexport some lookup functionsEnrico Weigelt, metux IT consult1-0/+2
These aren't used by any drivers, so no need to export them. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1380>
2024-03-03composite: move out unexported CompositeIsImplicitRedirectException()Enrico Weigelt, metux IT consult3-2/+19
Move out non-exported stuff from public module header compositeext.h, into compositeext_priv.h Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1284>
2023-07-18composite: Expose CompositeIsImplicitRedirectExceptionMichel Dänzer2-4/+6
Make it usable by code outside of the composite layer.
2023-07-18composite: Free cs->implicitRedirectExceptions in compCloseScreenMichel Dänzer1-0/+1
Fixes leaking the memory it points to.
2023-03-29composite: Fix use-after-free of the COWOlivier Fourdan1-0/+5
ZDI-CAN-19866/CVE-2023-1393 If a client explicitly destroys the compositor overlay window (aka COW), we would leave a dangling pointer to that window in the CompScreen structure, which will trigger a use-after-free later. Make sure to clear the CompScreen pointer to the COW when the latter gets destroyed explicitly by the client. This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2023-02-25Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith6-6/+6
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-10-27Remove autotools supportPovilas Kanapickas1-15/+0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-03-11meson: hide C API if Xorg is disabled (like autotools)Jan Beich1-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>
2020-07-05Fix spelling/wording issuesAlan Coopersmith1-1/+1
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>
2019-10-30composite: Stop wrapping GetImage/GetSpansAdam Jackson2-43/+0
SourceValidate handles this for us consistently now. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-10-30mi: Add a default no-op miSourceValidateAdam Jackson1-3/+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>
2019-08-15composite: Be more paranoid in compDestroyDamageAdam Jackson1-0/+2
Consider these two facts: - You can't rely on resource deletion order - damageDestroyWindow automatically destroys any damage listener connected to the doomed window Now consider a redirected window being destroyed. If the damage associated with the redirection is destroyed before the window, then when compFreeClientWindow tries to unredirect the window, the call to compSetParentPixmap may see that cw->damageRegistered is still true, and call DamageUnregister(NULL) (because compDestroyDamage already zeroed out cw->damage), and you get a backtrace that looks like: #6 <signal handler called> #7 DamageUnregister (pDamage=0x0) at damage.c:1773 <----------------- #8 0x000000000051f767 in compSetParentPixmap (pWin=pWin@entry=0x28489c0) at compalloc.c:646 #9 0x000000000051fa01 in compFreeClientWindow (pWin=0x28489c0, id=<optimized out>) at compalloc.c:291 #10 0x000000000051a499 in FreeCompositeClientWindow (value=<optimized out>, ccwid=<optimized out>) at compext.c:74 #11 0x0000000000597932 in doFreeResource (res=0x28494c0, skip=0) at resource.c:880 #12 0x000000000059850e in FreeResource (id=857, skipDeleteFuncType=skipDeleteFuncType@entry=0) at resource.c:910 #13 0x000000000051ee01 in compUnredirectWindow (pClient=0x1f6b4e0, pWin=pWin@entry=0x28489c0, update=update@entry=0) at compalloc.c:336 #14 0x000000000051b723 in compCheckBackingStore (pWin=0x28489c0) at compinit.c:131 #15 compChangeWindowAttributes (pWin=0x28489c0, mask=<optimized out>) at compinit.c:152 #16 0x000000000051d1f9 in compDestroyWindow (pWin=0x28489c0) at compwindow.c:664 #17 0x00000000004d85be in damageDestroyWindow (pWindow=0x28489c0) at damage.c:1570 #18 0x00000000004896f0 in DbeDestroyWindow (pWin=0x28489c0) at dbe.c:1326 #19 0x00000000004d229e in present_destroy_window (window=0x28489c0) at present_screen.c:163 #20 0x000000000059c4e4 in FreeWindowResources (pWin=pWin@entry=0x28489c0) at window.c:1032 #21 0x000000000059f2c6 in DeleteWindow (value=0x28489c0, wid=<optimized out>) at window.c:1101 #22 0x0000000000597932 in doFreeResource (res=0x2843bd0, skip=skip@entry=0) at resource.c:880 #23 0x0000000000598b0c in FreeClientResources (client=client@entry=0x2848560) at resource.c:1146 #24 0x0000000000572e2f in CloseDownClient (client=0x2848560) at dispatch.c:3473 Fix this by zeroing out more of the CompWindowPtr when the damage is destroyed, so that any further calls into composite will avoid touching cw->damage.
2019-05-02assert(a && b) --> assert(a); assert(b)Adam Richter2-5/+13
Separate each statement of the form "assert(a && b);" into "assert(a);" and "assert(b);" for more precise diagnostics, except for this clever use in drmmode_display.c where it was used to pass a hint to developers: assert(num_infos <= 32 && "update return type");
2019-04-12dix: Remove WindowRec::backStorageAdam Jackson1-2/+0
This is only being set, never read.
2019-04-12dix, composite: Optimize setting window backing store stateAdam Jackson1-2/+2
We hide CWBackingStore from the screen hook if nothing's actually changing, which means compChangeWindowAttributes no longer needs to compare the requested state with the present one.
2018-10-03Switch automatic composite update to WorkQueuePierre Ossman3-20/+15
It is currently (ab)using the screen BlockHandler callback to do this. But this can cause problems with other extension as their block handlers might have executed before Composite's. And the operations Composite does might result in them wanting to change timeouts. Practically this caused problems for TigerVNC's VNC extension which failed to send out updates for Composite's screen updates.
2018-04-02meson: Distribute more SDK headersThierry Reding1-0/+6
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-02-23composite: Fix use-after-free in compReparentWindowPeter Harris1-1/+2
If an implicitly redirected window is unredirected by the reparent operation, cw will be a stale pointer. Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-24composite: Propagate damagedDescendants when reparentedPeter Harris3-8/+20
If a window that is fully covered by an automatic-redirected descendant (even implicitly, eg. via BackingStores) is reparented, the automatic updates could be broken if the new parent is not marked as having damaged descendants. Fix this issue by propagating the damagedDescendants flag whenever a window is reparented. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Harris <pharris@opentext.com>
2017-10-30Use ARRAY_SIZE all over the treeDaniel Martin1-4/+1
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>
2017-08-11composite: Make compIsAlternateVisual safe even if Composite is offAdam Jackson1-1/+1
As of ea483af9 we're calling this unconditionally from the GLX code so the synthetic visual is in a lower select group. If Composite has been disabled then GetCompScreen() will return NULL, and this would crash. Rather than force the caller to check first, just always return FALSE if Composite is disabled (which is correct, since none of the visuals will be synthetic in that case). Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2017-04-26Add a Meson build system alongside autotools.Eric Anholt1-0/+13
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>
2017-03-01dispatch: Mark swapped dispatch as _X_COLDAdam Jackson1-19/+22
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>
2017-01-25composite: Export compIsAlternateVisualAdam Jackson2-1/+3
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25composite: Remove a misleading commentAdam Jackson1-5/+0
This comment is above compIsAlternateVisual, which used to be the only thing determining whether implicit redirect was needed. It's not anymore due to the redirection exception list. That job is now performed by compImplicitRedirect, whose code is self-explanitory. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-12-07composite: Fix repaint of borders (v2)Adam Jackson3-7/+10
When going from border width zero to a non-zero border width, the Composite extension is informed via the ConfigNotify callback. The call-chain looks like this: compConfigNotify -> compReallocPixmap -> compSetPixmap -> TraverseTree -> compSetPixmapVisitWindow. However, at this time, pWindow->borderWidth was not yet updated. Thus, HasBorder() is false and the window border will not be repainted. To fix this, thread the new bw through to the window visitor, and inspect that rather than HasBorder(). For the other callers of compSetPixmap the border does not change size, so we can pass pWin->borderWidth instead. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98499 Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-07-18Remove readmask from screen block/wakeup handlerKeith Packard1-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>
2016-06-21res: Fix accounting of redirected window pixmaps for CompositeAdam Jackson1-7/+8
The previous change removed the special case that matched resources of CompositeClientWindowType and walked back from that to the window pixmap. That was intentional, since that logic was broken anyway. CCWTs don't map 1:1 to references on the backing pixmap; a window redirected by multiple clients (say, by the server since it's on the synthetic visual, and then manually by a compositor) would have a window pixmap refcount of 1, but would have those bytes accounted twice. The right thing is to have Composite wrap window accounting, and add the pixmap bytes once and only once for the redirection reference. Note that the view from the client can still be non-intuitive in the face of Composite. xcompmgr, for example, holds _two_ references to each window pixmap (one each from CompositeNameWindowPixmap and RenderCreatePicture), so a synthetic-visual window will have its bytes split 2/3 to xcompmgr and 1/3 to the server-client. Nothing to be done about that, and at least this way we're not over-accounting. Acked-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-11dix: Remove pointless client-state callbacksAdam Jackson1-14/+0
Private storage is pre-zeroed by the private system itself. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-09-24composite: Factor out backing store transitionAdam Jackson1-11/+16
No functional change. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08dix: Restore PaintWindow screen hookAdam Jackson1-1/+1
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>
2015-04-21Convert top level extensions to new *allocarray functionsAlan Coopersmith1-4/+4
v2: remove now useless parentheses Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-11-12Drop trailing whitespacesPeter Hutterer5-10/+10
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>
2014-10-28composite: Wrap GetSpansAdam Jackson2-0/+20
GetSpans should flush composition from children to parent, just like GetImage and SourceValidate. Fortunately no one is likely to have noticed, since to hit this you're already deep into failure town. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27composite: Skip SetWindowPixmap when pixmap isn't changingKeith Packard1-3/+4
Check the current window pixmap to see if it matches the new pixmap and avoid calling SetWindowPixmap in that case. x11perf -ucreate highlights an instance where compCreateWindow reassigns the same Pixmap to the Window. Currently this triggers an expensive invalidation of the entire window hierachy, making sure that DRI2 clients are kept informed of the handle changes. However, as the backing Pixmap for the Window is actually unchanged, there is no need to do anything in this case. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-09dix: Lower backStorage to a bit instead of a pointerAdam Jackson1-2/+2
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Simplify composite border clip redirection interfaceAdam Jackson1-3/+0
There's not really a good reason for mi to not just call the composite code directly. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-04-21composite: Fix memory leak in compCopyWindowPeter Harris1-0/+1
Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-03Add pScreen->NameWindowPixmap hookDaniel Stone1-1/+12
This hook allows drivers to be notified when a pixmap gains a new ID. (ABI break.) Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-01composite: Add exception mechanism for implicit redirection policyKristian Høgsberg4-0/+53
Normally composite will decide to add implicit redirection when a window with an alternate visual is a parent of a window with a regular visual or vice versa. This uses extra pixmap memory and incurs an extra copy. This exception mechanism provides a way for a DDX to override this if the DDX knows that its acceleration architecture will render correctly. The relevant case is that of an RGB window reparented into a ARGB parent frame window. If the DDX knows that the acceleration architecture in use will pad the alpha channel to opaque when rendering to the RGB window, the implicit redirection can be avoided. This patch adds a new composite function: CompositeRegisterImplicitRedirectionException() which lets a DDX register a pair of parent and child window visuals, that will not be implicitly redirected even if the normal policy would have made that choice. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-22composite: Remove duplicate window pixmap fetchKeith Packard1-1/+0
There's nothing between the previous fetch and this one that could cause the window pixmap to have changed. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12Replace 'pointer' type with 'void *'Keith Packard6-21/+21
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12composite: Remove unused pScreen variablesKeith Packard1-4/+0
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-09composite: Fix COW creation for Xinerama (v2)Adam Jackson1-1/+4
Say you have two 800x600 screens left/right of each other. A window that's 200x200 at +700+0 in protocol coordinate space will appear to be at -100+0 in the coordinate space of the right hand screen. Put another way: windows are in the coordinate space of their root window pixmap. We weren't doing this translation for the COW, so when rendering came in to it you'd see the top-left chunk of the COW on all screens. Cool effect and all, but wrong. v2: Only translate when Xinerama is active [keithp] Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09composite: Don't double-redirect if someone asks for backing store twiceAdam Jackson1-2/+2
v2: Belt-and-suspenders the unredirection path [vsyrjala] Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>