diff options
| -rw-r--r-- | meta-xilinx-core/recipes-graphics/wayland/files/0002-libmali-does-not-support-gles3.patch | 77 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-graphics/wayland/weston_%.bbappend | 2 |
2 files changed, 79 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/0002-libmali-does-not-support-gles3.patch b/meta-xilinx-core/recipes-graphics/wayland/files/0002-libmali-does-not-support-gles3.patch new file mode 100644 index 00000000..d4dadc7c --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/wayland/files/0002-libmali-does-not-support-gles3.patch | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | libmali does not support libgles3 | ||
| 2 | |||
| 3 | Build in compatible ifdefs where necessary to workaround slight differences | ||
| 4 | between GLES2 (mali) and GLES3 (mesa) that Weston is expecting. | ||
| 5 | |||
| 6 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
| 7 | |||
| 8 | diff -urN a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c | ||
| 9 | --- a/libweston/renderer-gl/gl-renderer.c 2022-07-26 03:22:25.000000000 -0700 | ||
| 10 | +++ b/libweston/renderer-gl/gl-renderer.c 2022-10-26 16:25:13.497247422 -0700 | ||
| 11 | @@ -29,7 +29,7 @@ | ||
| 12 | |||
| 13 | #include <GLES2/gl2.h> | ||
| 14 | #include <GLES2/gl2ext.h> | ||
| 15 | -#include <GLES3/gl3.h> | ||
| 16 | +/*#include <GLES3/gl3.h>*/ | ||
| 17 | |||
| 18 | #include <stdbool.h> | ||
| 19 | #include <stdint.h> | ||
| 20 | @@ -1822,7 +1822,13 @@ | ||
| 21 | return GL_RED_EXT; | ||
| 22 | case GL_RG8_EXT: | ||
| 23 | return GL_RG_EXT; | ||
| 24 | +#ifndef GL_RGBA16F | ||
| 25 | +#define GL_RGBA16F GL_RGBA16F_EXT | ||
| 26 | +#endif | ||
| 27 | case GL_RGBA16F: | ||
| 28 | +#ifndef GL_RGB10_A2 | ||
| 29 | +#define GL_RGB10_A2 GL_RGB10_A2_EXT | ||
| 30 | +#endif | ||
| 31 | case GL_RGB10_A2: | ||
| 32 | return GL_RGBA; | ||
| 33 | default: | ||
| 34 | @@ -2023,6 +2029,9 @@ | ||
| 35 | gs->shader_variant = SHADER_VARIANT_RGBA; | ||
| 36 | pitch = wl_shm_buffer_get_stride(shm_buffer) / 8; | ||
| 37 | gl_format[0] = GL_RGBA16F; | ||
| 38 | +#ifndef GL_HALF_FLOAT | ||
| 39 | +#define GL_HALF_FLOAT GL_HALF_FLOAT_OES | ||
| 40 | +#endif | ||
| 41 | gl_pixel_type = GL_HALF_FLOAT; | ||
| 42 | es->is_opaque = false; | ||
| 43 | break; | ||
| 44 | diff -urN a/libweston/renderer-gl/gl-shader-config-color-transformation.c b/libweston/renderer-gl/gl-shader-config-color-transformation.c | ||
| 45 | --- a/libweston/renderer-gl/gl-shader-config-color-transformation.c 2022-07-26 03:22:25.000000000 -0700 | ||
| 46 | +++ b/libweston/renderer-gl/gl-shader-config-color-transformation.c 2022-07-26 03:22:25.000000000 -0700 | ||
| 47 | @@ -25,7 +25,8 @@ | ||
| 48 | |||
| 49 | #include "config.h" | ||
| 50 | |||
| 51 | -#include <GLES3/gl3.h> | ||
| 52 | +#include <GLES2/gl2.h> | ||
| 53 | +/*#include <GLES3/gl3.h>*/ | ||
| 54 | #include <GLES2/gl2ext.h> | ||
| 55 | |||
| 56 | #include <assert.h> | ||
| 57 | @@ -138,6 +139,9 @@ | ||
| 58 | glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0); | ||
| 59 | glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0); | ||
| 60 | glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0); | ||
| 61 | +#ifndef GL_R32F | ||
| 62 | +#define GL_R32F GL_R32F_EXT | ||
| 63 | +#endif | ||
| 64 | glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, lut_len, nr_rows, 0, | ||
| 65 | GL_RED_EXT, GL_FLOAT, lut); | ||
| 66 | |||
| 67 | diff -ur a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h | ||
| 68 | --- a/shared/weston-egl-ext.h 2022-07-26 03:22:25.000000000 -0700 | ||
| 69 | +++ b/shared/weston-egl-ext.h 2022-10-26 17:11:28.501107772 -0700 | ||
| 70 | @@ -150,6 +150,7 @@ | ||
| 71 | #define EGL_NO_DEVICE_EXT EGL_CAST(EGLDeviceEXT,0) | ||
| 72 | #define EGL_BAD_DEVICE_EXT 0x322B | ||
| 73 | #define EGL_DEVICE_EXT 0x322C | ||
| 74 | +#define EGLAttrib EGLAttribKHR | ||
| 75 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); | ||
| 76 | typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); | ||
| 77 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); | ||
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston_%.bbappend b/meta-xilinx-core/recipes-graphics/wayland/weston_%.bbappend index 85176995..f8d7f6ab 100644 --- a/meta-xilinx-core/recipes-graphics/wayland/weston_%.bbappend +++ b/meta-xilinx-core/recipes-graphics/wayland/weston_%.bbappend | |||
| @@ -7,6 +7,8 @@ SOC_FAMILY_ARCH ??= "${TUNE_PKGARCH}" | |||
| 7 | PACKAGE_ARCH:zynqmp = "${SOC_FAMILY_ARCH}" | 7 | PACKAGE_ARCH:zynqmp = "${SOC_FAMILY_ARCH}" |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | SRC_URI:append:mali400 = " file://0002-libmali-does-not-support-gles3.patch" | ||
| 11 | |||
| 10 | # OpenGL comes from libmali on ev/eg, when egl is enabled | 12 | # OpenGL comes from libmali on ev/eg, when egl is enabled |
| 11 | DEPENDS:append:mali400 = "${@bb.utils.contains('PACKAGECONFIG', 'egl', ' libmali-xlnx', '', d)}" | 13 | DEPENDS:append:mali400 = "${@bb.utils.contains('PACKAGECONFIG', 'egl', ' libmali-xlnx', '', d)}" |
| 12 | 14 | ||
