summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-03-06 18:09:58 +0900
committerMichel Dänzer <michel@daenzer.net>2017-03-07 16:56:24 +0900
commit8d2b7d1758e3fcac520a18a0684c073f0ac62389 (patch)
treeff613feb27363b9efe2db62a6beb5f37735c501d /src
parentcd73100114a18642d9c40f1df33cef8311e96a8b (diff)
Use local implementation of RegionDuplicate for older xserver
It was only added in xserver 1.15. Fixes build against older xserver. Reported-by: Pali Rohár <pali.rohar@gmail.com> (Ported from radeon commit 80cc892ee1ce54fad3cb7dd11bd9df18c359136f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h19
1 files changed, 19 insertions, 0 deletions
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