summaryrefslogtreecommitdiff
path: root/src/compat-api.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-09 19:15:20 +0000
committerroot <root@ivybridge.(none)>2013-02-10 10:24:12 +0000
commit3cbdfb54d1fcfed7745111e861e19b7bbac243cc (patch)
treec355f97cca41d34d66f1097b586198cc492a43c2 /src/compat-api.h
parent42a6b25817985e22e7d462be87fbd97973d96a29 (diff)
downloadxorg-driver-xf86-video-intel-3cbdfb54d1fcfed7745111e861e19b7bbac243cc.tar.gz
sna: Backport to squeeze - Xorg-1.6, pixman-0.16, libdrm-2.4.21
The principle change is to switch to the old Privates API and undo the Region renames. The downside is that this ignores the critical bugfixes made to the xserver since xorg-1.6 - but I assume that whoever wants to run the latest hardware on the old xservers is also backporting those stability fixes... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/compat-api.h')
-rw-r--r--src/compat-api.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/compat-api.h b/src/compat-api.h
index 6b765724..2a912e5d 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -28,6 +28,8 @@
#ifndef COMPAT_API_H
#define COMPAT_API_H
+#include <xorgVersion.h>
+
#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
@@ -103,4 +105,54 @@
#endif
+#ifndef INCLUDE_LEGACY_REGION_DEFINES
+#define RegionCreate(r, s) REGION_CREATE(NULL, r, s)
+#define RegionBreak(r) REGION_BREAK(NULL, r)
+#define RegionSizeof REGION_SZOF
+#define RegionBoxptr REGION_BOXPTR
+#define RegionEnd REGION_END
+#define RegionExtents(r) REGION_EXTENTS(NULL, r)
+#define RegionRects REGION_RECTS
+#define RegionNumRects REGION_NUM_RECTS
+#define RegionContainsRect(r, b) RECT_IN_REGION(NULL, r, b)
+#define RegionContainsPoint(r, x, y, b) POINT_IN_REGION(NULL, r, x, y, b)
+#define RegionCopy(res, r) REGION_COPY(NULL, res, r)
+#define RegionIntersect(res, r1, r2) REGION_INTERSECT(NULL, res, r1, r2)
+#define RegionUnion(res, r1, r2) REGION_UNION(NULL, res, r1, r2)
+#define RegionTranslate(r, x, y) REGION_TRANSLATE(NULL, r, x, y)
+#define RegionUninit(r) REGION_UNINIT(NULL, r)
+#define region_from_bitmap BITMAP_TO_REGION
+#define RegionNil REGION_NIL
+#define RegionNull(r) REGION_NULL(NULL, r)
+#define RegionNotEmpty(r) REGION_NOTEMPTY(NULL, r)
+#define RegionEmpty(r) REGION_EMPTY(NULL, r)
+#define RegionDestroy(r) REGION_DESTROY(NULL, r)
+#else
+#define region_from_bitmap BitmapToRegion
+#endif
+
+#ifndef _X_UNUSED
+#define _X_UNUSED
+#endif
+
+#if HAS_DEVPRIVATEKEYREC
+#define __get_private(p, key) dixGetPrivateAddr(&(p)->devPrivates, &(key))
+#else
+#define __get_private(p, key) dixLookupPrivate(&(p)->devPrivates, &(key))
+typedef int DevPrivateKeyRec;
+static inline void FreePixmap(PixmapPtr pixmap)
+{
+ dixFreePrivates(pixmap->devPrivates);
+ free(pixmap);
+}
+#endif
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,902,0)
+#define SourceValidate(d, x, y, w, h, mode) \
+ if ((d)->pScreen->SourceValidate) (d)->pScreen->SourceValidate(d, x, y, w, h, mode)
+#else
+#define SourceValidate(d, x, y, w, h, mode) \
+ if ((d)->pScreen->SourceValidate) (d)->pScreen->SourceValidate(d, x, y, w, h)
+#endif
+
#endif