From fe4a4b6836252cc8caa642a32fb3910c8590076b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 24 Apr 2015 09:52:04 +0900 Subject: Fix build when gbm.h doesn't define GBM_BO_USE_LINEAR Option "AccelMethod" "none" is ignored in that case. Reviewed-by: Alex Deucher --- src/amdgpu_bo_helper.c | 2 ++ src/amdgpu_kms.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c index 10f5856..fa87783 100644 --- a/src/amdgpu_bo_helper.c +++ b/src/amdgpu_bo_helper.c @@ -81,9 +81,11 @@ struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width, } #endif +#ifdef GBM_BO_USE_LINEAR if (usage_hint & AMDGPU_CREATE_PIXMAP_LINEAR) { bo_use |= GBM_BO_USE_LINEAR; } +#endif pixmap_buffer->bo.gbm = gbm_bo_create(info->gbm, width, height, gbm_format, diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 798db5c..a9fb997 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -332,16 +332,18 @@ static Bool AMDGPUPreInitWeight(ScrnInfoPtr pScrn) static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn) { AMDGPUInfoPtr info = AMDGPUPTR(pScrn); - const char *accel_method; if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, info->ChipFamily == CHIP_FAMILY_HAWAII) && AMDGPUIsAccelWorking(pScrn)) { Bool use_glamor = TRUE; +#ifdef GBM_BO_USE_LINEAR + const char *accel_method; accel_method = xf86GetOptValString(info->Options, OPTION_ACCEL_METHOD); if ((accel_method && !strcmp(accel_method, "none"))) use_glamor = FALSE; +#endif #ifdef DRI2 info->dri2.available = ! !xf86LoadSubModule(pScrn, "dri2"); -- cgit v1.2.3