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 extern DevPrivateKeyRec exaScreenPrivateKeyRec;
218 
219 #define exaScreenPrivateKey (&exaScreenPrivateKeyRec)
220 
221 #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey))
222 #define ExaScreenPriv(s)	ExaScreenPrivPtr    pExaScr = ExaGetScreenPriv(s)
223 
224 #define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, &ExaGetScreenPriv(gc->pScreen)->gcPrivateKeyRec))
225 #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc)
226 
227 /*
228  * Some macros to deal with function wrapping.
229  */
230 #define wrap(priv, real, mem, func) {\
231     priv->Saved##mem = real->mem; \
232     real->mem = func; \
233 }
234 
235 #define unwrap(priv, real, mem) {\
236     real->mem = priv->Saved##mem; \
237 }
238 
239 #ifdef HAVE_TYPEOF
240 #define swap(priv, real, mem) {\
241     typeof(real->mem) tmp = priv->Saved##mem; \
242     priv->Saved##mem = real->mem; \
243     real->mem = tmp; \
244 }
245 #else
246 #define swap(priv, real, mem) {\
247     const void *tmp = priv->Saved##mem; \
248     priv->Saved##mem = real->mem; \
249     real->mem = tmp; \
250 }
251 #endif
252 
253 #define EXA_PRE_FALLBACK(_screen_) \
254     ExaScreenPriv(_screen_); \
255     pExaScr->fallback_counter++;
256 
257 #define EXA_POST_FALLBACK(_screen_) \
258     pExaScr->fallback_counter--;
259 
260 #define EXA_PRE_FALLBACK_GC(_gc_) \
261     ExaScreenPriv(_gc_->pScreen); \
262     ExaGCPriv(_gc_); \
263     pExaScr->fallback_counter++; \
264     swap(pExaGC, _gc_, ops);
265 
266 #define EXA_POST_FALLBACK_GC(_gc_) \
267     pExaScr->fallback_counter--; \
268     swap(pExaGC, _gc_, ops);
269 
270 /** Align an offset to an arbitrary alignment */
271 #define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \
272 	(((offset) + (align) - 1) % (align)))
273 /** Align an offset to a power-of-two alignment */
274 #define EXA_ALIGN2(offset, align) (((offset) + (align) - 1) & ~((align) - 1))
275 
276 #define EXA_PIXMAP_SCORE_MOVE_IN    10
277 #define EXA_PIXMAP_SCORE_MAX	    20
278 #define EXA_PIXMAP_SCORE_MOVE_OUT   -10
279 #define EXA_PIXMAP_SCORE_MIN	    -20
280 #define EXA_PIXMAP_SCORE_PINNED	    1000
281 #define EXA_PIXMAP_SCORE_INIT	    1001
282 
283 #define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &ExaGetScreenPriv((p)->drawable.pScreen)->pixmapPrivateKeyRec))
284 #define ExaPixmapPriv(p)	ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
285 
286 #define EXA_RANGE_PITCH (1 << 0)
287 #define EXA_RANGE_WIDTH (1 << 1)
288 #define EXA_RANGE_HEIGHT (1 << 2)
289 
290 typedef struct {
291     ExaOffscreenArea *area;
292     int score;                  /**< score for the move-in vs move-out heuristic */
293     Bool use_gpu_copy;
294 
295     CARD8 *sys_ptr;             /**< pointer to pixmap data in system memory */
296     int sys_pitch;              /**< pitch of pixmap in system memory */
297 
298     CARD8 *fb_ptr;              /**< pointer to pixmap data in framebuffer memory */
299     int fb_pitch;               /**< pitch of pixmap in framebuffer memory */
300     unsigned int fb_size;       /**< size of pixmap in framebuffer memory */
301 
302     /**
303      * Holds information about whether this pixmap can be used for
304      * acceleration (== 0) or not (> 0).
305      *
306      * Contains a OR'ed combination of the following values:
307      * EXA_RANGE_PITCH - set if the pixmap's pitch is out of range
308      * EXA_RANGE_WIDTH - set if the pixmap's width is out of range
309      * EXA_RANGE_HEIGHT - set if the pixmap's height is out of range
310      */
311     unsigned int accel_blocked;
312 
313     /**
314      * The damage record contains the areas of the pixmap's current location
315      * (framebuffer or system) that have been damaged compared to the other
316      * location.
317      */
318     DamagePtr pDamage;
319     /**
320      * The valid regions mark the valid bits (at least, as they're derived from
321      * damage, which may be overreported) of a pixmap's system and FB copies.
322      */
323     RegionRec validSys, validFB;
324     /**
325      * Driver private storage per EXA pixmap
326      */
327     void *driverPriv;
328 } ExaPixmapPrivRec, *ExaPixmapPrivPtr;
329 
330 typedef struct {
331     /* GC values from the layer below. */
332     const GCOps *Savedops;
333     const GCFuncs *Savedfuncs;
334 } ExaGCPrivRec, *ExaGCPrivPtr;
335 
336 typedef struct {
337     PicturePtr pDst;
338     INT16 xSrc;
339     INT16 ySrc;
340     INT16 xMask;
341     INT16 yMask;
342     INT16 xDst;
343     INT16 yDst;
344     INT16 width;
345     INT16 height;
346 } ExaCompositeRectRec, *ExaCompositeRectPtr;
347 
348 /**
349  * exaDDXDriverInit must be implemented by the DDX using EXA, and is the place
350  * to set EXA options or hook in screen functions to handle using EXA as the AA.
351   */
352 void exaDDXDriverInit(ScreenPtr pScreen);
353 
354 /* exa_unaccel.c */
355 void
356  exaPrepareAccessGC(GCPtr pGC);
357 
358 void
359  exaFinishAccessGC(GCPtr pGC);
360 
361 void
362 
363 ExaCheckFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nspans,
364                   DDXPointPtr ppt, int *pwidth, int fSorted);
365 
366 void
367 
368 ExaCheckSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
369                  DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
370 
371 void
372 
373 ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
374                  int x, int y, int w, int h, int leftPad, int format,
375                  char *bits);
376 
377 void
378 
379 ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
380                  BoxPtr pbox, int nbox, int dx, int dy, Bool reverse,
381                  Bool upsidedown, Pixel bitplane, void *closure);
382 
383 RegionPtr
384 
385 ExaCheckCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
386                  int srcx, int srcy, int w, int h, int dstx, int dsty);
387 
388 RegionPtr
389 
390 ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
391                   int srcx, int srcy, int w, int h, int dstx, int dsty,
392                   unsigned long bitPlane);
393 
394 void
395 
396 ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
397                   DDXPointPtr pptInit);
398 
399 void
400 
401 ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC,
402                   int mode, int npt, DDXPointPtr ppt);
403 
404 void
405 
406 ExaCheckPolySegment(DrawablePtr pDrawable, GCPtr pGC,
407                     int nsegInit, xSegment * pSegInit);
408 
409 void
410  ExaCheckPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs);
411 
412 void
413 
414 ExaCheckPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
415                      int nrect, xRectangle *prect);
416 
417 void
418 
419 ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
420                       int x, int y, unsigned int nglyph,
421                       CharInfoPtr * ppci, void *pglyphBase);
422 
423 void
424 
425 ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
426                      int x, int y, unsigned int nglyph,
427                      CharInfoPtr * ppci, void *pglyphBase);
428 
429 void
430 
431 ExaCheckPushPixels(GCPtr pGC, PixmapPtr pBitmap,
432                    DrawablePtr pDrawable, int w, int h, int x, int y);
433 
434 void
435  ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
436 
437 void
438 
439 ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
440                  unsigned int format, unsigned long planeMask, char *d);
441 
442 void
443 
444 ExaCheckGetSpans(DrawablePtr pDrawable,
445                  int wMax,
446                  DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart);
447 
448 void
449 
450 ExaCheckAddTraps(PicturePtr pPicture,
451                  INT16 x_off, INT16 y_off, int ntrap, xTrap * traps);
452 
453 /* exa_accel.c */
454 
455 static _X_INLINE Bool
exaGCReadsDestination(DrawablePtr pDrawable,unsigned long planemask,unsigned int fillStyle,unsigned char alu,Bool clientClip)456 exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask,
457                       unsigned int fillStyle, unsigned char alu,
458                       Bool clientClip)
459 {
460     return ((alu != GXcopy && alu != GXclear && alu != GXset &&
461              alu != GXcopyInverted) || fillStyle == FillStippled ||
462             clientClip != FALSE || !EXA_PM_IS_SOLID(pDrawable, planemask));
463 }
464 
465 void
466  exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
467 
468 Bool
469 
470 exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
471                    DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu,
472                    Bool clientClip);
473 
474 void
475 
476 exaGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
477             unsigned int format, unsigned long planeMask, char *d);
478 
479 RegionPtr
480 
481 exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
482             int srcx, int srcy, int width, int height, int dstx, int dsty);
483 
484 Bool
485 
486 exaHWCopyNtoN(DrawablePtr pSrcDrawable,
487               DrawablePtr pDstDrawable,
488               GCPtr pGC,
489               BoxPtr pbox,
490               int nbox, int dx, int dy, Bool reverse, Bool upsidedown);
491 
492 void
493 
494 exaCopyNtoN(DrawablePtr pSrcDrawable,
495             DrawablePtr pDstDrawable,
496             GCPtr pGC,
497             BoxPtr pbox,
498             int nbox,
499             int dx,
500             int dy,
501             Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
502 
503 extern const GCOps exaOps;
504 
505 void
506 
507 ExaCheckComposite(CARD8 op,
508                   PicturePtr pSrc,
509                   PicturePtr pMask,
510                   PicturePtr pDst,
511                   INT16 xSrc,
512                   INT16 ySrc,
513                   INT16 xMask,
514                   INT16 yMask,
515                   INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
516 
517 void
518 
519 ExaCheckGlyphs(CARD8 op,
520                PicturePtr pSrc,
521                PicturePtr pDst,
522                PictFormatPtr maskFormat,
523                INT16 xSrc,
524                INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
525 
526 /* exa_offscreen.c */
527 void
528  ExaOffscreenSwapOut(ScreenPtr pScreen);
529 
530 void
531  ExaOffscreenSwapIn(ScreenPtr pScreen);
532 
533 ExaOffscreenArea *ExaOffscreenDefragment(ScreenPtr pScreen);
534 
535 Bool
536  exaOffscreenInit(ScreenPtr pScreen);
537 
538 void
539  ExaOffscreenFini(ScreenPtr pScreen);
540 
541 /* exa.c */
542 Bool
543  ExaDoPrepareAccess(PixmapPtr pPixmap, int index);
544 
545 void
546  exaPrepareAccess(DrawablePtr pDrawable, int index);
547 
548 void
549  exaFinishAccess(DrawablePtr pDrawable, int index);
550 
551 void
552  exaDestroyPixmap(PixmapPtr pPixmap);
553 
554 void
555  exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
556 
557 void
558 
559 exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap,
560                      int *xp, int *yp);
561 
562 Bool
563  exaPixmapHasGpuCopy(PixmapPtr p);
564 
565 PixmapPtr
566  exaGetOffscreenPixmap(DrawablePtr pDrawable, int *xp, int *yp);
567 
568 PixmapPtr
569  exaGetDrawablePixmap(DrawablePtr pDrawable);
570 
571 void
572 
573 exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
574               int w, int h, int bpp);
575 
576 void
577 
578 exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
579                  int w, int h, int bpp);
580 
581 void
582  exaDoMigration(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
583 
584 Bool
585  exaPixmapIsPinned(PixmapPtr pPix);
586 
587 extern const GCFuncs exaGCFuncs;
588 
589 /* exa_classic.c */
590 PixmapPtr
591 
592 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
593                         unsigned usage_hint);
594 
595 Bool
596 
597 exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height,
598                               int depth, int bitsPerPixel, int devKind,
599                               void *pPixData);
600 
601 Bool
602  exaDestroyPixmap_classic(PixmapPtr pPixmap);
603 
604 Bool
605  exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
606 
607 /* exa_driver.c */
608 PixmapPtr
609 
610 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
611                        unsigned usage_hint);
612 
613 Bool
614 
615 exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height,
616                              int depth, int bitsPerPixel, int devKind,
617                              void *pPixData);
618 
619 Bool
620  exaDestroyPixmap_driver(PixmapPtr pPixmap);
621 
622 Bool
623  exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
624 
625 /* exa_mixed.c */
626 PixmapPtr
627 
628 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
629                       unsigned usage_hint);
630 
631 Bool
632 
633 exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
634                             int bitsPerPixel, int devKind, void *pPixData);
635 
636 Bool
637  exaDestroyPixmap_mixed(PixmapPtr pPixmap);
638 
639 Bool
640  exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap);
641 
642 /* exa_migration_mixed.c */
643 void
644  exaCreateDriverPixmap_mixed(PixmapPtr pPixmap);
645 
646 void
647  exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
648 
649 void
650  exaMoveInPixmap_mixed(PixmapPtr pPixmap);
651 
652 void
653  exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure);
654 
655 void
656  exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
657 
658 Bool
659 exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle);
660 Bool
661 exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
662 
663 /* exa_render.c */
664 Bool
665  exaOpReadsDestination(CARD8 op);
666 
667 void
668 
669 exaComposite(CARD8 op,
670              PicturePtr pSrc,
671              PicturePtr pMask,
672              PicturePtr pDst,
673              INT16 xSrc,
674              INT16 ySrc,
675              INT16 xMask,
676              INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
677 
678 void
679 
680 exaCompositeRects(CARD8 op,
681                   PicturePtr Src,
682                   PicturePtr pMask,
683                   PicturePtr pDst, int nrect, ExaCompositeRectPtr rects);
684 
685 void
686 
687 exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
688               PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
689               int ntrap, xTrapezoid * traps);
690 
691 void
692 
693 exaTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
694              PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
695              int ntri, xTriangle * tris);
696 
697 /* exa_glyph.c */
698 void
699  exaGlyphsInit(ScreenPtr pScreen);
700 
701 void
702  exaGlyphsFini(ScreenPtr pScreen);
703 
704 void
705 
706 exaGlyphs(CARD8 op,
707           PicturePtr pSrc,
708           PicturePtr pDst,
709           PictFormatPtr maskFormat,
710           INT16 xSrc,
711           INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
712 
713 /* exa_migration_classic.c */
714 void
715  exaCopyDirtyToSys(ExaMigrationPtr migrate);
716 
717 void
718  exaCopyDirtyToFb(ExaMigrationPtr migrate);
719 
720 void
721  exaDoMigration_classic(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
722 
723 void
724  exaPixmapSave(ScreenPtr pScreen, ExaOffscreenArea * area);
725 
726 void
727  exaMoveOutPixmap_classic(PixmapPtr pPixmap);
728 
729 void
730  exaMoveInPixmap_classic(PixmapPtr pPixmap);
731 
732 void
733  exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg);
734 
735 #endif                          /* EXAPRIV_H */
736