Commit Graph

42 Commits

Author SHA1 Message Date
Adam Jackson 77f614eb33 composite: Stop wrapping GetImage/GetSpans
SourceValidate handles this for us consistently now.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-10-30 16:26:01 +00:00
Pierre Ossman 1bd5d0a53c Switch automatic composite update to WorkQueue
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-10-03 10:28:52 +02:00
Peter Harris d5c23b2948 composite: Propagate damagedDescendants when reparented
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>
2018-01-24 16:20:21 -05:00
Adam Jackson f31875510d composite: Fix repaint of borders (v2)
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-12-07 12:31:43 -05:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
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-11-12 10:25:00 +10:00
Adam Jackson 0fbbdb37c8 composite: Wrap GetSpans
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-28 11:29:48 -07:00
Kristian Høgsberg 4ba7b59446 composite: Add exception mechanism for implicit redirection policy
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-04-01 10:31:09 -07:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
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-12 10:24:11 -08:00
Daniel Stone a1d41e311c Move extension initialisation prototypes into extinit.h
Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to
hold all our extension initialisation prototypes, rather than
duplicating them everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Dave Airlie 957bf959fb dix/render: consolidate window format matching code.
This code existed in 3 different forms, perhaps it should be
consolidated.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-28 10:43:35 -07:00
Keith Packard 31e3c0ff7f Export CompositeClientWindowType
Make sure CompositeClientWindowType is visible for XResource v1.2

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-04-19 15:34:32 -05:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Ville Syrjälä 74663e6152 composite: Copy the window contents back from the pixmap
Since extra expose events are no longer generated during window
unredirection, the window contents must be preserved by the server.
So copy the window contents back from the pixmap. The copy can only
be done after the clips have been recomputed, so delay the copy and
the pixmap destruction until ValidateTree is done. Window borders are
restored by HandleExposures and thus don't need to be copied back.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-04 19:01:01 +03:00
Ville Syrjälä f3480286ae composite: Support updating an arbitrary subtree
Rename compUpdateWindow to compPaintWindowToParent and split the child
walk to compPaintChildrenToWindow. Calling compPaintChildrenToWindow
allows an arbitrary subtree to be updated, instead of having to update
all the windows. This will be used to make sure all the descendants are
copied to the parent when the parent window contents need to be accessed
in IncludeInferios sub-window mode.

WindowRec has a new member 'damagedDescendants' that is used to keep
track of which subtrees need updating. When a window is damaged,
'damagedDescendants' will be set for all the ancestors, and when a
subtree is updated, the tree walk can be stopped early if no damaged
descendants are present.

CompScreenRec no longer needs the 'damaged' member since the root
window's 'damagedDescendants' provides the same information.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:57:31 -08:00
Ville Syrjälä b89e6dbdfb composite: Add SourceValidate wrapper
When SourceValidate is performed on a window with IncludeInferiors
sub-window mode, force an immediate update of all the automatically
redirected windows, so that the current window contents will be up
to date.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:57:25 -08:00
Ville Syrjälä 84154954db composite: Add GetImage wrapper
When GetImage is performed on a window, force an immediate update of
all the automatically redirected windows, so that the current window
contents will be up to date.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:57:04 -08:00
Pauli Nieminen ed8db09b4b composite: Remove unnecessary variable.
We know that there is damage if the dynamic block handler is registered.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Alan Coopersmith 2db6951763 Sun's copyrights now belong to Oracle
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
David Reveman 84a14fab8f composite: add panoramix support
Taken from:
50d2d8c896
dbffd0d44a
9b5b102163
75f9b98af3
07fba8b1f7

With minor style fixes, ported to dixLookupResourceByType, and ported
away from client->noClientException and xalloc/xfree.

v2: Fix a memory leak in PanoramiXCompositeNameWindowPixmap, spotted by
James Jones.
v3: Fix a buglet in PanoramiXCompositeUnredirectSubwindows, spotted by
Dave Airlie.
v4: Fix a style issue with resource lookup noted by Jamey Sharp.

Reviewed-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:47:42 -05:00
Dave Airlie 82d41ada99 composite: fix freeing of old pixmap until after move/resize/cbw (bug 28345)
The fixes for the composite reallocation failure, were freeing the oldpixmap
straight after reallocating the new one, however this led to some wierd
effects in e16 compositing, and I think in a few other places. This patch
moves the freeing of the pixmap into the post wrapped stage. I'm not sure if
we are actually better off breaking ABI and adding another callback from the
ConfigureWindow to composite to make sure the old pixmap is always freed,
but this should be satisfactory as we should always hit one of the freeing
paths or else its a bug in the DIX.

bug: https://bugs.freedesktop.org/show_bug.cgi?id=28435

Reported-by: Andrew Randrianasulu <randrik@mail.ru>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-22 11:41:20 -07:00
Keith Packard faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Dave Airlie 959a1eaf1c composite: use config notify hook to do pixmap resize.
Since reallocating the backing pixmap can fail, we need to try and do
it before any other side effects of reconfiguring the window happen.

This changes the ConfigNotify hook to return status, and moves the
composite window reconfiguration wrappers to ConfigNotify. They all
basically did the same thing, so we can drop the MoveWindow,
ResizeWindow, ChangeBorderWidth wrappers, and allow ConfigNotify to do
all the work. If reallocation fails we fail before we send any
confiureNotify events, or enter the area we can't recover from.

The only place we now enforce 32k limits are in EXA/UXA/fb, so drivers
that don't use this should probably deal with it in their pixmap
allocate if they don't already.

This also breaks ABI, so we need an alternate fix for older servers,
working on the X server makes me realise why I'm a kernel hacker.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03 21:26:24 -07:00
Alan Coopersmith c9726bbe31 Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-16 17:11:35 -08:00
Alan Coopersmith 8609a4e883 Correct some Sun license notices to Sun's standard X11 license format
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-15 11:24:15 -07:00
Aaron Plattner a8cf63fd18 Export CompositeRegisterAlternateVisuals.
Drivers need this if they add visuals that require implicit redirection.  Add a
new SDK header, compositeext.h, to contain the prototype for this function.
2009-04-27 13:29:40 -07:00
Keith Packard efa65a0317 Rework composite overlay window code to fix several resource management bugs.
The composite overlay window code had several misunderstandings of the
workings of the X server, in particular error handling paths would often
double-free objects. Clean all of this up by using resource destruction as
the sole mechanism for freeing resource-based objects.
2008-05-04 21:54:27 -07:00
Eamon Walsh 97c150b61b Merge branch 'master' into XACE-SELINUX
Conflicts:

	afb/afbpntwin.c
	afb/afbscrinit.c
	afb/afbwindow.c
	cfb/cfb.h
	cfb/cfballpriv.c
	cfb/cfbscrinit.c
	cfb/cfbwindow.c
	configure.ac
	fb/wfbrename.h
	hw/xfree86/xf4bpp/ppcIO.c
	hw/xfree86/xf4bpp/ppcPntWin.c
	hw/xfree86/xf4bpp/ppcWindow.c
	hw/xfree86/xf8_32bpp/cfbscrinit.c
	mfb/mfb.h
	mfb/mfbpntwin.c
	mfb/mfbscrinit.c
	mfb/mfbwindow.c
	mi/miexpose.c

Note: conflicts caused by devPrivates rework vs. paintwindow changes.
2007-09-19 07:25:55 -04:00
Eric Anholt e4d11e58ce Remove the PaintWindow optimization.
This was an attempt to avoid scratch gc creation and validation for paintwin
because that was expensive.  This is not the case in current servers, and the
danger of failure to implement it correctly (as seen in all previous
implementations) is high enough to justify removing it.  No performance
difference detected with x11perf -create -move -resize -circulate on Xvfb.
Leave the screen hooks for PaintWindow* in for now to avoid ABI change.
2007-09-13 00:08:53 +00:00
Keith Packard f98dfec79d [COMPOSITE] Composite used for pixmap population on redirect. (Bug #7447)
compNewPixmap copies bits from the parent window to the redirected child
pixmap to populate the pixmap with reasonable data. It cannot always use
CopyArea as that only works across matching depths. Use Composite when
the depths do not match.
2007-09-01 21:14:22 -07:00
Eamon Walsh 4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Adam Jackson ae7f71a8b3 Implement core protocol backing store exclusively in terms of Composite.
Composite's automatic redirection is a more general mechanism than the
ad-hoc BS machinery, so it's much prettier to implement the one in terms
of the other.  Composite now wraps ChangeWindowAttributes and activates
automatic redirection for windows with backing store requested.  The old
backing store infrastructure is completely gutted: ABI-visible structures
retain the function pointers, but they never get called, and all the
open-coded conditionals throughout the DIX layer to implement BS are gone.

Note that this is still not a strictly complete implementation of backing
store, since Composite will throw the bits away on unmap and therefore
WhenMapped and Always hints are equivalent.
2007-08-25 15:08:20 -04:00
Adam Jackson 4d76075dbb Death to RCS tags. 2007-06-29 14:06:52 -04:00
Adam Jackson 9a0f25de7c Static cleanups, dead code deletion. 2007-03-25 12:27:01 -04:00
Aaron Plattner 462bb61b0f Add CompositeRegisterAlternateVisuals.
This provides drivers the ability to add their own alternate visuals and then
register them with Composite for implicit redirection.
2006-08-08 18:41:30 -07:00
Deron Johnson 450018f48b Part 3 of 3 (Other parts are in proto and lib) Composite Version 0.3:
CompositeGetOverlayWindow, CompositeReleaseOverlayWindow Xfixes Version
    4.0: XFixesHideCursor, XFixesShowCursor
2006-03-13 21:59:55 +00:00
Daniel Stone 0bb669638f Change <X11/misc.h> and <X11/os.h> to "misc.h" and "os.h". 2005-07-03 08:53:54 +00:00
Daniel Stone e03198972c Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings.
Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all
    source files in the xserver/xorg tree, predicated on defines of
    HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to
    <X11/fonts/foo.h>.
2005-07-03 07:02:09 +00:00
Daniel Stone 9b1debcdb6 Change all misc.h and os.h references to <X11/foo.h>. 2005-07-01 22:43:43 +00:00
Keith Packard a68f350195 Remove debugging code which did a full tree walk on every window operation
Eliminate needless (and, it turns out, dangerous) call to ChangeGC on
    DestroyGCPrivate.
in cwSetWindowPixmap, check if the pixmap is the screen pixmap and disable
    the wrapper by setting the private to NULL.
2004-08-15 19:05:01 +00:00
Keith Packard a29bfbd3d0 Empty damage object when freeing pixmap.
Wrap InstallColormap so that the DDX doesn't see colormaps from our ARGB
    visual (avoids lovely green tint to screen). Also, set visual->nplanes
    of ARGB visual to all used (including alpha) planes so DIX can set
    pixel values correctly.
Translate automatic update regions correctly to account for borders
When nplanes == 32 (ARGB visuals), mask in all ones for alpha values to
    allocated pixel values.
Remove redundant fbAddTraps declaration
Fix fbCopyWindow to work on non-screen pixmaps (not needed yet)
Replace broken clipping code with that from modular tree.
Respect subWindowMode.
2004-08-13 08:16:14 +00:00
Eric Anholt 789cf3ed84 Fix some issues reported by deronj:
- Hopefully fix a crash in compCheckRedirect on unrealizing windows.
- Remove an extern that doesn't point at anything.
2004-08-12 07:57:03 +00:00
Eric Anholt d690556d49 Integrate COMPOSITEWRAP branch including composite wrapper. This code still
has several issues, including:
- CopyWindow and PaintWindow wrappers missing (will be done soon)
- Some segfaults seen in the Render wrappers.
- Xprt server build breaks with Composite.
- DDXs must be recompiled for Composite due to VisualRec size change.
- Composite bugs pointed out by Deron Johnson in email.
Also, reorder XFixes initialization according to comments by Keith which
    are also in xserver CVS.
2004-07-31 08:24:14 +00:00