summaryrefslogtreecommitdiff
blob: 8d46edb71b0ffcb9cb707ac28e2a89da47ab8632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Backport required to function properly with >=nvidia-drivers-560,
but no release with this change has been made yet.

https://github.com/NVIDIA/egl-gbm/commit/1352ca845fb78b28e3a097586abee2bcf2dbafb8
From: Kyle Brenneman <kbrenneman@nvidia.com>
Date: Fri, 12 Apr 2024 09:10:23 -0600
Subject: [PATCH] Fix the ABI version check.

The EGL_EXTERNAL_PLATFORM_VERSION_CHECK macro checks whether the given
version is older than EGL_EXTERNAL_PLATFORM_VERSION_MAJOR/MINOR, not
newer.

That's correct for using it in EGL_EXTERNAL_PLATFORM_HAS, since it'll
check whether the build-time version supports a given feature, but it's
wrong for checking the ABI version that the driver reports.

Instead, use EGL_EXTERNAL_PLATFORM_VERSION_CMP.
--- a/src/gbm-platform.c
+++ b/src/gbm-platform.c
@@ -167,5 +167,6 @@
 {
     if (!platform ||
-        !EGL_EXTERNAL_PLATFORM_VERSION_CHECK(major, minor)) {
+        !EGL_EXTERNAL_PLATFORM_VERSION_CMP(major, minor,
+            GBM_EXTERNAL_VERSION_MAJOR, GBM_EXTERNAL_VERSION_MINOR)) {
         return EGL_FALSE;
     }