[cogl/cogl-1.12] kms: Fix the version check for GBM
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.12] kms: Fix the version check for GBM
- Date: Thu, 6 Sep 2012 17:32:00 +0000 (UTC)
commit 27d74f09df9035367908492257d6782725ed968f
Author: Neil Roberts <neil linux intel com>
Date: Thu Sep 6 17:33:20 2012 +0100
kms: Fix the version check for GBM
The check for whether to use âstrideâ instead of âpitchâ from the GBM
API tries to check whether the GBM version is >= 8.1.0. However it was
comparing the major and micro components independently so any version
with the minor part set to 0 would fail. The GBM version in Mesa
master is now 9.0.0 which breaks it. This patch changes it to check
the version using the COGL_VERSION_ENCODE macro instead.
Reviewed-by: Robert Bragg <robert linux intel com>
(cherry picked from commit 38f1dc58b35023f9e6bbc0db746b1554bd0377fc)
cogl/winsys/cogl-winsys-egl-kms.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
index 4a9f51a..e1d098e 100644
--- a/cogl/winsys/cogl-winsys-egl-kms.c
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -51,6 +51,7 @@
#include "cogl-onscreen-private.h"
#include "cogl-kms-renderer.h"
#include "cogl-kms-display.h"
+#include "cogl-version.h"
static const CoglWinsysEGLVtable _cogl_winsys_egl_vtable;
@@ -676,7 +677,8 @@ _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);
-#if COGL_GBM_MAJOR >= 8 && COGL_GBM_MINOR >= 1
+#if (COGL_VERSION_ENCODE (COGL_GBM_MAJOR, COGL_GBM_MINOR, COGL_GBM_MICRO) >= \
+ COGL_VERSION_ENCODE (8, 1, 0))
stride = gbm_bo_get_stride (kms_onscreen->next_bo);
#else
stride = gbm_bo_get_pitch (kms_onscreen->next_bo);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]