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