Commit Graph

172 Commits

Author SHA1 Message Date
Ville Syrjala a5266dcb3a composite: Update borderClip in compAllocPixmap()
Previously the parent constrained borderClip was copied over
when compRedirectWindow() is called. That is insufficient eg. in
case the window was already redirected, but not yet realized. So
copy the borderClip over in compAllocPixmap() instead.

Example:
Window 1 is below an automatically redirect window 2. Window 2 is
unmapped and moved outside the extents of window 1. Window 2 is
then mapped again, and MarkOverlappedWindows() uses the up to
date borderSize of window 2 to mark windows, which leaves
window 1 unmarked. Then exposures are calculated using the stale
borderClip of window 2, which causes the window below window 2,
to be exposed through an apparent hole in window 1.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22566

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:24:23 -07:00
Matt Turner 2c7c520cfe Use internal temp variable for swap macros
Also, fix whitespace, mainly around
	swaps(&rep.sequenceNumber)

Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Ville Syrjälä 9504caf1c3 composite: Inhibit window background paint with manual subwindow redirection
The composite extension spec says that window background painting
should be inhibited when the subwindow redirection mode is set to
manual.

This eliminates the ugly flashing effect when compiz unredirects a
fullscreen window.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Owen Taylor <otaylor@fishsoup.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-03 20:46:36 -07:00
Pierre-Loup A. Griffais f1d75f3b74 Revert "composite: Don't backfill non-MapWindow allocations"
This reverts commit db8840600e.

It was an optimization for the resize case, but 193ecc8b45 made
it so that no backfilling takes place on resize if left in.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>

Conflicts:

	composite/compalloc.c
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-03 20:40:17 -07:00
Ville Syrjälä eac37f32b8 composite: Recompute clipping when changing between manual and automatic redirection
Call compMarkWindows() when changing between manual and automatic
redirection modes. Otherwise the window clipping won't be recomputed
correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
2011-05-04 19:01:01 +03:00
Ville Syrjälä f2001b0f6d composite: Fix pWin->redirectDraw when changing between manual and automatic redirection
compAllowPixmap() is not called when changing between manual and
automatic redirection modes. That means pWin->redirectDraw is left
with an incorrect value, and miComputeClips() gets confused whether
the window is supposed to be treated as transparent or not. Fix
the issue by updating pWin->redirectDraw in compCheckRedirect()
even when not calling compAllocPixmap().

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
2011-05-04 19:01:01 +03: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ä 193ecc8b45 composite: Get rid of the internal UnmapWindow+MapWindow cycle
Eliminate the internal MapWindow+UnmapWindow cycle around window
redirection changes. Instead do the work in a single pass by marking
the afected windows and calling ValidateTree and HandleExposures
directly. This gets rid of unnecessary expose events, and invalid
ClipNotify calls during rediredction changes. Now ClipNotify will only
get called with the final clip values, and expose events are only sent
to areas that actually got exposed.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-04 19:01:01 +03:00
Ville Syrjälä a6ae917462 composite: Initialize borderClip with current values
ValidateTree needs a valid borderClip so initialize the parent
constrained border clip with the window's current borderClip
in compRedirectWindow.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-04 19:01:01 +03:00
Ville Syrjälä ce9eff9e4c composite: Call ValidateGC after ChangeGC
ChangeGC changes the GC, so ValidateGC should be called after it, not
before.

Also pass NullClient instead of serverClient to ChangeGC() since we
know the changed values to be valid, and setting
serverClient->errorValue seems pointless anyway.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-04 19:01:01 +03:00
Adam Jackson dc0cf75967 Revert "composite: Don't backfill non-bg-None windows"
This reverts commit 6dd775f57d.

Bugzilla: https://bugs.freedesktop.org/34427

Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-04-15 12:55:48 -04:00
Dave Airlie 5a94934487 panoramiX: consolidate common id assignment code.
This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first
element and is a common idiom throughout panoramiX code.

It then adds a new inline function to hide id assignment to a
panoramiX resource and cleans up lots of common repeated code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10 11:00:48 +10: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
Ville Syrjälä a5dc3531e1 Revert "composite: Convert compWindowUpdate to use TraverseTree"
TraverseTree visits the parent before the children. When performing
the automatic redirection updates, the children must be visited before
the parent.

If there are automatically redirected windows on multiple levels of the
tree, updating the parents before the children would cause the parent
updates to use stale data for areas covered by the children. Also
updating the damaged children would re-damage the parent, which would
cause additional walks over the tree.

In the worst case with an unbroken chain of automatically redirected
subwindows, all of which are damaged, only the leaf window would be
properly updated on the first round. Then it's parent would be properly
updated on the second round, and so on. And on every round all of the
ancestor windows would be updated as well, but with stale data.
So with N damaged windows you would end up with (N^2+N)/2 updates,
instead of the expected N.

This reverts commit 648c8871c9.

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:56:56 -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
Pauli Nieminen c038b8b28e composite: Only register the block handler when it is required
Even calling block handler that doesn't do much is costly in arm. It
takes a few microseconds each time which adds up to relative high CPU
time because it is done 500+ times per second.

Simple optimization is to register the block handler only when it is
required.

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
Eric Anholt f36153e3ef Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.
In all these cases, any rendering implied by this damage has already
occurred, and we want to get the damage out to the client.  Some of
the DamageRegionAppend calls were explicitly telling damage to flush
the reportAfter damage out, but not all.

Bug #30260. Fixes the compiz wallpaper plugin with client damage
changed to reportAfter.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10 15:51:03 -08:00
Adam Jackson d6d90a4fcc composite: Move the backfill comment to a more appropriate indent level
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:23 -04:00
Adam Jackson db8840600e composite: Don't backfill non-MapWindow allocations
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:18 -04:00
Adam Jackson 6dd775f57d composite: Don't backfill non-bg-None windows
If there's a defined background then backfilling is a waste of effort,
since exposure processing will paint that in for us.  But note that we
have to backfill if any children are bg=None to preserve semantics with
non-composited servers.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:37:10 -04:00
Adam Jackson 648c8871c9 composite: Convert compWindowUpdate to use TraverseTree
v2: Use != RedirectDrawNone, since we aren't called for manual windows.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-10 11:56:57 -07: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
Keith Packard 2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -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
Jamey Sharp e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp 80b5d3a326 Move each screen's screensaver data into ScreenRec.
Most references to the savedScreenInfo array already had the
corresponding screen pointer handy, which meant they usually looked like
"savedScreenInfo[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:22 -07:00
Dave Airlie 91a6359caf composite: initialise pOldPixmap to NullPixmap at alloc time.
We just never initialised the malloced value.

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-02 21:01:09 -07:00
Jamey Sharp e291c56182 Return an appropriately-typed error from dixLookupResourceByType.
Rather than always returning BadValue, associate an error status like
BadWindow with a resource type like RT_WINDOW, and return the
appropriate one for the requested type.

This patch only touches the core protocol resource types. Others still
return BadValue and need to be mapped appropriately.

dixLookupResourceByType can now return BadImplementation, if the caller
asked for a resource type that has not been allocated in the server.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:48 -07:00
Jamey Sharp 92ed75ac59 Eliminate boilerplate around client->noClientException.
Just let Dispatch() check for a noClientException, rather than making
every single dispatch procedure take care of it.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13 17:14:07 -07:00
Jamey Sharp 6a84cd9434 Replace dixChangeGC with calls directly to the right variant.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp e2929db7b7 dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
The exceptions are ProcChangeGC and CreateGC.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:13:48 -07:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Rami Ylimaki 5b9a52be7e os: Prevent core dump from being truncated.
The problem fixed by this patch can be reproduced on Linux with the
following steps.
- Access NULL pointer intentionally in ProcessOtherEvent on key press.
- Instead of saving core dump to a file, write it into a pipe.
  echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
- Dump the core by pressing a key.

While the core is being dumped into the pipe, the smart schedule timer
will cause a pending SIGALRM. Linux kernel stops writing data to the
pipe when there are pending signals. This causes the core dump to be
truncated. On my system I'm expecting a 6 MB dump but the size will be
60 kB instead. The problem is solved if we block the SIGALRM caused by
expired smart schedule timer.

I haven't been able to reproduce this problem in the following cases.
- Save core dump to a file instead of a pipe.
- kill -SEGV `pidof Xorg`
- Press a key to dump core while gdb is attached to Xorg.
- Give option -dumbSched to Xorg.

Also note that the fix works only when NoTrapSignals has the default
value FALSE. The problem can still be reproduced if error signals
aren't trapped. In addition to pending SIGALRM, there is a similar
problem with pending SIGIO from the keyboard driver during core dump.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17 23:20:52 -08:00
Alan Coopersmith 895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Alan Coopersmith a11c58fa0c Ensure all resource types created have names registered
Calls RegisterResourceName to record the type name for
use by X-Resource, XACE/SELinux/XTsol, and DTrace.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18 16:51:45 -08: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
Michel Dänzer b375be9285 composite: Revert changes from adding support for BGRA picture formats.
They were aimed towards a since abandoned approach for making radeon KMS work
on big endian machines, and Aaron Plattner pointed out that they break the
Composite extension when the X server runs in 16bpp.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-09 16:04:52 -07:00
Jamey Sharp b0dd6be2c8 Cast small-int values through intptr_t when passed as pointers
On 64-bit systems, int and pointers don't have the same size, so GCC gives
warnings about casts between int and pointer types. However, in the cases
covered by this patch, it's always a value that fits in int being stored
temporarily as a pointer and then converted back later, which is safe.
Casting through the pointer-sized integer type intptr_t convinces the
compiler that this is OK.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:38:44 +11:00
Dave Airlie 6ffda5aae7 dix/glx/composite: consolidate visual resize in one place.
The previous code was copied and in both cases incorrectly fixed
up the colormaps after resizing the visuals, this patch consolidates
the visual resize + colormaps fixups in one place. This version
also consolidates the vid allocation for the DepthPtr inside the
function.

I'm not 100% sure colormap.[ch] is the correct place for this but
visuals are mostly created in fb and I know thats not the place to
be resizing them.

Fixes fd.o bug #19470.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-30 10:00:07 +10:00
Peter Hutterer 55747d256d input: define server-supported protocol versions in one single file.
include/protocol-versions.h specifies each extension version as supported by
the server and sent back on the wire to the client.

This fixes up several issues with the server potentially reporting a higher
version of the protocol if recompiled against a newer version of the
protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-21 21:47:35 +10:00
Adam Jackson 9d8fc33cae composite: Move screen init before extension registration.
Otherwise, you'd still advertise the extension even if no screens
actually supported it, and the first Composite protocol request would
probably crash.
2009-08-20 17:11:57 -04:00
Michel Dänzer 842373104d Add support for RENDER BGRA formats. 2009-08-04 23:23:21 +02: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
Kristian Høgsberg 4a27618565 composite: Fix resource lookups 2009-04-14 16:21:04 -04:00
Havoc Pennington 1731882341 Set bg pixmap of composite overlay window to None (#20912)
Otherwise it's impossible to get the COW without a white
flash on the screen, because it's on top, mapped immediately,
and unaffected by composite redirection. This makes
initial login ugly when it doesn't need to be.
2009-04-03 11:23:28 -04:00
Keith Packard f8dd80d13b Replace dixLookupResource by dixLookupResourceBy{Type,Class}
dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
2009-03-09 13:08:09 -07:00
Peter Åstrand f508446a2b Composite: Uninitialized borderClipX/borderClipY
Valgrind warned me about two other uninitialized variables, which are not
padding. Valgrind output at the end. I'm a bit unsure of what these should
be initialized to, is zero fine?
2009-03-06 19:43:10 -08:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Keith Packard d26083fe02 Switching from Automatic to Manual redirect needs to unmap/remap
When changing a window from automatic redirection to manual redirection, the
parent clip list needs to be recomputed; the easy way to get that computed
right is to unmap/map the window, just as when redirecting the window the
first time.

Thanks to Owen Taylor for helping diagnose this.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-09-19 20:58:32 -07:00
Aaron Plattner 97b9374a8a Conditionalize Composite-based backing store on pScreen->backingStoreSupport.
(cherry picked from commit 3787660295)
2008-09-17 17:00:46 -07:00
Maarten Maathuis f4e9a1a98f damage: choose less ambiguous function names 2008-08-31 17:46:26 +02:00
Maarten Maathuis 1861250cd7 {damage,exa}: sanitise damage
- Redo damage naming for more consistency.
- Call post submission functions only where appropriate.
- EXA can now live without it's odd damage workarounds.
2008-08-29 22:15:23 +02:00
Tomas Carnecky ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Adam Jackson 9757106bba Remove all empty extension reset hooks, replace with NULL. 2008-07-24 15:46:08 -04:00
Adam Jackson 100afae578 Bug #15586: (Correctly) refuse to redirect the root window. 2008-06-24 10:52:31 -04:00
James Cloos 04211c3532 Prevent the -wm command line option from causing a SEGV
The -wm (when mapped) option for the BackingStore support has been
causing the server to dereference a NULL pointer.

This has probably been the case since backing store has been
implemented on top of Composite.

It looks like (some of?) Composite didn’t expect its WIndowPtr
argument to be the root window.

In Composite’s compCheckRedirect() function we now avoid calling
compAllocPixmap() and compFreePixmap() when the pWin pointer’s
parent member is NULL, as is it the case with a server’s root window.

This addresses:

https://bugs.freedesktop.org/show_bug.cgi?id=15878
2008-05-12 03:03:13 -04:00
James Cloos 7e768c08f7 Clean up whitespace 2008-05-12 02:53:59 -04: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 4d91b1d5e4 XACE: Adjust the location of the COMPOSITE creation hook.
Avoids incrementing the refcnt if the hook fails.
2008-02-28 21:52:32 -05:00
Eamon Walsh 5675ae1f72 XACE: Call the creation hook to properly label COMPOSITE window pixmaps. 2008-02-28 18:12:52 -05:00
Eamon Walsh 27bcf40cda XACE: Fix instances of DixUnknownAccess at hook callsites. 2008-02-28 16:43:43 -05:00
Maarten Maathuis 70c0592a97 Resize composite overlay window when the root window changes.
- This allows some compositing managers to work, even after randr12 has changed the root window size.
- Thanks to ajax for figuring out the best place to put this.
- Example:
	- xf86RandR12SetMode() calls EnableDisableFBAccess().
	- That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize().
	- The final step is the call to PositionWindow().
2008-02-17 11:21:01 +01:00
Eamon Walsh 26586a7ad5 Revert "registry: Register composite extension protocol names."
This reverts commit 166ef972fe.

Moving all the names into dix/registry.c
2007-11-20 17:27:37 -05:00
Eamon Walsh a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Aaron Plattner f2e310132f Add CreatePixmap allocation hints.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
2007-11-04 16:11:28 -08:00
Eamon Walsh 166ef972fe registry: Register composite extension protocol names. 2007-10-15 15:22:02 -04:00
Eamon Walsh 27612748e0 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/devices.c
2007-09-26 07:47:29 -04:00
Aaron Plattner 50fa8722d3 Set noCompositeExtension to TRUE when failing to initialize the extension (e.g. when Xinerama is enabled). 2007-09-20 14:00:33 -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
Eamon Walsh 0003ccfcdf xace: add new fields to resource access hook to allow parent resource objects
to be passed in at create time.  Also added a missing devPrivates initializer.
2007-09-05 11:18:36 -04: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 c9ceb48780 xace: add hooks + new access codes: Composite extension 2007-08-31 11:03:54 -04: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
Aaron Plattner 951c058e78 Don't fail compScreenInit if the driver added its own alternate visuals. 2007-07-31 14:23:58 -07:00
Adam Jackson aed6569309 Refactor how Composite adds visuals to the screen.
Besides being slightly simpler to read, it's now trivial to add a depth-16
visual to a depth-24 screen just by adding a line for it in the alternate
visual list.  Visuals for indexed depths are slightly tricky still.
2007-07-18 15:54:26 -04:00
Keith Packard b2f9ca6ac4 Redirect fix: Manual + Automatic - Manual = Automatic
A window with redirect manual *and* redirect automatic which loses the
manual redirecting client becomes redirect automatic.
2007-07-10 21:33:55 -07:00
Michel Dänzer 5957aa6fdc Fix regression from recent composite changes.
One pWin->redirectDraw test was converted incorrectly, causing incorrect
rendering in some cases.
2007-07-09 08:47:05 +02:00
Keith Packard f106c04b62 Have Composite always report server version.
It was reporting the lessor of the server and client versions, which doesn't
make sense with the 0.4 semantic change in clipping.
2007-07-03 14:47:19 -07:00
Keith Packard 4f88d68bdb Force advertised Composite version to 0.4 instead of using header version.
Installed protocol header version may be newer than the server code base.
Use internal version number for Composite extension to make sure the server
doesn't advertise capabilities it doesn't support.
2007-07-03 14:43:17 -07:00
Keith Packard 866f092ca0 Make Composite manual redirect windows not clip their parent.
This patch changes the semantics of manual redirect windows so that they no
longer affect the clip list of their parent. Doing this means the parent can
draw to the area covered by the child without using IncludeInferiors. More
importantly, this also means that the parent receives expose events when
that region is damaged by other actions.
2007-07-03 14:29:11 -07:00
Adam Jackson 4d76075dbb Death to RCS tags. 2007-06-29 14:06:52 -04:00
Luo Jie 1f48995d66 Fix build of composite, dix, and randr when Xinerama is disabled. 2007-05-24 11:20:59 -07:00
Eric Anholt 0bfc3cc22d Disable composite when Xinerama is active.
It will likely take a decent bit of work to make that work right.
2007-03-27 17:34:00 -07:00
Eric Anholt 5e7936371c Disable Composite when the screen's visual is pseudocolor.
Rendering fails badly in this case, and I don't care enough to fix it.
2007-03-27 17:31:39 -07:00
Eric Anholt 8afc7e2eb3 Refuse to initialize Composite if Render is not present.
Composite relies on the presence of Render, in particular for the automatic
compositing.
2007-03-27 17:31:34 -07:00
Adam Jackson 9a0f25de7c Static cleanups, dead code deletion. 2007-03-25 12:27:01 -04:00
Eamon Walsh 04c721854f Convert callers of LookupWindow() to dixLookupWindow(). 2006-12-15 14:19:54 -05:00
Aaron Plattner 724f9cb578 Bug #9219: Use pWin->viewable instead of pWin->realized to catch InputOnly windows too. 2006-12-05 13:44:05 -08:00
Aaron Plattner 3690de9b1b Bug #9219: Return BadMatch when trying to name the backing pixmap of an unrealized window.
Before this change, ProcCompositeNameWindowPixmap would name the screen pixmap
if !pWin->realized.
2006-12-05 12:42:12 -08: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
Daniel Stone 84683f19b4 get rid of XFree86LOADER, XFree86Server, XFree86Module, and IN_MODULE
Get rid of almost all uses of these definitions.  They're still defined for
delinquent out-of-tree drivers, and also for the Mesa build.  As well as
for miinitext.c.  But largely gone.
2006-07-18 18:17:38 -04:00
Søren Sandmann Pedersen dc43909219 Fri Apr 7 13:46:45 2006 Søren Sandmann <sandmann@redhat.com>
Use FreeResource instead of deleteCompOverlayClient()
2006-04-07 17:49:32 +00:00