All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH v2 1/3] glmark2: update information
@ 2020-12-03 14:24 Trevor Woerner
  2020-12-03 14:24 ` [meta-oe][PATCH v2 2/3] glmark2: update to latest Trevor Woerner
  2020-12-03 14:24 ` [meta-oe][PATCH v2 3/3] glmark2: add support for dispmanx Trevor Woerner
  0 siblings, 2 replies; 5+ messages in thread
From: Trevor Woerner @ 2020-12-03 14:24 UTC (permalink / raw)
  To: openembedded-devel

According to https://launchpad.net/glmark2 the preferred "home" and bugtracker
for the project are on github.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta-oe/recipes-benchmark/glmark2/glmark2_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
index 2e727a01c..320d07dfc 100644
--- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
+++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
@@ -1,8 +1,8 @@
 SUMMARY = "OpenGL (ES) 2.0 benchmark"
 DESCRIPTION = "glmark2 is a benchmark for OpenGL (ES) 2.0. \
 It uses only the subset of the OpenGL 2.0 API that is compatible with OpenGL ES 2.0."
-HOMEPAGE = "https://launchpad.net/glmark2"
-BUGTRACKER = "https://bugs.launchpad.net/glmark2"
+HOMEPAGE = "https://github.com/glmark2/glmark2"
+BUGTRACKER = "https://github.com/glmark2/glmark2/issues"
 
 LICENSE = "GPLv3+ & SGIv1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-- 
2.28.0.497.g54e85e7af1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH v2 2/3] glmark2: update to latest
  2020-12-03 14:24 [meta-oe][PATCH v2 1/3] glmark2: update information Trevor Woerner
@ 2020-12-03 14:24 ` Trevor Woerner
  2020-12-03 22:47   ` [oe] " Khem Raj
  2020-12-03 14:24 ` [meta-oe][PATCH v2 3/3] glmark2: add support for dispmanx Trevor Woerner
  1 sibling, 1 reply; 5+ messages in thread
From: Trevor Woerner @ 2020-12-03 14:24 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta-oe/recipes-benchmark/glmark2/glmark2_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
index 320d07dfc..da8ca9e2b 100644
--- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
+++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
@@ -10,12 +10,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
 
 DEPENDS = "libpng jpeg udev"
 
-PV = "20191226+${SRCPV}"
+PV = "2020.11+${SRCPV}"
 
 COMPATIBLE_HOST_rpi  = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}"
 
 SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https"
-SRCREV = "72dabc5d72b49c6d45badeb8a941ba4d829b0bd6"
+SRCREV = "784aca755a469b144acf3cae180b6e613b7b057a"
 
 S = "${WORKDIR}/git"
 
-- 
2.28.0.497.g54e85e7af1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH v2 3/3] glmark2: add support for dispmanx
  2020-12-03 14:24 [meta-oe][PATCH v2 1/3] glmark2: update information Trevor Woerner
  2020-12-03 14:24 ` [meta-oe][PATCH v2 2/3] glmark2: update to latest Trevor Woerner
@ 2020-12-03 14:24 ` Trevor Woerner
  1 sibling, 0 replies; 5+ messages in thread
From: Trevor Woerner @ 2020-12-03 14:24 UTC (permalink / raw)
  To: openembedded-devel

Upstream glmark2 includes support for running glmark2 on a RaspberryPi via the
dispmanx interface, as is provided by "userland".

The build depends on x11, but this is a quirk of the upstream sources. One
can easily build a minimal image without any x11/wayland on which to run
dispmanx applications directly (including glmark2).

NOTE: unlike with other flavours, one can only build the dispmanx-eglv2
      flavour on its own (this is a constraint of the glmark2 build)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 .../files/0001-fix-dispmanx-build.patch       | 125 ++++++++++++++++++
 .../files/0002-run-dispmanx-fullscreen.patch  |  30 +++++
 .../recipes-benchmark/glmark2/glmark2_git.bb  |  20 ++-
 3 files changed, 168 insertions(+), 7 deletions(-)
 create mode 100644 meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch
 create mode 100644 meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch

diff --git a/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch b/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch
new file mode 100644
index 000000000..e9b880c26
--- /dev/null
+++ b/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch
@@ -0,0 +1,125 @@
+From 56e4959f0bc3e442c813d78e8ab6b3bf64b4ac66 Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Wed, 2 Dec 2020 20:27:42 +0000
+Subject: [PATCH] fix dispmanx build
+
+For when the user is building "--with-flavors dispmanx-glesv2", fixes a bunch
+of "redeclared as different kind of symbol" problems.
+
+This patch is almost entirely from:
+	https://github.com/glmark2/glmark2/commit/3b1a0f78d03ae126b78ee52a7c434809115e5993
+
+Which was created by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
+
+See:
+	https://github.com/glmark2/glmark2/issues/80
+
+My contribution is to tweak the wscript to link all the required libraries.
+
+Upstream-status: submitted [https://github.com/glmark2/glmark2/pull/135]
+Signed-off-by: Trevor Woerner <twoerner@gmail.com>
+---
+ src/native-state-dispmanx.cpp | 22 +++++++++++++++++-----
+ src/native-state-dispmanx.h   |  7 +++----
+ wscript                       |  2 +-
+ 3 files changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/src/native-state-dispmanx.cpp b/src/native-state-dispmanx.cpp
+index 2117386..49f74e7 100644
+--- a/src/native-state-dispmanx.cpp
++++ b/src/native-state-dispmanx.cpp
+@@ -23,13 +23,25 @@
+ #include "native-state-dispmanx.h"
+ #include "log.h"
+ 
++#include "EGL/egl.h"
++
+ #include <cstring>
+ #include <csignal>
+ 
++struct NativeStateDispmanx::Private
++{
++    Private()
++    {
++	memset(&egl_dispmanx_window, 0, sizeof(egl_dispmanx_window));
++    }
++
++    EGL_DISPMANX_WINDOW_T egl_dispmanx_window;
++};
++
+ NativeStateDispmanx::NativeStateDispmanx()
++    : priv{std::make_unique<Private>()}
+ {
+     memset(&properties_, 0, sizeof(properties_));
+-    memset(&egl_dispmanx_window, 0, sizeof(egl_dispmanx_window));
+ }
+ 
+ NativeStateDispmanx::~NativeStateDispmanx()
+@@ -99,9 +111,9 @@ NativeStateDispmanx::create_window(WindowProperties const& properties)
+ 					       0 /*clamp*/,
+ 					       DISPMANX_NO_ROTATE);
+ 
+-    egl_dispmanx_window.element = dispmanx_element;
+-    egl_dispmanx_window.width = dst_rect.width;
+-    egl_dispmanx_window.height = dst_rect.height;
++    priv->egl_dispmanx_window.element = dispmanx_element;
++    priv->egl_dispmanx_window.width = dst_rect.width;
++    priv->egl_dispmanx_window.height = dst_rect.height;
+     vc_dispmanx_update_submit_sync(dispmanx_update);
+ 
+     return true;
+@@ -111,7 +123,7 @@ void*
+ NativeStateDispmanx::window(WindowProperties &properties)
+ {
+     properties = properties_;
+-    return &egl_dispmanx_window;
++    return &priv->egl_dispmanx_window;
+ }
+ 
+ void
+diff --git a/src/native-state-dispmanx.h b/src/native-state-dispmanx.h
+index a6ed3d4..794b2d3 100644
+--- a/src/native-state-dispmanx.h
++++ b/src/native-state-dispmanx.h
+@@ -24,10 +24,8 @@
+ #define GLMARK2_NATIVE_STATE_DISPMANX_H_
+ 
+ #include <vector>
++#include <memory>
+ #include "bcm_host.h"
+-#include "GLES/gl.h"
+-#include "EGL/egl.h"
+-#include "EGL/eglext.h"
+ 
+ #include "native-state.h"
+ 
+@@ -46,11 +44,12 @@ public:
+     void flip();
+ 
+ private:
++    struct Private;
+     DISPMANX_DISPLAY_HANDLE_T dispmanx_display;
+     DISPMANX_UPDATE_HANDLE_T dispmanx_update;
+     DISPMANX_ELEMENT_HANDLE_T dispmanx_element;
+-    EGL_DISPMANX_WINDOW_T egl_dispmanx_window;
+     WindowProperties properties_;
++    std::unique_ptr<Private> priv;
+ };
+ 
+ #endif /* GLMARK2_NATIVE_STATE_DISPMANX_H_ */
+diff --git a/wscript b/wscript
+index e09fa78..6c3869c 100644
+--- a/wscript
++++ b/wscript
+@@ -205,7 +205,7 @@ def configure_linux(ctx):
+ 
+         ctx.check_cxx(lib = 'brcmGLESv2', uselib_store = 'glesv2', libpath='/opt/vc/lib')
+         ctx.check_cxx(lib = ['brcmEGL', 'brcmGLESv2'], uselib_store = 'egl', libpath='/opt/vc/lib')
+-        ctx.check_cxx(lib = ['bcm_host', 'vcos', 'vchiq_arm'], uselib_store = 'dispmanx', libpath='/opt/vc/lib')
++        ctx.check_cxx(lib = ['brcmEGL', 'brcmGLESv2', 'vchostif', 'bcm_host', 'vcos', 'vchiq_arm'], uselib_store = 'dispmanx', libpath='/opt/vc/lib')
+ 
+     # Check optional packages
+     opt_pkgs = [('x11', 'x11', None, list_contains(ctx.options.flavors, 'x11')),
+-- 
+2.28.0.497.g54e85e7af1
+
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch b/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch
new file mode 100644
index 000000000..27bd62edb
--- /dev/null
+++ b/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch
@@ -0,0 +1,30 @@
+From 110ef8357ebaf24bc3995e631ec809a2f84c3b87 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner <twoerner@gmail.com>
+Date: Thu, 3 Dec 2020 07:16:58 -0500
+Subject: [PATCH] run dispmanx fullscreen
+
+The dispmanx flavour can only run fullscreen, therefore set the size to
+fullscreen when glmark2-es2-dispmanx is run.
+
+Upstream-status: submitted [https://github.com/glmark2/glmark2/pull/135]
+Signed-off-by: Trevor Woerner <twoerner@gmail.com>
+---
+ src/main.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/main.cpp b/src/main.cpp
+index 677962e..273a217 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -164,6 +164,11 @@ main(int argc, char *argv[])
+         Options::size = std::pair<int,int>(800, 600);
+     }
+ 
++#if GLMARK2_USE_DISPMANX
++    /* dispmanx can only run fullscreen */
++    Options::size = std::pair<int,int>(-1, -1);
++#endif
++
+     // Create the canvas
+ #if GLMARK2_USE_X11
+     NativeStateX11 native_state;
diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
index da8ca9e2b..1c1fb5ed0 100644
--- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
+++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
@@ -12,20 +12,23 @@ DEPENDS = "libpng jpeg udev"
 
 PV = "2020.11+${SRCPV}"
 
-COMPATIBLE_HOST_rpi  = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}"
-
-SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https"
+SRC_URI = " \
+    git://github.com/glmark2/glmark2.git;protocol=https \
+    file://0001-fix-dispmanx-build.patch \
+    file://0002-run-dispmanx-fullscreen.patch \
+    "
 SRCREV = "784aca755a469b144acf3cae180b6e613b7b057a"
 
 S = "${WORKDIR}/git"
 
 inherit waf pkgconfig features_check
 
-REQUIRED_DISTRO_FEATURES += "opengl"
+ANY_OF_DISTRO_FEATURES = "opengl dispmanx"
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2', '', d)} \
-                  ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', '', d)} \
-                  drm-gles2"
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2 drm-gles2', '', d)} \
+                  ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2 drm-gles2', '', d)} \
+                  ${@bb.utils.contains('DISTRO_FEATURES', 'dispmanx', 'dispmanx', '', d)} \
+                 "
 
 PACKAGECONFIG[x11-gl] = ",,virtual/libgl virtual/libx11"
 PACKAGECONFIG[x11-gles2] = ",,virtual/libgles2 virtual/libx11"
@@ -33,6 +36,7 @@ PACKAGECONFIG[drm-gl] = ",,virtual/libgl libdrm virtual/libgbm"
 PACKAGECONFIG[drm-gles2] = ",,virtual/libgles2 libdrm virtual/libgbm"
 PACKAGECONFIG[wayland-gl] = ",,virtual/libgl wayland"
 PACKAGECONFIG[wayland-gles2] = ",,virtual/libgles2 wayland"
+PACKAGECONFIG[dispmanx] = ",,virtual/libgles2 virtual/libx11"
 
 python __anonymous() {
     packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
@@ -49,6 +53,8 @@ python __anonymous() {
         flavors.append("drm-glesv2")
     if "drm-gl" in packageconfig:
         flavors.append("drm-gl")
+    if "dispmanx" in packageconfig:
+        flavors = ["dispmanx-glesv2"]
     if flavors:
         d.appendVar("EXTRA_OECONF", " --with-flavors=%s" % ",".join(flavors))
 }
-- 
2.28.0.497.g54e85e7af1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [oe] [meta-oe][PATCH v2 2/3] glmark2: update to latest
  2020-12-03 14:24 ` [meta-oe][PATCH v2 2/3] glmark2: update to latest Trevor Woerner
@ 2020-12-03 22:47   ` Khem Raj
  2020-12-04  4:09     ` Trevor Woerner
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2020-12-03 22:47 UTC (permalink / raw)
  To: Trevor Woerner; +Cc: openembeded-devel

I am seeing this error

https://errors.yoctoproject.org/Errors/Details/539076/

all across machines. Perhaps it needs to depend on wayland-scanner

On Thu, Dec 3, 2020 at 6:24 AM Trevor Woerner <twoerner@gmail.com> wrote:
>
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
>  meta-oe/recipes-benchmark/glmark2/glmark2_git.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
> index 320d07dfc..da8ca9e2b 100644
> --- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
> +++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
> @@ -10,12 +10,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
>
>  DEPENDS = "libpng jpeg udev"
>
> -PV = "20191226+${SRCPV}"
> +PV = "2020.11+${SRCPV}"
>
>  COMPATIBLE_HOST_rpi  = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}"
>
>  SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https"
> -SRCREV = "72dabc5d72b49c6d45badeb8a941ba4d829b0bd6"
> +SRCREV = "784aca755a469b144acf3cae180b6e613b7b057a"
>
>  S = "${WORKDIR}/git"
>
> --
> 2.28.0.497.g54e85e7af1
>
>
> 
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [oe] [meta-oe][PATCH v2 2/3] glmark2: update to latest
  2020-12-03 22:47   ` [oe] " Khem Raj
@ 2020-12-04  4:09     ` Trevor Woerner
  0 siblings, 0 replies; 5+ messages in thread
From: Trevor Woerner @ 2020-12-04  4:09 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

On Thu, Dec 3, 2020 at 5:48 PM Khem Raj <raj.khem@gmail.com> wrote:

> I am seeing this error
>
> https://errors.yoctoproject.org/Errors/Details/539076/
>
> all across machines. Perhaps it needs to depend on wayland-scanner
>

Excellent, thanks for testing. Sorry, I hadn't tried building for wayland.
Please see V3

[-- Attachment #2: Type: text/html, Size: 728 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-04  4:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 14:24 [meta-oe][PATCH v2 1/3] glmark2: update information Trevor Woerner
2020-12-03 14:24 ` [meta-oe][PATCH v2 2/3] glmark2: update to latest Trevor Woerner
2020-12-03 22:47   ` [oe] " Khem Raj
2020-12-04  4:09     ` Trevor Woerner
2020-12-03 14:24 ` [meta-oe][PATCH v2 3/3] glmark2: add support for dispmanx Trevor Woerner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.