Mesa (staging/20.1): egl/entrypoint-check: add check that GLVND and plain EGL have the same entrypoints

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 8 15:03:12 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: b044f25a570c554813d14d1a26e15dad7d2572d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b044f25a570c554813d14d1a26e15dad7d2572d5

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Fri Apr  3 12:29:04 2020 +0200

egl/entrypoint-check: add check that GLVND and plain EGL have the same entrypoints

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4448>
(cherry picked from commit 800816d70be50b0b04669a016288121e1b11f0c8)

---

 .pick_status.json               |  2 +-
 src/egl/egl-entrypoint-check.py | 42 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 3b2e26d3514..d33cbca8b44 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
         "description": "egl/entrypoint-check: add check that GLVND and plain EGL have the same entrypoints",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/egl/egl-entrypoint-check.py b/src/egl/egl-entrypoint-check.py
index 7cbb8a7708a..332578f44c2 100644
--- a/src/egl/egl-entrypoint-check.py
+++ b/src/egl/egl-entrypoint-check.py
@@ -1,11 +1,22 @@
 #!/usr/bin/env python
 
 import argparse
+from generate.eglFunctionList import EGL_FUNCTIONS as GLVND_ENTRYPOINTS
+
 
 PREFIX = 'EGL_ENTRYPOINT('
 SUFFIX = ')'
 
 
+# These entrypoints should *not* be in the GLVND entrypoints
+GLVND_EXCLUDED_ENTRYPOINTS = [
+        # EGL_KHR_debug
+        'eglDebugMessageControlKHR',
+        'eglQueryDebugKHR',
+        'eglLabelObjectKHR',
+    ]
+
+
 def check_entrypoint_sorted(entrypoints):
     print('Checking that EGL API entrypoints are sorted...')
 
@@ -20,6 +31,33 @@ def check_entrypoint_sorted(entrypoints):
     print('All good :)')
 
 
+def check_glvnd_entrypoints(egl_entrypoints, glvnd_entrypoints):
+    print('Checking the GLVND entrypoints against the plain EGL ones...')
+    success = True
+
+    for egl_entrypoint in egl_entrypoints:
+        if egl_entrypoint in GLVND_EXCLUDED_ENTRYPOINTS:
+            continue
+        if egl_entrypoint not in glvnd_entrypoints:
+            print('ERROR: ' + egl_entrypoint + ' is missing from the GLVND entrypoints (src/egl/generate/eglFunctionList.py)')
+            success = False
+
+    for glvnd_entrypoint in glvnd_entrypoints:
+        if glvnd_entrypoint not in egl_entrypoints:
+            print('ERROR: ' + glvnd_entrypoint + ' is missing from the plain EGL entrypoints (src/egl/main/eglentrypoint.h)')
+            success = False
+
+    for glvnd_entrypoint in GLVND_EXCLUDED_ENTRYPOINTS:
+        if glvnd_entrypoint in glvnd_entrypoints:
+            print('ERROR: ' + glvnd_entrypoint + ' is should *not* be in the GLVND entrypoints (src/egl/generate/eglFunctionList.py)')
+            success = False
+
+    if success:
+        print('All good :)')
+    else:
+        exit(1)
+
+
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument('header')
@@ -37,5 +75,9 @@ def main():
 
     check_entrypoint_sorted(entrypoints)
 
+    glvnd_entrypoints = [x[0] for x in GLVND_ENTRYPOINTS]
+
+    check_glvnd_entrypoints(entrypoints, glvnd_entrypoints)
+
 if __name__ == '__main__':
     main()



More information about the mesa-commit mailing list