diff options
author | Mark Hatle <mark.hatle@amd.com> | 2022-12-13 11:54:20 -0800 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2022-12-16 10:18:32 -0800 |
commit | 29bffb843fdb1da44ffa36920be5743bb46fe0c9 (patch) | |
tree | 010d957202e62041ef329ff0d82c59b9b407ffd7 /meta-xilinx-core/recipes-graphics | |
parent | 0817f31320ffecbe159c97e091d3a3ea9fecb03a (diff) | |
download | meta-xilinx-29bffb843fdb1da44ffa36920be5743bb46fe0c9.tar.gz |
mesa-demos: Move mesa-demos from meta-petalinux
Move mesa-demos work from meta-petalinux, fix libmali integration and remove
the testapps workaround.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-graphics')
4 files changed, 165 insertions, 3 deletions
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch new file mode 100644 index 00000000..fc2108e1 --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 9470d00850e8b622d963d4d9c61ad1e59972310a Mon Sep 17 00:00:00 2001 | ||
2 | From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
3 | Date: Tue, 28 Jan 2020 16:10:54 -0800 | ||
4 | Subject: [PATCH 1/2] src: egl: eglinfo: Align EXT_platform_device extension | ||
5 | macros with khronos | ||
6 | |||
7 | Although the macro definitions are consistent, using the macros name | ||
8 | defined under khronos makes it backward compatible with older eglext.h | ||
9 | |||
10 | Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
11 | upstream-status: Inappropriate [Xilinx specific] | ||
12 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
13 | --- | ||
14 | src/egl/opengl/eglinfo.c | 6 +++--- | ||
15 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
16 | |||
17 | diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c | ||
18 | index 72fe45a..e8a0225 100644 | ||
19 | --- a/src/egl/opengl/eglinfo.c | ||
20 | +++ b/src/egl/opengl/eglinfo.c | ||
21 | @@ -305,17 +305,17 @@ main(int argc, char *argv[]) | ||
22 | NULL), "Android platform"); | ||
23 | if (strstr(clientext, "EGL_MESA_platform_gbm") || | ||
24 | strstr(clientext, "EGL_KHR_platform_gbm")) | ||
25 | - ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_MESA, | ||
26 | + ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_KHR, | ||
27 | EGL_DEFAULT_DISPLAY, | ||
28 | NULL), "GBM platform"); | ||
29 | if (strstr(clientext, "EGL_EXT_platform_wayland") || | ||
30 | strstr(clientext, "EGL_KHR_platform_wayland")) | ||
31 | - ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, | ||
32 | + ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, | ||
33 | EGL_DEFAULT_DISPLAY, | ||
34 | NULL), "Wayland platform"); | ||
35 | if (strstr(clientext, "EGL_EXT_platform_x11") || | ||
36 | strstr(clientext, "EGL_KHR_platform_x11")) | ||
37 | - ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_EXT, | ||
38 | + ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR, | ||
39 | EGL_DEFAULT_DISPLAY, | ||
40 | NULL), "X11 platform"); | ||
41 | if (strstr(clientext, "EGL_MESA_platform_surfaceless")) | ||
42 | -- | ||
43 | 2.17.1 | ||
44 | |||
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch new file mode 100644 index 00000000..4453b63e --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 040b0b79a8e73a3348ab2e95f817636a7d479f18 Mon Sep 17 00:00:00 2001 | ||
2 | From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
3 | Date: Tue, 28 Jan 2020 16:17:46 -0800 | ||
4 | Subject: [PATCH 2/2] src: egl: eglinfo: Use EGL_PLATFORM_DEVICE_EXT only if | ||
5 | the EGL provider supports it | ||
6 | |||
7 | Compiling against the other EGL provider like mali fails, as they dont | ||
8 | support this macro as one of thier supported platforms | ||
9 | |||
10 | Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
11 | upstream-status: Inappropritate [Xilinx specific] | ||
12 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
13 | --- | ||
14 | src/egl/opengl/eglinfo.c | 4 ++++ | ||
15 | 1 file changed, 4 insertions(+) | ||
16 | |||
17 | diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c | ||
18 | index e8a0225..bc0e869 100644 | ||
19 | --- a/src/egl/opengl/eglinfo.c | ||
20 | +++ b/src/egl/opengl/eglinfo.c | ||
21 | @@ -243,6 +243,7 @@ doOneDisplay(EGLDisplay d, const char *name) | ||
22 | static int | ||
23 | doOneDevice(EGLDeviceEXT d, int i) | ||
24 | { | ||
25 | +#ifdef EGL_PLATFORM_DEVICE_EXT | ||
26 | PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = | ||
27 | (PFNEGLGETPLATFORMDISPLAYEXTPROC) | ||
28 | eglGetProcAddress("eglGetPlatformDisplayEXT"); | ||
29 | @@ -253,6 +254,9 @@ doOneDevice(EGLDeviceEXT d, int i) | ||
30 | |||
31 | return doOneDisplay(getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, d, NULL), | ||
32 | "Platform Device"); | ||
33 | +#else | ||
34 | + return 0; | ||
35 | +#endif | ||
36 | } | ||
37 | |||
38 | |||
39 | -- | ||
40 | 2.17.1 | ||
41 | |||
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch new file mode 100644 index 00000000..19248bb3 --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | Index: mesa-demos-8.5.0/src/egl/opengl/eglinfo.c | ||
2 | =================================================================== | ||
3 | --- mesa-demos-8.5.0.orig/src/egl/opengl/eglinfo.c | ||
4 | +++ mesa-demos-8.5.0/src/egl/opengl/eglinfo.c | ||
5 | @@ -195,6 +195,7 @@ PrintDisplayExtensions(EGLDisplay d) | ||
6 | } | ||
7 | |||
8 | |||
9 | +#ifdef EGL_EXT_device_base | ||
10 | static const char * | ||
11 | PrintDeviceExtensions(EGLDeviceEXT d) | ||
12 | { | ||
13 | @@ -211,7 +212,7 @@ PrintDeviceExtensions(EGLDeviceEXT d) | ||
14 | |||
15 | return PrintExtensions(extensions); | ||
16 | } | ||
17 | - | ||
18 | +#endif | ||
19 | |||
20 | static int | ||
21 | doOneDisplay(EGLDisplay d, const char *name) | ||
22 | @@ -240,6 +241,7 @@ doOneDisplay(EGLDisplay d, const char *n | ||
23 | } | ||
24 | |||
25 | |||
26 | +#ifdef EGL_EXT_device_base | ||
27 | static int | ||
28 | doOneDevice(EGLDeviceEXT d, int i) | ||
29 | { | ||
30 | @@ -258,8 +260,9 @@ doOneDevice(EGLDeviceEXT d, int i) | ||
31 | return 0; | ||
32 | #endif | ||
33 | } | ||
34 | +#endif | ||
35 | |||
36 | - | ||
37 | +#ifdef EGL_EXT_device_base | ||
38 | static int | ||
39 | doDevices(const char *name) | ||
40 | { | ||
41 | @@ -288,7 +291,7 @@ doDevices(const char *name) | ||
42 | |||
43 | return ret; | ||
44 | } | ||
45 | - | ||
46 | +#endif | ||
47 | |||
48 | int | ||
49 | main(int argc, char *argv[]) | ||
50 | @@ -322,13 +325,17 @@ main(int argc, char *argv[]) | ||
51 | ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR, | ||
52 | EGL_DEFAULT_DISPLAY, | ||
53 | NULL), "X11 platform"); | ||
54 | +#ifdef EGL_PLATFORM_SURFACELESS_MESA | ||
55 | if (strstr(clientext, "EGL_MESA_platform_surfaceless")) | ||
56 | ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, | ||
57 | EGL_DEFAULT_DISPLAY, | ||
58 | NULL), "Surfaceless platform"); | ||
59 | +#endif | ||
60 | +#ifdef EGL_EXT_device_base | ||
61 | if (strstr(clientext, "EGL_EXT_device_enumeration") && | ||
62 | strstr(clientext, "EGL_EXT_platform_device")) | ||
63 | ret += doDevices("Device platform"); | ||
64 | +#endif | ||
65 | } | ||
66 | else { | ||
67 | ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default display"); | ||
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend index d430b63e..b7714a39 100644 --- a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend +++ b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend | |||
@@ -1,4 +1,14 @@ | |||
1 | # OpenGL comes from libmali on ev/eg, when egl is enabled | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/mesa-demos:" |
2 | DEPENDS:append:mali400 = "${@bb.utils.contains('PACKAGECONFIG', 'egl', ' libmali-xlnx', '', d)}" | ||
3 | 2 | ||
4 | PACKAGE_ARCH:mali400 = "${@bb.utils.contains('PACKAGECONFIG', 'egl', '${MACHINE_ARCH}', '${TUNE_PKGARCH}', d)}" | 3 | SRC_URI += " \ |
4 | file://0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch \ | ||
5 | file://0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch \ | ||
6 | file://libmali-egl-workaround.patch \ | ||
7 | " | ||
8 | |||
9 | DEPENDS += "wayland-protocols" | ||
10 | |||
11 | # Links to libmali-xlnx, so it becomes MACHINE_ARCH specific | ||
12 | DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" | ||
13 | MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" | ||
14 | PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" | ||