summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/amdgpu_drv.h19
2 files changed, 25 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 11dc285..00249a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,6 +152,12 @@ else
fi
AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
+AC_CHECK_DECL(RegionDuplicate,
+ [AC_DEFINE(HAVE_REGIONDUPLICATE, 1,
+ [Have RegionDuplicate API])], [],
+ [#include <xorg-server.h>
+ #include <regionstr.h>])
+
AC_CHECK_DECL(fbGlyphs,
[AC_DEFINE(HAVE_FBGLYPHS, 1, [Have fbGlyphs API])], [],
[#include <X11/Xmd.h>
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index ae5b6f9..0700dae 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -89,6 +89,25 @@
struct _SyncFence;
+#ifndef HAVE_REGIONDUPLICATE
+
+static inline RegionPtr
+RegionDuplicate(RegionPtr pOld)
+{
+ RegionPtr pNew;
+
+ pNew = RegionCreate(&pOld->extents, 0);
+ if (!pNew)
+ return NULL;
+ if (!RegionCopy(pNew, pOld)) {
+ RegionDestroy(pNew);
+ return NULL;
+ }
+ return pNew;
+}
+
+#endif
+
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif