[cogl/cogl-1.12] kms: Update to latest gbm api
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.12] kms: Update to latest gbm api
- Date: Mon, 3 Sep 2012 18:19:08 +0000 (UTC)
commit 74d749eca470d1ea0d82d7a3e4cfb66f8e41a0c0
Author: Robert Bragg <robert linux intel com>
Date: Tue Aug 7 14:56:45 2012 +0100
kms: Update to latest gbm api
gbm_bo_get_pitch was renamed to gbm_bo_get_stride to be consistent with
how the terms pitch and stride are used throughout mesa. This updates
the Cogl backend to use the new gbm_bo_get_stride name.
For compatibility with previous version of libgbm we now explicitly
check the version of libgbm in configure.ac and expose
COGL_GBM_{MAJOR,MINOR,MICRO} defines to the code so we can conditionally
use the older gbm_bo_get_pitch() name with older versions.
Reviewed-by: Neil Roberts <neil linux intel com>
(cherry picked from commit 47c6247095e2f1f8725c4eb08d38c9de15e283cd)
cogl/winsys/cogl-winsys-egl-kms.c | 10 +++++++---
configure.ac | 9 +++++++++
2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
index a4928e8..4a9f51a 100644
--- a/cogl/winsys/cogl-winsys-egl-kms.c
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -662,7 +662,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
CoglRendererKMS *kms_renderer = egl_renderer->platform;
CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
CoglOnscreenKMS *kms_onscreen = egl_onscreen->platform;
- uint32_t handle, pitch;
+ uint32_t handle, stride;
CoglFlipKMS *flip;
GList *l;
@@ -676,7 +676,11 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
/* Now we need to set the CRTC to whatever is the front buffer */
kms_onscreen->next_bo = gbm_surface_lock_front_buffer (kms_onscreen->surface);
- pitch = gbm_bo_get_pitch (kms_onscreen->next_bo);
+#if COGL_GBM_MAJOR >= 8 && COGL_GBM_MINOR >= 1
+ stride = gbm_bo_get_stride (kms_onscreen->next_bo);
+#else
+ stride = gbm_bo_get_pitch (kms_onscreen->next_bo);
+#endif
handle = gbm_bo_get_handle (kms_onscreen->next_bo).u32;
if (drmModeAddFB (kms_renderer->fd,
@@ -684,7 +688,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
kms_display->height,
24, /* depth */
32, /* bpp */
- pitch,
+ stride,
handle,
&kms_onscreen->next_fb_id))
{
diff --git a/configure.ac b/configure.ac
index 78e5312..893cc46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -859,6 +859,15 @@ AS_IF([test "x$enable_kms_egl_platform" = "xyes"],
],
[AC_MSG_ERROR([Unable to locate required kms libraries])])
+ GBM_VERSION=`$PKG_CONFIG --modversion gbm`
+ GBM_MAJOR=`echo $GBM_VERSION | cut -d'.' -f1`
+ GBM_MINOR=`echo $GBM_VERSION | cut -d'.' -f2`
+ GBM_MICRO=`echo $GBM_VERSION | cut -d'.' -f3`
+
+ AC_DEFINE_UNQUOTED([COGL_GBM_MAJOR], [$GBM_MAJOR], [The major version for libgbm])
+ AC_DEFINE_UNQUOTED([COGL_GBM_MINOR], [$GBM_MINOR], [The minor version for libgbm])
+ AC_DEFINE_UNQUOTED([COGL_GBM_MICRO], [$GBM_MICRO], [The micro version for libgbm])
+
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_KMS_SUPPORT"
])
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_KMS,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]