[PATCH xf86-video-amdgpu] Check GBM_BO_USE_LINEAR correctly v2

Jammy Zhou Jammy.Zhou at amd.com
Fri May 29 09:31:44 PDT 2015


v2: remove the check for gbm.h

Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
---
 configure.ac           | 5 +++++
 src/amdgpu_bo_helper.c | 2 +-
 src/amdgpu_kms.c       | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index c2411d9..b26eebb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,11 @@ if test "x$have_list_h" = xyes; then
 		   #include "list.h"])
 fi
 
+AC_CHECK_DECL(GBM_BO_USE_LINEAR,
+	      [AC_DEFINE(HAVE_GBM_BO_USE_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [],
+	      [#include <stdlib.h>
+	       #include <gbm.h>])
+
 CPPFLAGS="$SAVE_CPPFLAGS"
 
 PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 1de2a0a..0487b46 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -75,7 +75,7 @@ struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width,
 		if ( bitsPerPixel == pScrn->bitsPerPixel)
 			bo_use |= GBM_BO_USE_SCANOUT;
 
-#ifdef GBM_BO_USE_LINEAR
+#ifdef HAVE_GBM_BO_USE_LINEAR
 #ifdef CREATE_PIXMAP_USAGE_SHARED
 		if (usage_hint == CREATE_PIXMAP_USAGE_SHARED) {
 			bo_use |= GBM_BO_USE_LINEAR;
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index d66f050..16a7449 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -323,7 +323,7 @@ static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn)
 
 	if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, false)) {
 		Bool use_glamor = TRUE;
-#ifdef GBM_BO_USE_LINEAR
+#ifdef HAVE_GBM_BO_USE_LINEAR
 		const char *accel_method;
 
 		accel_method = xf86GetOptValString(info->Options, OPTION_ACCEL_METHOD);
-- 
1.9.1



More information about the xorg-driver-ati mailing list