diff options
author | Keith Packard <keithp@keithp.com> | 2012-03-21 12:55:09 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-03-21 13:54:42 -0700 |
commit | 9838b7032ea9792bec21af424c53c07078636d21 (patch) | |
tree | b72d0827dac50f0f3b8eab29b3b7639546d735d7 /exa/exa.h | |
parent | 75199129c603fc8567185ac31866c9518193cb78 (diff) |
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>
Diffstat (limited to 'exa/exa.h')
-rw-r--r-- | exa/exa.h | 223 |
1 files changed, 98 insertions, 125 deletions
@@ -44,7 +44,8 @@ typedef struct _ExaOffscreenArea ExaOffscreenArea; -typedef void (*ExaOffscreenSaveProc) (ScreenPtr pScreen, ExaOffscreenArea *area); +typedef void (*ExaOffscreenSaveProc) (ScreenPtr pScreen, + ExaOffscreenArea * area); typedef enum _ExaOffscreenState { ExaOffscreenAvail, @@ -53,22 +54,22 @@ typedef enum _ExaOffscreenState { } ExaOffscreenState; struct _ExaOffscreenArea { - int base_offset; /* allocation base */ - int offset; /* aligned offset */ - int size; /* total allocation size */ - unsigned last_use; - pointer privData; + int base_offset; /* allocation base */ + int offset; /* aligned offset */ + int size; /* total allocation size */ + unsigned last_use; + pointer privData; ExaOffscreenSaveProc save; - ExaOffscreenState state; + ExaOffscreenState state; - ExaOffscreenArea *next; + ExaOffscreenArea *next; - unsigned eviction_cost; + unsigned eviction_cost; - ExaOffscreenArea *prev; /* Double-linked list for defragmentation */ - int align; /* required alignment */ + ExaOffscreenArea *prev; /* Double-linked list for defragmentation */ + int align; /* required alignment */ }; /** @@ -89,7 +90,7 @@ typedef struct _ExaDriver { * The visible screen should be within memoryBase to memoryBase + * memorySize. */ - CARD8 *memoryBase; + CARD8 *memoryBase; /** * offScreenBase is the offset from memoryBase of the beginning of the area @@ -98,7 +99,7 @@ typedef struct _ExaDriver { * In XFree86 DDX drivers, this is probably: * (pScrn->displayWidth * cpp * pScrn->virtualY) */ - unsigned long offScreenBase; + unsigned long offScreenBase; /** * memorySize is the length (in bytes) of framebuffer memory beginning @@ -162,8 +163,8 @@ typedef struct _ExaDriver { /* private */ ExaOffscreenArea *offScreenAreas; - Bool needsSync; - int lastMarker; + Bool needsSync; + int lastMarker; /** @name Solid * @{ @@ -189,10 +190,8 @@ typedef struct _ExaDriver { * The PrepareSolid() call is required of all drivers, but it may fail for any * reason. Failure results in a fallback to software rendering. */ - Bool (*PrepareSolid) (PixmapPtr pPixmap, - int alu, - Pixel planemask, - Pixel fg); + Bool (*PrepareSolid) (PixmapPtr pPixmap, + int alu, Pixel planemask, Pixel fg); /** * Solid() performs a solid fill set up in the last PrepareSolid() call. @@ -213,7 +212,7 @@ typedef struct _ExaDriver { * * This call is required if PrepareSolid() ever succeeds. */ - void (*Solid) (PixmapPtr pPixmap, int x1, int y1, int x2, int y2); + void (*Solid) (PixmapPtr pPixmap, int x1, int y1, int x2, int y2); /** * DoneSolid() finishes a set of solid fills. @@ -227,7 +226,7 @@ typedef struct _ExaDriver { * * This call is required if PrepareSolid() ever succeeds. */ - void (*DoneSolid) (PixmapPtr pPixmap); + void (*DoneSolid) (PixmapPtr pPixmap); /** @} */ /** @name Copy @@ -264,12 +263,9 @@ typedef struct _ExaDriver { * The PrepareCopy() call is required of all drivers, but it may fail for any * reason. Failure results in a fallback to software rendering. */ - Bool (*PrepareCopy) (PixmapPtr pSrcPixmap, - PixmapPtr pDstPixmap, - int dx, - int dy, - int alu, - Pixel planemask); + Bool (*PrepareCopy) (PixmapPtr pSrcPixmap, + PixmapPtr pDstPixmap, + int dx, int dy, int alu, Pixel planemask); /** * Copy() performs a copy set up in the last PrepareCopy call. @@ -295,13 +291,9 @@ typedef struct _ExaDriver { * * This call is required if PrepareCopy ever succeeds. */ - void (*Copy) (PixmapPtr pDstPixmap, - int srcX, - int srcY, - int dstX, - int dstY, - int width, - int height); + void (*Copy) (PixmapPtr pDstPixmap, + int srcX, + int srcY, int dstX, int dstY, int width, int height); /** * DoneCopy() finishes a set of copies. @@ -315,7 +307,7 @@ typedef struct _ExaDriver { * * This call is required if PrepareCopy() ever succeeds. */ - void (*DoneCopy) (PixmapPtr pDstPixmap); + void (*DoneCopy) (PixmapPtr pDstPixmap); /** @} */ /** @name Composite @@ -346,10 +338,9 @@ typedef struct _ExaDriver { * The CheckComposite() call is recommended if PrepareComposite() is * implemented, but is not required. */ - Bool (*CheckComposite) (int op, - PicturePtr pSrcPicture, - PicturePtr pMaskPicture, - PicturePtr pDstPicture); + Bool (*CheckComposite) (int op, + PicturePtr pSrcPicture, + PicturePtr pMaskPicture, PicturePtr pDstPicture); /** * PrepareComposite() sets up the driver for doing a Composite operation @@ -405,13 +396,11 @@ typedef struct _ExaDriver { * of cairo applications. Failure results in a fallback to software * rendering. */ - Bool (*PrepareComposite) (int op, - PicturePtr pSrcPicture, - PicturePtr pMaskPicture, - PicturePtr pDstPicture, - PixmapPtr pSrc, - PixmapPtr pMask, - PixmapPtr pDst); + Bool (*PrepareComposite) (int op, + PicturePtr pSrcPicture, + PicturePtr pMaskPicture, + PicturePtr pDstPicture, + PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst); /** * Composite() performs a Composite operation set up in the last @@ -437,15 +426,11 @@ typedef struct _ExaDriver { * * This call is required if PrepareComposite() ever succeeds. */ - void (*Composite) (PixmapPtr pDst, - int srcX, - int srcY, - int maskX, - int maskY, - int dstX, - int dstY, - int width, - int height); + void (*Composite) (PixmapPtr pDst, + int srcX, + int srcY, + int maskX, + int maskY, int dstX, int dstY, int width, int height); /** * DoneComposite() finishes a set of Composite operations. @@ -459,7 +444,7 @@ typedef struct _ExaDriver { * * This call is required if PrepareComposite() ever succeeds. */ - void (*DoneComposite) (PixmapPtr pDst); + void (*DoneComposite) (PixmapPtr pDst); /** @} */ /** @@ -493,20 +478,15 @@ typedef struct _ExaDriver { * UploadToScreen() is not required, but is recommended if Composite * acceleration is supported. */ - Bool (*UploadToScreen) (PixmapPtr pDst, - int x, - int y, - int w, - int h, - char *src, - int src_pitch); + Bool (*UploadToScreen) (PixmapPtr pDst, + int x, + int y, int w, int h, char *src, int src_pitch); /** * UploadToScratch() is no longer used and will be removed next time the EXA * major version needs to be bumped. */ - Bool (*UploadToScratch) (PixmapPtr pSrc, - PixmapPtr pDst); + Bool (*UploadToScratch) (PixmapPtr pSrc, PixmapPtr pDst); /** * DownloadFromScreen() loads a rectangle of data from pSrc into dst @@ -538,10 +518,9 @@ typedef struct _ExaDriver { * * DownloadFromScreen() is not required, but is highly recommended. */ - Bool (*DownloadFromScreen)(PixmapPtr pSrc, - int x, int y, - int w, int h, - char *dst, int dst_pitch); + Bool (*DownloadFromScreen) (PixmapPtr pSrc, + int x, int y, + int w, int h, char *dst, int dst_pitch); /** * MarkSync() requests that the driver mark a synchronization point, @@ -558,7 +537,7 @@ typedef struct _ExaDriver { * * MarkSync() is optional. */ - int (*MarkSync) (ScreenPtr pScreen); + int (*MarkSync) (ScreenPtr pScreen); /** * WaitMarker() waits for all rendering before the given marker to have @@ -572,7 +551,7 @@ typedef struct _ExaDriver { * * WaitMarker() is required of all drivers. */ - void (*WaitMarker) (ScreenPtr pScreen, int marker); + void (*WaitMarker) (ScreenPtr pScreen, int marker); /** @{ */ /** @@ -608,7 +587,7 @@ typedef struct _ExaDriver { * @return FALSE if PrepareAccess() is unsuccessful and EXA should use * DownloadFromScreen() to migate the pixmap out. */ - Bool (*PrepareAccess)(PixmapPtr pPix, int index); + Bool (*PrepareAccess) (PixmapPtr pPix, int index); /** * FinishAccess() is called after CPU access to an offscreen pixmap. @@ -620,7 +599,7 @@ typedef struct _ExaDriver { * pixmap set up by PrepareAccess(). Note that the FinishAccess() will not be * called if PrepareAccess() failed and the pixmap was migrated out. */ - void (*FinishAccess)(PixmapPtr pPix, int index); + void (*FinishAccess) (PixmapPtr pPix, int index); /** * PixmapIsOffscreen() is an optional driver replacement to @@ -637,34 +616,34 @@ typedef struct _ExaDriver { * * */ - Bool (*PixmapIsOffscreen)(PixmapPtr pPix); + Bool (*PixmapIsOffscreen) (PixmapPtr pPix); - /** @name PrepareAccess() and FinishAccess() indices + /** @name PrepareAccess() and FinishAccess() indices * @{ */ - /** + /** * EXA_PREPARE_DEST is the index for a pixmap that may be drawn to or * read from. - */ - #define EXA_PREPARE_DEST 0 - /** + */ +#define EXA_PREPARE_DEST 0 + /** * EXA_PREPARE_SRC is the index for a pixmap that may be read from */ - #define EXA_PREPARE_SRC 1 - /** +#define EXA_PREPARE_SRC 1 + /** * EXA_PREPARE_SRC is the index for a second pixmap that may be read * from. */ - #define EXA_PREPARE_MASK 2 - /** +#define EXA_PREPARE_MASK 2 + /** * EXA_PREPARE_AUX* are additional indices for other purposes, e.g. * separate alpha maps with Composite operations. */ - #define EXA_PREPARE_AUX_DEST 3 - #define EXA_PREPARE_AUX_SRC 4 - #define EXA_PREPARE_AUX_MASK 5 - #define EXA_NUM_PREPARE_INDICES 6 - /** @} */ +#define EXA_PREPARE_AUX_DEST 3 +#define EXA_PREPARE_AUX_SRC 4 +#define EXA_PREPARE_AUX_MASK 5 +#define EXA_NUM_PREPARE_INDICES 6 + /** @} */ /** * maxPitchPixels controls the pitch limitation for rendering from @@ -697,23 +676,23 @@ typedef struct _ExaDriver { int maxPitchBytes; /* Hooks to allow driver to its own pixmap memory management */ - void *(*CreatePixmap)(ScreenPtr pScreen, int size, int align); - void (*DestroyPixmap)(ScreenPtr pScreen, void *driverPriv); + void *(*CreatePixmap) (ScreenPtr pScreen, int size, int align); + void (*DestroyPixmap) (ScreenPtr pScreen, void *driverPriv); /** * Returning a pixmap with non-NULL devPrivate.ptr implies a pixmap which is * not offscreen, which will never be accelerated and Prepare/FinishAccess won't * be called. */ - Bool (*ModifyPixmapHeader)(PixmapPtr pPixmap, int width, int height, - int depth, int bitsPerPixel, int devKind, - pointer pPixData); + Bool (*ModifyPixmapHeader) (PixmapPtr pPixmap, int width, int height, + int depth, int bitsPerPixel, int devKind, + pointer pPixData); /* hooks for drivers with tiling support: * driver MUST fill out new_fb_pitch with valid pitch of pixmap */ - void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height, - int depth, int usage_hint, int bitsPerPixel, - int *new_fb_pitch); + void *(*CreatePixmap2) (ScreenPtr pScreen, int width, int height, + int depth, int usage_hint, int bitsPerPixel, + int *new_fb_pitch); /** @} */ } ExaDriverRec, *ExaDriverPtr; @@ -772,65 +751,59 @@ typedef struct _ExaDriver { /** @} */ /* in exa.c */ -extern _X_EXPORT ExaDriverPtr -exaDriverAlloc(void); +extern _X_EXPORT ExaDriverPtr exaDriverAlloc(void); extern _X_EXPORT Bool -exaDriverInit(ScreenPtr pScreen, - ExaDriverPtr pScreenInfo); + exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo); extern _X_EXPORT void -exaDriverFini(ScreenPtr pScreen); + exaDriverFini(ScreenPtr pScreen); extern _X_EXPORT void -exaMarkSync(ScreenPtr pScreen); + exaMarkSync(ScreenPtr pScreen); extern _X_EXPORT void -exaWaitSync(ScreenPtr pScreen); + exaWaitSync(ScreenPtr pScreen); extern _X_EXPORT unsigned long -exaGetPixmapOffset(PixmapPtr pPix); + exaGetPixmapOffset(PixmapPtr pPix); extern _X_EXPORT unsigned long -exaGetPixmapPitch(PixmapPtr pPix); + exaGetPixmapPitch(PixmapPtr pPix); extern _X_EXPORT unsigned long -exaGetPixmapSize(PixmapPtr pPix); - -extern _X_EXPORT void * -exaGetPixmapDriverPrivate(PixmapPtr p); + exaGetPixmapSize(PixmapPtr pPix); +extern _X_EXPORT void *exaGetPixmapDriverPrivate(PixmapPtr p); /* in exa_offscreen.c */ -extern _X_EXPORT ExaOffscreenArea * -exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, - Bool locked, - ExaOffscreenSaveProc save, - pointer privData); +extern _X_EXPORT ExaOffscreenArea *exaOffscreenAlloc(ScreenPtr pScreen, + int size, int align, + Bool locked, + ExaOffscreenSaveProc save, + pointer privData); -extern _X_EXPORT ExaOffscreenArea * -exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea *area); +extern _X_EXPORT ExaOffscreenArea *exaOffscreenFree(ScreenPtr pScreen, + ExaOffscreenArea * area); extern _X_EXPORT void -ExaOffscreenMarkUsed (PixmapPtr pPixmap); + ExaOffscreenMarkUsed(PixmapPtr pPixmap); extern _X_EXPORT void -exaEnableDisableFBAccess (int index, Bool enable); + exaEnableDisableFBAccess(int index, Bool enable); extern _X_EXPORT Bool -exaDrawableIsOffscreen (DrawablePtr pDrawable); + exaDrawableIsOffscreen(DrawablePtr pDrawable); /* in exa.c */ extern _X_EXPORT void -exaMoveInPixmap (PixmapPtr pPixmap); + exaMoveInPixmap(PixmapPtr pPixmap); extern _X_EXPORT void -exaMoveOutPixmap (PixmapPtr pPixmap); - + exaMoveOutPixmap(PixmapPtr pPixmap); /* in exa_unaccel.c */ extern _X_EXPORT CARD32 -exaGetPixmapFirstPixel (PixmapPtr pPixmap); - + exaGetPixmapFirstPixel(PixmapPtr pPixmap); /** * Returns TRUE if the given planemask covers all the significant bits in the @@ -840,4 +813,4 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap); (((_pm) & FbFullMask((_pDrawable)->depth)) == \ FbFullMask((_pDrawable)->depth)) -#endif /* EXA_H */ +#endif /* EXA_H */ |