tests/syncobj_timeline: test delayed submission with, WAIT_AVAILABLE
PATCH 1/1 tests/syncobj_timeline: test delayed submission with, WAIT_AVAILABLE
The syncobj_timeline test suite includes cases where drmSyncobjTimelineWait is called with the WAIT_FOR_SUBMIT flag before the timeline point has been submitted. Then, after a short delay, the timeline point does get submitted and signaled and the test verifies that the drmSyncobjTimelineWait call is unblocked as expected.
Alas, while this was working correctly with the WAIT_FOR_SUBMIT flag, if the WAIT_AVAILABLE flag is used instead the wait will *always* block for the full timeout duration even if the timeline point is submitted earlier due to a bug in the kernel. The return value would still indicate that the wait completed successfully, though. That is, it wouldn't return -ETIME.
To ensure test coverage for such a scenario, this change adds delayed submission test cases which use the WAIT_AVAILABLE flag. These will be similar to the WAIT_FOR_SUBMIT cases mentioned above except that, after the delay, the timeline point will only submitted, not signaled.
Furthermore, it adds an assertion that the drmSyncobjTimelineWait call returned *before* the timeout expired, which it always should since the timeout is a full 100ms longer than the delay.
--- tests/syncobj_timeline.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-)
tests/syncobj_timeline.c +36 -4
@@ -490,6 +490,13 @@ syncobj_trigger(int fd, uint32_t handle, uint64_t point)close (timeline); } +static void +syncobj_submit (int fd,uint32_t handle,uint64_t point) +{ +int timeline =syncobj_attach_sw_sync (fd, handle, point); +close (timeline); +} +static timer_t set_timer (void (*cb)(union sigval ),void *ptr,int i,uint64_t nsec) {
@@ -534,8 +541,17 @@ syncobj_trigger_free_pair_func(union sigval sigval)free (pair); } +static void +syncobj_submit_free_pair_func (union sigval sigval) +{ +struct fd_handle_pair *pair = sigval.sival_ptr; +syncobj_submit (pair->fd, pair->handle, pair->point); +free (pair); +} +static timer_t -syncobj_trigger_delayed (int fd,uint32_t syncobj,uint64_t point,uint64_t nsec) +syncobj_delayed_operation (int fd,uint32_t syncobj,uint64_t point,uint64_t nsec, +void (*operation)(union sigval )) {struct fd_handle_pair *pair =malloc (sizeof (*pair));
@@ -543,7 +559,7 @@ syncobj_trigger_delayed(int fd, uint32_t syncobj, uint64_t point, uint64_t nsec) pair->handle = syncobj; pair->point = point; -return set_timer (syncobj_trigger_free_pair_func, pair,0 , nsec); +return set_timer (operation, pair,0 , nsec); } static const char *test_wait_bad_flags_desc =
@@ -942,18 +958,26 @@ test_wait_delayed_signal(int fd, uint32_t test_flags)uint64_t point =1 ;int timeline =-1 ;timer_t timer; +uint64_t start_time;if (test_flags &WAIT_FOR_SUBMIT ) { - timer =syncobj_trigger_delayed (fd, syncobj, point,SHORT_TIME_NSEC ); + timer =syncobj_delayed_operation (fd, syncobj, point,SHORT_TIME_NSEC , + syncobj_trigger_free_pair_func); + }else if (test_flags &WAIT_AVAILABLE ) { + timer =syncobj_delayed_operation (fd, syncobj, point,SHORT_TIME_NSEC , + syncobj_submit_free_pair_func); }else { timeline =syncobj_attach_sw_sync (fd, syncobj, point); timer =set_timer (timeline_inc_func,NULL , timeline,SHORT_TIME_NSEC ); } + start_time =gettime_ns ();igt_assert (syncobj_timeline_wait (fd, &syncobj, &point,1 , -gettime_ns () +SHORT_TIME_NSEC *2 , + start_time +SHORT_TIME_NSEC *2 , flags,NULL )); +/* ensure we were unblocked before the timeout expired */ +igt_assert (gettime_ns () - start_time <SHORT_TIME_NSEC *2 );timer_delete (timer);
@@ -1809,6 +1833,10 @@ igt_main igt_subtest("wait-for-submit-delayed-submit")test_wait_delayed_signal (fd,WAIT_FOR_SUBMIT ); +igt_describe (test_wait_delayed_signal_desc); + igt_subtest("wait-available-delayed-submit") +test_wait_delayed_signal (fd,WAIT_AVAILABLE ); +igt_describe (test_wait_delayed_signal_desc); igt_subtest("wait-all-delayed-signal")test_wait_delayed_signal (fd,WAIT_ALL );
@@ -1817,6 +1845,10 @@ igt_main igt_subtest("wait-all-for-submit-delayed-submit")test_wait_delayed_signal (fd,WAIT_ALL |WAIT_FOR_SUBMIT ); +igt_describe (test_wait_delayed_signal_desc); + igt_subtest("wait-all-available-delayed-submit") +test_wait_delayed_signal (fd,WAIT_ALL |WAIT_AVAILABLE ); +igt_describe (test_reset_unsignaled_desc); igt_subtest("reset-unsignaled")test_reset_unsignaled (fd);
Signature · 1 line
2.43.0
Patchwork
CI✗ Fi.CI.BUILD: failure for tests/syncobj_timeline: test delayed submission with, WAIT_AVAILABLE
== Series Details ==
== Series Details ==
Series: tests/syncobj_timeline: test delayed submission with, WAIT_AVAILABLE
URL : https://patchwork.freedesktop.org/series/128742/
State : failure
== Summary ==
IGT patchset build failed on latest successful build af432b481fb6a21e53e15d67784a317947f7ec96 tests/intel/xe_ccs: fix block-multicopy-inplace subtest
Tail of build.log:
[1615/1661] Linking target tools/intel_pm_rpm.
[1616/1661] Linking target runner/testdata/abort.
[1617/1661] Linking target tools/intel_dp_compliance.
[1618/1661] Linking target tools/intel_panel_fitter.
[1619/1661] Linking target runner/testdata/dynamic.
[1620/1661] Linking target tools/lsgpu.
[1621/1661] Linking target runner/testdata/no-subtests.
[1622/1661] Linking target tools/intel_watermark.
[1623/1661] Linking target runner/testdata/skippers.
[1624/1661] Linking target tools/msm_dp_compliance.
[1625/1661] Linking target runner/igt_comms_decoder.
[1626/1661] Linking target runner/testdata/abort-fixture.
[1627/1661] Linking target runner/testdata/abort-simple.
[1628/1661] Linking target runner/igt_runner.
[1629/1661] Linking target tools/intel_gem_info.
[1630/1661] Generating gem_stress.testlist with a meson_exe.py custom command.
[1631/1661] Linking target tools/amd_hdmi_compliance.
[1632/1661] Linking target tools/intel_residency.
[1633/1661] Linking target runner/testdata/successtest.
[1634/1661] Linking target runner/igt_resume.
[1635/1661] Linking target runner/igt_results.
[1636/1661] Linking target runner/testdata/abort-dynamic.
[1637/1661] Linking target tools/intel_reg.
[1638/1661] Linking target runner/runner_json_test.
[1639/1661] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt1.c.o'.
[1640/1661] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
[1641/1661] Linking target runner/runner_test.
[1642/1661] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt2.c.o'.
[1643/1661] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt3.c.o'.
[1644/1661] Linking target lib/libi915_perf.so.1.5.
[1645/1661] Generating symbol file 'lib/76b5a35@@i915_perf@sha/libi915_perf.so.1.5.symbols'.
[1646/1661] Linking target tools/i915-perf/i915-perf-configs.
[1647/1661] Linking target tools/i915-perf/i915-perf-recorder.
[1648/1661] Linking target tools/i915-perf/i915-perf-reader.
[1649/1661] Linking target tests/core_hotunplug.
[1650/1661] Linking target tests/gem_barrier_race.
[1651/1661] Linking target tests/perf.
[1652/1661] Generating core_hotunplug.testlist with a meson_exe.py custom command.
[1653/1661] Generating perf.testlist with a meson_exe.py custom command.
[1654/1661] Generating gem_barrier_race.testlist with a meson_exe.py custom command.
[1655/1661] Generating xe_tests.rst with a custom command.
[1656/1661] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst/usr/src/igt-gpu-tools/scripts/igt_doc.py --config /usr/src/igt-gpu-tools/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /opt/igt/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
[1657/1661] Generating kms_tests.rst with a custom command.
[1658/1661] Generating xe_tests.html with a custom command.
ninja: build stopped: subcommand failed.
Patchwork
CI✗ GitLab.Pipeline: warning for tests/syncobj_timeline: test delayed submission with, WAIT_AVAILABLE
In reply to Erik Kurzinger== Series Details ==
== Series Details ==
Series: tests/syncobj_timeline: test delayed submission with, WAIT_AVAILABLE
URL : https://patchwork.freedesktop.org/series/128742/
State : warning
== Summary ==
Pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1076865 for the overview.
build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/53689306):
[1652/1656] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/733] Generating version.h with a custom command.
[2/6] Linking target runner/runner_test.
[3/6] Linking target assembler/intel-gen4asm.
[4/6] Generating kms_tests.html with a custom command.
[5/6] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1705098197:step_script
section_start:1705098197:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1705098198:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/53689301):
Please refer: docs/test_documentation.md for more details
[1658/1662] Generating kms_tests.rst with a custom command.
[1659/1662] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/735] Generating version.h with a custom command.
[2/5] Linking target runner/runner_test.
[3/5] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1705098194:step_script
section_start:1705098194:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1705098194:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/53689305):
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
[1660/1662] Generating kms_tests.rst with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/735] Generating version.h with a custom command.
[2/4] Generating kms_tests.html with a custom command.
[3/4] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1705098222:step_script
section_start:1705098222:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1705098223:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/53689304):
Please refer: docs/test_documentation.md for more details
[1498/1502] Generating kms_tests.rst with a custom command.
[1499/1502] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/687] Generating version.h with a custom command.
[2/5] Linking target runner/runner_test.
[3/5] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1705098195:step_script
section_start:1705098195:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1705098196:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/53689302):
Please refer: docs/test_documentation.md for more details
[1658/1662] Generating kms_tests.rst with a custom command.
[1659/1662] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/735] Generating version.h with a custom command.
[2/5] Linking target runner/runner_test.
[3/5] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1705098192:step_script
section_start:1705098192:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1705098193:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/53689303):
Please refer: docs/test_documentation.md for more details
[1658/1662] Generating kms_tests.rst with a custom command.
[1659/1662] Compiling C object 'runner/runner@@runner_test@exe/runner_tests.c.o'.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/735] Generating version.h with a custom command.
[2/5] Linking target runner/runner_test.
[3/5] Generating i915_tests.rst with a custom command.
FAILED: docs/testplan/i915_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/i915_test_config.json --rest docs/testplan/i915_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
Warning: Missing documentation for igt@syncobj_timeline@wait-all-available-delayed-submit
Warning: Missing documentation for igt@syncobj_timeline@wait-available-delayed-submit
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1705098197:step_script
section_start:1705098197:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1705098197:cleanup_file_variables
ERROR: Job failed: exit code 1
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1076865