3
* Copyright ļæ½ 1999 Keith Packard
5
* Permission to use, copy, modify, distribute, and sell this software and its
6
* documentation for any purpose is hereby granted without fee, provided that
7
* the above copyright notice appear in all copies and that both that
8
* copyright notice and this permission notice appear in supporting
9
* documentation, and that the name of Keith Packard not be used in
10
* advertising or publicity pertaining to distribution of the software without
11
* specific, written prior permission. Keith Packard makes no
12
* representations about the suitability of this software for any purpose. It
13
* is provided "as is" without express or implied warranty.
15
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
* PERFORMANCE OF THIS SOFTWARE.
27
* These functions wrap the low-level fb rendering functions and
28
* synchronize framebuffer/accelerated drawing by stalling until
29
* the accelerator is idle
33
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
34
DDXPointPtr ppt, int *pwidth, int fSorted)
36
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
37
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
38
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
39
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
43
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
44
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
46
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
47
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
48
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
49
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
53
ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
54
int x, int y, int w, int h, int leftPad, int format,
57
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
58
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
59
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
60
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
64
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
65
int srcx, int srcy, int w, int h, int dstx, int dsty)
69
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrc, (long)pDst));
70
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
71
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
72
ret = fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
73
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
74
exaFinishAccess (pDst, EXA_PREPARE_DEST);
80
ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
81
int srcx, int srcy, int w, int h, int dstx, int dsty,
82
unsigned long bitPlane)
86
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pSrc, (long)pDst));
87
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
88
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
89
ret = fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
91
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
92
exaFinishAccess (pDst, EXA_PREPARE_DEST);
98
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
101
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
102
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
103
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
104
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
108
ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
109
int mode, int npt, DDXPointPtr ppt)
111
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
113
if (pGC->lineWidth == 0) {
114
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
115
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
116
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
119
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
123
ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
124
int nsegInit, xSegment *pSegInit)
126
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
127
if (pGC->lineWidth == 0) {
128
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
129
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
130
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
133
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
137
ExaCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC,
138
int nrects, xRectangle *prect)
140
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
141
if (pGC->lineWidth == 0) {
142
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
143
fbPolyRectangle (pDrawable, pGC, nrects, prect);
144
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
147
fbPolyRectangle (pDrawable, pGC, nrects, prect);
151
ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
152
int narcs, xArc *pArcs)
154
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
155
if (pGC->lineWidth == 0)
157
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
158
fbPolyArc (pDrawable, pGC, narcs, pArcs);
159
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
162
miPolyArc (pDrawable, pGC, narcs, pArcs);
167
ExaCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
168
int shape, int mode, int count, DDXPointPtr pPts)
170
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
171
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
172
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
173
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
178
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
179
int nrect, xRectangle *prect)
181
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
182
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
183
fbPolyFillRect (pDrawable, pGC, nrect, prect);
184
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
188
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
189
int narcs, xArc *pArcs)
191
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
192
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
193
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
194
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
198
ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
199
int x, int y, unsigned int nglyph,
200
CharInfoPtr *ppci, pointer pglyphBase)
202
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
203
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
204
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
205
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
209
ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
210
int x, int y, unsigned int nglyph,
211
CharInfoPtr *ppci, pointer pglyphBase)
213
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
214
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
215
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
216
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
220
ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
221
DrawablePtr pDrawable,
222
int w, int h, int x, int y)
224
EXA_FALLBACK(("from 0x%lx to 0x%lx\n", (long)pBitmap, (long)pDrawable));
225
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
226
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
227
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
231
ExaCheckGetImage (DrawablePtr pDrawable,
232
int x, int y, int w, int h,
233
unsigned int format, unsigned long planeMask,
236
EXA_FALLBACK(("from 0x%lx\n", (long)pDrawable));
237
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
238
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
239
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
243
ExaCheckGetSpans (DrawablePtr pDrawable,
250
EXA_FALLBACK(("from 0x%lx\n", (long)pDrawable));
251
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
252
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
253
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
257
ExaCheckSaveAreas (PixmapPtr pPixmap,
263
EXA_FALLBACK(("from 0x%lx\n", (long)&pPixmap->drawable));
264
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
265
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
266
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
270
ExaCheckRestoreAreas (PixmapPtr pPixmap,
276
EXA_FALLBACK(("to 0x%lx\n", (long)&pPixmap->drawable));
277
exaPrepareAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
278
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
279
exaFinishAccess ((DrawablePtr)pPixmap, EXA_PREPARE_DEST);
283
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
285
EXA_FALLBACK(("from 0x%lx\n", (long)pWin));
286
exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST);
287
fbPaintWindow (pWin, pRegion, what);
288
exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST);
292
ExaCheckComposite (CARD8 op,
305
EXA_FALLBACK(("from picts 0x%lx/0x%lx to pict 0x%lx\n",
306
(long)pSrc, (long)pMask, (long)pDst));
307
exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
308
exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
310
exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK);
324
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
325
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
326
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
330
* Only need to stall for CopyArea/CopyPlane, but we want to have the chance to
331
* do migration for CopyArea.
333
const GCOps exaAsyncPixmapGCOps = {
342
ExaCheckPolyRectangle,
345
ExaCheckPolyFillRect,
351
ExaCheckImageGlyphBlt,
352
ExaCheckPolyGlyphBlt,
354
#ifdef NEED_LINEHELPER