| 1 | /* |
| 2 | * |
| 3 | * Copyright (C) 2000 Keith Packard, member of The XFree86 Project, Inc. |
| 4 | * 2005 Zack Rusin, Trolltech |
| 5 | * |
| 6 | * Permission to use, copy, modify, distribute, and sell this software and its |
| 7 | * documentation for any purpose is hereby granted without fee, provided that |
| 8 | * the above copyright notice appear in all copies and that both that |
| 9 | * copyright notice and this permission notice appear in supporting |
| 10 | * documentation, and that the name of Keith Packard not be used in |
| 11 | * advertising or publicity pertaining to distribution of the software without |
| 12 | * specific, written prior permission. Keith Packard makes no |
| 13 | * representations about the suitability of this software for any purpose. It |
| 14 | * is provided "as is" without express or implied warranty. |
| 15 | * |
| 16 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS |
| 17 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 18 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 19 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING |
| 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
| 23 | * SOFTWARE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef EXAPRIV_H |
| 27 | #define EXAPRIV_H |
| 28 | |
| 29 | #ifdef HAVE_DIX_CONFIG_H |
| 30 | #include <dix-config.h> |
| 31 | #endif |
| 32 | |
| 33 | #include "exa.h" |
| 34 | |
| 35 | #include <X11/X.h> |
| 36 | #include <X11/Xproto.h> |
| 37 | #ifdef MITSHM |
| 38 | #include "shmint.h" |
| 39 | #endif |
| 40 | #include "scrnintstr.h" |
| 41 | #include "pixmapstr.h" |
| 42 | #include "windowstr.h" |
| 43 | #include "servermd.h" |
| 44 | #include "colormapst.h" |
| 45 | #include "gcstruct.h" |
| 46 | #include "input.h" |
| 47 | #include "mipointer.h" |
| 48 | #include "mi.h" |
| 49 | #include "dix.h" |
| 50 | #include "fb.h" |
| 51 | #include "fboverlay.h" |
| 52 | #include "fbpict.h" |
| 53 | #include "glyphstr.h" |
| 54 | #include "damage.h" |
| 55 | |
| 56 | #define DEBUG_TRACE_FALL 0 |
| 57 | #define DEBUG_MIGRATE 0 |
| 58 | #define DEBUG_PIXMAP 0 |
| 59 | #define DEBUG_OFFSCREEN 0 |
| 60 | #define DEBUG_GLYPH_CACHE 0 |
| 61 | |
| 62 | #if DEBUG_TRACE_FALL |
| 63 | #define EXA_FALLBACK(x) \ |
| 64 | do { \ |
| 65 | ErrorF("EXA fallback at %s: ", __FUNCTION__); \ |
| 66 | ErrorF x; \ |
| 67 | } while (0) |
| 68 | |
| 69 | char |
| 70 | exaDrawableLocation(DrawablePtr pDrawable); |
| 71 | #else |
| 72 | #define EXA_FALLBACK(x) |
| 73 | #endif |
| 74 | |
| 75 | #if DEBUG_PIXMAP |
| 76 | #define DBG_PIXMAP(a) ErrorF a |
| 77 | #else |
| 78 | #define DBG_PIXMAP(a) |
| 79 | #endif |
| 80 | |
| 81 | #ifndef EXA_MAX_FB |
| 82 | #define EXA_MAX_FB FB_OVERLAY_MAX |
| 83 | #endif |
| 84 | |
| 85 | #ifdef DEBUG |
| 86 | #define EXA_FatalErrorDebug(x) FatalError x |
| 87 | #define EXA_FatalErrorDebugWithRet(x, ret) FatalError x |
| 88 | #else |
| 89 | #define EXA_FatalErrorDebug(x) ErrorF x |
| 90 | #define EXA_FatalErrorDebugWithRet(x, ret) \ |
| 91 | do { \ |
| 92 | ErrorF x; \ |
| 93 | return ret; \ |
| 94 | } while (0) |
| 95 | #endif |
| 96 | |
| 97 | /** |
| 98 | * This is the list of migration heuristics supported by EXA. See |
| 99 | * exaDoMigration() for what their implementations do. |
| 100 | */ |
| 101 | enum ExaMigrationHeuristic { |
| 102 | ExaMigrationGreedy, |
| 103 | ExaMigrationAlways, |
| 104 | ExaMigrationSmart |
| 105 | }; |
| 106 | |
| 107 | typedef struct { |
| 108 | unsigned char sha1[20]; |
| 109 | } ExaCachedGlyphRec, *ExaCachedGlyphPtr; |
| 110 | |
| 111 | typedef struct { |
| 112 | /* The identity of the cache, statically configured at initialization */ |
| 113 | unsigned int format; |
| 114 | int glyphWidth; |
| 115 | int glyphHeight; |
| 116 | |
| 117 | int size; /* Size of cache; eventually this should be dynamically determined */ |
| 118 | |
| 119 | /* Hash table mapping from glyph sha1 to position in the glyph; we use |
| 120 | * open addressing with a hash table size determined based on size and large |
| 121 | * enough so that we always have a good amount of free space, so we can |
| 122 | * use linear probing. (Linear probing is preferrable to double hashing |
| 123 | * here because it allows us to easily remove entries.) |
| 124 | */ |
| 125 | int *hashEntries; |
| 126 | int hashSize; |
| 127 | |
| 128 | ExaCachedGlyphPtr glyphs; |
| 129 | int glyphCount; /* Current number of glyphs */ |
| 130 | |
| 131 | PicturePtr picture; /* Where the glyphs of the cache are stored */ |
| 132 | int yOffset; /* y location within the picture where the cache starts */ |
| 133 | int columns; /* Number of columns the glyphs are layed out in */ |
| 134 | int evictionPosition; /* Next random position to evict a glyph */ |
| 135 | } ExaGlyphCacheRec, *ExaGlyphCachePtr; |
| 136 | |
| 137 | #define EXA_NUM_GLYPH_CACHES 4 |
| 138 | |
| 139 | #define EXA_FALLBACK_COPYWINDOW (1 << 0) |
| 140 | #define EXA_ACCEL_COPYWINDOW (1 << 1) |
| 141 | |
| 142 | typedef struct _ExaMigrationRec { |
| 143 | Bool as_dst; |
| 144 | Bool as_src; |
| 145 | PixmapPtr pPix; |
| 146 | RegionPtr pReg; |
| 147 | } ExaMigrationRec, *ExaMigrationPtr; |
| 148 | |
| 149 | typedef void (*EnableDisableFBAccessProcPtr) (ScreenPtr, Bool); |
| 150 | typedef struct { |
| 151 | ExaDriverPtr info; |
| 152 | ScreenBlockHandlerProcPtr SavedBlockHandler; |
| 153 | ScreenWakeupHandlerProcPtr SavedWakeupHandler; |
| 154 | CreateGCProcPtr SavedCreateGC; |
| 155 | CloseScreenProcPtr SavedCloseScreen; |
| 156 | GetImageProcPtr SavedGetImage; |
| 157 | GetSpansProcPtr SavedGetSpans; |
| 158 | CreatePixmapProcPtr SavedCreatePixmap; |
| 159 | DestroyPixmapProcPtr SavedDestroyPixmap; |
| 160 | CopyWindowProcPtr SavedCopyWindow; |
| 161 | ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; |
| 162 | BitmapToRegionProcPtr SavedBitmapToRegion; |
| 163 | CreateScreenResourcesProcPtr SavedCreateScreenResources; |
| 164 | ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; |
| 165 | SharePixmapBackingProcPtr SavedSharePixmapBacking; |
| 166 | SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking; |
| 167 | SourceValidateProcPtr SavedSourceValidate; |
| 168 | CompositeProcPtr SavedComposite; |
| 169 | TrianglesProcPtr SavedTriangles; |
| 170 | GlyphsProcPtr SavedGlyphs; |
| 171 | TrapezoidsProcPtr SavedTrapezoids; |
| 172 | AddTrapsProcPtr SavedAddTraps; |
| 173 | void (*do_migration) (ExaMigrationPtr pixmaps, int npixmaps, |
| 174 | Bool can_accel); |
| 175 | Bool (*pixmap_has_gpu_copy) (PixmapPtr pPixmap); |
| 176 | void (*do_move_in_pixmap) (PixmapPtr pPixmap); |
| 177 | void (*do_move_out_pixmap) (PixmapPtr pPixmap); |
| 178 | void (*prepare_access_reg) (PixmapPtr pPixmap, int index, RegionPtr pReg); |
| 179 | |
| 180 | Bool swappedOut; |
| 181 | enum ExaMigrationHeuristic migration; |
| 182 | Bool checkDirtyCorrectness; |
| 183 | unsigned disableFbCount; |
| 184 | Bool optimize_migration; |
| 185 | unsigned offScreenCounter; |
| 186 | unsigned numOffscreenAvailable; |
| 187 | CARD32 lastDefragment; |
| 188 | CARD32 nextDefragment; |
| 189 | PixmapPtr deferred_mixed_pixmap; |
| 190 | |
| 191 | /* Reference counting for accessed pixmaps */ |
| 192 | struct { |
| 193 | PixmapPtr pixmap; |
| 194 | int count; |
| 195 | Bool retval; |
| 196 | } access[EXA_NUM_PREPARE_INDICES]; |
| 197 | |
| 198 | /* Holds information on fallbacks that cannot be relayed otherwise. */ |
| 199 | unsigned int fallback_flags; |
| 200 | unsigned int fallback_counter; |
| 201 | |
| 202 | ExaGlyphCacheRec glyphCaches[EXA_NUM_GLYPH_CACHES]; |
| 203 | |
| 204 | /** |
| 205 | * Regions affected by fallback composite source / mask operations. |
| 206 | */ |
| 207 | |
| 208 | RegionRec srcReg; |
| 209 | RegionRec maskReg; |
| 210 | PixmapPtr srcPix; |
| 211 | PixmapPtr maskPix; |
| 212 | |
| 213 | DevPrivateKeyRec pixmapPrivateKeyRec; |
| 214 | DevPrivateKeyRec gcPrivateKeyRec; |
| 215 | } ExaScreenPrivRec, *ExaScreenPrivPtr; |
| 216 | |
| 217 | /* |
| 218 | * This is the only completely portable way to |
| 219 | * compute this info. |
| 220 | */ |
| 221 | #ifndef BitsPerPixel |
| 222 | #define BitsPerPixel(d) (\ |
| 223 | PixmapWidthPaddingInfo[d].notPower2 ? \ |
| 224 | (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \ |
| 225 | ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ |
| 226 | (PixmapWidthPaddingInfo[d].padRoundUp+1))) |
| 227 | #endif |
| 228 | |
| 229 | extern DevPrivateKeyRec exaScreenPrivateKeyRec; |
| 230 | |
| 231 | #define exaScreenPrivateKey (&exaScreenPrivateKeyRec) |
| 232 | |
| 233 | #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey)) |
| 234 | #define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s) |
| 235 | |
| 236 | #define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, &ExaGetScreenPriv(gc->pScreen)->gcPrivateKeyRec)) |
| 237 | #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) |
| 238 | |
| 239 | /* |
| 240 | * Some macros to deal with function wrapping. |
| 241 | */ |
| 242 | #define wrap(priv, real, mem, func) {\ |
| 243 | priv->Saved##mem = real->mem; \ |
| 244 | real->mem = func; \ |
| 245 | } |
| 246 | |
| 247 | #define unwrap(priv, real, mem) {\ |
| 248 | real->mem = priv->Saved##mem; \ |
| 249 | } |
| 250 | |
| 251 | #define swap(priv, real, mem) {\ |
| 252 | void *tmp = priv->Saved##mem; \ |
| 253 | priv->Saved##mem = real->mem; \ |
| 254 | real->mem = tmp; \ |
| 255 | } |
| 256 | |
| 257 | #define EXA_PRE_FALLBACK(_screen_) \ |
| 258 | ExaScreenPriv(_screen_); \ |
| 259 | pExaScr->fallback_counter++; |
| 260 | |
| 261 | #define EXA_POST_FALLBACK(_screen_) \ |
| 262 | pExaScr->fallback_counter--; |
| 263 | |
| 264 | #define EXA_PRE_FALLBACK_GC(_gc_) \ |
| 265 | ExaScreenPriv(_gc_->pScreen); \ |
| 266 | ExaGCPriv(_gc_); \ |
| 267 | pExaScr->fallback_counter++; \ |
| 268 | swap(pExaGC, _gc_, ops); |
| 269 | |
| 270 | #define EXA_POST_FALLBACK_GC(_gc_) \ |
| 271 | pExaScr->fallback_counter--; \ |
| 272 | swap(pExaGC, _gc_, ops); |
| 273 | |
| 274 | /** Align an offset to an arbitrary alignment */ |
| 275 | #define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \ |
| 276 | (((offset) + (align) - 1) % (align))) |
| 277 | /** Align an offset to a power-of-two alignment */ |
| 278 | #define EXA_ALIGN2(offset, align) (((offset) + (align) - 1) & ~((align) - 1)) |
| 279 | |
| 280 | #define EXA_PIXMAP_SCORE_MOVE_IN 10 |
| 281 | #define EXA_PIXMAP_SCORE_MAX 20 |
| 282 | #define EXA_PIXMAP_SCORE_MOVE_OUT -10 |
| 283 | #define EXA_PIXMAP_SCORE_MIN -20 |
| 284 | #define EXA_PIXMAP_SCORE_PINNED 1000 |
| 285 | #define EXA_PIXMAP_SCORE_INIT 1001 |
| 286 | |
| 287 | #define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &ExaGetScreenPriv((p)->drawable.pScreen)->pixmapPrivateKeyRec)) |
| 288 | #define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p) |
| 289 | |
| 290 | #define EXA_RANGE_PITCH (1 << 0) |
| 291 | #define EXA_RANGE_WIDTH (1 << 1) |
| 292 | #define EXA_RANGE_HEIGHT (1 << 2) |
| 293 | |
| 294 | typedef struct { |
| 295 | ExaOffscreenArea *area; |
| 296 | int score; /**< score for the move-in vs move-out heuristic */ |
| 297 | Bool use_gpu_copy; |
| 298 | |
| 299 | CARD8 *sys_ptr; /**< pointer to pixmap data in system memory */ |
| 300 | int sys_pitch; /**< pitch of pixmap in system memory */ |
| 301 | |
| 302 | CARD8 *fb_ptr; /**< pointer to pixmap data in framebuffer memory */ |
| 303 | int fb_pitch; /**< pitch of pixmap in framebuffer memory */ |
| 304 | unsigned int fb_size; /**< size of pixmap in framebuffer memory */ |
| 305 | |
| 306 | /** |
| 307 | * Holds information about whether this pixmap can be used for |
| 308 | * acceleration (== 0) or not (> 0). |
| 309 | * |
| 310 | * Contains a OR'ed combination of the following values: |
| 311 | * EXA_RANGE_PITCH - set if the pixmap's pitch is out of range |
| 312 | * EXA_RANGE_WIDTH - set if the pixmap's width is out of range |
| 313 | * EXA_RANGE_HEIGHT - set if the pixmap's height is out of range |
| 314 | */ |
| 315 | unsigned int accel_blocked; |
| 316 | |
| 317 | /** |
| 318 | * The damage record contains the areas of the pixmap's current location |
| 319 | * (framebuffer or system) that have been damaged compared to the other |
| 320 | * location. |
| 321 | */ |
| 322 | DamagePtr pDamage; |
| 323 | /** |
| 324 | * The valid regions mark the valid bits (at least, as they're derived from |
| 325 | * damage, which may be overreported) of a pixmap's system and FB copies. |
| 326 | */ |
| 327 | RegionRec validSys, validFB; |
| 328 | /** |
| 329 | * Driver private storage per EXA pixmap |
| 330 | */ |
| 331 | void *driverPriv; |
| 332 | } ExaPixmapPrivRec, *ExaPixmapPrivPtr; |
| 333 | |
| 334 | typedef struct { |
| 335 | /* GC values from the layer below. */ |
| 336 | GCOps *Savedops; |
| 337 | GCFuncs *Savedfuncs; |
| 338 | } ExaGCPrivRec, *ExaGCPrivPtr; |
| 339 | |
| 340 | typedef struct { |
| 341 | PicturePtr pDst; |
| 342 | INT16 xSrc; |
| 343 | INT16 ySrc; |
| 344 | INT16 xMask; |
| 345 | INT16 yMask; |
| 346 | INT16 xDst; |
| 347 | INT16 yDst; |
| 348 | INT16 width; |
| 349 | INT16 height; |
| 350 | } ExaCompositeRectRec, *ExaCompositeRectPtr; |
| 351 | |
| 352 | /** |
| 353 | * exaDDXDriverInit must be implemented by the DDX using EXA, and is the place |
| 354 | * to set EXA options or hook in screen functions to handle using EXA as the AA. |
| 355 | */ |
| 356 | void exaDDXDriverInit(ScreenPtr pScreen); |
| 357 | |
| 358 | /* exa_unaccel.c */ |
| 359 | void |
| 360 | exaPrepareAccessGC(GCPtr pGC); |
| 361 | |
| 362 | void |
| 363 | exaFinishAccessGC(GCPtr pGC); |
| 364 | |
| 365 | void |
| 366 | |
| 367 | ExaCheckFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nspans, |
| 368 | DDXPointPtr ppt, int *pwidth, int fSorted); |
| 369 | |
| 370 | void |
| 371 | |
| 372 | ExaCheckSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, |
| 373 | DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); |
| 374 | |
| 375 | void |
| 376 | |
| 377 | ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, |
| 378 | int x, int y, int w, int h, int leftPad, int format, |
| 379 | char *bits); |
| 380 | |
| 381 | void |
| 382 | |
| 383 | ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, |
| 384 | BoxPtr pbox, int nbox, int dx, int dy, Bool reverse, |
| 385 | Bool upsidedown, Pixel bitplane, void *closure); |
| 386 | |
| 387 | RegionPtr |
| 388 | |
| 389 | ExaCheckCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, |
| 390 | int srcx, int srcy, int w, int h, int dstx, int dsty); |
| 391 | |
| 392 | RegionPtr |
| 393 | |
| 394 | ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, |
| 395 | int srcx, int srcy, int w, int h, int dstx, int dsty, |
| 396 | unsigned long bitPlane); |
| 397 | |
| 398 | void |
| 399 | |
| 400 | ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, |
| 401 | DDXPointPtr pptInit); |
| 402 | |
| 403 | void |
| 404 | |
| 405 | ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC, |
| 406 | int mode, int npt, DDXPointPtr ppt); |
| 407 | |
| 408 | void |
| 409 | |
| 410 | ExaCheckPolySegment(DrawablePtr pDrawable, GCPtr pGC, |
| 411 | int nsegInit, xSegment * pSegInit); |
| 412 | |
| 413 | void |
| 414 | ExaCheckPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs); |
| 415 | |
| 416 | void |
| 417 | |
| 418 | ExaCheckPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, |
| 419 | int nrect, xRectangle *prect); |
| 420 | |
| 421 | void |
| 422 | |
| 423 | ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, |
| 424 | int x, int y, unsigned int nglyph, |
| 425 | CharInfoPtr * ppci, pointer pglyphBase); |
| 426 | |
| 427 | void |
| 428 | |
| 429 | ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, |
| 430 | int x, int y, unsigned int nglyph, |
| 431 | CharInfoPtr * ppci, pointer pglyphBase); |
| 432 | |
| 433 | void |
| 434 | |
| 435 | ExaCheckPushPixels(GCPtr pGC, PixmapPtr pBitmap, |
| 436 | DrawablePtr pDrawable, int w, int h, int x, int y); |
| 437 | |
| 438 | void |
| 439 | ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); |
| 440 | |
| 441 | void |
| 442 | |
| 443 | ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, |
| 444 | unsigned int format, unsigned long planeMask, char *d); |
| 445 | |
| 446 | void |
| 447 | |
| 448 | ExaCheckGetSpans(DrawablePtr pDrawable, |
| 449 | int wMax, |
| 450 | DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); |
| 451 | |
| 452 | void |
| 453 | |
| 454 | ExaCheckAddTraps(PicturePtr pPicture, |
| 455 | INT16 x_off, INT16 y_off, int ntrap, xTrap * traps); |
| 456 | |
| 457 | /* exa_accel.c */ |
| 458 | |
| 459 | static _X_INLINE Bool |
| 460 | exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask, |
| 461 | unsigned int fillStyle, unsigned char alu, |
| 462 | unsigned int clientClipType) |
| 463 | { |
| 464 | return ((alu != GXcopy && alu != GXclear && alu != GXset && |
| 465 | alu != GXcopyInverted) || fillStyle == FillStippled || |
| 466 | clientClipType != CT_NONE || |
| 467 | !EXA_PM_IS_SOLID(pDrawable, planemask)); |
| 468 | } |
| 469 | |
| 470 | void |
| 471 | exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); |
| 472 | |
| 473 | Bool |
| 474 | |
| 475 | exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, |
| 476 | DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu, |
| 477 | unsigned int clientClipType); |
| 478 | |
| 479 | void |
| 480 | |
| 481 | exaGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, |
| 482 | unsigned int format, unsigned long planeMask, char *d); |
| 483 | |
| 484 | RegionPtr |
| 485 | |
| 486 | exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, |
| 487 | int srcx, int srcy, int width, int height, int dstx, int dsty); |
| 488 | |
| 489 | Bool |
| 490 | |
| 491 | exaHWCopyNtoN(DrawablePtr pSrcDrawable, |
| 492 | DrawablePtr pDstDrawable, |
| 493 | GCPtr pGC, |
| 494 | BoxPtr pbox, |
| 495 | int nbox, int dx, int dy, Bool reverse, Bool upsidedown); |
| 496 | |
| 497 | void |
| 498 | |
| 499 | exaCopyNtoN(DrawablePtr pSrcDrawable, |
| 500 | DrawablePtr pDstDrawable, |
| 501 | GCPtr pGC, |
| 502 | BoxPtr pbox, |
| 503 | int nbox, |
| 504 | int dx, |
| 505 | int dy, |
| 506 | Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); |
| 507 | |
| 508 | extern const GCOps exaOps; |
| 509 | |
| 510 | void |
| 511 | |
| 512 | ExaCheckComposite(CARD8 op, |
| 513 | PicturePtr pSrc, |
| 514 | PicturePtr pMask, |
| 515 | PicturePtr pDst, |
| 516 | INT16 xSrc, |
| 517 | INT16 ySrc, |
| 518 | INT16 xMask, |
| 519 | INT16 yMask, |
| 520 | INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); |
| 521 | |
| 522 | void |
| 523 | |
| 524 | ExaCheckGlyphs(CARD8 op, |
| 525 | PicturePtr pSrc, |
| 526 | PicturePtr pDst, |
| 527 | PictFormatPtr maskFormat, |
| 528 | INT16 xSrc, |
| 529 | INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); |
| 530 | |
| 531 | /* exa_offscreen.c */ |
| 532 | void |
| 533 | ExaOffscreenSwapOut(ScreenPtr pScreen); |
| 534 | |
| 535 | void |
| 536 | ExaOffscreenSwapIn(ScreenPtr pScreen); |
| 537 | |
| 538 | ExaOffscreenArea *ExaOffscreenDefragment(ScreenPtr pScreen); |
| 539 | |
| 540 | Bool |
| 541 | exaOffscreenInit(ScreenPtr pScreen); |
| 542 | |
| 543 | void |
| 544 | ExaOffscreenFini(ScreenPtr pScreen); |
| 545 | |
| 546 | /* exa.c */ |
| 547 | Bool |
| 548 | ExaDoPrepareAccess(PixmapPtr pPixmap, int index); |
| 549 | |
| 550 | void |
| 551 | exaPrepareAccess(DrawablePtr pDrawable, int index); |
| 552 | |
| 553 | void |
| 554 | exaFinishAccess(DrawablePtr pDrawable, int index); |
| 555 | |
| 556 | void |
| 557 | exaDestroyPixmap(PixmapPtr pPixmap); |
| 558 | |
| 559 | void |
| 560 | exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2); |
| 561 | |
| 562 | void |
| 563 | |
| 564 | exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap, |
| 565 | int *xp, int *yp); |
| 566 | |
| 567 | Bool |
| 568 | exaPixmapHasGpuCopy(PixmapPtr p); |
| 569 | |
| 570 | PixmapPtr |
| 571 | exaGetOffscreenPixmap(DrawablePtr pDrawable, int *xp, int *yp); |
| 572 | |
| 573 | PixmapPtr |
| 574 | exaGetDrawablePixmap(DrawablePtr pDrawable); |
| 575 | |
| 576 | void |
| 577 | |
| 578 | exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, |
| 579 | int w, int h, int bpp); |
| 580 | |
| 581 | void |
| 582 | |
| 583 | exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, |
| 584 | int w, int h, int bpp); |
| 585 | |
| 586 | void |
| 587 | exaDoMigration(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); |
| 588 | |
| 589 | Bool |
| 590 | exaPixmapIsPinned(PixmapPtr pPix); |
| 591 | |
| 592 | extern const GCFuncs exaGCFuncs; |
| 593 | |
| 594 | /* exa_classic.c */ |
| 595 | PixmapPtr |
| 596 | |
| 597 | exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, |
| 598 | unsigned usage_hint); |
| 599 | |
| 600 | Bool |
| 601 | |
| 602 | exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, |
| 603 | int depth, int bitsPerPixel, int devKind, |
| 604 | pointer pPixData); |
| 605 | |
| 606 | Bool |
| 607 | exaDestroyPixmap_classic(PixmapPtr pPixmap); |
| 608 | |
| 609 | Bool |
| 610 | exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap); |
| 611 | |
| 612 | /* exa_driver.c */ |
| 613 | PixmapPtr |
| 614 | |
| 615 | exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, |
| 616 | unsigned usage_hint); |
| 617 | |
| 618 | Bool |
| 619 | |
| 620 | exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, |
| 621 | int depth, int bitsPerPixel, int devKind, |
| 622 | pointer pPixData); |
| 623 | |
| 624 | Bool |
| 625 | exaDestroyPixmap_driver(PixmapPtr pPixmap); |
| 626 | |
| 627 | Bool |
| 628 | exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap); |
| 629 | |
| 630 | /* exa_mixed.c */ |
| 631 | PixmapPtr |
| 632 | |
| 633 | exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, |
| 634 | unsigned usage_hint); |
| 635 | |
| 636 | Bool |
| 637 | |
| 638 | exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, |
| 639 | int bitsPerPixel, int devKind, pointer pPixData); |
| 640 | |
| 641 | Bool |
| 642 | exaDestroyPixmap_mixed(PixmapPtr pPixmap); |
| 643 | |
| 644 | Bool |
| 645 | exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap); |
| 646 | |
| 647 | /* exa_migration_mixed.c */ |
| 648 | void |
| 649 | exaCreateDriverPixmap_mixed(PixmapPtr pPixmap); |
| 650 | |
| 651 | void |
| 652 | exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); |
| 653 | |
| 654 | void |
| 655 | exaMoveInPixmap_mixed(PixmapPtr pPixmap); |
| 656 | |
| 657 | void |
| 658 | exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure); |
| 659 | |
| 660 | void |
| 661 | exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg); |
| 662 | |
| 663 | Bool |
| 664 | exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle); |
| 665 | Bool |
| 666 | exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p); |
| 667 | |
| 668 | /* exa_render.c */ |
| 669 | Bool |
| 670 | exaOpReadsDestination(CARD8 op); |
| 671 | |
| 672 | void |
| 673 | |
| 674 | exaComposite(CARD8 op, |
| 675 | PicturePtr pSrc, |
| 676 | PicturePtr pMask, |
| 677 | PicturePtr pDst, |
| 678 | INT16 xSrc, |
| 679 | INT16 ySrc, |
| 680 | INT16 xMask, |
| 681 | INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); |
| 682 | |
| 683 | void |
| 684 | |
| 685 | exaCompositeRects(CARD8 op, |
| 686 | PicturePtr Src, |
| 687 | PicturePtr pMask, |
| 688 | PicturePtr pDst, int nrect, ExaCompositeRectPtr rects); |
| 689 | |
| 690 | void |
| 691 | |
| 692 | exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, |
| 693 | PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, |
| 694 | int ntrap, xTrapezoid * traps); |
| 695 | |
| 696 | void |
| 697 | |
| 698 | exaTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, |
| 699 | PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, |
| 700 | int ntri, xTriangle * tris); |
| 701 | |
| 702 | /* exa_glyph.c */ |
| 703 | void |
| 704 | exaGlyphsInit(ScreenPtr pScreen); |
| 705 | |
| 706 | void |
| 707 | exaGlyphsFini(ScreenPtr pScreen); |
| 708 | |
| 709 | void |
| 710 | |
| 711 | exaGlyphs(CARD8 op, |
| 712 | PicturePtr pSrc, |
| 713 | PicturePtr pDst, |
| 714 | PictFormatPtr maskFormat, |
| 715 | INT16 xSrc, |
| 716 | INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); |
| 717 | |
| 718 | /* exa_migration_classic.c */ |
| 719 | void |
| 720 | exaCopyDirtyToSys(ExaMigrationPtr migrate); |
| 721 | |
| 722 | void |
| 723 | exaCopyDirtyToFb(ExaMigrationPtr migrate); |
| 724 | |
| 725 | void |
| 726 | exaDoMigration_classic(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); |
| 727 | |
| 728 | void |
| 729 | exaPixmapSave(ScreenPtr pScreen, ExaOffscreenArea * area); |
| 730 | |
| 731 | void |
| 732 | exaMoveOutPixmap_classic(PixmapPtr pPixmap); |
| 733 | |
| 734 | void |
| 735 | exaMoveInPixmap_classic(PixmapPtr pPixmap); |
| 736 | |
| 737 | void |
| 738 | exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg); |
| 739 | |
| 740 | #endif /* EXAPRIV_H */ |