diff options
Diffstat (limited to 'meta-oe/recipes-benchmark/glmark2')
7 files changed, 283 insertions, 116 deletions
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0001-Fix-clang-warnings.patch b/meta-oe/recipes-benchmark/glmark2/files/0001-Fix-clang-warnings.patch deleted file mode 100644 index cdf09faec8..0000000000 --- a/meta-oe/recipes-benchmark/glmark2/files/0001-Fix-clang-warnings.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 35e9f80518d666db5f9c62e8072ffbc307b4af4f Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sat, 26 Aug 2017 08:30:01 -0700 -Subject: [PATCH] Fix clang warnings - -../src/native-state-drm.cpp:334:20: error: cannot pass object of non-trivial type 'std::__cxx11::basic_string<char>' through variadic function; call will abort at runtime [-Wnon-pod-varargs] - dev_path); - ^ -1 error generated. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - src/native-state-drm.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/native-state-drm.cpp b/src/native-state-drm.cpp -index dc2b323..62566ee 100644 ---- a/src/native-state-drm.cpp -+++ b/src/native-state-drm.cpp -@@ -331,7 +331,7 @@ static int open_using_udev_scan() - if (!valid_fd(fd)) { - // %m is GLIBC specific... Maybe use strerror here... - Log::error("Tried to use '%s' but failed.\nReason : %m", -- dev_path); -+ dev_path.c_str()); - } - else - Log::debug("Success!\n"); --- -2.14.1 - 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 0000000000..9d652e10ad --- /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 0000000000..05a074cf55 --- /dev/null +++ b/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch @@ -0,0 +1,32 @@ +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 d1077fe..d717cd4 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -202,6 +202,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_EGL + GLStateEGL gl_state; +-- +2.25.1 diff --git a/meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch b/meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch new file mode 100644 index 0000000000..dc47af83e7 --- /dev/null +++ b/meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch @@ -0,0 +1,103 @@ +From b59ec731c8c7e084b289e4ea92938faaebcc389d Mon Sep 17 00:00:00 2001 +From: Alexandros Frantzis <alexandros.frantzis@collabora.com> +Date: Wed, 1 Nov 2023 13:43:00 +0200 +Subject: [PATCH] GLVisualConfig: By default don't care about the stencil + config component + +Our benchmarks don't use a stencil buffer, but its presence doesn't hurt +either, so don't mark configs that have one as unacceptable. Our scoring +still favors configs without one, unless the user explicitly specifies +otherwise with --visual-config. + +Upstream-Status: Backport [https://github.com/glmark2/glmark2/commit/5f23d540342ba69e12afeb6a1ac4f6fd36747975] +--- + doc/glmark2.1.in | 2 +- + src/gl-visual-config.cpp | 9 ++++++--- + src/gl-visual-config.h | 2 +- + src/options.cpp | 6 +++--- + 4 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/doc/glmark2.1.in b/doc/glmark2.1.in +index 015ba20..1f4a047 100644 +--- a/doc/glmark2.1.in ++++ b/doc/glmark2.1.in +@@ -38,7 +38,7 @@ Render to an off-screen surface + The visual configuration to use for the rendering target: + \'id=ID:red=R:green=G:blue=B:alpha=A:buffer=BUF:stencil=STENCIL:samples=SAMPLES'. + The parameters may be defined in any order, and any omitted parameters assume a +-default value of '0' (id, stencil, samples) or '1' (red, green, blue, alpha, buffer). ++default value of '0' (id, samples), -1 (stencil) or '1' (red, green, blue, alpha, buffer). + If 'id' is set to a non-zero value, all other parameters are ignored + .TP + \fB\-\-reuse\-context\fR +diff --git a/src/gl-visual-config.cpp b/src/gl-visual-config.cpp +index de92f93..665f53a 100644 +--- a/src/gl-visual-config.cpp ++++ b/src/gl-visual-config.cpp +@@ -26,7 +26,7 @@ + #include <vector> + + GLVisualConfig::GLVisualConfig(const std::string &s) : +- id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1), samples(0) ++ GLVisualConfig() + { + std::vector<std::string> elems; + +@@ -85,7 +85,7 @@ GLVisualConfig::match_score(const GLVisualConfig &target) const + score += score_component(blue, target.blue, 4); + score += score_component(alpha, target.alpha, 4); + score += score_component(depth, target.depth, 1); +- score += score_component(stencil, target.stencil, 0); ++ score += score_component(stencil, target.stencil, 1); + score += score_component(buffer, target.buffer, 1); + score += score_component(samples, target.samples, -1); + +@@ -135,11 +135,14 @@ GLVisualConfig::score_component(int component, int target, int scale) const + * score for all components ranges from [0,MAXIMUM_COMPONENT_SCORE). + * If scale > 0, we reward the largest positive difference from target, + * otherwise the smallest positive difference from target. ++ * We also reward the smallest positive difference from the target, ++ * if the target < 0, i.e., we don't care about this value. + */ + int diff = std::abs(scale) * (component - target); + if (diff > 0) + { +- score = scale < 0 ? MAXIMUM_COMPONENT_SCORE - diff : diff; ++ score = (scale < 0 || target < 0) ? ++ MAXIMUM_COMPONENT_SCORE - diff : diff; + score = std::min(MAXIMUM_COMPONENT_SCORE, score); + score = std::max(0, score); + } +diff --git a/src/gl-visual-config.h b/src/gl-visual-config.h +index b28473f..013ce14 100644 +--- a/src/gl-visual-config.h ++++ b/src/gl-visual-config.h +@@ -31,7 +31,7 @@ class GLVisualConfig + { + public: + GLVisualConfig(): +- id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1), samples(0) {} ++ id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(-1), buffer(1), samples(0) {} + GLVisualConfig(const std::string &s); + + /** +diff --git a/src/options.cpp b/src/options.cpp +index 8d1ec16..3a31d3d 100644 +--- a/src/options.cpp ++++ b/src/options.cpp +@@ -213,9 +213,9 @@ Options::print_help() + " target: 'id=ID:red=R:green=G:blue=B:alpha=A:buffer=BUF:\n" + " stencil=STENCIL:samples=SAMPLES'. The parameters may be\n" + " defined in any order, and any omitted parameters assume a\n" +- " default value of '0' (id, stencil, samples) or '1' (red,\n" +- " green, blue, alpha, buffer). If 'id' is set to a non-zero\n" +- " value, all other parameters are ignored\n" ++ " default value of '0' (id, samples), '-1' (stencil) or\n" ++ " '1' (red, green, blue, alpha, buffer). If 'id' is set to\n" ++ " a non-zero value, all other parameters are ignored\n" + " --reuse-context Use a single context for all scenes\n" + " (by default, each scene gets its own context)\n" + " -s, --size WxH Size of the output window (default: 800x600)\n" +-- +2.44.0 + diff --git a/meta-oe/recipes-benchmark/glmark2/files/Fix-configure-for-sqrt-check.patch b/meta-oe/recipes-benchmark/glmark2/files/Fix-configure-for-sqrt-check.patch deleted file mode 100644 index 7de05ee583..0000000000 --- a/meta-oe/recipes-benchmark/glmark2/files/Fix-configure-for-sqrt-check.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 9fb298c398f88a63d71432be1410d52fae089063 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein <tom.hochstein@nxp.com> -Date: Mon, 8 Aug 2016 11:39:54 -0500 - ---- - wscript | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/wscript b/wscript -index ca843f4..eb4a26a 100644 ---- a/wscript -+++ b/wscript -@@ -84,7 +84,7 @@ def configure(ctx): - ctx.check_cc(lib = lib, uselib_store = uselib) - - # Check required functions -- req_funcs = [('memset', 'string.h', []) ,('sqrt', 'math.h', ['m'])] -+ req_funcs = [('memset', 'string.h', [])] - for func, header, uselib in req_funcs: - ctx.check_cc(function_name = func, header_name = header, - uselib = uselib, mandatory = True) diff --git a/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch b/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch deleted file mode 100644 index 72b8debe56..0000000000 --- a/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Otavio Salvador <otavio@ossystems.com.br> -Subject: [PATCH] build: Check packages to be used by the enabled flavors -Organization: O.S. Systems Software LTDA. - -The packages shouldn't be dynamically detected otherwise the build -predictability is lost. We now have all packages as mandatory but -dependent of the flavors which use them. - -Upstream-Status: Submitted [https://github.com/glmark2/glmark2/pull/8] - -Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> ---- - wscript | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/wscript b/wscript -index cab62a3..e7eaed0 100644 ---- a/wscript -+++ b/wscript -@@ -121,13 +121,17 @@ def configure(ctx): - ('mirclient','mirclient', '0.13', list_contains(ctx.options.flavors, 'mir')), - ('wayland-client','wayland-client', None, list_contains(ctx.options.flavors, 'wayland')), - ('wayland-egl','wayland-egl', None, list_contains(ctx.options.flavors, 'wayland'))] -- for (pkg, uselib, atleast, mandatory) in opt_pkgs: -+ for (pkg, uselib, atleast, check) in opt_pkgs: -+ # Check packages required by the flavors -+ if not check: -+ continue -+ - if atleast is None: - ctx.check_cfg(package = pkg, uselib_store = uselib, -- args = '--cflags --libs', mandatory = mandatory) -+ args = '--cflags --libs', mandatory = True) - else: - ctx.check_cfg(package = pkg, uselib_store = uselib, atleast_version=atleast, -- args = '--cflags --libs', mandatory = mandatory) -+ args = '--cflags --libs', mandatory = True) - - - # Prepend CXX flags so that they can be overriden by the --- -2.4.6 - diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb index 99050e7047..0b61d6ed62 100644 --- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb +++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb @@ -1,38 +1,37 @@ 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" +LICENSE = "GPL-3.0-or-later & SGI-1" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ file://COPYING.SGI;beginline=5;md5=269cdab4af6748677acce51d9aa13552" DEPENDS = "libpng jpeg udev" +DEPENDS:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-native wayland-protocols', '', d)}" -PV = "2017.07+${SRCPV}" +PV = "2023.01" -COMPATIBLE_HOST_rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}" - -SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https \ - file://build-Check-packages-to-be-used-by-the-enabled-flavo.patch \ - file://Fix-configure-for-sqrt-check.patch \ - file://0001-Fix-clang-warnings.patch \ - " -SRCREV = "ed20c633f1926d1dd78e3e89043c85a81302cbe6" +SRC_URI = " \ + git://github.com/glmark2/glmark2.git;protocol=https;branch=master \ + file://0001-fix-dispmanx-build.patch \ + file://0002-run-dispmanx-fullscreen.patch \ + file://0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch \ +" +SRCREV = "42e3d8fe3aa88743ef90348138f643f7b04a9237" S = "${WORKDIR}/git" -inherit waf pkgconfig distro_features_check - -REQUIRED_DISTRO_FEATURES += "opengl" +inherit meson pkgconfig features_check -PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gl x11-gles2', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gl wayland-gles2', '', d)} \ - drm-gl drm-gles2" +ANY_OF_DISTRO_FEATURES = "opengl dispmanx" -# Enable C++11 features -CXXFLAGS += "-std=c++11" +PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'dispmanx', 'dispmanx', '', d)} \ + drm-gles2 \ + " PACKAGECONFIG[x11-gl] = ",,virtual/libgl virtual/libx11" PACKAGECONFIG[x11-gles2] = ",,virtual/libgles2 virtual/libx11" @@ -40,6 +39,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() @@ -56,7 +56,9 @@ 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)) + d.appendVar("EXTRA_OEMESON", " -Dflavors=%s" % ",".join(flavors)) } |