[PATCH xf86-video-ati] Use local implementation of RegionDuplicate for older xserver

Deucher, Alexander Alexander.Deucher at amd.com
Tue Sep 20 16:11:58 UTC 2016


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Tuesday, September 20, 2016 5:04 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Pali Rohár
> Subject: [PATCH xf86-video-ati] Use local implementation of RegionDuplicate
> for older xserver
> 
> From: Michel Dänzer <michel.daenzer at amd.com>
> 
> It was only added in xserver 1.15. Fixes build against older xserver.
> 
> Reported-by: Pali Rohár <pali.rohar at gmail.com>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  configure.ac |  6 ++++++
>  src/radeon.h | 19 +++++++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 394f45a..8dc55d8 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -137,6 +137,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/radeon.h b/src/radeon.h
> index f3a3e1c..590966f 100644
> --- a/src/radeon.h
> +++ b/src/radeon.h
> @@ -96,6 +96,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
> --
> 2.9.3
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list