Skip to content

Commit 04d2e00

Browse files
committed
Brings back checks for older MESA versions.
Reverts commits 6e65547 and 479df8e. These commits caused the build to fail on DragonFlyBSD. mesa-libs 21.3.9 is not by any means ancient, it is only 3 years old and it is still receiving critical bug fixes, and most importantly it is still being used on DragonFlyBSD, also these are relatively small and harmless checks. Signed-off-by: b-aaz <b-aazbsd.proton.me>
1 parent bcf5894 commit 04d2e00

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

configure.ac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ else
125125
fi
126126
AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
127127

128+
AC_CHECK_DECL(GBM_BO_USE_LINEAR,
129+
[AC_DEFINE(HAVE_GBM_BO_USE_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [],
130+
[#include <stdlib.h>
131+
#include <gbm.h>])
132+
133+
AC_CHECK_DECL(GBM_BO_USE_FRONT_RENDERING,
134+
[AC_DEFINE(HAVE_GBM_BO_USE_FRONT_RENDERING, 1, [Have GBM_BO_USE_FRONT_RENDERING])], [],
135+
[#include <stdlib.h>
136+
#include <gbm.h>])
137+
128138
CPPFLAGS="$SAVE_CPPFLAGS"
129139

130140
# Checks for headers/macros for byte swapping

src/amdgpu_bo_helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width,
8282
if (usage_hint & AMDGPU_CREATE_PIXMAP_SCANOUT)
8383
bo_use |= GBM_BO_USE_SCANOUT;
8484

85+
#ifdef HAVE_GBM_BO_USE_FRONT_RENDERING
8586
if (usage_hint & AMDGPU_CREATE_PIXMAP_FRONT)
8687
bo_use |= GBM_BO_USE_FRONT_RENDERING;
88+
#endif
8789

90+
#ifdef HAVE_GBM_BO_USE_LINEAR
8891
if (usage_hint == CREATE_PIXMAP_USAGE_SHARED ||
8992
(usage_hint & AMDGPU_CREATE_PIXMAP_LINEAR)) {
9093
bo_use |= GBM_BO_USE_LINEAR;
9194
}
95+
#endif
9296

9397
pixmap_buffer->bo.gbm = gbm_bo_create(info->gbm, width, height,
9498
gbm_format,

src/amdgpu_kms.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,11 +1316,13 @@ static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn)
13161316
if (xf86ReturnOptValBool(info->Options, OPTION_ACCEL, TRUE)) {
13171317
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
13181318
Bool use_glamor = TRUE;
1319+
#ifdef HAVE_GBM_BO_USE_LINEAR
13191320
const char *accel_method;
13201321

13211322
accel_method = xf86GetOptValString(info->Options, OPTION_ACCEL_METHOD);
13221323
if ((accel_method && !strcmp(accel_method, "none")))
13231324
use_glamor = FALSE;
1325+
#endif
13241326

13251327
#ifdef DRI2
13261328
info->dri2.available = ! !xf86LoadSubModule(pScrn, "dri2");

0 commit comments

Comments
 (0)