VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/exa_priv.h@ 37801

最後變更 在這個檔案從37801是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

  • 屬性 svn:eol-style 設為 native
檔案大小: 10.9 KB
 
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#define NEED_EVENTS
37#include <X11/Xproto.h>
38#include "scrnintstr.h"
39#include "pixmapstr.h"
40#include "windowstr.h"
41#include "servermd.h"
42#include "mibstore.h"
43#include "colormapst.h"
44#include "gcstruct.h"
45#include "input.h"
46#include "mipointer.h"
47#include "mi.h"
48#include "dix.h"
49#include "fb.h"
50#include "fboverlay.h"
51#ifdef RENDER
52#include "fbpict.h"
53#endif
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
61#if DEBUG_TRACE_FALL
62#define EXA_FALLBACK(x) \
63do { \
64 ErrorF("EXA fallback at %s: ", __FUNCTION__); \
65 ErrorF x; \
66} while (0)
67
68char
69exaDrawableLocation(DrawablePtr pDrawable);
70#else
71#define EXA_FALLBACK(x)
72#endif
73
74#if DEBUG_PIXMAP
75#define DBG_PIXMAP(a) ErrorF a
76#else
77#define DBG_PIXMAP(a)
78#endif
79
80#ifndef EXA_MAX_FB
81#define EXA_MAX_FB FB_OVERLAY_MAX
82#endif
83
84/**
85 * This is the list of migration heuristics supported by EXA. See
86 * exaDoMigration() for what their implementations do.
87 */
88enum ExaMigrationHeuristic {
89 ExaMigrationGreedy,
90 ExaMigrationAlways,
91 ExaMigrationSmart
92};
93
94typedef void (*EnableDisableFBAccessProcPtr)(int, Bool);
95typedef struct {
96 ExaDriverPtr info;
97 CreateGCProcPtr SavedCreateGC;
98 CloseScreenProcPtr SavedCloseScreen;
99 GetImageProcPtr SavedGetImage;
100 GetSpansProcPtr SavedGetSpans;
101 PaintWindowBackgroundProcPtr SavedPaintWindowBackground;
102 CreatePixmapProcPtr SavedCreatePixmap;
103 DestroyPixmapProcPtr SavedDestroyPixmap;
104 PaintWindowBorderProcPtr SavedPaintWindowBorder;
105 CopyWindowProcPtr SavedCopyWindow;
106#ifdef RENDER
107 CompositeProcPtr SavedComposite;
108 RasterizeTrapezoidProcPtr SavedRasterizeTrapezoid;
109 AddTrianglesProcPtr SavedAddTriangles;
110 GlyphsProcPtr SavedGlyphs;
111#endif
112 Bool swappedOut;
113 enum ExaMigrationHeuristic migration;
114 Bool hideOffscreenPixmapData;
115 Bool checkDirtyCorrectness;
116} ExaScreenPrivRec, *ExaScreenPrivPtr;
117
118/*
119 * This is the only completely portable way to
120 * compute this info.
121 */
122#ifndef BitsPerPixel
123#define BitsPerPixel(d) (\
124 PixmapWidthPaddingInfo[d].notPower2 ? \
125 (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \
126 ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
127 (PixmapWidthPaddingInfo[d].padRoundUp+1)))
128#endif
129
130extern int exaScreenPrivateIndex;
131extern int exaPixmapPrivateIndex;
132#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)(s)->devPrivates[exaScreenPrivateIndex].ptr)
133#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
134
135/** Align an offset to an arbitrary alignment */
136#define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \
137 (((offset) + (align) - 1) % (align)))
138/** Align an offset to a power-of-two alignment */
139#define EXA_ALIGN2(offset, align) (((offset) + (align) - 1) & ~((align) - 1))
140
141#define EXA_PIXMAP_SCORE_MOVE_IN 10
142#define EXA_PIXMAP_SCORE_MAX 20
143#define EXA_PIXMAP_SCORE_MOVE_OUT -10
144#define EXA_PIXMAP_SCORE_MIN -20
145#define EXA_PIXMAP_SCORE_PINNED 1000
146#define EXA_PIXMAP_SCORE_INIT 1001
147
148#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)(p)->devPrivates[exaPixmapPrivateIndex].ptr)
149#define ExaSetPixmapPriv(p,a) ((p)->devPrivates[exaPixmapPrivateIndex].ptr = (pointer) (a))
150#define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
151
152typedef struct {
153 ExaOffscreenArea *area;
154 int score; /**< score for the move-in vs move-out heuristic */
155
156 CARD8 *sys_ptr; /**< pointer to pixmap data in system memory */
157 int sys_pitch; /**< pitch of pixmap in system memory */
158
159 CARD8 *fb_ptr; /**< pointer to pixmap data in framebuffer memory */
160 int fb_pitch; /**< pitch of pixmap in framebuffer memory */
161 unsigned int fb_size; /**< size of pixmap in framebuffer memory */
162
163 /**
164 * The damage record contains the areas of the pixmap's current location
165 * (framebuffer or system) that have been damaged compared to the other
166 * location.
167 */
168 DamagePtr pDamage;
169 /**
170 * The valid region marks the valid bits of a drawable (at least, as it's
171 * derived from damage, which may be overreported).
172 */
173 RegionRec validReg;
174} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
175
176typedef struct _ExaMigrationRec {
177 Bool as_dst;
178 Bool as_src;
179 PixmapPtr pPix;
180} ExaMigrationRec, *ExaMigrationPtr;
181
182/**
183 * exaDDXDriverInit must be implemented by the DDX using EXA, and is the place
184 * to set EXA options or hook in screen functions to handle using EXA as the AA.
185 */
186void exaDDXDriverInit (ScreenPtr pScreen);
187
188/* exa_unaccel.c */
189void
190exaPrepareAccessGC(GCPtr pGC);
191
192void
193exaFinishAccessGC(GCPtr pGC);
194
195void
196ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
197 DDXPointPtr ppt, int *pwidth, int fSorted);
198
199void
200ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
201 DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
202
203void
204ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
205 int x, int y, int w, int h, int leftPad, int format,
206 char *bits);
207
208RegionPtr
209ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
210 int srcx, int srcy, int w, int h, int dstx, int dsty);
211
212RegionPtr
213ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
214 int srcx, int srcy, int w, int h, int dstx, int dsty,
215 unsigned long bitPlane);
216
217void
218ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
219 DDXPointPtr pptInit);
220
221void
222ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
223 int mode, int npt, DDXPointPtr ppt);
224
225void
226ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
227 int nsegInit, xSegment *pSegInit);
228
229void
230ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
231 int narcs, xArc *pArcs);
232
233void
234ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
235 int nrect, xRectangle *prect);
236
237void
238ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
239 int x, int y, unsigned int nglyph,
240 CharInfoPtr *ppci, pointer pglyphBase);
241
242void
243ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
244 int x, int y, unsigned int nglyph,
245 CharInfoPtr *ppci, pointer pglyphBase);
246
247void
248ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
249 DrawablePtr pDrawable,
250 int w, int h, int x, int y);
251
252void
253ExaCheckGetImage (DrawablePtr pDrawable,
254 int x, int y, int w, int h,
255 unsigned int format, unsigned long planeMask,
256 char *d);
257
258void
259ExaCheckGetSpans (DrawablePtr pDrawable,
260 int wMax,
261 DDXPointPtr ppt,
262 int *pwidth,
263 int nspans,
264 char *pdstStart);
265
266void
267ExaCheckSaveAreas (PixmapPtr pPixmap,
268 RegionPtr prgnSave,
269 int xorg,
270 int yorg,
271 WindowPtr pWin);
272
273void
274ExaCheckRestoreAreas (PixmapPtr pPixmap,
275 RegionPtr prgnSave,
276 int xorg,
277 int yorg,
278 WindowPtr pWin);
279
280void
281ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what);
282
283CARD32
284exaGetPixmapFirstPixel (PixmapPtr pPixmap);
285
286/* exa_accel.c */
287void
288exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
289
290void
291exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
292
293void
294exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
295 unsigned int format, unsigned long planeMask, char *d);
296
297void
298exaGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth,
299 int nspans, char *pdstStart);
300
301extern const GCOps exaOps;
302
303#ifdef RENDER
304void
305ExaCheckComposite (CARD8 op,
306 PicturePtr pSrc,
307 PicturePtr pMask,
308 PicturePtr pDst,
309 INT16 xSrc,
310 INT16 ySrc,
311 INT16 xMask,
312 INT16 yMask,
313 INT16 xDst,
314 INT16 yDst,
315 CARD16 width,
316 CARD16 height);
317#endif
318
319/* exa_offscreen.c */
320void
321ExaOffscreenMarkUsed (PixmapPtr pPixmap);
322
323void
324ExaOffscreenSwapOut (ScreenPtr pScreen);
325
326void
327ExaOffscreenSwapIn (ScreenPtr pScreen);
328
329Bool
330exaOffscreenInit(ScreenPtr pScreen);
331
332void
333ExaOffscreenFini (ScreenPtr pScreen);
334
335/* exa.c */
336void
337exaPrepareAccess(DrawablePtr pDrawable, int index);
338
339void
340exaFinishAccess(DrawablePtr pDrawable, int index);
341
342void
343exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
344
345void
346exaDrawableDirty(DrawablePtr pDrawable, int x1, int y1, int x2, int y2);
347
348Bool
349exaDrawableIsOffscreen (DrawablePtr pDrawable);
350
351Bool
352exaPixmapIsOffscreen(PixmapPtr p);
353
354PixmapPtr
355exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp);
356
357PixmapPtr
358exaGetDrawablePixmap(DrawablePtr pDrawable);
359
360RegionPtr
361exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
362 int srcx, int srcy, int width, int height, int dstx, int dsty);
363
364void
365exaCopyNtoN (DrawablePtr pSrcDrawable,
366 DrawablePtr pDstDrawable,
367 GCPtr pGC,
368 BoxPtr pbox,
369 int nbox,
370 int dx,
371 int dy,
372 Bool reverse,
373 Bool upsidedown,
374 Pixel bitplane,
375 void *closure);
376
377/* exa_render.c */
378void
379exaComposite(CARD8 op,
380 PicturePtr pSrc,
381 PicturePtr pMask,
382 PicturePtr pDst,
383 INT16 xSrc,
384 INT16 ySrc,
385 INT16 xMask,
386 INT16 yMask,
387 INT16 xDst,
388 INT16 yDst,
389 CARD16 width,
390 CARD16 height);
391
392void
393exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
394 int x_off, int y_off);
395
396void
397exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
398 xTriangle *tris);
399
400void
401exaGlyphs (CARD8 op,
402 PicturePtr pSrc,
403 PicturePtr pDst,
404 PictFormatPtr maskFormat,
405 INT16 xSrc,
406 INT16 ySrc,
407 int nlist,
408 GlyphListPtr list,
409 GlyphPtr *glyphs);
410
411/* exa_migration.c */
412void
413exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
414
415void
416exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area);
417
418#endif /* EXAPRIV_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette