head 1.2; access; symbols netbsd-7-2-RELEASE:1.1.1.3 netbsd-7-1-2-RELEASE:1.1.1.3 netbsd-7-1-1-RELEASE:1.1.1.3 netbsd-7-1:1.1.1.3.0.14 netbsd-7-1-RELEASE:1.1.1.3 netbsd-7-1-RC2:1.1.1.3 netbsd-7-1-RC1:1.1.1.3 netbsd-7-0-2-RELEASE:1.1.1.3 netbsd-7-0-1-RELEASE:1.1.1.3 netbsd-7-0:1.1.1.3.0.12 netbsd-7-0-RELEASE:1.1.1.3 netbsd-7-0-RC3:1.1.1.3 netbsd-7-0-RC2:1.1.1.3 netbsd-7-0-RC1:1.1.1.3 netbsd-5-2-3-RELEASE:1.1.1.1 netbsd-5-1-5-RELEASE:1.1.1.1 netbsd-6-0-6-RELEASE:1.1.1.3 netbsd-6-1-5-RELEASE:1.1.1.3 netbsd-7:1.1.1.3.0.10 netbsd-7-base:1.1.1.3 netbsd-6-1-4-RELEASE:1.1.1.3 netbsd-6-0-5-RELEASE:1.1.1.3 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.3 riastradh-drm2:1.1.1.3.0.8 riastradh-drm2-base:1.1.1.3 netbsd-6-1-3-RELEASE:1.1.1.3 netbsd-6-0-4-RELEASE:1.1.1.3 netbsd-5-2-2-RELEASE:1.1.1.1 netbsd-5-1-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.3 netbsd-6-0-3-RELEASE:1.1.1.3 netbsd-5-2-1-RELEASE:1.1.1.1 netbsd-5-1-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.3 xorg-server-1-10-6:1.1.1.3 netbsd-6-1:1.1.1.3.0.6 netbsd-6-0-2-RELEASE:1.1.1.3 netbsd-6-1-RELEASE:1.1.1.3 netbsd-6-1-RC4:1.1.1.3 netbsd-6-1-RC3:1.1.1.3 netbsd-6-1-RC2:1.1.1.3 netbsd-6-1-RC1:1.1.1.3 netbsd-5-2:1.1.1.1.0.8 netbsd-6-0-1-RELEASE:1.1.1.3 netbsd-5-2-RELEASE:1.1.1.1 netbsd-5-2-RC1:1.1.1.1 netbsd-6-0:1.1.1.3.0.4 netbsd-6-0-RELEASE:1.1.1.3 netbsd-6-0-RC2:1.1.1.3 netbsd-6-0-RC1:1.1.1.3 netbsd-6:1.1.1.3.0.2 netbsd-6-base:1.1.1.3 netbsd-5-1-2-RELEASE:1.1.1.1 netbsd-5-1-1-RELEASE:1.1.1.1 xorg-server-1-10-3:1.1.1.3 mrg-xorg-server-1-9-5-pre-1-10-3:1.1.1.2 xorg-server-1-9-5:1.1.1.2 xorg-server-1-9-2:1.1.1.2 netbsd-5-1:1.1.1.1.0.6 netbsd-5-1-RELEASE:1.1.1.1 netbsd-5-1-RC4:1.1.1.1 netbsd-5-1-RC3:1.1.1.1 netbsd-5-1-RC2:1.1.1.1 netbsd-5-1-RC1:1.1.1.1 netbsd-5-0-2-RELEASE:1.1.1.1 xorg-server-1-6-5:1.1.1.1 xorg-server-1-6-3:1.1.1.1 netbsd-5-0-1-RELEASE:1.1.1.1 xorg-server-1-6-2:1.1.1.1 xorg-server-1-6-1-901:1.1.1.1 netbsd-5-0:1.1.1.1.0.4 netbsd-5-0-RELEASE:1.1.1.1 netbsd-5-0-RC4:1.1.1.1 netbsd-5-0-RC3:1.1.1.1 netbsd-5-0-RC2:1.1.1.1 netbsd-5-0-RC1:1.1.1.1 netbsd-5:1.1.1.1.0.2 netbsd-5-base:1.1.1.1 xorg-server-1-4-2:1.1.1.1 xorg:1.1.1; locks; strict; comment @# @; 1.2 date 2016.08.11.00.04.28; author mrg; state dead; branches; next 1.1; commitid FQxwnZNPy5ZgOOhz; 1.1 date 2008.07.31.19.50.31; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.07.31.19.50.31; author mrg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2010.11.23.05.21.21; author mrg; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2011.08.02.06.56.51; author mrg; state Exp; branches; next ; desc @@ 1.2 log @first merge of netbsd changes. not tested yet. @ text @ File Index
Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

dmxsync.c File Reference

#include "dmx.h"
#include "dmxsync.h"
#include "dmxstat.h"
#include "dmxlog.h"
#include <sys/time.h>

Functions

void dmxSyncActivate (const char *interval)
void dmxSyncInit (void)
void dmxSync (DMXScreenInfo *dmxScreen, Bool now)

Detailed Description

The DMX server code is written to call dmxSync() whenever an XSync() might be necessary. However, since XSync() requires a two way communication with the other X server, eliminating unnecessary XSync() calls is a key performance optimization. Support for this optimization is provided here. Statistics about XSync() calls and latency are gathered in #dmxstat.c.

During the initial conversion from calling XSync() immediately to the XSync() batching method implemented in this file, it was noted that, out of more than 300 x11perf tests, 8 tests became more than 100 times faster, with 68 more than 50X faster, 114 more than 10X faster, and 181 more than 2X faster.


Function Documentation

void dmxSync DMXScreenInfo dmxScreen,
Bool  now
 

Request an XSync() to the display used by dmxScreen. If now is TRUE, call XSync() immediately instead of waiting for the next XSync() batching point. Note that if XSync() batching was deselected with dmxSyncActivate() before dmxSyncInit() was called, then no XSync() batching is performed and this function always calles XSync() immediately.

(Note that this function uses TimerSet but works correctly in the face of a server generation. See the source for details.)

If dmxScreen is NULL, then all pending syncs will be flushed immediately.

void dmxSyncActivate const char *  interval  ) 
 

Request the XSync() batching optimization with the specified interval (in mS). If the interval is 0, 100mS is used. If the interval is less than 0, then the XSync() batching optimization is not requested (e.g., so the -syncbatch -1 command line option can turn off the default 100mS XSync() batching).

Note that the parameter to this routine is a string, since it will usually be called from ddxProcessArgument in #dmxinit.c

void dmxSyncInit void   ) 
 

Initialize the XSync() batching optimization, but only if dmxSyncActivate was last called with a non-negative value.


Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4. @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @initial import of xorg-server-1.4.2 @ text @@ 1.1.1.2 log @import xorg-server 1.9.2. important changes since 1.6.5 include: - built-in symbol visibility, default not export - fixes for various crashes - many fixes for XI2, EXA, dix, render, glx, xkb, EDID, randr, Xv, resource handling, Xext, vfb, xfree86 / vga and composite support. - fixes several memory leaks - many many documentation updates - record extension enabled - no longer looks for XF86Config files @ text @d9 11 a19 64

dmxsync.c File Reference

#include "dmx.h"
#include "dmxsync.h"
#include "dmxstat.h"
#include "dmxlog.h"
#include <sys/time.h>

Functions

static void dmxDoSync (DMXScreenInfo *dmxScreen)
static CARD32 dmxSyncCallback (OsTimerPtr timer, CARD32 time, pointer arg)
static void dmxSyncBlockHandler (pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
static void dmxSyncWakeupHandler (pointer blockData, int result, pointer pReadMask)
void dmxSyncActivate (const char *interval)
void dmxSyncInit (void)
void dmxSync (DMXScreenInfo *dmxScreen, Bool now)

Variables

static int dmxSyncInterval = 100
static OsTimerPtr dmxSyncTimer
static int dmxSyncPending

Detailed Description

The DMX server code is written to call dmxSync() whenever an XSync() might be necessary. However, since XSync() requires a two way communication with the other X server, eliminating unnecessary XSync() calls is a key performance optimization. Support for this optimization is provided here. Statistics about XSync() calls and latency are gathered in dmxstat.c.

During the initial conversion from calling XSync() immediately to the XSync() batching method implemented in this file, it was noted that, out of more than 300 x11perf tests, 8 tests became more than 100 times faster, with 68 more than 50X faster, 114 more than 10X faster, and 181 more than 2X faster.


Function Documentation

static void dmxDoSync ( DMXScreenInfo dmxScreen  )  [static]
d21 1 a21 1

References _DMXScreenInfo::beDisplay, dmxStatInterval, dmxStatSync(), dmxSyncPending, and _DMXScreenInfo::needsSync.

d23 1 a23 1

Referenced by dmxSync(), and dmxSyncCallback().

d25 9 a33 6
d35 4 a38 4 a40 1 a41 4 d43 2 a44 2 a45 17
void dmxSync ( DMXScreenInfo dmxScreen, Bool  now 
)

Request an XSync() to the display used by dmxScreen. If now is TRUE, call XSync() immediately instead of waiting for the next XSync() batching point. Note that if XSync() batching was deselected with dmxSyncActivate() before dmxSyncInit() was called, then no XSync() batching is performed and this function always calles XSync() immediately.

(Note that this function uses TimerSet but works correctly in the face of a server generation. See the source for details.)

If dmxScreen is NULL, then all pending syncs will be flushed immediately.

References dmxDoSync(), dmxFatal, dmxGeneration, dmxLog(), dmxSyncCallback(), dmxSyncInterval, dmxSyncPending, dmxSyncTimer, _DMXScreenInfo::name, and _DMXScreenInfo::needsSync.

Referenced by _dmxMoveCursor(), _dmxSetCursor(), dmxAddInput(), dmxAttachScreen(), dmxBackendCollectEvents(), dmxBackendProcessInput(), dmxBackendUpdatePosition(), dmxBECreateCursor(), dmxBECreatePixmap(), dmxBELoadFont(), dmxBitmapToRegion(), dmxChangeBorderWidth(), dmxChangeGC(), dmxChangePictureClip(), dmxChangeWindowAttributes(), dmxCheckFontPath(), dmxCheckFontPathElement(), dmxCommonMouOn(), dmxCommonSaveState(), dmxComposite(), dmxCompositeRects(), dmxConsoleCapture(), dmxConsoleUncapture(), dmxCopyArea(), dmxCopyPlane(), dmxCopyWindow(), dmxCreateAndRealizeWindow(), dmxCreateWindow(), dmxDestroyPicture(), dmxDestroyPictureClip(), dmxDestroyPixmap(), dmxDestroyWindow(), dmxDPMSInit(), dmxDPMSTerm(), dmxFillPolygon(), dmxFlushPendingSyncs(), dmxGetImage(), dmxImageText16(), dmxImageText8(), dmxInstallColormap(), dmxPolyArc(), dmxPolyFillArc(), dmxPolyFillRect(), dmxPolylines(), dmxPolyPoint(), dmxPolyRectangle(), dmxPolySegment(), dmxPolyText16(), dmxPolyText8(), dmxPositionWindow(), dmxProcRenderAddGlyphs(), dmxProcRenderCompositeGlyphs(), dmxProcRenderFreeGlyphs(), dmxProcRenderFreeGlyphSet(), dmxProcRenderSetPictureFilter(), dmxProcRenderSetPictureTransform(), dmxPutImage(), dmxRealizeWindow(), dmxReparentWindow(), dmxResizeRootWindow(), dmxResizeScreenWindow(), dmxResizeWindow(), dmxRestackWindow(), dmxSaveScreen(), dmxSetFontPath(), dmxSetShape(), dmxShadowUpdateProc(), dmxStoreColors(), dmxTrapezoids(), dmxTriangles(), dmxTriFan(), dmxTriStrip(), dmxUnrealizeWindow(), dmxValidatePicture(), and dmxWindowExposures().

a46 5 d48 2 a50 7
void dmxSyncActivate ( const char *  interval  ) 

Request the XSync() batching optimization with the specified interval (in mS). If the interval is 0, 100mS is used. If the interval is less than 0, then the XSync() batching optimization is not requested (e.g., so the -syncbatch -1 command line option can turn off the default 100mS XSync() batching).

Note that the parameter to this routine is a string, since it will usually be called from ddxProcessArgument in dmxinit.c

References dmxSyncInterval.

a51 31

Referenced by ddxProcessArgument().

d53 28 a80 35

References dmxSyncTimer.

Referenced by dmxSyncInit().

static void dmxSyncBlockHandler ( pointer  blockData,
OSTimePtr  pTimeout,
pointer  pReadMask 
) [static]
a81 7
static CARD32 dmxSyncCallback ( OsTimerPtr  timer,
CARD32  time,
pointer  arg 
) [static]
d84 27 a110 25

Initialize the XSync() batching optimization, but only if dmxSyncActivate was last called with a non-negative value.

References dmxInfo, dmxLog(), dmxSyncBlockHandler(), dmxSyncInterval, and dmxSyncWakeupHandler().

Referenced by InitOutput().

void dmxSyncInit ( void   ) 
a111 16
static void dmxSyncWakeupHandler ( pointer  blockData,
int  result,
pointer  pReadMask 
) [static]

Referenced by dmxSyncInit().

a112 10

Variable Documentation

d114 14 a127 38
int dmxSyncInterval = 100 [static]
int dmxSyncPending [static]

Referenced by dmxDoSync(), dmxSync(), and dmxSyncCallback().

OsTimerPtr dmxSyncTimer [static]

Referenced by dmxSync(), and dmxSyncBlockHandler().

@ 1.1.1.3 log @initial import of xorg-server 1.10.3. highlights include: - fixes xorg bugs 29969, 30367, 30527, 30267, 30260, 29046, 30260, 31548, 28672, 24887, 32115, 21457, 32436, 21827, 28414, 24703, 32803, 16318, 33449, 33324, 33929, 35082, 35209, 36146, 36119 - many additional NULL checks - adjustments related to input ABI 12 - *lots* of dead code removal - vga arbitrator fixes - GL fixes - EDID fixes - conversion to using asprintf() in many places - many fixes from valgrind, compiler warnings see these for more details: http://lists.freedesktop.org/archives/xorg-announce/2011-February/001612.html http://lists.freedesktop.org/archives/xorg-announce/2011-April/001646.html http://lists.freedesktop.org/archives/xorg-announce/2011-May/001675.html http://lists.freedesktop.org/archives/xorg-announce/2011-July/001710.html @ text @d9 3 a11 2