diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2017-03-06 18:09:58 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2017-03-07 16:56:24 +0900 |
commit | 8d2b7d1758e3fcac520a18a0684c073f0ac62389 (patch) | |
tree | ff613feb27363b9efe2db62a6beb5f37735c501d /src | |
parent | cd73100114a18642d9c40f1df33cef8311e96a8b (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.h | 19 |
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 |