diff options
Diffstat (limited to 'meta/recipes-graphics/piglit')
7 files changed, 230 insertions, 110 deletions
diff --git a/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch b/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch deleted file mode 100644 index e07e810a73..0000000000 --- a/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 26faa2c157a27a18a9f767976730fe0c115e3af4 Mon Sep 17 00:00:00 2001 -From: Jussi Kukkonen <jussi.kukkonen@intel.com> -Date: Wed, 13 Jul 2016 19:19:02 +0300 -Subject: [PATCH] cmake: install bash-completions in the right place - -The completionsdir variable is a full path and should not be -prefixed. - -This does mean the files may be installed outside of -CMAKE_INSTALL_PREFIX -- the alternative is more difficult and -means that bash completion files may be installed where -bash-completion can't find them. - -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> -Upstream-Status: Submitted [mailing list] ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e2abba..784a8f9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -532,7 +532,7 @@ install ( - if (BASH_COMPLETION_FOUND) - install( - FILES completions/bash/piglit -- DESTINATION ${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}/ -+ DESTINATION ${BASH_COMPLETION_COMPLETIONSDIR}/ - ) - endif (BASH_COMPLETION_FOUND) - --- -2.8.1 - diff --git a/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch b/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch new file mode 100644 index 0000000000..08e709b1d0 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch @@ -0,0 +1,50 @@ +From 77f327909e4a99c64261290cd76e234e10cc64d2 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 3 May 2023 21:59:43 -0700 +Subject: [PATCH] tests: Fix narrowing errors seen with clang + +Fixes +piglit-test-pattern.cpp:656:26: error: type 'float' cannot be narrowed to 'int' in initiali +zer list [-Wc++11-narrowing] + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/807] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../spec/ext_framebuffer_multisample/draw-buffers-common.cpp | 4 ++-- + tests/util/piglit-test-pattern.cpp | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp +index 48e1ad4a5..b36830c45 100644 +--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp ++++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp +@@ -353,8 +353,8 @@ draw_pattern(bool sample_alpha_to_coverage, + float vertices[4][2] = { + { 0.0f, 0.0f + i * (pattern_height / num_rects) }, + { 0.0f, (i + 1.0f) * (pattern_height / num_rects) }, +- { pattern_width, (i + 1.0f) * (pattern_height / num_rects) }, +- { pattern_width, 0.0f + i * (pattern_height / num_rects) } }; ++ { static_cast<float>(pattern_width), (i + 1.0f) * (pattern_height / num_rects) }, ++ { static_cast<float>(pattern_width), 0.0f + i * (pattern_height / num_rects) } }; + + glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, + sizeof(vertices[0]), +diff --git a/tests/util/piglit-test-pattern.cpp b/tests/util/piglit-test-pattern.cpp +index 43d451d6a..52ee94457 100644 +--- a/tests/util/piglit-test-pattern.cpp ++++ b/tests/util/piglit-test-pattern.cpp +@@ -653,12 +653,12 @@ ColorGradientSunburst::draw_with_scale_and_offset(const float (*proj)[4], + { + switch (out_type) { + case GL_INT: { +- int clear_color[4] = { offset, offset, offset, offset }; ++ int clear_color[4] = { static_cast<int>(offset), static_cast<int>(offset), static_cast<int>(offset), static_cast<int>(offset) }; + glClearBufferiv(GL_COLOR, 0, clear_color); + break; + } + case GL_UNSIGNED_INT: { +- unsigned clear_color[4] = { offset, offset, offset, offset }; ++ unsigned clear_color[4] = { static_cast<unsigned>(offset), static_cast<unsigned>(offset), static_cast<unsigned>(offset), static_cast<unsigned>(offset) }; + glClearBufferuiv(GL_COLOR, 0, clear_color); + break; + } diff --git a/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch b/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch deleted file mode 100644 index f851a92ceb..0000000000 --- a/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0fc2c2932699cfd68be96c820fddfdd79b48b788 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sat, 9 Jul 2016 07:52:19 +0000 -Subject: [PATCH] tests: Use FE_UPWARD only if its defined in fenv.h - -On ARM, musl does not define FE_* when arch does not have -VFP, (which is right interpretation), therefore check if -its defined before using it - -Fixes errors like - -tests/general/roundmode-pixelstore.c:82:19: error: 'FE_UPWARD' undeclared (first use in this function) - ret = fesetround(FE_UPWARD); - ^~~~~~~~~ - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- -Upstream-Status: Pending - - tests/general/roundmode-getintegerv.c | 2 ++ - tests/general/roundmode-pixelstore.c | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/tests/general/roundmode-getintegerv.c b/tests/general/roundmode-getintegerv.c -index 28ecfaf..5c27579 100644 ---- a/tests/general/roundmode-getintegerv.c -+++ b/tests/general/roundmode-getintegerv.c -@@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) - { - int ret; - bool pass = true; -+#ifdef FE_UPWARD - ret = fesetround(FE_UPWARD); -+#endif - if (ret != 0) { - printf("Couldn't set rounding mode\n"); - piglit_report_result(PIGLIT_SKIP); -diff --git a/tests/general/roundmode-pixelstore.c b/tests/general/roundmode-pixelstore.c -index 9284f43..3fcb396 100644 ---- a/tests/general/roundmode-pixelstore.c -+++ b/tests/general/roundmode-pixelstore.c -@@ -79,7 +79,9 @@ piglit_init(int argc, char **argv) - { - int ret; - bool pass = true; -+#ifdef FE_UPWARD - ret = fesetround(FE_UPWARD); -+#endif - if (ret != 0) { - printf("Couldn't set rounding mode\n"); - piglit_report_result(PIGLIT_SKIP); --- -1.8.3.1 - diff --git a/meta/recipes-graphics/piglit/piglit/0001-utils-Include-libgen.h-on-musl-linux-systems.patch b/meta/recipes-graphics/piglit/piglit/0001-utils-Include-libgen.h-on-musl-linux-systems.patch new file mode 100644 index 0000000000..2875dd52ec --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-utils-Include-libgen.h-on-musl-linux-systems.patch @@ -0,0 +1,83 @@ +From 6c852e6ac292008137a6f3a8aa908090bb5b4b11 Mon Sep 17 00:00:00 2001 +From: Erik Faye-Lund <erik.faye-lund@collabora.com> +Date: Tue, 19 Mar 2024 16:34:02 +0100 +Subject: [PATCH] properly check for libgen.h + +Some users are reporting that basename is not available when building on +Linux with musl libc. And since the POSIX spec[1] says that basename is +defined in libgen.h, we should include that when available. + +So let's properly detect the header, and include it if it exists. This +should hopefully make things a bit more robust. + +Since we're also including this from the CL program-tester, let's +rearrange the includes a bit so we know that config.h has been included. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/888] +Reviewed-by: David Heidelberg <david.heidelberg@collabora.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + CMakeLists.txt | 1 + + tests/cl/program/program-tester.c | 5 ++++- + tests/util/config.h.in | 1 + + tests/util/piglit-util.h | 4 ++-- + 4 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dd2bf67125..5563fe0e20 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -492,6 +492,7 @@ check_include_file(unistd.h HAVE_UNISTD_H) + check_include_file(fcntl.h HAVE_FCNTL_H) + check_include_file(linux/sync_file.h HAVE_LINUX_SYNC_FILE_H) + check_include_file(endian.h HAVE_ENDIAN_H) ++check_include_file(libgen.h HAVE_LIBGEN_H) + + if(DEFINED PIGLIT_INSTALL_VERSION) + set(PIGLIT_INSTALL_VERSION_SUFFIX +diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c +index 97fe64906d..e47fb5aacc 100644 +--- a/tests/cl/program/program-tester.c ++++ b/tests/cl/program/program-tester.c +@@ -31,10 +31,13 @@ + #include <inttypes.h> + #include <math.h> + #include <regex.h> +-#include <libgen.h> + + #include "piglit-framework-cl-program.h" + ++#ifdef HAVE_LIBGEN_H ++#include <libgen.h> ++#endif ++ + /* Regexes */ + + /* +diff --git a/tests/util/config.h.in b/tests/util/config.h.in +index 8ed5af1709..437eb91418 100644 +--- a/tests/util/config.h.in ++++ b/tests/util/config.h.in +@@ -16,3 +16,4 @@ + #cmakedefine HAVE_SYS_RESOURCE_H 1 + #cmakedefine HAVE_UNISTD_H 1 + #cmakedefine HAVE_ENDIAN_H 1 ++#cmakedefine HAVE_LIBGEN_H 1 +diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h +index 4d3606c708..de999980b6 100644 +--- a/tests/util/piglit-util.h ++++ b/tests/util/piglit-util.h +@@ -52,8 +52,8 @@ extern "C" { + #include <math.h> + #include <float.h> + +-#if defined(__APPLE__) || defined(__MINGW32__) +-# include "libgen.h" // for basename ++#ifdef HAVE_LIBGEN_H ++# include <libgen.h> // for basename + #elif defined(_MSC_VER) + + static inline char * +-- +GitLab + diff --git a/meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch b/meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch new file mode 100644 index 0000000000..70bb55053d --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch @@ -0,0 +1,29 @@ +From cb8e4b99fcfe81399e3e6d922156db4a48a39a8e Mon Sep 17 00:00:00 2001 +From: Pascal Bach <pascal.bach@siemens.com> +Date: Thu, 4 Oct 2018 14:43:17 +0200 +Subject: [PATCH] cmake: use proper WAYLAND_INCLUDE_DIRS variable + +WAYLAND_wayland-client_INCLUDEDIR is an internal variable and is not correctly +set when cross compiling. WAYLAND_INCLUDE_DIRS includes the correct path even +when cross compiling. + +Signed-off-by: Pascal Bach <pascal.bach@siemens.com> + +Upstream-Status: Submitted [piglit@lists.freedesktop.org] +--- + tests/util/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt +index 1714ab41f..3b67aa7da 100644 +--- a/tests/util/CMakeLists.txt ++++ b/tests/util/CMakeLists.txt +@@ -97,7 +97,7 @@ if(PIGLIT_USE_WAFFLE) + piglit-framework-gl/piglit_wl_framework.c + ) + list(APPEND UTIL_GL_INCLUDES +- ${WAYLAND_wayland-client_INCLUDEDIR} ++ ${WAYLAND_INCLUDE_DIRS} + ) + endif() + if(PIGLIT_HAS_X11) diff --git a/meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch b/meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch new file mode 100644 index 0000000000..ce5cbd3ea9 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch @@ -0,0 +1,27 @@ +From 7d2d23125f1946a7b74f9a427388d469500fcd8d Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Tue, 10 Nov 2020 17:13:50 +0000 +Subject: [PATCH] tests/util/piglit-shader.c: do not hardcode build path into + target binary + +This helps reproducibilty. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/util/piglit-shader.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c +index 1787eb180..9e74704b1 100644 +--- a/tests/util/piglit-shader.c ++++ b/tests/util/piglit-shader.c +@@ -73,7 +73,7 @@ piglit_compile_shader(GLenum target, const char *filename) + + source_dir = getenv("PIGLIT_SOURCE_DIR"); + if (source_dir == NULL) { +- source_dir = SOURCE_DIR; ++ source_dir = "."; + } + + snprintf(filename_with_path, FILENAME_MAX - 1, diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb index bbe9a88969..99d75e64f8 100644 --- a/meta/recipes-graphics/piglit/piglit_git.bb +++ b/meta/recipes-graphics/piglit/piglit_git.bb @@ -1,25 +1,31 @@ SUMMARY = "OpenGL driver testing framework" -LICENSE = "MIT & LGPLv2+ & GPLv3 & GPLv2+ & BSD-3-Clause" +DESCRIPTION = "Piglit is an open-source test suite for OpenGL and OpenCL \ +implementations." +HOMEPAGE = "https://gitlab.freedesktop.org/mesa/piglit" +BUGTRACKER = "https://gitlab.freedesktop.org/mesa/piglit/-/issues" +LICENSE = "MIT & LGPL-2.0-or-later & GPL-3.0-only & GPL-2.0-or-later & BSD-3-Clause" LIC_FILES_CHKSUM = "file://COPYING;md5=b2beded7103a3d8a442a2a0391d607b0" -SRC_URI = "git://anongit.freedesktop.org/piglit \ - file://0001-cmake-install-bash-completions-in-the-right-place.patch \ - file://0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch \ +SRC_URI = "git://gitlab.freedesktop.org/mesa/piglit.git;protocol=https;branch=main \ + file://0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch \ + file://0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \ + file://0001-tests-Fix-narrowing-errors-seen-with-clang.patch \ + file://0001-utils-Include-libgen.h-on-musl-linux-systems.patch \ " UPSTREAM_CHECK_COMMITS = "1" -# From 2017-07-03 -SRCREV = "c8f4fd9eeb298a2ef0855927f22634f794ef3eff" +SRCREV = "22eaf6a91cfd57f7bb3df4e5068c2ac1472d4ec1" # (when PV goes above 1.0 remove the trailing r) -PV = "1.0+gitr${SRCPV}" +PV = "1.0+gitr" S = "${WORKDIR}/git" -DEPENDS = "libpng virtual/libx11 libxkbcommon libxrender waffle virtual/libgl libglu python3-mako-native python3-numpy-native python3-six-native virtual/egl" +X11_DEPS = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxrender libglu', '', d)}" +X11_RDEPS = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'mesa-demos', '', d)}" -inherit cmake python3native distro_features_check bash-completion -# depends on virtual/libx11 -REQUIRED_DISTRO_FEATURES = "x11" +DEPENDS = "libpng waffle libxkbcommon python3-mako-native python3-numpy-native python3-six-native virtual/egl" + +inherit cmake pkgconfig python3native features_check bash-completion # depends on virtual/libgl REQUIRED_DISTRO_FEATURES += "opengl" @@ -30,25 +36,39 @@ REQUIRED_DISTRO_FEATURES += "opengl" export TEMP = "${B}/temp/" do_compile[dirs] =+ "${B}/temp/" -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glx', '', d)}" PACKAGECONFIG[freeglut] = "-DPIGLIT_USE_GLUT=1,-DPIGLIT_USE_GLUT=0,freeglut," +PACKAGECONFIG[glx] = "-DPIGLIT_BUILD_GLX_TESTS=ON,-DPIGLIT_BUILD_GLX_TESTS=OFF" +PACKAGECONFIG[opencl] = "-DPIGLIT_BUILD_CL_TESTS=ON,-DPIGLIT_BUILD_CL_TESTS=OFF,virtual/opencl-icd" +PACKAGECONFIG[x11] = "-DPIGLIT_BUILD_GL_TESTS=ON,-DPIGLIT_BUILD_GL_TESTS=OFF,${X11_DEPS}, ${X11_RDEPS}" +PACKAGECONFIG[vulkan] = "-DPIGLIT_BUILD_VK_TESTS=ON,-DPIGLIT_BUILD_VK_TESTS=OFF,glslang-native vulkan-loader,glslang" + +export PIGLIT_BUILD_DIR = "../../../../git" -do_configure_prepend() { +do_configure:prepend() { if [ "${@bb.utils.contains('PACKAGECONFIG', 'freeglut', 'yes', 'no', d)}" = "no" ]; then sed -i -e "/^#.*include <GL\/freeglut_ext.h>$/d" ${S}/src/piglit/glut_wrap.h sed -i -e "/^#.*include.*<GL\/glut.h>$/d" ${S}/src/piglit/glut_wrap.h fi } -do_install() { - oe_runmake -C ${B} 'DESTDIR=${D}' install/strip -} +# Forcibly strip because Piglit is *huge*, and don't bother trying to split/strip the result. +OECMAKE_TARGET_INSTALL = "install/strip" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -RDEPENDS_${PN} = "waffle python3 python3-mako python3-json \ - python3-subprocess python3-misc python3-importlib \ +RDEPENDS:${PN} = "waffle waffle-bin python3 python3-mako python3-json \ + python3-misc \ python3-unixadmin python3-xml python3-multiprocessing \ - python3-six python3-shell python3-io python3-argparse \ - python3-netserver mesa-demos bash \ + python3-six python3-shell python3-io \ + python3-netserver bash \ " -INSANE_SKIP_${PN} += "dev-so already-stripped" +INSANE_SKIP:${PN} += "dev-so already-stripped" + +# As nothing builds against Piglit we don't need to have anything in the +# sysroot, especially when this is ~2GB of test suite +SYSROOT_DIRS:remove = "${libdir}" + +# Can't be built with ccache +CCACHE_DISABLE = "1" |