On 10/26/22 9:06 AM, Paul Barker wrote:
On 25/10/2022 15:08, Paul Barker wrote:
Hi Andrew,

On 17/10/2022 15:30, Andrew Davis wrote:
I'm attaching a patch for meta-ti that should
get both core-image-x11 and core-image-weston building for Kirkstone.

I'll give this a test this week. I've included some review comments
below so we can hopefully get something merged to fix this issue...

Here's my build results with this patch applied:

   * DISTRO=poky:
       * core-image-minimal: Success
       * core-image-base: Success
       * core-image-x11: Success
       * core-image-weston: Failed

   * DISTRO=arago:
       * tisdk-base-image: Success
       * tisdk-default-image: Failed

For both of the failed builds, the failure looks the same:

| Dependency gbm found: NO found 19.1.6 but need: '>= 21.1.1' (cached)
| Message: dmabuf-feedback requires gbm which was not found. If you rather not build 
this, drop "dmabuf-feedback" from simple-clients option.
|
| ../weston-10.0.1/clients/meson.build:42:0: ERROR: Dependency 'gbm' is 
required but not found.
|
| A full log can be found at 
/workdir/build-kirkstone/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/weston/10.0.1-r0/build/meson-logs/meson-log.txt
| ERROR: meson failed
| WARNING: 
/workdir/build-kirkstone/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/weston/10.0.1-r0/temp/run.do_configure.1057121:184
 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
|       #1: bbfatal_log, 
/workdir/build-kirkstone/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/weston/10.0.1-r0/temp/run.do_configure.1057121,
 line 184
|       #2: meson_do_configure, 
/workdir/build-kirkstone/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/weston/10.0.1-r0/temp/run.do_configure.1057121,
 line 173
|       #3: do_configure, 
/workdir/build-kirkstone/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/weston/10.0.1-r0/temp/run.do_configure.1057121,
 line 149
|       #4: main, 
/workdir/build-kirkstone/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/weston/10.0.1-r0/temp/run.do_configure.1057121,
 line 197
ERROR: Task 
(/workdir/layers/poky/meta/recipes-graphics/wayland/weston_10.0.1.bb:do_configure)
 failed with exit code '1'

It looks like some further work is needed on this.


Ah, looks like you will need:

PACKAGECONFIG:remove:pn-weston = "clients"

Since the client demo app "dmabuf-feedback" needs Mesa >= 21.1.1, and
SGX is at 19.1.6 (will update that when the other Kirkstone forward-ports
are done).

Weston 10 also needs GL_EXT_unpack_subimage, so you'll need the attached
patch on weston for now.

Andrew


 From c81fbae2cf7787ed01ee00b378e95be9d653d7df Mon Sep 17 00:00:00 2001
From: Andrew Davis <[email protected]>
Date: Thu, 13 Oct 2022 09:59:46 -0500
Subject: [PATCH] Add core-image-weston and core-image-x11 support

This is more changes than I would normally like in a single commit
but these all do seem so logically connected. The goal being to
enable the two oe-core graphical images.

These changes are needed due to our MACHINES all only having GLES2
and not the desktop OpenGL versions. That would mean these belong
in the layer that adds the machines and not in a distro layer.

At some point we should add a new MACHINE_FEATURE that lets a BSP
layer specify the API supported by the hardware. Until then
we append these key recipes to switch them over to GLES2.

Signed-off-by: Andrew Davis <[email protected]>

I expect the long-term solution will be to add a "gles2" entry to
MACHINE_FEATURES on the Yocto master branch, but I doubt that will be
accepted onto the existing kirkstone branch. In the meantime we do need
a solution which can be applied for kirkstone.

Are the changes here expected to work for all TI targets or just the
AM335x SoC? i.e. can this be applied to the kirkstone branch in meta-ti
once refactored into a couple of different commits (e.g. one per
package)?

---
  .../recipes-graphics/cairo/cairo_%.bbappend   |  3 ++
  ...abling-patch-to-not-exclude-libepoxy.patch | 46 +++++++++++++++++++
  .../recipes-graphics/gtk+/gtk+3_%.bbappend    |  9 ++++
  .../libepoxy/libepoxy_%.bbappend              |  3 ++
  .../xorg-xserver/xserver-xorg_%.bbappend      |  2 +
  .../xwayland/xwayland_%.bbappend              |  3 ++
  6 files changed, 66 insertions(+)
  create mode 100644 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend
  create mode 100644 
meta-ti-bsp/recipes-graphics/gtk+/gtk+3/0001-Fix-OpenGL-disabling-patch-to-not-exclude-libepoxy.patch
  create mode 100644 meta-ti-bsp/recipes-graphics/gtk+/gtk+3_%.bbappend
  create mode 100644 meta-ti-bsp/recipes-graphics/libepoxy/libepoxy_%.bbappend
  create mode 100644 
meta-ti-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
  create mode 100644 meta-ti-bsp/recipes-graphics/xwayland/xwayland_%.bbappend

diff --git a/meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend 
b/meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend
new file mode 100644
index 00000000..726f3911
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend
@@ -0,0 +1,3 @@
+PR:append:ti-soc = ".ti1"
+PACKAGECONFIG:append:ti-soc = " ${@bb.utils.contains('MACHINE_FEATURES', 'gpu', 
'egl glesv2', '', d)}"
+PACKAGECONFIG:remove:ti-soc = "opengl"
diff --git 
a/meta-ti-bsp/recipes-graphics/gtk+/gtk+3/0001-Fix-OpenGL-disabling-patch-to-not-exclude-libepoxy.patch
 
b/meta-ti-bsp/recipes-graphics/gtk+/gtk+3/0001-Fix-OpenGL-disabling-patch-to-not-exclude-libepoxy.patch
new file mode 100644
index 00000000..c873fb8d
--- /dev/null
+++ 
b/meta-ti-bsp/recipes-graphics/gtk+/gtk+3/0001-Fix-OpenGL-disabling-patch-to-not-exclude-libepoxy.patch
@@ -0,0 +1,46 @@
+From eb16e80bf1f7c51024f3ed950ae85541e5ba2233 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Wed, 12 Oct 2022 13:05:45 -0500
+Subject: [PATCH] Fix OpenGL disabling patch to not exclude libepoxy
+
+Upstream-Status: Inappropriate
+Signed-off-by: Andrew Davis <[email protected]>

I think this is appropriate to fix upstream.

+---
+ configure.ac | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3cb24e9..aa365be 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,10 +348,9 @@ AC_ARG_ENABLE(cloudproviders,
+                               [cloudproviders_set=yes])
+ AC_ARG_ENABLE(opengl,
+               [AS_HELP_STRING([--enable-opengl],
+-                              [When enabled, Gtk+ will use libepoxy and 
exposes GtkGLArea widget ])])
++                              [When enabled, Gtk+ exposes GtkGLArea widget 
])])
+ AS_IF([test "x$enable_opengl" != "xno"], [
+-  AC_DEFINE([HAVE_OPENGL], [1], [libepoxy and opengl APIs are available at 
buildtime])
+-  EPOXY_PACKAGES="epoxy >= epoxy_required_version"
++  AC_DEFINE([HAVE_OPENGL], [1], [OpenGL APIs are available at buildtime])

This section can be changed to always define EPOXY_PACKAGES, or to
define it when `--enable-epoxy` is passed on the command line if we need
a way to enable/disable this dependency to be able to submit the patch
upstream.

+ ])
+ AM_CONDITIONAL([HAVE_OPENGL],[test "x$enable_opengl" != "xno"])
+
+@@ -1365,7 +1364,7 @@ CFLAGS="$saved_cflags"
+ LDFLAGS="$saved_ldflags"
+
+ GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= 
cairo_required_version cairo-gobject >= cairo_required_version"
+-GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends 
$EPOXY_PACKAGES $CLOUDPROVIDER_PACKAGES $PROFILER_PACKAGES fribidi >= 
fribidi_required_version"
++GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends 
epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES $PROFILER_PACKAGES fribidi >= 
fribidi_required_version"

This line can remain unchanged if EPOXY_PACKAGES is unconditionally
defined above.

+
+ PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
+ GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
+@@ -1399,7 +1398,7 @@ fi
+ PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
+
+ GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject 
>= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= 
glib_required_version"
+-GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $EPOXY_PACKAGES fribidi >= 
fribidi_required_version"
++GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES epoxy >= epoxy_required_version 
fribidi >= fribidi_required_version"

As above.

+ if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; 
then
+   GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
+ fi
diff --git a/meta-ti-bsp/recipes-graphics/gtk+/gtk+3_%.bbappend 
b/meta-ti-bsp/recipes-graphics/gtk+/gtk+3_%.bbappend
new file mode 100644
index 00000000..b6e82d14
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/gtk+/gtk+3_%.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI:append:ti-soc = " \
+       file://0001-Fix-OpenGL-disabling-patch-to-not-exclude-libepoxy.patch \
+"
+
+PR:append:ti-soc = ".ti1"
+PACKAGECONFIG:remove:ti-soc = "opengl"
+DEPENDS:append:ti-soc = " libepoxy"
diff --git a/meta-ti-bsp/recipes-graphics/libepoxy/libepoxy_%.bbappend 
b/meta-ti-bsp/recipes-graphics/libepoxy/libepoxy_%.bbappend
new file mode 100644
index 00000000..aadf5bab
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/libepoxy/libepoxy_%.bbappend
@@ -0,0 +1,3 @@
+PR:append:ti-soc = ".ti1"
+PACKAGECONFIG:append:ti-soc = " ${@bb.utils.contains('MACHINE_FEATURES', 'gpu', 
'egl', '', d)}"
+PACKAGECONFIG:remove:ti-soc = "x11"
diff --git a/meta-ti-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend 
b/meta-ti-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
new file mode 100644
index 00000000..86c1e714
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -0,0 +1,2 @@
+PR:append:ti-soc = ".ti1"
+OPENGL_PKGCONFIGS:ti-soc = ""
diff --git a/meta-ti-bsp/recipes-graphics/xwayland/xwayland_%.bbappend 
b/meta-ti-bsp/recipes-graphics/xwayland/xwayland_%.bbappend
new file mode 100644
index 00000000..e7163207
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/xwayland/xwayland_%.bbappend
@@ -0,0 +1,3 @@
+PR:append:ti-soc = ".ti1"
+PACKAGECONFIG:remove:ti-soc = "glx"
+DEPENDS:append:ti-soc = " libxshmfence"

Thanks,






From 5fc282bb9c0beccd87160af63e45abbab00f2b24 Mon Sep 17 00:00:00 2001
From: Andrew Davis <[email protected]>
Date: Thu, 6 Oct 2022 15:49:31 -0500
Subject: [PATCH] Revert "gl-renderer: require GL_EXT_unpack_subimage"

This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d.
---
 libweston/renderer-gl/gl-renderer-internal.h |  2 ++
 libweston/renderer-gl/gl-renderer.c          | 29 ++++++++++++++++----
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/libweston/renderer-gl/gl-renderer-internal.h b/libweston/renderer-gl/gl-renderer-internal.h
index 72101b47..7a6e2f48 100644
--- a/libweston/renderer-gl/gl-renderer-internal.h
+++ b/libweston/renderer-gl/gl-renderer-internal.h
@@ -133,6 +133,8 @@ struct gl_renderer {
 	PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window;
 	bool has_platform_base;
 
+	bool has_unpack_subimage;
+
 	PFNEGLBINDWAYLANDDISPLAYWL bind_display;
 	PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display;
 	PFNEGLQUERYWAYLANDBUFFERWL query_buffer;
diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
index a5f5eae4..410ba85c 100644
--- a/libweston/renderer-gl/gl-renderer.c
+++ b/libweston/renderer-gl/gl-renderer.c
@@ -1835,6 +1835,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
 {
 	const struct weston_testsuite_quirks *quirks =
 		&surface->compositor->test_data.test_quirks;
+	struct gl_renderer *gr = get_renderer(surface->compositor);
 	struct gl_surface_state *gs = get_surface_state(surface);
 	struct weston_buffer *buffer = gs->buffer_ref.buffer;
 	struct weston_view *view;
@@ -1872,6 +1873,24 @@ gl_renderer_flush_damage(struct weston_surface *surface)
 
 	glActiveTexture(GL_TEXTURE0);
 
+	if (!gr->has_unpack_subimage) {
+		wl_shm_buffer_begin_access(buffer->shm_buffer);
+		for (j = 0; j < gs->num_textures; j++) {
+			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
+			glTexImage2D(GL_TEXTURE_2D, 0,
+				     gs->gl_format[j],
+				     gs->pitch / gs->hsub[j],
+				     buffer->height / gs->vsub[j],
+				     0,
+				     gl_format_from_internal(gs->gl_format[j]),
+				     gs->gl_pixel_type,
+				     data + gs->offset[j]);
+		}
+		wl_shm_buffer_end_access(buffer->shm_buffer);
+
+		goto done;
+	}
+
 	if (gs->needs_full_upload || quirks->gl_force_full_upload) {
 		glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
 		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
@@ -3932,11 +3951,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
 	else
 		ec->read_format = PIXMAN_a8b8g8r8;
 
-	if (gr->gl_version < gr_gl_version(3, 0) &&
-	    !weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage")) {
-		weston_log("GL_EXT_unpack_subimage not available.\n");
-		return -1;
-	}
+	if (gr->gl_version >= gr_gl_version(3, 0) ||
+	    weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage"))
+		gr->has_unpack_subimage = true;
 
 	if (gr->gl_version >= gr_gl_version(3, 0) ||
 	    weston_check_egl_extension(extensions, "GL_EXT_texture_type_2_10_10_10_REV"))
@@ -3977,6 +3994,8 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
 		   gr_gl_version_minor(gr->gl_version));
 	weston_log_continue(STAMP_SPACE "read-back format: %s\n",
 		ec->read_format == PIXMAN_a8r8g8b8 ? "BGRA" : "RGBA");
+	weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
+			    gr->has_unpack_subimage ? "yes" : "no");
 	weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n",
 			    gr->has_bind_display ? "yes" : "no");
 
-- 
2.37.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15206): 
https://lists.yoctoproject.org/g/meta-ti/message/15206
Mute This Topic: https://lists.yoctoproject.org/mt/93954566/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to