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