diff options
Diffstat (limited to 'meta/recipes-graphics/piglit')
10 files changed, 243 insertions, 155 deletions
diff --git a/meta/recipes-graphics/piglit/piglit/0001-Add-a-missing-include-for-htobe32-definition.patch b/meta/recipes-graphics/piglit/piglit/0001-Add-a-missing-include-for-htobe32-definition.patch new file mode 100644 index 0000000000..caa48e088d --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-Add-a-missing-include-for-htobe32-definition.patch @@ -0,0 +1,27 @@ +From d623e9797b7ee9b3739a8a4afe1a01f7e03754aa Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Sun, 1 Nov 2020 20:08:49 +0000 +Subject: [PATCH] Add a missing include for htobe32 definition + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/spec/nv_copy_depth_to_color/nv_copy_depth_to_color.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tests/spec/nv_copy_depth_to_color/nv_copy_depth_to_color.c b/tests/spec/nv_copy_depth_to_color/nv_copy_depth_to_color.c +index 5f45e0c23..c755ee29a 100644 +--- a/tests/spec/nv_copy_depth_to_color/nv_copy_depth_to_color.c ++++ b/tests/spec/nv_copy_depth_to_color/nv_copy_depth_to_color.c +@@ -34,6 +34,8 @@ + + #include "piglit-util-gl.h" + ++#include <endian.h> ++ + #define IMAGE_WIDTH 60 + #define IMAGE_HEIGHT 60 + +-- +2.17.1 + diff --git a/meta/recipes-graphics/piglit/piglit/0001-framework-profile.py-make-test-lists-reproducible.patch b/meta/recipes-graphics/piglit/piglit/0001-framework-profile.py-make-test-lists-reproducible.patch new file mode 100644 index 0000000000..cc9482c047 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-framework-profile.py-make-test-lists-reproducible.patch @@ -0,0 +1,31 @@ +From 9086d42df1f3134bafcfe33ff16db7bbb9d9a0fd Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Mon, 30 Nov 2020 23:08:22 +0000 +Subject: [PATCH] framework/profile.py: make test lists reproducible + +These are created with os.walk, which yields different +order depending on where it's run. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + framework/profile.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/framework/profile.py b/framework/profile.py +index c210e535e..9b5d51d68 100644 +--- a/framework/profile.py ++++ b/framework/profile.py +@@ -528,7 +528,11 @@ class TestProfile(object): + else: + opts[n] = self.test_list[n] + else: +- opts = self.test_list # pylint: disable=redefined-variable-type ++ opts = collections.OrderedDict() ++ test_keys = list(self.test_list.keys()) ++ test_keys.sort() ++ for k in test_keys: ++ opts[k] = self.test_list[k] + + for k, v in self.filters.run(opts.items()): + yield k, v diff --git a/meta/recipes-graphics/piglit/piglit/0001-generated_tests-gen_tcs-tes_input_tests.py-do-not-ha.patch b/meta/recipes-graphics/piglit/piglit/0001-generated_tests-gen_tcs-tes_input_tests.py-do-not-ha.patch new file mode 100644 index 0000000000..8704f98500 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-generated_tests-gen_tcs-tes_input_tests.py-do-not-ha.patch @@ -0,0 +1,44 @@ +From 1b23539aece156f6fe0789cb988f22e5915228f6 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Tue, 10 Nov 2020 17:12:32 +0000 +Subject: [PATCH 1/2] generated_tests/gen_tcs/tes_input_tests.py: do not + hardcode the full binary path + +This helps reproducibility. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + generated_tests/gen_tcs_input_tests.py | 2 +- + generated_tests/gen_tes_input_tests.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/generated_tests/gen_tcs_input_tests.py b/generated_tests/gen_tcs_input_tests.py +index face4f19a..e36671af4 100644 +--- a/generated_tests/gen_tcs_input_tests.py ++++ b/generated_tests/gen_tcs_input_tests.py +@@ -272,7 +272,7 @@ class Test(object): + relative probe rgb (0.75, 0.75) (0.0, 1.0, 0.0) + """) + +- test = test.format(self=self, generator_command=" ".join(sys.argv)) ++ test = test.format(self=self, generator_command="generated_tests/gen_tcs_input_tests.py") + + filename = self.filename() + dirname = os.path.dirname(filename) +diff --git a/generated_tests/gen_tes_input_tests.py b/generated_tests/gen_tes_input_tests.py +index 3d847b5cc..954840b20 100644 +--- a/generated_tests/gen_tes_input_tests.py ++++ b/generated_tests/gen_tes_input_tests.py +@@ -301,7 +301,7 @@ class Test(object): + relative probe rgb (0.75, 0.75) (0.0, 1.0, 0.0) + """) + +- test = test.format(self=self, generator_command=" ".join(sys.argv)) ++ test = test.format(self=self, generator_command="generated_tests/gen_tes_input_tests.py") + + filename = self.filename() + dirname = os.path.dirname(filename) +-- +2.17.1 + diff --git a/meta/recipes-graphics/piglit/piglit/0001-render-ops.c-add-missing-format-string.patch b/meta/recipes-graphics/piglit/piglit/0001-render-ops.c-add-missing-format-string.patch new file mode 100644 index 0000000000..261d98d8f6 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-render-ops.c-add-missing-format-string.patch @@ -0,0 +1,24 @@ +From e21e68f6aa0f5249fce613e8fd4ac0edbd5cb7b0 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Tue, 22 Dec 2020 13:35:11 +0100 +Subject: [PATCH] render-ops.c: add missing format string + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/spec/ati_fragment_shader/render-ops.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/spec/ati_fragment_shader/render-ops.c b/tests/spec/ati_fragment_shader/render-ops.c +index 131334ba2..19a353d67 100644 +--- a/tests/spec/ati_fragment_shader/render-ops.c ++++ b/tests/spec/ati_fragment_shader/render-ops.c +@@ -393,7 +393,7 @@ piglit_display(void) + bool ok = piglit_probe_rect_halves_equal_rgba(get_test_x(i), get_test_y(i), + w * 2, h); + enum piglit_result sub_result = ok ? PIGLIT_PASS : PIGLIT_FAIL; +- piglit_report_subtest_result(sub_result, test->name); ++ piglit_report_subtest_result(sub_result, "%s", test->name); + piglit_merge_result(&result, sub_result); + } + diff --git a/meta/recipes-graphics/piglit/piglit/0001-serializer.py-make-.gz-files-reproducible.patch b/meta/recipes-graphics/piglit/piglit/0001-serializer.py-make-.gz-files-reproducible.patch new file mode 100644 index 0000000000..2efba6f866 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-serializer.py-make-.gz-files-reproducible.patch @@ -0,0 +1,30 @@ +From 1919bb7f4072d73dcbb64d0e06eff5b04529c3db Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Mon, 16 Nov 2020 18:01:02 +0000 +Subject: [PATCH] serializer.py: make .gz files reproducible + +.gz format contains mtime of the compressed data, and +SOURCE_DATE_EPOCH is the standard way to make it reproducuble. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/serializer.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/serializer.py b/tests/serializer.py +index bd14bc3db..bc5b45d7f 100644 +--- a/tests/serializer.py ++++ b/tests/serializer.py +@@ -138,7 +138,10 @@ def serializer(name, profile, outfile): + et.SubElement(env, 'env', name=k, value=v) + + tree = et.ElementTree(root) +- with gzip.open(outfile, 'wb') as f: ++ reproducible_mtime = None ++ if 'SOURCE_DATE_EPOCH' in os.environ: ++ reproducible_mtime=os.environ['SOURCE_DATE_EPOCH'] ++ with gzip.GzipFile(outfile, 'wb', mtime=reproducible_mtime) as f: + tree.write(f, encoding='utf-8', xml_declaration=True) + + 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 57eda2e207..0000000000 --- a/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch +++ /dev/null @@ -1,75 +0,0 @@ -Upstream-Status: Submitted [mailing list] -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From 0e0a2a69261031d55d52b6045990e8982ea12912 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: only run rounding tests if FE_UPWARD is present - -On ARM, musl does not define FE_* when the architecture does not have VFP (which -is the right interpretation). - -As these tests depend on calling fesetround(), skip the test if FE_UPWARD isn't -available. - -Signed-off-by: Ross Burton <ross.burton@intel.com> ---- - tests/general/roundmode-getintegerv.c | 12 ++++++++---- - tests/general/roundmode-pixelstore.c | 12 ++++++++---- - 2 files changed, 16 insertions(+), 8 deletions(-) - -diff --git a/tests/general/roundmode-getintegerv.c b/tests/general/roundmode-getintegerv.c -index 28ecfaf55..aa99044a1 100644 ---- a/tests/general/roundmode-getintegerv.c -+++ b/tests/general/roundmode-getintegerv.c -@@ -79,13 +79,17 @@ test(float val, int expect) - void - piglit_init(int argc, char **argv) - { -- int ret; - bool pass = true; -- ret = fesetround(FE_UPWARD); -- if (ret != 0) { -- printf("Couldn't set rounding mode\n"); -+ -+#ifdef FE_UPWARD -+ if (fesetround(FE_UPWARD) != 0) { -+ printf("Setting rounding mode failed\n"); - piglit_report_result(PIGLIT_SKIP); - } -+#else -+ printf("Cannot set rounding mode\n"); -+ piglit_report_result(PIGLIT_SKIP); -+#endif - - pass = test(2.2, 2) && pass; - pass = test(2.8, 3) && pass; -diff --git a/tests/general/roundmode-pixelstore.c b/tests/general/roundmode-pixelstore.c -index 8a029b257..57ec11c09 100644 ---- a/tests/general/roundmode-pixelstore.c -+++ b/tests/general/roundmode-pixelstore.c -@@ -79,13 +79,17 @@ test(float val, int expect) - void - piglit_init(int argc, char **argv) - { -- int ret; - bool pass = true; -- ret = fesetround(FE_UPWARD); -- if (ret != 0) { -- printf("Couldn't set rounding mode\n"); -+ -+#ifdef FE_UPWARD -+ if (fesetround(FE_UPWARD) != 0) { -+ printf("Setting rounding mode failed\n"); - piglit_report_result(PIGLIT_SKIP); - } -+#else -+ printf("Cannot set rounding mode\n"); -+ piglit_report_result(PIGLIT_SKIP); -+#endif - - pass = test(2.2, 2) && pass; - pass = test(2.8, 3) && pass; --- -2.11.0 - diff --git a/meta/recipes-graphics/piglit/piglit/0001-tests-shader.py-sort-the-file-list-before-working-on.patch b/meta/recipes-graphics/piglit/piglit/0001-tests-shader.py-sort-the-file-list-before-working-on.patch new file mode 100644 index 0000000000..8321be8490 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-tests-shader.py-sort-the-file-list-before-working-on.patch @@ -0,0 +1,28 @@ +From 5bf89c6a314952313b2b762fff0d5501fe57ac53 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 2 Dec 2020 21:21:52 +0000 +Subject: [PATCH] tests/shader.py: sort the file list before working on it + +This allows later xml output to be reproducible. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/shader.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/shader.py b/tests/shader.py +index 849273660..e6e65d1ba 100644 +--- a/tests/shader.py ++++ b/tests/shader.py +@@ -52,7 +52,9 @@ for basedir in [TESTS_DIR, GENERATED_TESTS_DIR]: + for group, files in shader_tests.items(): + assert group not in profile.test_list, 'duplicate group: {}'.format(group) + +- # We'll end up with a list of tuples, split that into two lists ++ # This makes the xml output reproducible, as os.walk() order is random ++ files.sort() ++ # We'll end up with a list of tuples, split that into two list + files, installedfiles = list(zip(*files)) + files = list(files) + installedfiles = list(installedfiles) diff --git a/meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch b/meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch new file mode 100644 index 0000000000..16c7c5c803 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch @@ -0,0 +1,30 @@ +From 1c67250308a92d4991ed05d9d240090ab84accae 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 2/2] 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 4fd68d21e..c9ea8295e 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, +-- +2.17.1 + diff --git a/meta/recipes-graphics/piglit/piglit/format-fix.patch b/meta/recipes-graphics/piglit/piglit/format-fix.patch deleted file mode 100644 index 73d539fef2..0000000000 --- a/meta/recipes-graphics/piglit/piglit/format-fix.patch +++ /dev/null @@ -1,69 +0,0 @@ -Upstream-Status: Submitted [mailing list] -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From f0c6981322807e179e39ce67aeebd42cf7a54d36 Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Wed, 21 Nov 2018 12:44:36 +0000 -Subject: [PATCH] arb_texture_view: fix security format warnings - -If built with -Werror=format-security then Piglit fails to build: - -/tests/spec/arb_texture_view/rendering-layers-image.c:150:8: -error: format not a string literal and no format arguments [-Werror=format-security] - (desc)); \ - ^~~~~~ - -In this case test->uniform_type is being turned into a string using snprintf() -and then passed to piglit_report_subtest_result() which takes a format string, -but GCC can't verify the format. - -As _subtest_report() takes a format string, we can just remove the snprintf() -and let it construct the label. - -Also as X is used once and doesn't make the code clearer, just inline it. - -Signed-off-by: Ross Burton <ross.burton@intel.com> ---- - tests/spec/arb_texture_view/rendering-layers-image.c | 19 ++++++------------- - 1 file changed, 6 insertions(+), 13 deletions(-) - -diff --git a/tests/spec/arb_texture_view/rendering-layers-image.c b/tests/spec/arb_texture_view/rendering-layers-image.c -index 415b01657..86148075b 100644 ---- a/tests/spec/arb_texture_view/rendering-layers-image.c -+++ b/tests/spec/arb_texture_view/rendering-layers-image.c -@@ -142,26 +142,19 @@ test_render_layers(const struct test_info *test) - return pass; - } - --#define X(f, desc) \ -- do { \ -- const bool subtest_pass = (f); \ -- piglit_report_subtest_result(subtest_pass \ -- ? PIGLIT_PASS : PIGLIT_FAIL, \ -- (desc)); \ -- pass = pass && subtest_pass; \ -- } while (0) -- - enum piglit_result - piglit_display(void) - { - bool pass = true; - for (int test_idx = 0; test_idx < ARRAY_SIZE(tests); test_idx++) { - const struct test_info *test = &tests[test_idx]; -- char test_name[128]; -- snprintf(test_name, sizeof(test_name), "layers rendering of %s", test->uniform_type); -- X(test_render_layers(test), test_name); -+ -+ const bool subtest_pass = test_render_layers(test); -+ -+ piglit_report_subtest_result(subtest_pass ? PIGLIT_PASS : PIGLIT_FAIL, -+ "layers rendering of %s", test->uniform_type); -+ pass = pass && subtest_pass; - } --#undef X - pass = piglit_check_gl_error(GL_NO_ERROR) && pass; - return pass ? PIGLIT_PASS : PIGLIT_FAIL; - } --- -2.11.0 - diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb index 622e0462b3..442c1a3c62 100644 --- a/meta/recipes-graphics/piglit/piglit_git.bb +++ b/meta/recipes-graphics/piglit/piglit_git.bb @@ -1,27 +1,34 @@ SUMMARY = "OpenGL driver testing framework" +DESCRIPTION = "Piglit is an open-source test suite for OpenGL and OpenCL \ +implementations." LICENSE = "MIT & LGPLv2+ & GPLv3 & GPLv2+ & BSD-3-Clause" LIC_FILES_CHKSUM = "file://COPYING;md5=b2beded7103a3d8a442a2a0391d607b0" -SRC_URI = "git://anongit.freedesktop.org/piglit \ +SRC_URI = "git://gitlab.freedesktop.org/mesa/piglit.git;protocol=https \ 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 \ file://0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch \ - file://format-fix.patch \ + file://0001-Add-a-missing-include-for-htobe32-definition.patch \ + file://0001-generated_tests-gen_tcs-tes_input_tests.py-do-not-ha.patch \ + file://0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \ + file://0001-serializer.py-make-.gz-files-reproducible.patch \ + file://0001-framework-profile.py-make-test-lists-reproducible.patch \ + file://0001-tests-shader.py-sort-the-file-list-before-working-on.patch \ + file://0001-render-ops.c-add-missing-format-string.patch \ " UPSTREAM_CHECK_COMMITS = "1" -# From 2018-10-26 -SRCREV = "b9066c7717af1d169a616c9e61706b99ff8515b5" +SRCREV = "603deba4ab66e2a8948693a14d715e536caddcc5" # (when PV goes above 1.0 remove the trailing r) PV = "1.0+gitr${SRCPV}" 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 pkgconfig python3native distro_features_check bash-completion -# depends on virtual/libx11 -REQUIRED_DISTRO_FEATURES = "x11" +DEPENDS = "libpng waffle libxkbcommon virtual/libgl 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" @@ -32,8 +39,11 @@ REQUIRED_DISTRO_FEATURES += "opengl" export TEMP = "${B}/temp/" do_compile[dirs] =+ "${B}/temp/" -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" PACKAGECONFIG[freeglut] = "-DPIGLIT_USE_GLUT=1,-DPIGLIT_USE_GLUT=0,freeglut," +PACKAGECONFIG[x11] = "-DPIGLIT_BUILD_GL_TESTS=ON,-DPIGLIT_BUILD_GL_TESTS=OFF,${X11_DEPS}, ${X11_RDEPS}" + +export PIGLIT_BUILD_DIR = "../../../../git" do_configure_prepend() { if [ "${@bb.utils.contains('PACKAGECONFIG', 'freeglut', 'yes', 'no', d)}" = "no" ]; then @@ -42,13 +52,21 @@ do_configure_prepend() { fi } +# Forcibly strip because Piglit is *huge* OECMAKE_TARGET_INSTALL = "install/strip" 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-netserver mesa-demos bash \ + python3-netserver bash \ " 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" |