exa_priv.h revision 7e31ba66
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)     					\
64do {								\
65	ErrorF("EXA fallback at %s: ", __FUNCTION__);		\
66	ErrorF x;						\
67} while (0)
68
69char
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) \
91do { \
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 */
101enum ExaMigrationHeuristic {
102    ExaMigrationGreedy,
103    ExaMigrationAlways,
104    ExaMigrationSmart
105};
106
107typedef struct {
108    unsigned char sha1[20];
109} ExaCachedGlyphRec, *ExaCachedGlyphPtr;
110
111typedef 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
142typedef struct _ExaMigrationRec {
143    Bool as_dst;
144    Bool as_src;
145    PixmapPtr pPix;
146    RegionPtr pReg;
147} ExaMigrationRec, *ExaMigrationPtr;
148
149typedef void (*EnableDisableFBAccessProcPtr) (ScreenPtr, Bool);
150typedef 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
217extern 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
290typedef 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
330typedef struct {
331    /* GC values from the layer below. */
332    const GCOps *Savedops;
333    const GCFuncs *Savedfuncs;
334} ExaGCPrivRec, *ExaGCPrivPtr;
335
336typedef 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  */
352void exaDDXDriverInit(ScreenPtr pScreen);
353
354/* exa_unaccel.c */
355void
356 exaPrepareAccessGC(GCPtr pGC);
357
358void
359 exaFinishAccessGC(GCPtr pGC);
360
361void
362
363ExaCheckFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nspans,
364                  DDXPointPtr ppt, int *pwidth, int fSorted);
365
366void
367
368ExaCheckSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
369                 DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
370
371void
372
373ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
374                 int x, int y, int w, int h, int leftPad, int format,
375                 char *bits);
376
377void
378
379ExaCheckCopyNtoN(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
383RegionPtr
384
385ExaCheckCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
386                 int srcx, int srcy, int w, int h, int dstx, int dsty);
387
388RegionPtr
389
390ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
391                  int srcx, int srcy, int w, int h, int dstx, int dsty,
392                  unsigned long bitPlane);
393
394void
395
396ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
397                  DDXPointPtr pptInit);
398
399void
400
401ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC,
402                  int mode, int npt, DDXPointPtr ppt);
403
404void
405
406ExaCheckPolySegment(DrawablePtr pDrawable, GCPtr pGC,
407                    int nsegInit, xSegment * pSegInit);
408
409void
410 ExaCheckPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs);
411
412void
413
414ExaCheckPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
415                     int nrect, xRectangle *prect);
416
417void
418
419ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
420                      int x, int y, unsigned int nglyph,
421                      CharInfoPtr * ppci, void *pglyphBase);
422
423void
424
425ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
426                     int x, int y, unsigned int nglyph,
427                     CharInfoPtr * ppci, void *pglyphBase);
428
429void
430
431ExaCheckPushPixels(GCPtr pGC, PixmapPtr pBitmap,
432                   DrawablePtr pDrawable, int w, int h, int x, int y);
433
434void
435 ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
436
437void
438
439ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
440                 unsigned int format, unsigned long planeMask, char *d);
441
442void
443
444ExaCheckGetSpans(DrawablePtr pDrawable,
445                 int wMax,
446                 DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart);
447
448void
449
450ExaCheckAddTraps(PicturePtr pPicture,
451                 INT16 x_off, INT16 y_off, int ntrap, xTrap * traps);
452
453/* exa_accel.c */
454
455static _X_INLINE Bool
456exaGCReadsDestination(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
465void
466 exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
467
468Bool
469
470exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
471                   DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu,
472                   Bool clientClip);
473
474void
475
476exaGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
477            unsigned int format, unsigned long planeMask, char *d);
478
479RegionPtr
480
481exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
482            int srcx, int srcy, int width, int height, int dstx, int dsty);
483
484Bool
485
486exaHWCopyNtoN(DrawablePtr pSrcDrawable,
487              DrawablePtr pDstDrawable,
488              GCPtr pGC,
489              BoxPtr pbox,
490              int nbox, int dx, int dy, Bool reverse, Bool upsidedown);
491
492void
493
494exaCopyNtoN(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
503extern const GCOps exaOps;
504
505void
506
507ExaCheckComposite(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
517void
518
519ExaCheckGlyphs(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 */
527void
528 ExaOffscreenSwapOut(ScreenPtr pScreen);
529
530void
531 ExaOffscreenSwapIn(ScreenPtr pScreen);
532
533ExaOffscreenArea *ExaOffscreenDefragment(ScreenPtr pScreen);
534
535Bool
536 exaOffscreenInit(ScreenPtr pScreen);
537
538void
539 ExaOffscreenFini(ScreenPtr pScreen);
540
541/* exa.c */
542Bool
543 ExaDoPrepareAccess(PixmapPtr pPixmap, int index);
544
545void
546 exaPrepareAccess(DrawablePtr pDrawable, int index);
547
548void
549 exaFinishAccess(DrawablePtr pDrawable, int index);
550
551void
552 exaDestroyPixmap(PixmapPtr pPixmap);
553
554void
555 exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
556
557void
558
559exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap,
560                     int *xp, int *yp);
561
562Bool
563 exaPixmapHasGpuCopy(PixmapPtr p);
564
565PixmapPtr
566 exaGetOffscreenPixmap(DrawablePtr pDrawable, int *xp, int *yp);
567
568PixmapPtr
569 exaGetDrawablePixmap(DrawablePtr pDrawable);
570
571void
572
573exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
574              int w, int h, int bpp);
575
576void
577
578exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
579                 int w, int h, int bpp);
580
581void
582 exaDoMigration(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
583
584Bool
585 exaPixmapIsPinned(PixmapPtr pPix);
586
587extern const GCFuncs exaGCFuncs;
588
589/* exa_classic.c */
590PixmapPtr
591
592exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
593                        unsigned usage_hint);
594
595Bool
596
597exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height,
598                              int depth, int bitsPerPixel, int devKind,
599                              void *pPixData);
600
601Bool
602 exaDestroyPixmap_classic(PixmapPtr pPixmap);
603
604Bool
605 exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
606
607/* exa_driver.c */
608PixmapPtr
609
610exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
611                       unsigned usage_hint);
612
613Bool
614
615exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height,
616                             int depth, int bitsPerPixel, int devKind,
617                             void *pPixData);
618
619Bool
620 exaDestroyPixmap_driver(PixmapPtr pPixmap);
621
622Bool
623 exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
624
625/* exa_mixed.c */
626PixmapPtr
627
628exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
629                      unsigned usage_hint);
630
631Bool
632
633exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
634                            int bitsPerPixel, int devKind, void *pPixData);
635
636Bool
637 exaDestroyPixmap_mixed(PixmapPtr pPixmap);
638
639Bool
640 exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap);
641
642/* exa_migration_mixed.c */
643void
644 exaCreateDriverPixmap_mixed(PixmapPtr pPixmap);
645
646void
647 exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
648
649void
650 exaMoveInPixmap_mixed(PixmapPtr pPixmap);
651
652void
653 exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure);
654
655void
656 exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
657
658Bool
659exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle);
660Bool
661exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
662
663/* exa_render.c */
664Bool
665 exaOpReadsDestination(CARD8 op);
666
667void
668
669exaComposite(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
678void
679
680exaCompositeRects(CARD8 op,
681                  PicturePtr Src,
682                  PicturePtr pMask,
683                  PicturePtr pDst, int nrect, ExaCompositeRectPtr rects);
684
685void
686
687exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
688              PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
689              int ntrap, xTrapezoid * traps);
690
691void
692
693exaTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
694             PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
695             int ntri, xTriangle * tris);
696
697/* exa_glyph.c */
698void
699 exaGlyphsInit(ScreenPtr pScreen);
700
701void
702 exaGlyphsFini(ScreenPtr pScreen);
703
704void
705
706exaGlyphs(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 */
714void
715 exaCopyDirtyToSys(ExaMigrationPtr migrate);
716
717void
718 exaCopyDirtyToFb(ExaMigrationPtr migrate);
719
720void
721 exaDoMigration_classic(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
722
723void
724 exaPixmapSave(ScreenPtr pScreen, ExaOffscreenArea * area);
725
726void
727 exaMoveOutPixmap_classic(PixmapPtr pPixmap);
728
729void
730 exaMoveInPixmap_classic(PixmapPtr pPixmap);
731
732void
733 exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg);
734
735#endif                          /* EXAPRIV_H */
736