summaryrefslogtreecommitdiff
path: root/cogl/winsys/cogl-winsys-egl-kms.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-09-06 17:33:20 +0100
committerNeil Roberts <neil@linux.intel.com>2012-09-06 18:30:30 +0100
commit27d74f09df9035367908492257d6782725ed968f (patch)
tree25927807099ec28842854931b9f1faf6425838fa /cogl/winsys/cogl-winsys-egl-kms.c
parent023528d94e4eac02b3c09ab7d2d065d95cc14b9a (diff)
downloadcogl-27d74f09df9035367908492257d6782725ed968f.tar.gz
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)
Diffstat (limited to 'cogl/winsys/cogl-winsys-egl-kms.c')
-rw-r--r--cogl/winsys/cogl-winsys-egl-kms.c4
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 4a9f51ac..e1d098e7 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);