summaryrefslogtreecommitdiff
path: root/damageext
AgeCommit message (Collapse)AuthorFilesLines
2014-01-12Replace 'pointer' type with 'void *'Keith Packard2-4/+4
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>
2013-12-09damageext: Die if we can't create the Xinerama resource typeAdam Jackson1-0/+2
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09damageext: Xineramify (v7)Adam Jackson2-52/+338
v7: Don't bother making resources for the backing listeners. [keithp] This is now slightly unlike how other resources are xineramified. We create N+1 internal damage listeners, one that's a real resource and reflects the protocol view, and then one per backend screen where the report function piles onto the protocol view. The internal listeners are not stored in the resource database directly, they just hang off the xinerama resource. We don't wrap Subtract at the dispatch level, but we do extend it for the Xinerama case to clip to the root window geometry. As a result of the N+1 design here, the damage reports we generate are not quite minimal. However they are indistinguishable from sequential rendering events happening before the client hears damage, and we don't need to add a post-dispatch callback just for this one extension. Add is probably (still) somewhat broken since it will only hit screen 0, but Add really only exists for DRI1's sake, and DRI1 disables itself with Xinerama enabled anyway. In the absence of a use case, I'm leaving it unwrapped under Xinerama; if someone wants to define how it ought to work, be my guest. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-04Merge remote-tracking branch 'ajax/xserver-next'Keith Packard1-26/+14
2013-09-20damage: Must translate initial window damage by window offsetKeith Packard1-0/+2
Damage is reported relative to the drawable origin, but the window borderClip is absolute. Translate the region by the window position before reporting damage to adjust. Reported-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-09-10damageext: Style fixAdam Jackson1-8/+14
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10damage: Implicitly unregister on destroyAdam Jackson1-1/+0
There's no reason not to, and it simplifies quite a few callers. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10damage: Remove the 'damage window' resource type.Adam Jackson1-17/+0
Note that the existing code never actually creates a resource of this type, so it can't possibly do anything. This is clearly meant to track window destruction and clean up any associated Damages, but that's already handled by miext/damage's DestroyWindow wrapper. Previous discussion: http://lists.freedesktop.org/archives/xorg-devel/2011-March/020847.html Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-07-09Move extension initialisation prototypes into extinit.hDaniel Stone3-2/+1
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-09Use C99 designated initializers in extension EventsAlan Coopersmith1-9/+11
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in various extension RepliesAlan Coopersmith1-4/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Remove unneccesary casts from WriteToClient callsAlan Coopersmith1-1/+1
Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-03-21Introduce a consistent coding styleKeith Packard3-234/+218
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>
2011-09-21Use internal temp variable for swap macrosMatt Turner1-25/+19
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-04-13damage: use DamageReportDamage for the initial borderClip damage reportErkki Seppälä1-1/+1
Instead of using DamageDamageRegion for reporting the first (virtual) damage in ProcDamageCreate that covers the borderClip of the drawable window, use a function DamageReportDamage directly (previously called damageReportDamage). This avoids sending all other damage listeners a full window update when a new damage object is created. As this patch makes DamageReportDamage a public interface, the function has been moved into the part of the file that contains all the other public functions. The function has not been otherwise modified. Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10Set DamageSetReportAfterOp to true for the damage extensionKristian Høgsberg1-0/+1
Change the damage extension reporter to queue up events after we chain to the wrapped functions. Damage events are typically sent out after the rendering happens anyway, since we submit batch buffers from the flush callback chain and then flush client io buffers. Compositing managers relie on this order, and there is no way we could reliably provide damage events to clients before the rendering happens anyway. By queueing up the damage events before the rendering happens, there's a risk that the client io buffer may overflow and send the damage events to the client before the driver has even seen the rendering request. Reporting damage events after the rendering fixes this corner case and better corresponds with how we expect this to work. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 8d7b7a0d71e0b89321b3341b781bc8845386def6) [anholt: re-applied to revert the revert, now that the cause of the revert is fixed] Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.Eric Anholt1-2/+2
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-10-20Revert "Set DamageSetReportAfterOp to true for the damage extension" (#30260)Aaron Plattner1-1/+0
This commit breaks the Compiz "Wallpaper" plugin. This reverts commit 8d7b7a0d71e0b89321b3341b781bc8845386def6. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-08-06Set DamageSetReportAfterOp to true for the damage extensionKristian Høgsberg1-0/+1
Change the damage extension reporter to queue up events after we chain to the wrapped functions. Damage events are typically sent out after the rendering happens anyway, since we submit batch buffers from the flush callback chain and then flush client io buffers. Compositing managers relie on this order, and there is no way we could reliably provide damage events to clients before the rendering happens anyway. By queueing up the damage events before the rendering happens, there's a risk that the client io buffer may overflow and send the damage events to the client before the driver has even seen the rendering request. Reporting damage events after the rendering fixes this corner case and better corresponds with how we expect this to work. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Clean up after removal of screen parameters from region macros.Jamey Sharp1-2/+0
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard1-3/+4
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-05Rename region macros to eliminate screen argumentKeith Packard1-6/+6
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-05-19Add typed resource-lookup errors for non-core resource types.Jamey Sharp2-3/+2
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19Set event sequence number in WriteEventsToClient instead of at callers.Jamey Sharp1-1/+0
TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19Make WriteEventsToClient/WriteToClient no-op on fake or dead clients.Jamey Sharp1-4/+2
This matches the test in TryClientEvents, and is a superset of tests done by the callers of these functions. The consequence of forgetting these tests is a server crash, so they're always desirable. In my opinion, it's better to not require the callers to remember to do these checks. For callers that don't do very much work before calling WriteToClient or WriteEventsToClient, I've removed the redundant checks. hw/xquartz/xpr/appledri.c has an interesting case: While its check for "client == NULL" appears redundant with the test in WriteEventsToClient, it dereferences client to get the sequence number. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497 Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-5/+5
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-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-3/+3
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-11Remember drawable ID used to find damage target for use in events. Bug 5730.Keith Packard2-1/+3
Using Composite, window pixmaps are given names in the client resource namespace and yet may not have any XID recorded in the drawable structure. As such, we need to remember the XID used to lookup the pixmap in the resource database so that we can report the correct XID back to the client in damage events. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith1-5/+2
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-18Ensure all resource types created have names registeredAlan Coopersmith1-0/+3
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-09-21input: define server-supported protocol versions in one single file.Peter Hutterer1-12/+6
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-04-29Fix most remaining deprecated resource lookups.Eamon Walsh1-5/+4
Callsites updated to use dixLookupResourceBy{Type,Class}. TODO: Audit access modes to make sure they reflect the usage.
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-1/+0
A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-10-02Unifdef ISCAdam Jackson1-0/+0
2008-08-31damage: choose less ambiguous function namesMaarten Maathuis1-2/+2
2008-08-29{damage,exa}: sanitise damageMaarten Maathuis1-2/+2
- 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-28Prepare for array-index based devPrivates.Tomas Carnecky1-1/+3
TODO: static indices can be made just an int; some indices can be combined.
2008-08-11The smart scheduler is not optional.Mathieu Bérard1-2/+0
2007-11-20Revert "registry: Register DAMAGE extension protocol names."Eamon Walsh1-20/+1
This reverts commit 20db50b4c44a14f7eeac2b1de17ada68482521da. Moving all the names into dix/registry.c
2007-10-15registry: Register DAMAGE extension protocol names.Eamon Walsh1-1/+20
2007-09-04xace: add hooks + new access codes: Damage extensionEamon Walsh1-2/+2
2007-08-28devPrivates rework: since API is already broken, switch everythingEamon Walsh2-5/+3
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-06-29Death to RCS tags.Adam Jackson3-6/+0
2007-03-25Static cleanups, dead code deletion.Adam Jackson2-23/+9
2007-02-01Set the Damage version supported in the server, instead of using damageproto.Eric Anholt1-5/+12
This was caught by distributions upgrading damageproto to 1.1, before the server they had supported it. The server then advertised the new version without supporting the protocol.
2007-01-09Track rename of DamagePost -> DamageAdd.Eric Anholt1-8/+8
2007-01-05Add support for the DamagePost (XDamage 1.1) request.Eric Anholt1-1/+43
This makes damageproto >= 1.1 a requirement to build.
2006-12-14Remove instances of macro SECURITY_VERIFY_DRAWABLE.Eamon Walsh1-2/+6
2006-12-14Naming change: Security*Access -> Dix*AccessEamon Walsh1-5/+5
2006-07-18get rid of XFree86LOADER, XFree86Server, XFree86Module, and IN_MODULEDaniel Stone1-1/+1
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.