summaryrefslogtreecommitdiff
path: root/Xext/sync.c
AgeCommit message (Collapse)AuthorFilesLines
2011-09-21Use internal temp variable for swap macrosMatt Turner1-117/+69
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-01-05X Sync CleanupsJames Jones1-56/+86
Various cleanups identified during review of the X Sync Fence Object patches. -Correctly handle failure of AddResource() -Don't assert when data structures are corrupt. Instead, use a new helper function to check for counter sync objects when they're expected, and warn if the type is wrong. -Use the default switch label rather than reimplementing it. -Re-introduce cast of result of dixAllocateObjectWithPrivate() to kill an incompatible pointer type warning. -Remove comments claiming protocol updates are needed. One wasn't true and the other was addressed with a xextproto change. -Return BadFence, not BadCounter from XSyncAwaitFence() Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19IDLETIME: Fix edge-case in IdleTimeBlockHandlerChristopher James Halse Rogers1-0/+8
Ensure that if we're called exactly on the threshold of a NegativeTransition trigger that we reshedule to pick up an idle time over the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19Xext: Fix edge case with {Positive, Negative}Transition triggers.Christopher James Halse Rogers1-0/+22
The {Positive,Negative}Transition triggers only fire when the counter goes from strictly {below,above} the threshold. If SyncComputeBracketValues gets called exactly at this threshold we may update the bracket values so that the counter is not updated past the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-06sync: syncObject may be None in SyncInitTriggerKeith Packard1-2/+2
And often is, especially when called from ProcSyncCreateAlarm. Crashing in this case seems unwise. Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-06Expose Sync Fence Object protocolJames Jones1-0/+24
Add the new protocol handlers for XSync 3.1 to the dispatch tables and report support for Sync protocol version 3.1. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Add XSyncAwaitFence() handlerJames Jones1-31/+152
-Add the actual ProcSyncAwaitFence() dispatch func -Add support for fence sync triggers. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Create/Destroy/Trigger/Reset/Query Fence Sync objsJames Jones1-4/+223
Initial server side implementation of fence sync objects. Allows creation, management, and state queries of binary state objects. Currently they are not very useful as there is no way to wait for them efficiently. The basic trigger operation added here triggers relative to a given X screen's rendering operations. To perform this operation, fence sync objects must be tied to a screen. As Aaron Plattner pointed out, screens are identified but a drawable in X protocol, so a drawable argument is included in XSyncCreateFence(). The screen also could have been specified as part of the trigger operation. However, it is also desireable to associate a screen with fence sync objects at creation time so that the associated screen's driver can allocate any HW- specific resources needed by the fence object up front. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Add fence sync driver interfaceJames Jones1-1/+5
-Add fence sync objects -Add fence sync devPrivates -Add a X sync module screen private -Add wrappable functions to create and destroy fence sync objects -Give fence sync objects wrappable functions to trigger, test, and reset their 'triggered' value. -Give fence sync objects wrappable functions to notify driver when adding/removing triggers to/ from the sync object. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Move some sync code to miextJames Jones1-1/+0
As a precursor to the fence sync object video driver and extension API, move some code from Xext to miext/sync. Most of this is just code to set up the build system to include the new directory. No functional code is added in this change. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Factor out generic code from ProcSyncAwait()James Jones1-43/+63
In preparation for adding more sync object types that will need Await requests of their own, factor out some setup and finalization code from ProcSyncAwait() into SyncAwaitPrologue() and SyncAwaitEpilogue() Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Make Await SyncTrigger functions genericJames Jones1-113/+199
Update all the functions dealing with Await sync triggers handle generic sync objects instead of just counters. This will facilitate code sharing between the counter sync waits and the fence sync waits. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Create SyncObject base type.James Jones1-34/+61
SyncObject is now the base type for SyncCounter. Data to be used by all sync types is stored in the base object. SyncCounter can be safely cast to SyncObject, and a SyncObject can be cast to the correct type based on SyncObject::type. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Add and use SERVER_SYNC_*_VERSIONJames Jones1-2/+3
Most extensions have a version defined in the protocol headers, and also in the server's protocol-versions.h. The latter defines which version the server advertises support for. Sync wasn't included in protocol-versions.h, and was advertising support for whatever was in the protocol headers the server was built against. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-28xserver: delete pervasively use of DISPATCH_PROCTiago Vignatti1-30/+0
Some functions had to be moved around due some missing static definitions. Another minor clean up like inexistent function declarations and etc were made also. Part of this patch was cooked using: sed -i -e '/static DISPATCH_PROC*.*;/d' `git ls-files` Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-05-19Add typed resource-lookup errors for non-core resource types.Jamey Sharp1-8/+11
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-5/+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-6/+3
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-18SyncSendAlarmNotifyEvents: check the correct client's clientGone flag.Jamey Sharp1-1/+1
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-7/+7
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-27/+27
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-10Fix wrong bracket values when startOver = FALSE.David James1-11/+8
Currently, SyncComputeBracketValues reuses old values of bracket_greater and bracket_less when startOver = FALSE. This can result in incorrect bracket values. To fix this issue, the startOver parameter is removed, and we do not reuse old values of bracket_greater and bracket_less. X.Org Bug 27023 <http://bugs.freedesktop.org/show_bug.cgi?id=27023> Signed-off-by: David James <davidjames@google.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21Death to Multibuffer extensionTiago Vignatti1-1/+1
The rationale behind is because no sane application will use this when we have modern APIs such DRI2. Besides, as a fact, xfree86 server has already deprecated this extension in 1998: http://www.xfree86.org/3.3.6/isc7.html Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith1-11/+5
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/+6
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-18Check for failures from CreateNewResourceTypeAlan Coopersmith1-2/+6
Make sure to check return value before setting bitmask flags. For most calls, just fails to init the extension. Since Xinput already calls FatalError() on initialization failure, so does failure to allocate Xinput's resource type. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-08-14Xext: fix up wrong conditions for negative sync transitions.Peter Hutterer1-18/+14
If the counter had a value higher than the trigger value for a negative transition, the trigger value did not get set. The correct sequence of checks is: if (positive transition) if (counter value < trigger value) set up trigger if (negative transition) if (counter value > trigger value) set up trigger Red Hat Bug 501601 <https://bugzilla.redhat.com/show_bug.cgi?id=501601> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13Xext: add missing return code check to ProcSyncDestroyAlarmPeter Hutterer1-0/+1
Introduced with 57aff88c7d0761e590806d07bee1c9410680c89f. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15Update to xextproto 7.0.99.1.Peter Hutterer1-4/+1
xextproto had Xlib client headers moved into libXext. Protocol header files are named fooproto.h, header files with constants foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-14Xext: switch to byte counting functionsPeter Hutterer1-6/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-29Fix most remaining deprecated resource lookups.Eamon Walsh1-47/+35
Callsites updated to use dixLookupResourceBy{Type,Class}. TODO: Audit access modes to make sure they reflect the usage.
2009-03-09Replace dixLookupResource by dixLookupResourceBy{Type,Class}Keith Packard1-1/+1
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-02-16xserver: Avoid sending uninitialized padding data over the networkPeter Åstrand1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Remove a bunch of useless casts.Adam Jackson1-1/+1
We've had void * for twenty years now people let's try to act like we know how it works.
2009-01-11xsync: make SyncAlarmCounterDestroyed staticJulien Cristau1-1/+1
2009-01-11Xext: ANSI cleanupsJulien Cristau1-15/+12
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-2/+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-12-11xsync: Prototype fix.Colin Harrison1-1/+1
2008-12-11xsync: build fixAdam Jackson1-0/+2
argh protocol header disaster
2008-12-11xsync: Fix wakeup storm in idletime counter.Adam Jackson1-10/+41
Wakeup scheduling only considered the threshold values, and not whether the trigger was edge or level. See also: https://bugzilla.redhat.com/show_bug.cgi?id=474586 http://svn.gnome.org/viewvc/gnome-screensaver/trunk/src/test-idle-ext.c?view=markup
2008-12-11xsync: ANSI cleanupsAdam Jackson1-392/+138
2008-12-11xsync: Use a local header for server API definitionsAdam Jackson1-1/+1
2008-12-11xsync: remove cast abuse.Adam Jackson1-41/+40
2008-07-17Drop a bunch of #ifdef Lynx.Mathieu Bérard1-1/+1
2008-01-03Merge branch 'master' into mpxPeter Hutterer1-8/+8
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
2007-11-21Xext: Scruffy the janitor don't like no "register" keywords.Peter Hutterer1-19/+19
2007-11-20Revert "registry: Register SYNC extension protocol names."Eamon Walsh1-40/+0
This reverts commit 9f597f6c87e0b14cc382d8e5929e42f822db4329. Moving all the names into dix/registry.c
2007-11-05Merge branch 'master' into XACE-SELINUXEamon Walsh1-6/+6
Conflicts: dix/dispatch.c dix/property.c hw/xfree86/common/xf86VidMode.c include/xkbsrv.h render/glyph.c xkb/xkbActions.c
2007-11-05Xext: Remove usage of allocaDaniel Stone1-6/+6
Replace with heap allocations.
2007-10-15registry: Register SYNC extension protocol names.Eamon Walsh1-0/+40