summaryrefslogtreecommitdiffstats
path: root/meta-agl-flutter/recipes-graphics
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-flutter/recipes-graphics')
-rw-r--r--meta-agl-flutter/recipes-graphics/toyota/files/0001-Disable-on_frame_base_surface-wl_surface_commit.patch26
-rw-r--r--meta-agl-flutter/recipes-graphics/toyota/files/0001-backend-wayland_egl-Add-a-fallback-eglConfig.patch88
-rw-r--r--meta-agl-flutter/recipes-graphics/toyota/flutter-auto_%.bbappend1
-rw-r--r--meta-agl-flutter/recipes-graphics/toyota/flutter-auto_aglflutter.inc9
4 files changed, 124 insertions, 0 deletions
diff --git a/meta-agl-flutter/recipes-graphics/toyota/files/0001-Disable-on_frame_base_surface-wl_surface_commit.patch b/meta-agl-flutter/recipes-graphics/toyota/files/0001-Disable-on_frame_base_surface-wl_surface_commit.patch
new file mode 100644
index 000000000..a37233b50
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/toyota/files/0001-Disable-on_frame_base_surface-wl_surface_commit.patch
@@ -0,0 +1,26 @@
+From fda28bbd6718bf113061292d8cec15084060c923 Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarske@gmail.com>
+Date: Wed, 19 Jul 2023 15:21:46 -0700
+Subject: [PATCH] Disable on_frame_base_surface wl_surface_commit
+
+Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
+---
+ shell/wayland/window.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/shell/wayland/window.cc b/shell/wayland/window.cc
+index c74b438..f244f08 100644
+--- a/shell/wayland/window.cc
++++ b/shell/wayland/window.cc
+@@ -257,7 +257,7 @@ void WaylandWindow::on_frame_base_surface(void* data,
+ window->m_fps_counter++;
+ window->m_fps_counter++;
+
+- wl_surface_commit(window->m_base_surface);
++ //wl_surface_commit(window->m_base_surface);
+ }
+
+ uint32_t WaylandWindow::GetFpsCounter() {
+--
+2.41.0
+
diff --git a/meta-agl-flutter/recipes-graphics/toyota/files/0001-backend-wayland_egl-Add-a-fallback-eglConfig.patch b/meta-agl-flutter/recipes-graphics/toyota/files/0001-backend-wayland_egl-Add-a-fallback-eglConfig.patch
new file mode 100644
index 000000000..f2195dddc
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/toyota/files/0001-backend-wayland_egl-Add-a-fallback-eglConfig.patch
@@ -0,0 +1,88 @@
+From 372b9c4edd42b67827b75863b978091ba5cff5cd Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Thu, 17 Oct 2024 17:25:41 +0300
+Subject: [PATCH 1/2] backend/wayland_egl: Add a fallback eglConfig
+
+This seems to aid flutter-auto at displaying an image on agl-rdp
+with software rendering, and on agl-kvm with virgl. Makes uses of a fallback
+eGLConfig (< 24 bit) and tries to use that one rather than the default one (24-bit).
+
+Bug-AGL: SPEC-5260
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ cmake/config_common.h.in | 17 ++++++++++++++++-
+ shell/backend/wayland_egl/egl.cc | 23 ++++++++++++++++++++---
+ 2 files changed, 36 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/config_common.h.in b/cmake/config_common.h.in
+index 07ce9b7..2c54c67 100644
+--- a/cmake/config_common.h.in
++++ b/cmake/config_common.h.in
+@@ -155,6 +155,21 @@ static constexpr std::array<EGLint, 27> kEglConfigAttribs = {{
+ // clang-format on
+ }};
+
++
++static constexpr std::array<EGLint, 27> kEglConfigAttribsFallBack = {{
++ // clang-format off
++ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
++ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
++
++ EGL_RED_SIZE, 1,
++ EGL_GREEN_SIZE, 1,
++ EGL_BLUE_SIZE, 1,
++ EGL_ALPHA_SIZE, 2,
++ EGL_NONE // termination sentinel
++ // clang-format on
++}};
++
++
+ // All vkCreate* functions take an optional allocator. For now, we select the
+ // default allocator by passing in a null pointer, and we highlight the argument
+ // by using the VKALLOC constant.
+@@ -181,4 +196,4 @@ constexpr struct VkAllocationCallbacks* VKALLOC = nullptr;
+ #cmakedefine01 ENV32BIT
+ #cmakedefine01 ENV64BIT
+
+-#endif //CONFIG_COMMON_H_
+\ No newline at end of file
++#endif //CONFIG_COMMON_H_
+diff --git a/shell/backend/wayland_egl/egl.cc b/shell/backend/wayland_egl/egl.cc
+index 99555d6..70164ba 100644
+--- a/shell/backend/wayland_egl/egl.cc
++++ b/shell/backend/wayland_egl/egl.cc
+@@ -62,11 +62,28 @@ Egl::Egl(void* native_display, int buffer_size, bool debug)
+ break;
+ }
+ }
+- free(configs);
+ if (m_config == nullptr) {
+- spdlog::critical("did not find config with buffer size {}", m_buffer_size);
+- assert(false);
++ // try with the fallback one
++ spdlog::critical("Could not use default EGLConfig trying with fallback.");
++ ret = eglChooseConfig(m_dpy, kEglConfigAttribsFallBack.data(), configs,
++ count, &n);
++ assert(ret && n >= 1);
++
++ for (EGLint i = 0; i < n; i++) {
++ eglGetConfigAttrib(m_dpy, configs[i], EGL_BUFFER_SIZE, &size);
++ SPDLOG_DEBUG("Buffer size for config {} is {}", i, size);
++ if (m_buffer_size <= size) {
++ memcpy(&m_config, &configs[i], sizeof(EGLConfig));
++ break;
++ }
++ }
++ if (m_config == nullptr) {
++ spdlog::critical("did not find config with buffer size {}",
++ m_buffer_size);
++ assert(false);
++ }
+ }
++ free(configs);
+
+ m_context = eglCreateContext(m_dpy, m_config, EGL_NO_CONTEXT,
+ kEglContextAttribs.data());
+--
+2.43.0
+
diff --git a/meta-agl-flutter/recipes-graphics/toyota/flutter-auto_%.bbappend b/meta-agl-flutter/recipes-graphics/toyota/flutter-auto_%.bbappend
new file mode 100644
index 000000000..dbc82bc3f
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/toyota/flutter-auto_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-flutter', 'flutter-auto_aglflutter.inc', '', d)}
diff --git a/meta-agl-flutter/recipes-graphics/toyota/flutter-auto_aglflutter.inc b/meta-agl-flutter/recipes-graphics/toyota/flutter-auto_aglflutter.inc
new file mode 100644
index 000000000..6c1503024
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/toyota/flutter-auto_aglflutter.inc
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+EGLCONFIG_FALLBACK = "${@bb.utils.contains_any('AGL_FEATURES', 'agl-rdp agl-kvm-guest', '', 'file://0001-backend-wayland_egl-Add-a-fallback-eglConfig.patch', d)}"
+SRC_URI:append:use-nxp-bsp = " file://0001-Disable-on_frame_base_surface-wl_surface_commit.patch"
+SRC_URI:append = " ${EGLCONFIG_FALLBACK}"
+
+# Disable WIP webview plugin on 32-bit ARM platforms for now, as build
+# failures have been seen on qemuarm and beaglebone.
+PACKAGECONFIG:remove:arm = "webview_flutter_view"