build: inverse get_pitch/stride logic

We should use get_stride() if this check fails as this is the new
function. We use this check only for backwards-compatibility reasons but
should not require it to pass for new builds.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann committed 2012-10-08 17:36:36 +02:00
1 parent 4ed3e08dfe
commit b2dd933cff
2 files changed
+7 -7

No files matched your search

+4 -4
View File
@@ -474,7 +474,7 @@ AM_CONDITIONAL([BUILD_ENABLE_DUMB], [test x$dumb_enabled = xyes])
AM_CONDITIONAL([BUILD_ENABLE_DRM], [test x$drm_enabled = xyes])
AM_CONDITIONAL([BUILD_ENABLE_GLES2], [test x$gles2_enabled = xyes])
# check for gbm_bo_get_stride() function, otherwise gbm_bo_get_pitch() is used
# check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
if test x$have_gbm = xyes ; then
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
@@ -483,10 +483,10 @@ if test x$have_gbm = xyes ; then
LIBS="$DRM_LIBS $GBM_LIBS"
LDFLAGS=""
AC_CHECK_LIB([gbm],
[gbm_bo_get_stride],
[AC_DEFINE([BUILD_HAVE_GBM_BO_GET_STRIDE],
[gbm_bo_get_pitch],
[AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
[1],
[Define to 1 if your libgbm provides gbm_bo_get_stride])])
[Define to 1 if your libgbm provides gbm_bo_get_pitch])])
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
+3 -3
View File
@@ -82,10 +82,10 @@ static int init_rb(struct uterm_display *disp, struct drm_rb *rb)
return -EFAULT;
}
#ifdef BUILD_HAVE_GBM_BO_GET_STRIDE
stride = gbm_bo_get_stride(rb->bo);
#else
#ifdef BUILD_HAVE_GBM_BO_GET_PITCH
stride = gbm_bo_get_pitch(rb->bo);
#else
stride = gbm_bo_get_stride(rb->bo);
#endif
handle = gbm_bo_get_handle(rb->bo).u32;