build: add build-time check for gbm_bo_get_stride()

Upstream mesa renamed gbm_bo_get_pitch() to gbm_bo_get_stride(). As gbm
has not seen an official release, they actually don't care but several
users complained about this. Therefore, we simply add a build-time check
for this. However, this may break when mesa is updated without recompiling
kmscon but that is less intrusive.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-08-21 14:38:30 +02:00
parent 585879281f
commit 7ad970c1f4
2 changed files with 6 additions and 0 deletions

View File

@ -362,6 +362,8 @@ AM_CONDITIONAL([UTERM_HAVE_DUMB], [test x$dumb_enabled = xyes])
AM_CONDITIONAL([UTERM_HAVE_DRM], [test x$drm_enabled = xyes])
AM_CONDITIONAL([KMSCON_HAVE_GLES2], [test x$gles2_enabled = xyes])
AC_CHECK_DECLS([gbm_bo_get_stride], [], [], [[#include <gbm.h>]])
#
# xkbcommon keyboard backend
# This checks for the xkbcommon library for keyboard handling in uterm. If it is

View File

@ -83,7 +83,11 @@ static int init_rb(struct uterm_display *disp, struct drm_rb *rb)
return -EFAULT;
}
#if defined(HAVE_DECL_GBM_BO_GET_STRIDE) && HAVE_DECL_GBM_BO_GET_STRIDE
stride = gbm_bo_get_stride(rb->bo);
#else
stride = gbm_bo_get_pitch(rb->bo);
#endif
handle = gbm_bo_get_handle(rb->bo).u32;
/* TODO: how can we choose 24/32 dynamically? */