From: Quanyang Wang <[email protected]>

The mesa-demos-8.4.0 uses the EGL_PLATFORM_* macros and these macros are
declared in the eglext.h which version is higher than 24567 because of
commit 38848b621737 ("egl: Update to revision 24567 of eglext.h") in
https://gitlab.freedesktop.org/mesa/mesa.git.

But the version of eglext.h which provided by libmali-xlnx is 21116 and
no EGL_PLATFORM_* definition there. So revert the 2 commits
7a0f0310a9b5 ("eglinfo: Add EXT_platform_* awareness") and
164487d7b3a0 ("eglinfo: Learn about EGL_EXT_platform_device") to make
eglinfo.c fall back to older version.

This is to fix the build error as below when bitbake mesa-demos.

| ../../../../mesa-demos-8.4.0/src/egl/opengl/eglinfo.c: In function 'main':
| ../../../../mesa-demos-8.4.0/src/egl/opengl/eglinfo.c:224:51: error: 
'EGL_PLATFORM_GBM_MESA' undeclared (first use in this function); did you mean 
'EGL_PLATFORM_GBM_KHR'?
|   224 |            ret += 
doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_MESA,
|       |                                                   
^~~~~~~~~~~~~~~~~~~~~
|       |                                                   EGL_PLATFORM_GBM_KHR
| ../../../../mesa-demos-8.4.0/src/egl/opengl/eglinfo.c:224:51: note: each 
undeclared identifier is reported only once for each function it appears in
| ../../../../mesa-demos-8.4.0/src/egl/opengl/eglinfo.c:229:51: error: 
'EGL_PLATFORM_WAYLAND_EXT' undeclared (first use in this function); did you 
mean 'EGL_PLATFORM_WAYLAND_KHR'?
|   229 |            ret += 
doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT,
|       |                                                   
^~~~~~~~~~~~~~~~~~~~~~~~
|       |                                                   
EGL_PLATFORM_WAYLAND_KHR
| ../../../../mesa-demos-8.4.0/src/egl/opengl/eglinfo.c:234:51: error: 
'EGL_PLATFORM_X11_EXT' undeclared (first use in this function); did you mean 
'EGL_PLATFORM_X11_KHR'?
|   234 |            ret += 
doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_EXT,
|       |                                                   ^~~~~~~~~~~~~~~~~~~~
|       |                                                   EGL_PLATFORM_X11_KHR
| ../../../../mesa-demos-8.4.0/src/egl/opengl/eglinfo.c:238:51: error: 
'EGL_PLATFORM_DEVICE_EXT' undeclared (first use in this function)
|   238 |            ret += 
doOneDisplay(getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT,
|       |                                                   
^~~~~~~~~~~~~~~~~~~~~~~
| Makefile:595: recipe for target 'eglinfo.o' failed

Signed-off-by: Quanyang Wang <[email protected]>
---
 ...-eglinfo-Add-EXT_platform_-awareness.patch | 109 ++++++++++++++++++
 .../mesa/mesa-demos_%.bbappend                |   2 +
 2 files changed, 111 insertions(+)
 create mode 100644 
meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos/0001-Revert-eglinfo-Add-EXT_platform_-awareness.patch
 create mode 100644 meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos_%.bbappend

diff --git 
a/meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos/0001-Revert-eglinfo-Add-EXT_platform_-awareness.patch
 
b/meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos/0001-Revert-eglinfo-Add-EXT_platform_-awareness.patch
new file mode 100644
index 0000000..3a85221
--- /dev/null
+++ 
b/meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos/0001-Revert-eglinfo-Add-EXT_platform_-awareness.patch
@@ -0,0 +1,109 @@
+From 1d1443a6fec30fd8ebc75fd7371b4ac99a4a41ca Mon Sep 17 00:00:00 2001
+From: Quanyang Wang <[email protected]>
+Date: Fri, 17 Jul 2020 14:49:20 +0800
+Subject: [PATCH] Revert "eglinfo: Add EXT_platform_* awareness"
+
+This reverts commit 7a0f0310a9b5 ("eglinfo: Add EXT_platform_* awareness")
+and 164487d7b3a0 ("eglinfo: Learn about EGL_EXT_platform_device").
+
+Since these 2 patches depend on the eglext.h of version 24567, but
+libmali-xlnx can only provide the eglext.h of version 21116, so revert
+them to fix build error.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Quanyang Wang <[email protected]>
+---
+ src/egl/opengl/eglinfo.c | 41 ++++++----------------------------------
+ 1 file changed, 6 insertions(+), 35 deletions(-)
+
+diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
+index f7da372b..0124c37c 100644
+--- a/src/egl/opengl/eglinfo.c
++++ b/src/egl/opengl/eglinfo.c
+@@ -115,7 +115,7 @@ PrintConfigs(EGLDisplay d)
+ }
+ 
+ 
+-static const char *
++static void
+ PrintExtensions(EGLDisplay d)
+ {
+    const char *extensions, *p, *end, *next;
+@@ -126,7 +126,7 @@ PrintExtensions(EGLDisplay d)
+ 
+    extensions = eglQueryString(d, EGL_EXTENSIONS);
+    if (!extensions)
+-      return NULL;
++      return;
+ 
+    column = 0;
+    end = extensions + strlen(extensions);
+@@ -153,8 +153,6 @@ PrintExtensions(EGLDisplay d)
+ 
+    if (column > 0)
+       printf("\n");
+-
+-   return extensions;
+ }
+ 
+ static int
+@@ -164,7 +162,7 @@ doOneDisplay(EGLDisplay d, const char *name)
+ 
+    printf("%s:\n", name);
+    if (!eglInitialize(d, &maj, &min)) {
+-      printf("eglinfo: eglInitialize failed\n\n");
++      printf("eglinfo: eglInitialize failed\n");
+       return 1;
+    }
+ 
+@@ -186,43 +184,12 @@ doOneDisplay(EGLDisplay d, const char *name)
+ int
+ main(int argc, char *argv[])
+ {
+-   int ret = 0;
+-   const char *clientext;
++   int ret;
+ 
+-   clientext = PrintExtensions(EGL_NO_DISPLAY);
++   PrintExtensions(EGL_NO_DISPLAY);
+    printf("\n");
+ 
+-   if (strstr(clientext, "EGL_EXT_platform_base")) {
+-       PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay =
+-           (PFNEGLGETPLATFORMDISPLAYEXTPROC)
+-           eglGetProcAddress("eglGetPlatformDisplayEXT");
+-       if (strstr(clientext, "EGL_KHR_platform_android"))
+-           ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_ANDROID_KHR,
+-                                                  EGL_DEFAULT_DISPLAY,
+-                                                  NULL), "Android platform");
+-       if (strstr(clientext, "EGL_MESA_platform_gbm") ||
+-           strstr(clientext, "EGL_KHR_platform_gbm"))
+-           ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_MESA,
+-                                                  EGL_DEFAULT_DISPLAY,
+-                                                  NULL), "GBM platform");
+-       if (strstr(clientext, "EGL_EXT_platform_wayland") ||
+-           strstr(clientext, "EGL_KHR_platform_wayland"))
+-           ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT,
+-                                                  EGL_DEFAULT_DISPLAY,
+-                                                  NULL), "Wayland platform");
+-       if (strstr(clientext, "EGL_EXT_platform_x11") ||
+-           strstr(clientext, "EGL_KHR_platform_x11"))
+-           ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_EXT,
+-                                                  EGL_DEFAULT_DISPLAY,
+-                                                  NULL), "X11 platform");
+-       if (strstr(clientext, "EGL_EXT_platform_device"))
+-           ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT,
+-                                                  EGL_DEFAULT_DISPLAY,
+-                                                  NULL), "Device platform");
+-   }
+-   else {
+-      ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default 
display");
+-   }
++   ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default display");
+ 
+    return ret;
+ }
+-- 
+2.17.1
+
diff --git a/meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos_%.bbappend 
b/meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos_%.bbappend
new file mode 100644
index 0000000..45cf91a
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-graphics/mesa/mesa-demos_%.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/mesa-demos:"
+SRC_URI_append_zynqmp = 
"file://0001-Revert-eglinfo-Add-EXT_platform_-awareness.patch"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#4723): 
https://lists.yoctoproject.org/g/meta-xilinx/message/4723
Mute This Topic: https://lists.yoctoproject.org/mt/75629095/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to