syncobj: Add some wait and reset tests
PATCH 1/1 syncobj: Add some wait and reset tests
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 624 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 625 insertions(+) create mode 100644 tests/syncobj_wait.c
tests/Makefile.sources +1 -0
@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \
tests/syncobj_wait.c new file +624 -0
624 lines not on this page · raw message
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for syncobj: Add some wait and reset tests
== Series Details ==
== Series Details ==
Series: syncobj: Add some wait and reset tests
URL : https://patchwork.freedesktop.org/series/28567/
State : failure
== Summary ==
IGT patchset build failed on latest successful build c129026622accef6f54c0cfb0dc55e930cfa60b5 igt: add syncobj_basic.
make all-recursive
Making all in lib
make all-recursive
Making all in .
Making all in tests
make[4]: Nothing to be done for 'all'.
Making all in man
make[2]: Nothing to be done for 'all'.
Making all in tools
Making all in null_state_gen
make[3]: Nothing to be done for 'all'.
Making all in registers
make[3]: Nothing to be done for 'all'.
make[3]: Nothing to be done for 'all-am'.
Making all in scripts
make[2]: Nothing to be done for 'all'.
Making all in benchmarks
make[2]: Nothing to be done for 'all'.
Making all in tests
Making all in intel-ci
make[3]: Nothing to be done for 'all'.
CCLD debugfs_test CCLD drm_import_export CCLD drm_mm CCLD drm_read CCLD drm_vma_limiter CCLD drm_vma_limiter_cached CCLD drm_vma_limiter_cpu CCLD drm_vma_limiter_gtt CCLD drv_getparams_basic CCLD drv_hangman CCLD drv_missed_irq CCLD drv_module_reload CCLD drv_selftest CCLD drv_suspend CCLD gem_bad_length CCLD gem_bad_reloc CCLD gem_basic CCLD gem_busy CCLD gem_caching CCLD gem_close_race CCLD gem_concurrent_blit CCLD gem_cpu_reloc CCLD gem_create CCLD gem_cs_prefetch CCLD gem_cs_tlb CCLD gem_ctx_bad_destroy CCLD gem_ctx_bad_exec CCLD gem_ctx_basic CCLD gem_ctx_create CCLD gem_ctx_exec CCLD gem_ctx_param CCLD gem_ctx_switch CCLD gem_ctx_thrash CCLD gem_double_irq_loop CCLD gem_eio CCLD gem_evict_alignment CCLD gem_evict_everything CCLD gem_exec_alignment CCLD gem_exec_async CCLD gem_exec_await CCLD gem_exec_bad_domains CCLD gem_exec_basic CCLD gem_exec_big CCLD gem_exec_blt CCLD gem_exec_capture CCLD gem_exec_create CCLD gem_exec_faulting_reloc CCLD gem_exec_fence CCLD gem_exec_flush CCLD gem_exec_gttfill CCLD gem_exec_latency CCLD gem_exec_lut_handle CCLD gem_exec_nop CCLD gem_exec_parallel CCLD gem_exec_params CCLD gem_exec_parse CCLD gem_exec_reloc CCLD gem_exec_reuse CCLD gem_exec_schedule CCLD gem_exec_store CCLD gem_exec_suspend CCLD gem_exec_whisper CCLD gem_fd_exhaustion CCLD gem_fence_thrash CCLD gem_fence_upload CCLD gem_fenced_exec_thrash CCLD gem_flink_basic CCLD gem_flink_race CCLD gem_gpgpu_fill CCLD gem_gtt_cpu_tlb CCLD gem_gtt_hog CCLD gem_gtt_speed CCLD gem_hangcheck_forcewake CCLD gem_largeobject CCLD gem_linear_blits CCLD gem_lut_handle CCLD gem_madvise CCLD gem_media_fill CCLD gem_mmap CCLD gem_mmap_gtt CCLD gem_mmap_offset_exhaustion CCLD gem_mmap_wc CCLD gem_mocs_settings CCLD gem_partial_pwrite_pread CCLD gem_persistent_relocs CCLD gem_pin CCLD gem_pipe_control_store_loop CCLD gem_ppgtt CCLD gem_pread CCLD gem_pread_after_blit CCLD gem_pwrite CCLD gem_pwrite_pread CCLD gem_pwrite_snooped CCLD gem_read_read_speed CCLD gem_readwrite CCLD gem_reg_read CCLD gem_reloc_overflow CCLD gem_reloc_vs_gpu CCLD gem_render_copy CCLD gem_render_copy_redux CCLD gem_render_linear_blits CCLD gem_render_tiled_blits CCLD gem_request_retire CCLD gem_reset_stats CCLD gem_ring_sync_copy CCLD gem_ring_sync_loop CCLD gem_ringfill CCLD gem_seqno_wrap CCLD gem_set_tiling_vs_blt CCLD gem_set_tiling_vs_gtt CCLD gem_set_tiling_vs_pwrite CCLD gem_shrink CCLD gem_softpin CCLD gem_spin_batch CCLD gem_stolen CCLD gem_storedw_batches_loop CCLD gem_storedw_loop CCLD gem_streaming_writes CCLD gem_sync CCLD gem_threaded_access_tiled CCLD gem_tiled_blits CCLD gem_tiled_fence_blits CCLD gem_tiled_partial_pwrite_pread CCLD gem_tiled_pread_basic CCLD gem_tiled_pread_pwrite CCLD gem_tiled_swapping CCLD gem_tiled_wb CCLD gem_tiled_wc CCLD gem_tiling_max_stride CCLD gem_unfence_active_buffers CCLD gem_unref_active_buffers CCLD gem_userptr_blits CCLD gem_wait CCLD gem_workarounds CCLD gem_write_read_ring_switch CCLD gen3_mixed_blits CCLD gen3_render_linear_blits CCLD gen3_render_mixed_blits CCLD gen3_render_tiledx_blits CCLD gen3_render_tiledy_blits CCLD gen7_forcewake_mt CCLD gvt_basic CCLD kms_3d CCLD kms_addfb_basic CCLD kms_atomic CCLD kms_atomic_transition CCLD kms_busy CCLD kms_ccs CCLD kms_chv_cursor_fail CCLD kms_concurrent CCLD kms_crtc_background_color CCLD kms_cursor_crc CCLD kms_cursor_legacy CCLD kms_draw_crc CCLD kms_fbc_crc CCLD kms_fbcon_fbt CCLD kms_fence_pin_leak CCLD kms_flip CCLD kms_flip_event_leak CCLD kms_flip_tiling CCLD kms_force_connector_basic CCLD kms_frontbuffer_tracking CCLD kms_hdmi_inject CCLD kms_invalid_dotclock CCLD kms_legacy_colorkey CCLD kms_mmap_write_crc CCLD kms_mmio_vs_cs_flip CCLD kms_panel_fitting CCLD kms_pipe_b_c_ivb CCLD kms_pipe_color CCLD kms_pipe_crc_basic CCLD kms_plane CCLD kms_plane_lowres CCLD kms_plane_multiple CCLD kms_plane_scaling CCLD kms_properties CCLD kms_psr_sink_crc CCLD kms_pwrite_crc CCLD kms_render CCLD kms_rmfb CCLD kms_rotation_crc CCLD kms_setmode CCLD kms_sink_crc_basic CCLD kms_sysfs_edid_timing CCLD kms_tv_load_detect CCLD kms_universal_plane CCLD kms_vblank CCLD meta_test CCLD perf CCLD pm_backlight CCLD pm_lpsp CCLD pm_rc6_residency CCLD pm_rpm CCLD pm_rps CCLD pm_sseu CCLD prime_busy CCLD prime_mmap CCLD prime_mmap_coherency CCLD prime_mmap_kms CCLD prime_self_import CCLD prime_udl CCLD prime_vgem CCLD sw_sync CCLD syncobj_basic CC syncobj_wait.o
Makefile:3912: recipe for target 'syncobj_wait.o' failed Makefile:4383: recipe for target 'all-recursive' failed Makefile:528: recipe for target 'all-recursive' failed Makefile:460: recipe for target 'all' failed
====================================================
intel-gpu-tools 1.19: lib/tests/test-suite.log
====================================================
# TOTAL: 15
# PASS: 2
# SKIP: 0
# XFAIL: 6
# FAIL: 7
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
XFAIL: igt_no_exit
==================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_no_exit:10666) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_exit:10666) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_exit:10666) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_exit:10666) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_no_exit failed.
**** DEBUG ****
(igt_no_exit:10666) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_exit:10666) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_exit:10666) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_exit:10666) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_no_exit: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
XFAIL igt_no_exit (exit status: 134)
XFAIL: igt_no_exit_list_only
============================
igt_no_exit_list_only: igt_core.c:576: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed. A
XFAIL igt_no_exit_list_only (exit status: 134)
XFAIL: igt_no_subtest
=====================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_subtest:10670) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_subtest:10670) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_no_exit failed.
**** DEBUG ****
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_subtest:10670) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_subtest:10670) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_no_subtest: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
XFAIL igt_no_subtest (exit status: 134)
FAIL: igt_simulation
====================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_simulation:10679) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simulation:10679) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simulation:10679) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simulation:10679) igt-debugfs-CRITICAL: error: -1 != 0
Test test failed.
**** DEBUG ****
(igt_simulation:10679) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simulation:10679) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simulation:10679) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simulation:10679) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)igt_simulation: igt_simulation.c:111: main: Assertion `do_fork() == IGT_EXIT_SKIP' failed.
FAIL igt_simulation (exit status: 134)
XFAIL: igt_simple_test_subtests
===============================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_simple_test_subtests failed.
**** DEBUG ****
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
XFAIL igt_simple_test_subtests (exit status: 99)
FAIL: igt_stats
===============
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_stats:10693) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_stats:10693) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_stats:10693) igt-debugfs-CRITICAL: Last errno: 13, Permission denied
(igt_stats:10693) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_stats failed.
**** DEBUG ****
(igt_stats:10693) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_stats:10693) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_stats:10693) igt-debugfs-CRITICAL: Last errno: 13, Permission denied
(igt_stats:10693) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
FAIL igt_stats (exit status: 99)
XFAIL: igt_timeout
==================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_timeout:10691) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_timeout:10691) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_timeout:10691) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_timeout:10691) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_timeout failed.
**** DEBUG ****
(igt_timeout:10691) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_timeout:10691) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_timeout:10691) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_timeout:10691) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
XFAIL igt_timeout (exit status: 99)
XFAIL: igt_invalid_subtest_name
===============================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_invalid_subtest_name failed.
**** DEBUG ****
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_invalid_subtest_name: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
XFAIL igt_invalid_subtest_name (exit status: 134)
FAIL: igt_segfault
==================
Simple test.
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_segfault:10687) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_segfault:10687) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_segfault:10687) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_segfault:10687) igt-debugfs-CRITICAL: error: -1 != 0
Test test failed.
**** DEBUG ****
(igt_segfault:10675) INFO: Simple test.
(igt_segfault:10687) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_segfault:10687) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_segfault:10687) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_segfault:10687) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)igt_segfault: igt_segfault.c:119: main: Assertion `do_fork() == SIGSEGV + 128' failed.
FAIL igt_segfault (exit status: 134)
FAIL: igt_subtest_group
=======================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_subtest_group:10697) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_subtest_group:10697) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_subtest_group failed.
**** DEBUG ****
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_subtest_group:10697) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_subtest_group:10697) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_subtest_group: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL igt_subtest_group (exit status: 134)
FAIL: igt_assert
================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_assert:10681) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_assert:10681) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_assert:10681) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_assert:10681) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_assert failed.
**** DEBUG ****
(igt_assert:10681) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_assert:10681) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_assert:10681) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_assert:10681) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_assert: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL igt_assert (exit status: 134)
FAIL: igt_exit_handler
======================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_exit_handler:10700) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_exit_handler:10700) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_no_exit failed.
**** DEBUG ****
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_exit_handler:10700) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_exit_handler:10700) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_exit_handler: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]igt_exit_handler: igt_exit_handler.c:106: testfunc: Assertion `read(pipes[0], &tmp, 1) == 1' failed. FAIL igt_exit_handler (exit status: 134)
FAIL: igt_hdmi_inject
=====================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_hdmi_inject failed.
**** DEBUG ****
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
FAIL igt_hdmi_inject (exit status: 99)
====================================================
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 syncobj: Add some wait and reset tests (v2)
In reply to Jason EkstrandThis adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
v2:
- Actually add the reset tests.
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 714 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 715 insertions(+) create mode 100644 tests/syncobj_wait.c
tests/Makefile.sources +1 -0
@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \
tests/syncobj_wait.c new file +714 -0
714 lines not on this page · raw message
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 syncobj: Add some wait and reset tests (v3)
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Use do_ioctl and do_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthread
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 691 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 692 insertions(+) create mode 100644 tests/syncobj_wait.c
tests/Makefile.sources +1 -0
@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \
tests/syncobj_wait.c new file +691 -0
691 lines not on this page · raw message
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t] syncobj: Add some wait and reset tests (v3)
Quoting Jason Ekstrand (2017-08-09 19:49:34)
Quoted 116 lines
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Usedo_ioctlanddo_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthreadSigned-off-by Jason Ekstrand <[email protected]>--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 691 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 692 insertions(+) create mode 100644 tests/syncobj_wait.ctests/Makefile.sources +1
-0@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \tests/syncobj_wait.c new file +76
-0@@ -0,0 +1,691 @@ +/* +* Copyright © 2017 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +*/ + +#include "igt.h" +#include <unistd.h> +#include <time.h> +#include <sys/ioctl.h> +#include "drm.h" + +IGT_TEST_DESCRIPTION ("Tests for the drm sync object wait API" ); + +/* One tenth of a second */ +#define SHORT_TIME_NSEC 100000000ull + +/** A per-platform function which triggers a set of sync objects +* +* If wait is set, the function should wait for the work to complete so +* that an immediate call to SYNCOBJ_WAIT will return success. If wait is +* not set, then the function should try to submit enough work that an +* immediate call to SYNCOBJ_WAIT with a timeout of 0 will time out. +*/ +void (*trigger_syncobj)(int fd,uint32_t *syncobjs,int count,bool wait); + +#define LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) +#define LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) +struct local_syncobj_wait { +__u64 handles; +/* absolute timeout */ +__s64 timeout_nsec; +__u32 count_handles; +__u32 flags; +__u32 first_signaled;/* only valid when not waiting all */ +__u32 pad; +}; + +struct local_syncobj_reset { +__u32 handle; +__u32 flags; +}; + +#define LOCAL_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct local_syncobj_wait) +#define LOCAL_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct local_syncobj_reset) + +#define NSECS_PER_SEC 1000000000ull + +static uint64_t +gettime_ns (void ) +{ +struct timespec current; +clock_gettime (CLOCK_MONOTONIC , ¤t); +return (uint64_t )current.tv_sec *NSECS_PER_SEC + current.tv_nsec; +} + +static uint64_t +short_timeout (void ) +{
tests/syncobj_wait.c line 86
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+return gettime_ns () +SHORT_TIME_NSEC ; +} + +static uint32_t +syncobj_create (int fd) +{ +struct drm_syncobj_create create = {0 }; +int ret; + + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_CREATE , &create);
I recommend a pattern like:
int err;
static int __syncobj_create(int fd, uint32_t *syncobj)
{
struct local_syncobj_create create = {};
int err;
if (igt_ioctl(fd, LOCAL_IOCTL_SYNCOBJ_CREATE, &create))
return -errno;
*syncobj = create.handle;
return 0;
}static uint32_t syncobj_create(int fd)
{
uint32_t syncobj;
igt_assert_eq(__syncobj_create(fd, &syncobj), 0);
igt_assert(syncobj);
return syncobj;
}igt_assert_eq() prints the comparison and its values, makes debugging less guess work, and __syncobj_create() is much easier to understand than the macro expansion inside the assert output.
You may want to pass the ioctl_arg or individual members as convenience dictates.
Quoted 76 lines
tests/syncobj_wait.c new file +76
-0+igt_assert (ret ==0 ); +igt_assert (create.handle >0 ); + +return create.handle; +} + +static void +syncobj_destroy (int fd,uint32_t handle) +{ +struct drm_syncobj_destroy destroy = {0 }; +int ret; + + destroy.handle = handle; + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy); +igt_assert (ret ==0 ); +} + +struct delayed_trigger { +int fd; +uint32_t *syncobjs; +int count; +uint64_t nsec; +}; + +static void +trigger_syncobj_delayed_func (union sigval sigval) +{ +struct delayed_trigger *trigger = sigval.sival_ptr; +struct timespec time; + +trigger_syncobj (trigger->fd, trigger->syncobjs, trigger->count, true); +free (trigger); +} + +static timer_t +trigger_syncobj_delayed (int fd,uint32_t *syncobjs,int count,uint64_t nsec) +{ +struct delayed_trigger *trigger; +timer_t timer; +struct sigevent sev; +struct itimerspec its; + + trigger =malloc (sizeof (*trigger)); + trigger->fd = fd; + trigger->syncobjs = syncobjs; + trigger->count = count; + trigger->nsec = nsec; + +memset (&sev,0 ,sizeof (sev)); + sev.sigev_notify =SIGEV_THREAD ; + sev.sigev_value.sival_ptr = trigger; + sev.sigev_notify_function = trigger_syncobj_delayed_func; +igt_assert (timer_create (CLOCK_MONOTONIC , &sev, &timer) ==0 ); + +memset (&its,0 ,sizeof (its)); + its.it_value.tv_sec = nsec /NSEC_PER_SEC ; + its.it_value.tv_nsec = nsec %NSEC_PER_SEC ; +igt_assert (timer_settime (timer,0 , &its,NULL ) ==0 ); + +return timer; +} + +static void +test_wait_bad_flags (int fd) +{ +struct local_syncobj_wait wait = {0 }; + wait.flags =0xdeadbeef ; +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,EINVAL ); +} + +static void +test_wait_zero_handles (int fd) +{ +struct local_syncobj_wait wait = {0 }; +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,EINVAL ); +}
tests/syncobj_wait.c line 172
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ +static void +test_wait_illegal_handle (int fd) +{ +struct local_syncobj_wait wait = {0 }; +uint32_t handle =0 ; + + wait.count_handles =1 ; + wait.handles =to_user_pointer (&handle); +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,ENOENT );
Better check a valid + an invalid handle also generates an error.
EFAULT testing is missing, i.e. wait.handles = -1; handles is allowed to be in read-only memory, so another good test would be:
wait.handles = -1; igt_assert_eq(__syncobj_wait(fd, &eait), -EFAULT);
ptr = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1); igt_assert(ptr != MAP_FAILED);
wait.handles = ptr; igt_assert_eq(__syncobj_wait(fd, &eait), -ENOENT);
do_or_die(mprotect(ptr, 4096, PROT_READ)); igt_assert_eq(__syncobj_wait(fd, &eait), -ENOENT);
do_or_die(mprotect(ptr, 4096, PROT_NONE)); igt_assert_eq(__syncobj_wait(fd, &eait), -EFAULT);
munmap(ptr, 4096);
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+} + +static void +test_reset_bad_flags (int fd) +{ +struct local_syncobj_reset reset = {0 };
tests/syncobj_wait.c line 188
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ reset.flags =0xdeadbeef ; +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_RESET , &reset,EINVAL ); +} + +static void +test_reset_illegal_handle (int fd) +{ +struct local_syncobj_reset reset = {0 }; + reset.handle =0 ; +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_RESET , &reset,ENOENT );
reset.handle = syncobj_create(fd); do_ioctl_err(fd, LOCAL_IOCTL_SYNCOBJ_RESET, &reset, 0);
syncobj_destroy(fd, reset.handle); do_ioctl_err(fd, LOCAL_IOCTL_SYNCOBJ_RESET, &reset, ENOENT);
Also good for test_wait_illegal_handle.
tests/syncobj_wait.c line 201
Quoted 13 lines
tests/syncobj_wait.c new file +13
-0+} + +static void +test_wait_unsignaled (int fd) +{ +uint32_t syncobj =syncobj_create (fd); +struct local_syncobj_wait wait = {0 }; + + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ; + wait.timeout_nsec =short_timeout (); + +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,EINVAL );
Does polling an unsubmitted syncobj also raise an error?
i.e.
wait.timeout_nsec = 0,
wait.timeout_nsec = short,
wait.timeout_nsec = infinity
all generate EINVAL?
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+ +syncobj_destroy (fd, syncobj); +} + +static void +test_wait_for_submit_unsignaled (int fd)
tests/syncobj_wait.c line 217
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+{ +uint32_t syncobj =syncobj_create (fd); +struct local_syncobj_wait wait = {0 }; + + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ; + wait.flags =LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT ; + wait.timeout_nsec =short_timeout (); + +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,ETIME );
Same question about wait.timeout_nsec = 0.
tests/syncobj_wait.c line 230
Quoted 13 lines
tests/syncobj_wait.c new file +13
-0+ +syncobj_destroy (fd, syncobj); +} + +static void +test_wait_signaled (int fd) +{ +uint32_t syncobj =syncobj_create (fd); +struct local_syncobj_wait wait = {0 }; +int ret; + + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ;
assert unsigned here.
tests/syncobj_wait.c line 236
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+ +trigger_syncobj (fd, &syncobj,1 , false); + + wait.timeout_nsec =0 ; + ret =drmIoctl (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait); +igt_warn_on (ret !=-1 || errno !=ETIME );
It had better well be signaled at this point, i.e.
wait.timeout_nsec = 0; while (drmIoctl(fd, LOCAL_IOCTL_SYNCOBJ_WAIT, &wait)) ;
should terminate (imo, consider it like glQuerySync). Hmm, this of course rules out just using dma_fence_is_signaled() as the only condition due to the lax rules ondma_fence.
Quoted 12 lines
tests/syncobj_wait.c new file +12
-0+ wait.timeout_nsec =short_timeout (); +do_ioctl (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait); + +syncobj_destroy (fd, syncobj); +} + +static void +test_wait_for_submit_signaled (int fd) +{ +uint32_t syncobj =syncobj_create (fd); +struct local_syncobj_wait wait = {0 }; +int ret;
tests/syncobj_wait.c line 259
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ; + wait.flags =LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT ; + +trigger_syncobj (fd, &syncobj,1 , false); + + wait.timeout_nsec =0 ; + ret =drmIoctl (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait); +igt_warn_on (ret !=-1 || errno !=ETIME );
Same arguments as above.
Quoted 38 lines
tests/syncobj_wait.c new file +36
-0+ + wait.timeout_nsec =short_timeout (); +do_ioctl (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait); + +syncobj_destroy (fd, syncobj); +} + +static void +test_wait_for_submit_delayed_signal (int fd) +{ +uint32_t syncobj =syncobj_create (fd); +struct local_syncobj_wait wait = {0 }; +timer_t timer; + + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ; + wait.flags =LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT ; + + timer =trigger_syncobj_delayed (fd, &syncobj,1 ,SHORT_TIME_NSEC ); + + wait.timeout_nsec =0 ; +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,ETIME ); + + wait.timeout_nsec =gettime_ns () +SHORT_TIME_NSEC *2 ; +do_ioctl (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait); + +timer_delete (timer); + +syncobj_destroy (fd, syncobj); +static void +test_wait_all_some_signaled (int fd) +{ +struct local_syncobj_wait wait = {0 }; +uint32_t syncobjs[2 ]; + + syncobjs[0 ] =syncobj_create (fd);
tests/syncobj_wait.c line 377
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ syncobjs[1 ] =syncobj_create (fd); + +trigger_syncobj (fd, syncobjs,1 , true); + + wait.handles =to_user_pointer (&syncobjs); + wait.count_handles =2 ; + wait.timeout_nsec =short_timeout (); + wait.flags =LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_ALL ; + +do_ioctl_err (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait,EINVAL );
And in reverse order. Also include invalid in the subtest name, I was expected to see a busy/idle pair, not signaled/unsubmitted.
test_invalid_wait_all_some_unsubmitted? Maybe covered below?
At some point, you just give in and start compiling the tests using combinatorics. And pine for automated fuzz exploration.
Quoted 8 lines
tests/syncobj_wait.c new file +8
-0+static void +test_wait_for_submit_any_some_signaled (int fd) +{ +struct local_syncobj_wait wait = {0 }; +uint32_t tmp, syncobjs[2 ]; + + syncobjs[0 ] =syncobj_create (fd); + syncobjs[1 ] =syncobj_create (fd);
tests/syncobj_wait.c line 468
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ +trigger_syncobj (fd, syncobjs,1 , true); + + wait.handles =to_user_pointer (&syncobjs); + wait.count_handles =2 ; + wait.timeout_nsec =short_timeout (); + wait.flags =LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT ; + +do_ioctl (fd,LOCAL_IOCTL_SYNCOBJ_WAIT , &wait); +igt_assert (wait.first_signaled ==0 );
Whenever possible try to use igt_assert_eq(wait.first_signaled, 0); Quite often we wait for an error before going overboard in adding igt_assert_f(), but igt_assert_eq() are easy to add.
Looking good though.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t] syncobj: Add some wait and reset tests (v3)
In reply to Jason EkstrandQuoting Jason Ekstrand (2017-08-09 19:49:34)
Quoted 6 lines
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
Quoted 8 lines
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Usedo_ioctlanddo_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthread
Do we want to bake the snapshot of fences into the ABI? It's a pretty fundamental detail (at least imo)...
test_fences_snapshot {
syncobj[] = ...
bind_to_cpu(0); /* tie both to the same processor/runqueue */
igt_fork(child, 1) {
wait_synbocj()
}
yield(); /* force child to run + wait */
/* swap fences in syncobj[] */
/* signal new fences */
yield();
igt_assert(kill(childpid, 0));
igt_waitchildren()Details are hazy, but we have to force the child in sleeping on the snapshot of fences, then change the syncobj[] in a detectable manner. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/4 lib: Add some syncobj helpers
In reply to Jason Ekstrand--- lib/Makefile.sources | 2 + lib/igt_syncobj.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++ lib/igt_syncobj.h | 65 +++++++++++++++++++ 3 files changed, 243 insertions(+) create mode 100644 lib/igt_syncobj.c create mode 100644 lib/igt_syncobj.h
lib/Makefile.sources +2 -0
@@ -83,6 +83,8 @@ lib_source_list = \ uwildmat/uwildmat.c \ igt_kmod.c \ igt_kmod.h \ + igt_syncobj.c \ + igt_syncobj.h \ $(NULL) .PHONY: version.h.tmp
lib/igt_syncobj.c new file +176 -0
176 lines not on this page · raw message
lib/igt_syncobj.h new file +65 -0
65 lines not on this page · raw message
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 tests/syncobj: Convert the basic test over to the helpers
--- tests/syncobj_basic.c | 77 +++++++++++++-------------------------------------- 1 file changed, 19 insertions(+), 58 deletions(-)
tests/syncobj_basic.c +19 -58
@@ -22,6 +22,7 @@*/ #include "igt.h" +#include "igt_syncobj.h" #include <unistd.h> #include <sys/ioctl.h> #include "drm.h"
@@ -48,14 +49,11 @@ static void test_bad_handle_to_fd(int fd) {struct drm_syncobj_handle handle; -int ret; handle.handle =0xdeadbeef ; handle.flags =0 ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD , &handle); - -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_handle_to_fd (fd, &handle), -EINVAL ); }/* fd to handle a bad fd */
@@ -63,14 +61,11 @@ static void test_bad_fd_to_handle(int fd) {struct drm_syncobj_handle handle; -int ret; handle.fd =-1 ; handle.flags =0 ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE , &handle); - -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_fd_to_handle (fd, &handle), -EINVAL ); }/* fd to handle an fd but not a sync file one */
@@ -78,58 +73,47 @@ static void test_illegal_fd_to_handle(int fd) {struct drm_syncobj_handle handle; -int ret; handle.fd = fd; handle.flags =0 ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE , &handle); - -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_fd_to_handle (fd, &handle), -EINVAL ); }static void test_bad_flags_fd_to_handle (int fd) {struct drm_syncobj_handle handle = {0 }; -int ret; handle.flags =0xdeadbeef ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE , &handle); -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_fd_to_handle (fd, &handle), -EINVAL ); }static void test_bad_flags_handle_to_fd (int fd) {struct drm_syncobj_handle handle = {0 }; -int ret; handle.flags =0xdeadbeef ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD , &handle); -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_handle_to_fd (fd, &handle), -EINVAL ); }static void test_bad_pad_handle_to_fd (int fd) {struct drm_syncobj_handle handle = {0 }; -int ret; handle.pad =0xdeadbeef ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD , &handle); -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_handle_to_fd (fd, &handle), -EINVAL ); }static void test_bad_pad_fd_to_handle (int fd) {struct drm_syncobj_handle handle = {0 }; -int ret; handle.pad =0xdeadbeef ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE , &handle); -igt_assert (ret ==-1 && errno ==EINVAL ); +igt_assert_eq (__syncobj_fd_to_handle (fd, &handle), -EINVAL ); }
@@ -138,24 +122,17 @@ test_bad_pad_fd_to_handle(int fd)static void test_bad_destroy_pad (int fd) { -struct drm_syncobj_create create = {0 };struct drm_syncobj_destroy destroy;int ret; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_CREATE , &create); - - destroy.handle = create.handle; + destroy.handle =syncobj_create (fd); destroy.pad =0xdeadbeef ; ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy);igt_assert (ret ==-1 && errno ==EINVAL ); - destroy.handle = create.handle; - destroy.pad =0 ; - - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy); -igt_assert (ret ==0 ); +syncobj_destroy (fd, destroy.handle); } static void
@@ -176,34 +153,18 @@ test_bad_create_flags(int fd)static void test_valid_cycle (int fd) { -int ret; -struct drm_syncobj_create create = {0 }; -struct drm_syncobj_handle handle = {0 }; -struct drm_syncobj_destroy destroy = {0 }; -uint32_t first_handle; - - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_CREATE , &create); -igt_assert (ret ==0 ); +uint32_t first_handle, second_handle; +int syncobj_fd; - first_handle = create.handle; + first_handle =syncobj_create (fd); + syncobj_fd =syncobj_handle_to_fd (fd, first_handle,0 ); + second_handle =syncobj_fd_to_handle (fd, syncobj_fd,0 ); +close (syncobj_fd); - handle.handle = create.handle; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD , &handle); -igt_assert (ret ==0 ); - handle.handle =0 ; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE , &handle); -close (handle.fd); -igt_assert (ret ==0 ); +igt_assert (first_handle != second_handle); -igt_assert (handle.handle != first_handle); - - destroy.handle = handle.handle; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy); -igt_assert (ret ==0 ); - - destroy.handle = first_handle; - ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy); -igt_assert (ret ==0 ); +syncobj_destroy (fd, first_handle); +syncobj_destroy (fd, second_handle); }static bool has_syncobj (int fd)
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 lib/igt_vgem: Add a syncobj attach helper
In reply to Jason Ekstrand--- lib/igt_vgem.c | 25 ++++++++++++++++++++++++- lib/igt_vgem.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-)
lib/igt_vgem.c +24 -1
@@ -101,8 +101,9 @@ void *vgem_mmap(int fd, struct vgem_bo *bo, unsigned prot)struct local_vgem_fence_attach {uint32_t handle;uint32_t flags; +#define LOCAL_VGEM_FENCE_SYNCOBJ 0x2uint32_t out_fence; -uint32_t pad; +uint32_t syncobj; };struct local_vgem_fence_signal {
@@ -167,6 +168,28 @@ uint32_t vgem_fence_attach(int fd, struct vgem_bo *bo, unsigned flags)return arg.out_fence; } +uint32_t vgem_fence_attach_syncobj (int fd,uint32_t syncobj) +{ +struct local_vgem_fence_attach arg; +struct vgem_bo bo; + +/* Create a dummy BO so the import works */ + bo.width =1 ; + bo.height =1 ; + bo.bpp =4 ; +vgem_create (fd, &bo); + +memset (&arg,0 ,sizeof (arg)); + arg.handle = bo.handle; + arg.syncobj = syncobj; + arg.flags =LOCAL_VGEM_FENCE_SYNCOBJ ; +igt_assert_eq (__vgem_fence_attach (fd, &arg),0 ); + +gem_close (fd, bo.handle); + +return arg.out_fence; +} +static int ioctl_vgem_fence_signal (int fd,struct local_vgem_fence_signal *arg) {int err =0 ;
lib/igt_vgem.h +1 -0
@@ -44,6 +44,7 @@ bool vgem_fence_has_flag(int fd, unsigned flags);uint32_t vgem_fence_attach (int fd,struct vgem_bo *bo,unsigned flags);#define VGEM_FENCE_WRITE 0x1#define WIP_VGEM_FENCE_NOTIMEOUT 0x2 +uint32_t vgem_fence_attach_syncobj (int fd,uint32_t syncobj);int __vgem_fence_signal (int fd,uint32_t fence);void vgem_fence_signal (int fd,uint32_t fence);
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 tests/syncobj: Add some wait and reset tests (v4)
In reply to Jason EkstrandThis adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Use do_ioctl and do_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthread
v4:
- Use ioctl wrappers
- Use VGEM instead of i915
- Combine a bunch of the simple tests into one function
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 624 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 625 insertions(+) create mode 100644 tests/syncobj_wait.c
tests/Makefile.sources +1 -0
@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \
tests/syncobj_wait.c new file +624 -0
624 lines not on this page · raw message
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 tests/syncobj: Add some wait and reset tests (v5)
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Use do_ioctl and do_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthread
v4:
- Use ioctl wrappers
- Use VGEM instead of i915
- Combine a bunch of the simple tests into one function
v5:
- Combinatorially generate basic tests
- Use sw_sync instead of using vgem directly
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 477 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 478 insertions(+) create mode 100644 tests/syncobj_wait.c
tests/Makefile.sources +1 -0
@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \
tests/syncobj_wait.c new file +477 -0
477 lines not on this page · raw message
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)
Quoting Jason Ekstrand (2017-08-10 06:35:43)
tests/syncobj_wait.c line 386
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+igt_main +{ +int fd; + + igt_fixture { + fd =drm_open_driver (DRIVER_ANY );
DRIVER_ANY | DRIVER_VGEM
(ANY really means KMS)
tests/syncobj_wait.c line 388
Quoted 2 lines
tests/syncobj_wait.c new file +2
-0+igt_require (has_syncobj_wait (fd)); +igt_require_sw_sync ();
We should add something like
igt_require(has_timer_resolution(CLOCK_MONOTONIC, SHORT_TIME_NSEC / 2));
static bool has_timer_resolution(clockid_t clk, uint64_t target_ns)
{
struct timespec res;
if (clock_getres(clk, &res))
return false; /* clock unavailable */
return res.tv_sec * NSEC_PER_SEC + res.tv_nsec <= target_ns;
}That'll rule out testing on pnv most likely.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)
In reply to Jason EkstrandQuoting Jason Ekstrand (2017-08-10 06:35:43)
Quoted 6 lines
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
Quoted 15 lines
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Usedo_ioctlanddo_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthread
v4:
- Use ioctl wrappers
- Use VGEM instead of i915
- Combine a bunch of the simple tests into one function
v5:
- Combinatorially generate basic tests
- Usesw_syncinstead of using vgem directly
Aye, sw_sync looks to be quite useful here - a completely driver agnostic method for signaling syncobj. Nice.
Quoted 56 lines
tests/syncobj_wait.c new file +56
-0+static int +syncobj_attach_sw_sync (int fd,uint32_t handle) +{ +struct drm_syncobj_handle ; +int timeline, fence; + + timeline =sw_sync_timeline_create (); + fence =sw_sync_timeline_create_fence (timeline,1 ); +syncobj_import_sync_file (fd, handle, fence); +close (fence); + +return timeline; +} + +static void +syncobj_trigger (int fd,uint32_t handle) +{ +int timeline =syncobj_attach_sw_sync (fd, handle); +sw_sync_timeline_inc (timeline,1 ); +} + +struct delayed_trigger { +int fd; +uint32_t *syncobjs; +int count; +uint64_t nsec; +}; + +static void +trigger_syncobj_delayed_func (union sigval sigval) +{ +struct delayed_trigger *trigger = sigval.sival_ptr; +int i; + +for (i =0 ; i < trigger->count; i++) +syncobj_trigger (trigger->fd, trigger->syncobjs[i]); +free (trigger); +} + +static timer_t +trigger_syncobj_delayed (int fd,uint32_t *syncobjs,int count,uint64_t nsec) +{ +struct delayed_trigger *trigger; +timer_t timer; +struct sigevent sev; +struct itimerspec its; + + trigger =malloc (sizeof (*trigger)); + trigger->fd = fd; + trigger->syncobjs = syncobjs; + trigger->count = count; + trigger->nsec = nsec; + +memset (&sev,0 ,sizeof (sev)); + sev.sigev_notify =SIGEV_THREAD ; + sev.sigev_value.sival_ptr = trigger;
tests/syncobj_wait.c line 118
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ sev.sigev_notify_function = trigger_syncobj_delayed_func; +igt_assert (timer_create (CLOCK_MONOTONIC , &sev, &timer) ==0 ); + +memset (&its,0 ,sizeof (its)); + its.it_value.tv_sec = nsec /NSEC_PER_SEC ; + its.it_value.tv_nsec = nsec %NSEC_PER_SEC ; +igt_assert (timer_settime (timer,0 , &its,NULL ) ==0 ); + +return timer; +}
static voidtrigger_syncobj_delayed_func(union sigval sigval)
{
int timeline = (intptr_t)sigval.sival_ptr;
sw_sync_timeline_inc(timeline, 1);
close(timeline);
}static timer_ttrigger_syncobj_delayed(int fd, uint32_t *syncobjs, int count, uint64_t nsec)
{
struct itimerspec its;
struct sigevent sev;
int timeline, fence;
timer_t timer;
timeline = sw_sync_timeline_create();
fence = sw_sync_timeline_create_fence(timeline, 1);
for (int i = 0; i < count; i++)
syncobj_import_sync_file(fd, syncobjs[i], fence);
close(fence);
memset(&sev, 0, sizeof(sev));
sev.sigev_notify = SIGEV_THREAD;
sev.sigev_value.sival_ptr = (intptr_t)timeline;
sev.sigev_notify_function = trigger_syncobj_delayed_func;
igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0);
memset(&its, 0, sizeof(its));
its.it_value.tv_sec = nsec / NSEC_PER_SEC;
its.it_value.tv_nsec = nsec % NSEC_PER_SEC;
igt_assert(timer_settime(timer, 0, &its, NULL) == 0);
return timer;
}_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)
Quoted 124 lines · Chris Wilson
Quoting Jason Ekstrand (2017-08-10 06:35:43)
Quoted 6 lines
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
Quoted 15 lines
v2:
- Actually add the reset tests.
v3:
- Only do one execbuf for trigger
- Usedo_ioctlanddo_ioctl_err
- Better check for syncobj support
- Add local_/LOCAL_ defines of things
- Use a timer instead of a pthread
v4:
- Use ioctl wrappers
- Use VGEM instead of i915
- Combine a bunch of the simple tests into one function
v5:
- Combinatorially generate basic tests
- Usesw_syncinstead of using vgem directlyAye,
sw_synclooks to be quite useful here - a completely driver agnostic method for signaling syncobj. Nice.Quoted 31 lines
tests/syncobj_wait.c new file +31
-0+static int +syncobj_attach_sw_sync (int fd,uint32_t handle) +{ +struct drm_syncobj_handle ; +int timeline, fence; + + timeline =sw_sync_timeline_create (); + fence =sw_sync_timeline_create_fence (timeline,1 ); +syncobj_import_sync_file (fd, handle, fence); +close (fence); + +return timeline; +} + +static void +syncobj_trigger (int fd,uint32_t handle) +{ +int timeline =syncobj_attach_sw_sync (fd, handle); +sw_sync_timeline_inc (timeline,1 ); +} + +struct delayed_trigger { +int fd; +uint32_t *syncobjs; +int count; +uint64_t nsec; +}; + +static void +trigger_syncobj_delayed_func (union sigval sigval) +{tests/syncobj_wait.c
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+struct delayed_trigger *trigger = sigval.sival_ptr; +int i; + +for (i =0 ; i < trigger->count; i++) +syncobj_trigger (trigger->fd, trigger->syncobjs[i]); +free (trigger); +} + +static timer_t +trigger_syncobj_delayed(int fd, uint32_t *syncobjs, int count, uint64_tnsec)
Quoted 15 lines
tests/syncobj_wait.c new file +15
-0+{ +struct delayed_trigger *trigger; +timer_t timer; +struct sigevent sev; +struct itimerspec its; + + trigger =malloc (sizeof (*trigger)); + trigger->fd = fd; + trigger->syncobjs = syncobjs; + trigger->count = count; + trigger->nsec = nsec; + +memset (&sev,0 ,sizeof (sev)); + sev.sigev_notify =SIGEV_THREAD ; + sev.sigev_value.sival_ptr = trigger;tests/syncobj_wait.c line 118
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ sev.sigev_notify_function = trigger_syncobj_delayed_func; +igt_assert (timer_create (CLOCK_MONOTONIC , &sev, &timer) ==0 ); + +memset (&its,0 ,sizeof (its)); + its.it_value.tv_sec = nsec /NSEC_PER_SEC ; + its.it_value.tv_nsec = nsec %NSEC_PER_SEC ; +igt_assert (timer_settime (timer,0 , &its,NULL ) ==0 ); + +return timer; +}static void
trigger_syncobj_delayed_func(union sigval sigval){ int timeline = (intptr_t)sigval.sival_ptr; sw_sync_timeline_inc(timeline, 1); close(timeline); }static
timer_ttrigger_syncobj_delayed(int fd, uint32_t *syncobjs, int count, uint64_t nsec){ struct itimerspec its; struct sigevent sev; int timeline, fence; timer_t timer; timeline = sw_sync_timeline_create(); fence = sw_sync_timeline_create_fence(timeline, 1); for (int i = 0; i < count; i++) syncobj_import_sync_file(fd, syncobjs[i], fence); close(fence); memset(&sev, 0, sizeof(sev)); sev.sigev_notify = SIGEV_THREAD; sev.sigev_value.sival_ptr = (intptr_t)timeline; sev.sigev_notify_function = trigger_syncobj_delayed_func; igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0);
Quoted 8 lines
memset(&its, 0, sizeof(its));
its.it_value.tv_sec = nsec / NSEC_PER_SEC;
its.it_value.tv_nsec = nsec % NSEC_PER_SEC;
igt_assert(timer_settime(timer, 0, &its, NULL) == 0);
return timer;
}As i continue improving things, it's morphing to look more like that. Actually my current test do it both ways. The original way for WAIT_FOR_SUBMIT and the way described above for normal waits. There will be a v6...
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)
In reply to Jason EkstrandQuoting Jason Ekstrand (2017-08-10 06:35:43)
Quoted 17 lines
tests/syncobj_wait.c new file +17
-0+static void +test_single_wait (int fd,uint32_t test_flags,int expect) +{ +uint32_t syncobj =syncobj_create (fd); +uint32_t flags =0 ; +int timeline; + +if (test_flags &WAIT_FOR_SUBMIT ) + flags |=LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT ; + +if (test_flags &WAIT_ALL ) + flags |=LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_ALL ; + +if (test_flags & (WAIT_SUBMITTED |WAIT_SIGNALED )) + timeline =syncobj_attach_sw_sync (fd, syncobj); + +if (test_flags &WAIT_SIGNALED )
tests/syncobj_wait.c line 201
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+sw_sync_timeline_inc (timeline,1 ); + +igt_assert_eq (syncobj_wait_err (fd, &syncobj,1 ,0 , flags), expect); + +igt_assert_eq (syncobj_wait_err (fd, &syncobj,1 ,short_timeout (), + flags), expect); + +if (expect != -ETIME ) { +igt_assert_eq (syncobj_wait_err (fd, &syncobj,1 ,UINT64_MAX , + flags), expect);
Won't this fail in 6000 years time... Perhaps not an issue, but maximum duration is gettime_ns() + INT64_MAX (and these tests serve as part of the ABI guide / documentation as well as checking the contract). We don't have an encoding for an infinite wait, I guess several millennia will just have to do.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Jason Ekstrand (2017-08-09 18:04:42)
Quoted 5 lines
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
Note that this requires a libdrm version more recent than is requested.
Quoted 135 lines
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 624 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 625 insertions(+) create mode 100644 tests/syncobj_wait.ctests/Makefile.sources +1
-0@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \tests/syncobj_wait.c new file +111
-0@@ -0,0 +1,624 @@ +/* +* Copyright © 2017 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +*/ + +#include "igt.h" +#include <unistd.h> +#include <time.h> +#include <sys/ioctl.h> +#include "drm.h" + +IGT_TEST_DESCRIPTION ("Tests for the drm sync object wait API" ); + +/* One one tenth of a second */ +#define SHORT_TIME_NSEC 100000000ull + +/** A per-platform function which triggers a set of sync objects +* +* If wait is set, the function should wait for the work to complete so +* that an immediate call to SYNCOBJ_WAIT will return success. If wait is +* not set, then the function should try to submit enough work that an +* immediate call to SYNCOBJ_WAIT with a timeout of 0 will time out. +*/ +void (*trigger_syncobj)(int fd,uint32_t *syncobjs,int count,bool wait); + +#define NSECS_PER_SEC 1000000000ull + +static uint64_t +gettime_ns (void ) +{ +struct timespec current; +clock_gettime (CLOCK_MONOTONIC , ¤t); +return (uint64_t )current.tv_sec *NSECS_PER_SEC + current.tv_nsec; +} + +static uint64_t +short_timeout (void ) +{ +return gettime_ns () +SHORT_TIME_NSEC ; +} + +static uint32_t +syncobj_create (int fd) +{ +struct drm_syncobj_create create = {0 }; +int ret; + + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_CREATE , &create); +igt_assert (ret ==0 ); +igt_assert (create.handle >0 ); + +return create.handle; +} + +static void +syncobj_destroy (int fd,uint32_t handle) +{ +struct drm_syncobj_destroy destroy = {0 }; +int ret; + + destroy.handle = handle; + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy); +igt_assert (ret ==0 ); +} + +struct delayed_trigger { +int fd; +uint32_t *syncobjs; +int count; +uint64_t nsec; +}; + +static void * +trigger_syncobj_delayed_func (void *data) +{ +struct delayed_trigger *trigger = data; +struct timespec time; + + time.tv_sec = trigger->nsec /NSECS_PER_SEC ; + time.tv_nsec = trigger->nsec %NSECS_PER_SEC ; + +nanosleep (&time,NULL ); +trigger_syncobj (trigger->fd, trigger->syncobjs, trigger->count, true); +free (data); + +return NULL ; +} + +static pthread_t +trigger_syncobj_delayed (int fd,uint32_t *syncobjs,int count,uint64_t nsec) +{ +struct delayed_trigger *trigger; +pthread_t thread;
tests/syncobj_wait.c line 121
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+int ret; + + trigger =malloc (sizeof (*trigger)); + trigger->fd = fd; + trigger->syncobjs = syncobjs; + trigger->count = count; + trigger->nsec = nsec; + + ret =pthread_create (&thread,NULL , + trigger_syncobj_delayed_func, trigger);
This is just a timer:
timer_t timer;
struct sigevent sev;
struct itimerspec its;
memset(&sev, 0, sizeof(sev));
sev.sigev_notify = SIGEV_THREAD;
sev.sigev_value.sival_ptr = tigger;
sev.sigev_notify_function = trigger_syncobj_delayed_func;
igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0);
memset(&its, 0, sizeof(its));
its.it_value.tv_sec = nsec / NSEC_PER_SEC;
its.it_value.tv_nsec = nsec % NSEC_PER_SEC;
igt_assert(timer_settime(timer, 0, &its, NULL) == 0);tests/syncobj_wait.c line 125
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+igt_assert (ret ==0 ); + +return thread; +}
[snip]
Key tests missing here are signal (SIGINT) handling, especially how the timeout parameters is handled on repeats, see igt_interruptible(), though you must use igt_ioctl(). Polling multiple handles is not checked, especially combinations of signaled/unsignaled syncojbs.
tests/syncobj_wait.c line 491
Quoted 7 lines
tests/syncobj_wait.c new file +7
-0+ +/******** i915 specific bits ******/ +struct { +uint32_t batch; +} i915; + +#define I915_BATCH_COUNT 128
Is overrunning the ring/guc-wq and blocking a concern?
Do 128 provide any more significance than 2, one for wait, one for signal? Do 2 provide any more than 1?
Does this provide any more value than the coverage (of execbuf + wait/signaling) in gem_exec_fence?
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+static void +i915_trigger_syncobj (int fd,uint32_t *syncobjs,int count,bool wait) +{ +struct drm_i915_gem_exec_object2 exec_obj = {0 }; +struct drm_i915_gem_exec_fence *fence_array; +struct drm_i915_gem_execbuffer2 execbuf = {0 };
tests/syncobj_wait.c line 508
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+struct drm_i915_gem_wait gem_wait; +int i, ret; + + fence_array =calloc (count,sizeof (*fence_array)); +for (i =0 ; i < count; i++) { + fence_array[i].handle = syncobjs[i]; + fence_array[i].flags =I915_EXEC_FENCE_SIGNAL ; + } + + exec_obj.handle = i915.batch;
Is there any advantage in keeping the handle around in a global?
tests/syncobj_wait.c line 521
Quoted 13 lines
tests/syncobj_wait.c new file +13
-0+ + execbuf.buffers_ptr =to_user_pointer (&exec_obj); + execbuf.buffer_count =1 ; + execbuf.batch_start_offset =0 ; + execbuf.batch_len =8 ; + execbuf.flags =I915_EXEC_RENDER |I915_EXEC_FENCE_ARRAY ; + +for (i =0 ; i <I915_BATCH_COUNT ; i++) { +if (i ==I915_BATCH_COUNT -1 ) { + execbuf.cliprects_ptr =to_user_pointer (fence_array); + execbuf.num_cliprects = count; + } + ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf);
gem_execbuf
tests/syncobj_wait.c line 527
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+igt_assert (ret ==0 ); + } + +free (fence_array); + +if (wait) {
This is just gem_sync() (actually just gem_wait, but you since you just want a sync, you can use gem_sync)
Quoted 8 lines
tests/syncobj_wait.c new file +8
-0+ gem_wait.bo_handle = i915.batch; + gem_wait.flags =0 ; + gem_wait.timeout_ns =INT64_MAX ; + ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_WAIT , &gem_wait); +igt_assert (ret ==0 ); + } +} +
tests/syncobj_wait.c line 545
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+static void +i915_init (int fd) +{ +uint32_t batch_data[2 ] = {0 ,MI_BATCH_BUFFER_END }; + + i915.batch =gem_create (fd,4096 ); +gem_write (fd, i915.batch,0 , batch_data,sizeof (batch_data)); + trigger_syncobj = i915_trigger_syncobj; +} +/******** end of i915 bits ******/
If this used either vgem or sw_sync, you wouldn't need i915 specific details.
Quoted 19 lines
tests/syncobj_wait.c new file +19
-0+ +static bool +has_syncobj_wait (int fd) +{ +struct drm_syncobj_wait wait = {0 }; +uint64_t value; +int ret; + +if (drmGetCap (fd,DRM_CAP_SYNCOBJ , &value)) +return false; +if (!value) +return false; + +/* Try waiting for zero sync objects should fail with EINVAL */ + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_WAIT , &wait); +return ret ==-1 && errno ==EINVAL ; +} + +igt_main
tests/syncobj_wait.c line 574
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+{ +int fd; + + igt_fixture { + fd =drm_open_driver_render (DRIVER_INTEL ); +igt_require_gem (fd); +igt_require (has_syncobj_wait (fd)); + +if (is_i915_device (fd)) +i915_init (fd);
You asked for i915-only anyway, see DRIVER_INTEL. You meant DRIVER_ANY, but maybe just using DRIVER_VGEM and avoiding driver details would be better.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 174 lines · Chris Wilson
Quoting Jason Ekstrand (2017-08-09 18:04:42)
Quoted 5 lines
This adds both trivial error-checking tests as well as more complex tests which actually test whether or not waits do what they're supposed to do. They only currently work on i915 but it should be simple to hook them up for other drivers by simply implementing the little function pointer hook provided at the top for triggering a syncobj.
Note that this requires a libdrm version more recent than is requested.
Quoted 3 lines
--- tests/Makefile.sources | 1 + tests/syncobj_wait.c | 624 +++++++++++++++++++++++++++++++++++++++++++++++++
Quoted 21 lines
2 files changed, 625 insertions(+) create mode 100644 tests/syncobj_wait.ctests/Makefile.sources +1
-0@@ -230,6 +230,7 @@ TESTS_progs = \ prime_vgem \ sw_sync \ syncobj_basic \ + syncobj_wait \ template \ tools_test \ vgem_basic \tests/syncobj_wait.c new file +0
-0tests/syncobj_wait.c line 4
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0@@ -0,0 +1,624 @@ +/* +* Copyright © 2017 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a
tests/syncobj_wait.c line 5
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* copy of this software and associated documentation files (the "Software"),
tests/syncobj_wait.c line 6
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* to deal in the Software without restriction, including without limitation
tests/syncobj_wait.c line 7
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
tests/syncobj_wait.c
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next
tests/syncobj_wait.c line 12
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* paragraph) shall be included in all copies or substantial portions of the
tests/syncobj_wait.c
Quoted 3 lines
tests/syncobj_wait.c new file +3
-0+* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
tests/syncobj_wait.c line 16
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
tests/syncobj_wait.c line 17
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
tests/syncobj_wait.c line 18
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
tests/syncobj_wait.c line 19
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
tests/syncobj_wait.c line 20
Quoted 1 line
tests/syncobj_wait.c new file +1
-0+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
Quoted 8 lines
tests/syncobj_wait.c new file +8
-0+* IN THE SOFTWARE. +*/ + +#include "igt.h" +#include <unistd.h> +#include <time.h> +#include <sys/ioctl.h> +#include "drm.h" tests/syncobj_wait.c
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ +IGT_TEST_DESCRIPTION ("Tests for the drm sync object wait API" ); + +/* One one tenth of a second */ +#define SHORT_TIME_NSEC 100000000ull + +/** A per-platform function which triggers a set of sync objects +* +* If wait is set, the function should wait for the work to complete so +* that an immediate call to SYNCOBJ_WAIT will return success. If wait is
tests/syncobj_wait.c
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+* not set, then the function should try to submit enough work that an +* immediate call to SYNCOBJ_WAIT with a timeout of 0 will time out. +*/ +void (*trigger_syncobj)(int fd, uint32_t *syncobjs, int count, boolwait);
Quoted 49 lines
tests/syncobj_wait.c new file +49
-0+ +#define NSECS_PER_SEC 1000000000ull + +static uint64_t +gettime_ns (void ) +{ +struct timespec current; +clock_gettime (CLOCK_MONOTONIC , ¤t); +return (uint64_t )current.tv_sec *NSECS_PER_SEC + current.tv_nsec; +} + +static uint64_t +short_timeout (void ) +{ +return gettime_ns () +SHORT_TIME_NSEC ; +} + +static uint32_t +syncobj_create (int fd) +{ +struct drm_syncobj_create create = {0 }; +int ret; + + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_CREATE , &create); +igt_assert (ret ==0 ); +igt_assert (create.handle >0 ); + +return create.handle; +} + +static void +syncobj_destroy (int fd,uint32_t handle) +{ +struct drm_syncobj_destroy destroy = {0 }; +int ret; + + destroy.handle = handle; + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_DESTROY , &destroy); +igt_assert (ret ==0 ); +} + +struct delayed_trigger { +int fd; +uint32_t *syncobjs; +int count; +uint64_t nsec; +}; + +static void *tests/syncobj_wait.c
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+trigger_syncobj_delayed_func(void *data) +{ +struct delayed_trigger *trigger = data; +struct timespec time; + + time.tv_sec = trigger->nsec /NSECS_PER_SEC ; + time.tv_nsec = trigger->nsec %NSECS_PER_SEC ; + +nanosleep (&time,NULL ); + trigger_syncobj(trigger->fd, trigger->syncobjs, trigger->count,true);
tests/syncobj_wait.c
Quoted 7 lines
tests/syncobj_wait.c new file +7
-0+free (data); + +return NULL ; +} + +static pthread_t +trigger_syncobj_delayed(int fd, uint32_t *syncobjs, int count, uint64_tnsec)
tests/syncobj_wait.c line 121
Quoted 13 lines
tests/syncobj_wait.c new file +13
-0+{ +struct delayed_trigger *trigger; +pthread_t thread; +int ret; + + trigger =malloc (sizeof (*trigger)); + trigger->fd = fd; + trigger->syncobjs = syncobjs; + trigger->count = count; + trigger->nsec = nsec; + + ret =pthread_create (&thread,NULL , + trigger_syncobj_delayed_func, trigger);This is just a timer:
Quoted 15 lines
timer_t timer;
struct sigevent sev;
struct itimerspec its;
memset(&sev, 0, sizeof(sev));
sev.sigev_notify = SIGEV_THREAD;
sev.sigev_value.sival_ptr = tigger;
sev.sigev_notify_function = trigger_syncobj_delayed_func;
igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0);
memset(&its, 0, sizeof(its));
its.it_value.tv_sec = nsec / NSEC_PER_SEC;
its.it_value.tv_nsec = nsec % NSEC_PER_SEC;
igt_assert(timer_settime(timer, 0, &its, NULL) == 0);How do I do the equivalent of pthread_join() on said timer?
Quoted 22 lines
tests/syncobj_wait.c line 125
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+igt_assert (ret ==0 ); + +return thread; +}[snip]
Key tests missing here are signal (SIGINT) handling, especially how the timeout parameters is handled on repeats, see
igt_interruptible(), though you must useigt_ioctl(). Polling multiple handles is not checked, especially combinations of signaled/unsignaled syncojbs.tests/syncobj_wait.c line 491
Quoted 7 lines
tests/syncobj_wait.c new file +7
-0+ +/******** i915 specific bits ******/ +struct { +uint32_t batch; +} i915; + +#define I915_BATCH_COUNT 128Is overrunning the ring/guc-wq and blocking a concern?
Quoted 3 lines
Do 128 provide any more significance than 2, one for wait, one for signal? Do 2 provide any more than 1?
1 appears to work reliably. I just wanted to make sure. I'll drop it to one. It should only produce warnings at worst.
Quoted 3 lines
Does this provide any more value than the coverage (of execbuf + wait/signaling) in
gem_exec_fence?
They're different wait mechanisms...
Quoted 10 lines
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+static void +i915_trigger_syncobj (int fd,uint32_t *syncobjs,int count,bool wait) +{ +struct drm_i915_gem_exec_object2 exec_obj = {0 }; +struct drm_i915_gem_exec_fence *fence_array; +struct drm_i915_gem_execbuffer2 execbuf = {0 }; +struct drm_i915_gem_wait gem_wait; +int i, ret; + + fence_array =calloc (count,sizeof (*fence_array));
Quoted 9 lines
tests/syncobj_wait.c line 508
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+for (i =0 ; i < count; i++) { + fence_array[i].handle = syncobjs[i]; + fence_array[i].flags =I915_EXEC_FENCE_SIGNAL ; + } + + exec_obj.handle = i915.batch;Is there any advantage in keeping the handle around in a global?
Less work at trigger_syncobj time but that's all. I can create and destroy it here if you'd rather.
Quoted 11 lines
tests/syncobj_wait.c
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ + execbuf.buffers_ptr =to_user_pointer (&exec_obj); + execbuf.buffer_count =1 ; + execbuf.batch_start_offset =0 ; + execbuf.batch_len =8 ; + execbuf.flags =I915_EXEC_RENDER |I915_EXEC_FENCE_ARRAY ; + +for (i =0 ; i <I915_BATCH_COUNT ; i++) { +if (i ==I915_BATCH_COUNT -1 ) { + execbuf.cliprects_ptr =
to_user_pointer(fence_array);
Quoted 7 lines
tests/syncobj_wait.c
Quoted 3 lines
tests/syncobj_wait.c new file +3
-0+ execbuf.num_cliprects = count; + } + ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2,&execbuf);
gem_execbuf
?
Quoted 10 lines
tests/syncobj_wait.c line 527
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+igt_assert (ret ==0 ); + } + +free (fence_array); + +if (wait) {This is just
gem_sync()(actually justgem_wait, but you since you just want a sync, you can usegem_sync)
What's the difference between wait and sync?
Quoted 13 lines
Quoted 13 lines
tests/syncobj_wait.c new file +13
-0+ gem_wait.bo_handle = i915.batch; + gem_wait.flags =0 ; + gem_wait.timeout_ns =INT64_MAX ; + ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_WAIT , &gem_wait); +igt_assert (ret ==0 ); + } +} + +static void +i915_init (int fd) +{ +uint32_t batch_data[2 ] = {0 ,MI_BATCH_BUFFER_END }; +
Quoted 9 lines
tests/syncobj_wait.c line 545
Quoted 5 lines
tests/syncobj_wait.c new file +5
-0+ i915.batch =gem_create (fd,4096 ); +gem_write (fd, i915.batch,0 , batch_data,sizeof (batch_data)); + trigger_syncobj = i915_trigger_syncobj; +} +/******** end of i915 bits ******/ If this used either vgem or
sw_sync, you wouldn't need i915 specific details.
Those paths might be worth implementing as well but I wanted to make sure it worked for syncobjs triggered by the actual driver. See also our discussion about default waits. Also, that requires adding syncobj support to vgem. Maybe a worth endeavor but I don't really see the point atm.
Quoted 25 lines
Quoted 25 lines
tests/syncobj_wait.c new file +25
-0+ +static bool +has_syncobj_wait (int fd) +{ +struct drm_syncobj_wait wait = {0 }; +uint64_t value; +int ret; + +if (drmGetCap (fd,DRM_CAP_SYNCOBJ , &value)) +return false; +if (!value) +return false; + +/* Try waiting for zero sync objects should fail with EINVAL */ + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_WAIT , &wait); +return ret ==-1 && errno ==EINVAL ; +} + +igt_main +{ +int fd; + + igt_fixture { + fd =drm_open_driver_render (DRIVER_INTEL ); +igt_require_gem (fd);
Quoted 9 lines
tests/syncobj_wait.c line 574
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+igt_require (has_syncobj_wait (fd)); + +if (is_i915_device (fd)) +i915_init (fd);You asked for i915-only anyway, see
DRIVER_INTEL. You meantDRIVER_ANY, but maybe just usingDRIVER_VGEMand avoiding driver details would be better.
I was hoping that Dave would come along and add amdgpu bits and then we would need it. But maybe the extra check here is overkill.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Jason Ekstrand (2017-08-09 18:46:49)
Quoted 192 lines · Chris Wilson
Quoting Jason Ekstrand (2017-08-09 18:04:42)
> This adds both trivial error-checking tests as well as more complex
> tests which actually test whether or not waits do what they're supposed
> to do. They only currently work on i915 but it should be simple to hook
> them up for other drivers by simply implementing the little function
> pointer hook provided at the top for triggering a syncobj.
Note that this requires a libdrm version more recent than is requested.
> ---
> tests/Makefile.sources | 1 +
> tests/syncobj_wait.c | 624 ++++++++++++++++++++++++++++++
+++++++++++++++++++
> 2 files changed, 625 insertions(+)
> create mode 100644 tests/syncobj_wait.c
>
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index bb013c7..430b637 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -230,6 +230,7 @@ TESTS_progs = \
> prime_vgem \
> sw_sync \
> syncobj_basic \
> + syncobj_wait \
> template \
> tools_test \
> vgem_basic \
> diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c
> new file mode 100644
> index 0000000..6689d34
> --- /dev/null
> +++ b/tests/syncobj_wait.c
> @@ -0,0 +1,624 @@
> +/*
> + * Copyright © 2017 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining
a
> + * copy of this software and associated documentation files (the
"Software"),
> + * to deal in the Software without restriction, including without
limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
next
> + * paragraph) shall be included in all copies or substantial portions of
the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +#include "igt.h"
> +#include <unistd.h>
> +#include <time.h>
> +#include <sys/ioctl.h>
> +#include "drm.h"
> +
> +IGT_TEST_DESCRIPTION("Tests for the drm sync object wait API");
> +
> +/* One one tenth of a second */
> +#define SHORT_TIME_NSEC 100000000ull
> +
> +/** A per-platform function which triggers a set of sync objects
> + *
> + * If wait is set, the function should wait for the work to complete so
> + * that an immediate call to SYNCOBJ_WAIT will return success. If wait
is
> + * not set, then the function should try to submit enough work that an
> + * immediate call to SYNCOBJ_WAIT with a timeout of 0 will time out.
> + */
> +void (*trigger_syncobj)(int fd, uint32_t *syncobjs, int count, bool
wait);
> +
> +#define NSECS_PER_SEC 1000000000ull
> +
> +static uint64_t
> +gettime_ns(void)
> +{
> + struct timespec current;
> + clock_gettime(CLOCK_MONOTONIC, ¤t);
> + return (uint64_t)current.tv_sec * NSECS_PER_SEC + current.tv_nsec;
> +}
> +
> +static uint64_t
> +short_timeout(void)
> +{
> + return gettime_ns() + SHORT_TIME_NSEC;
> +}
> +
> +static uint32_t
> +syncobj_create(int fd)
> +{
> + struct drm_syncobj_create create = { 0 };
> + int ret;
> +
> + ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, &create);
> + igt_assert(ret == 0);
> + igt_assert(create.handle > 0);
> +
> + return create.handle;
> +}
> +
> +static void
> +syncobj_destroy(int fd, uint32_t handle)
> +{
> + struct drm_syncobj_destroy destroy = { 0 };
> + int ret;
> +
> + destroy.handle = handle;
> + ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, &destroy);
> + igt_assert(ret == 0);
> +}
> +
> +struct delayed_trigger {
> + int fd;
> + uint32_t *syncobjs;
> + int count;
> + uint64_t nsec;
> +};
> +
> +static void *
> +trigger_syncobj_delayed_func(void *data)
> +{
> + struct delayed_trigger *trigger = data;
> + struct timespec time;
> +
> + time.tv_sec = trigger->nsec / NSECS_PER_SEC;
> + time.tv_nsec = trigger->nsec % NSECS_PER_SEC;
> +
> + nanosleep(&time, NULL);
> + trigger_syncobj(trigger->fd, trigger->syncobjs, trigger->count,
true);
> + free(data);
> +
> + return NULL;
> +}
> +
> +static pthread_t
> +trigger_syncobj_delayed(int fd, uint32_t *syncobjs, int count, uint64_t
nsec)
> +{
> + struct delayed_trigger *trigger;
> + pthread_t thread;
> + int ret;
> +
> + trigger = malloc(sizeof(*trigger));
> + trigger->fd = fd;
> + trigger->syncobjs = syncobjs;
> + trigger->count = count;
> + trigger->nsec = nsec;
> +
> + ret = pthread_create(&thread, NULL,
> + trigger_syncobj_delayed_func, trigger);
This is just a timer:
timer_t timer;
struct sigevent sev;
struct itimerspec its;
memset(&sev, 0, sizeof(sev));
sev.sigev_notify = SIGEV_THREAD;
sev.sigev_value.sival_ptr = tigger;
sev.sigev_notify_function = trigger_syncobj_delayed_func;
igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0);
memset(&its, 0, sizeof(its));
its.it_value.tv_sec = nsec / NSEC_PER_SEC;
its.it_value.tv_nsec = nsec % NSEC_PER_SEC;
igt_assert(timer_settime(timer, 0, &its, NULL) == 0);Quoted 1 line
How do I do the equivalent of
pthread_join()on said timer?
You aren't doing anything more complicated than deleting the thread, so timer_delete().
Quoted 30 lines
tests/syncobj_wait.c line 125
Quoted 4 lines
+ igt_assert(ret == 0);
tests/syncobj_wait.c new file +3
-0+ + return thread; +}[snip] Key tests missing here are signal (SIGINT) handling, especially how the timeout parameters is handled on repeats, see igt_interruptible(), though you must use igt_ioctl(). Polling multiple handles is not checked, especially combinations of signaled/unsignaled syncojbs. > + > +/******** i915 specific bits ******/ > +struct { > + uint32_t batch; > +} i915; > + > +#define I915_BATCH_COUNT 128 Is overrunning the ring/guc-wq and blocking a concern? Do 128 provide any more significance than 2, one for wait, one for signal? Do 2 provide any more than 1?1 appears to work reliably. I just wanted to make sure. I'll drop it to one. It should only produce warnings at worst.
Quoted 5 lines
Does this provide any more value than the coverage (of execbuf + wait/signaling) in
gem_exec_fence?They're different wait mechanisms...
I know you are testing the syncobj wait-ioctl, I am questioning whether this pattern of i915<->syncobj is interesting at all as it should already be covered elsewhere. If we only need to use i915 as a plain and simple trigger mechanism (i.e. not the split submit/signal), we can just replace i915 with vgem. I want to try and avoid having i915/gem dependencies in what should be a driver agnostic test.
Quoted 20 lines
Quoted 6 lines
tests/syncobj_wait.c new file +6
-0+static void +i915_trigger_syncobj (int fd,uint32_t *syncobjs,int count,bool wait) +{ + struct drm_i915_gem_exec_object2 exec_obj = { 0 }; + struct drm_i915_gem_exec_fence *fence_array; + struct drm_i915_gem_execbuffer2 execbuf = { 0 };tests/syncobj_wait.c line 508
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ struct drm_i915_gem_wait gem_wait; + int i, ret; + + fence_array = calloc(count, sizeof(*fence_array)); + for (i = 0; i < count; i++) { + fence_array[i].handle = syncobjs[i]; + fence_array[i].flags = I915_EXEC_FENCE_SIGNAL; + } + + exec_obj.handle = i915.batch;Is there any advantage in keeping the handle around in a global?
Quoted 2 lines
Less work at
trigger_syncobjtime but that's all. I can create and destroy it here if you'd rather.
Keep it all local, definitely. The cost of allocating, clflushing, and binding 1 page for each trigger should be immaterial in the test runtime. If you were concerned you would not have set .batch_len=8 and just left it as 0 as per normal.
Quoted 18 lines
tests/syncobj_wait.c
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ + execbuf.buffers_ptr = to_user_pointer(&exec_obj); + execbuf.buffer_count = 1; + execbuf.batch_start_offset = 0; + execbuf.batch_len = 8; + execbuf.flags = I915_EXEC_RENDER | I915_EXEC_FENCE_ARRAY; + + for (i = 0; i < I915_BATCH_COUNT; i++) { + if (i == I915_BATCH_COUNT - 1) { + execbuf.cliprects_ptr = to_user_pointer(fence_array); > + execbuf.num_cliprects = count; > + } > + ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, & execbuf); gem_execbuf
Quoted 1 line
?
This (igt_assert(drmIoctl(EXECBUFFER2)) is open-coding gem_execbuf(). Anytime you use a raw ioctl/drmIoctl, it is a sign that we are missing a wrapper.
Quoted 11 lines
tests/syncobj_wait.c line 527
Quoted 6 lines
+ igt_assert(ret == 0);
+ }tests/syncobj_wait.c new file +4
-0+ + free(fence_array); + + if (wait) {This is just
gem_sync()(actually justgem_wait, but you since you just want a sync, you can usegem_sync)
Quoted 1 line
What's the difference between wait and sync?
gem_sync() is a gem_wait(fd, bo, NULL [== infinity])
Quoted 66 lines
Quoted 8 lines
+ gem_wait.bo_handle = i915.batch;
+ gem_wait.flags = 0;
+ gem_wait.timeout_ns =INT64_MAX;
+ ret =drmIoctl(fd, DRM_IOCTL_I915_GEM_WAIT, &gem_wait); + igt_assert(ret == 0);
+ }tests/syncobj_wait.c new file +2
-0+} +tests/syncobj_wait.c line 545
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+static void +i915_init (int fd) +{ + uint32_t batch_data[2] = {0, MI_BATCH_BUFFER_END}; + + i915.batch = gem_create(fd, 4096); + gem_write(fd, i915.batch, 0, batch_data, sizeof(batch_data)); + trigger_syncobj = i915_trigger_syncobj; +} +/******** end of i915 bits ******/ If this used either vgem or
sw_sync, you wouldn't need i915 specific details.Those paths might be worth implementing as well but I wanted to make sure it worked for syncobjs triggered by the actual driver. See also our discussion about default waits. Also, that requires adding syncobj support to vgem. Maybe a worth endeavor but I don't really see the point atm.
Quoted 19 lines
tests/syncobj_wait.c new file +19
-0+ +static bool +has_syncobj_wait (int fd) +{ + struct drm_syncobj_wait wait = { 0 }; + uint64_t value; + int ret; + + if (drmGetCap(fd, DRM_CAP_SYNCOBJ, &value)) + return false; + if (!value) + return false; + + /* Try waiting for zero sync objects should fail with EINVAL */ + ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_WAIT, &wait); + return ret == -1 && errno == EINVAL; +} + +igt_maintests/syncobj_wait.c line 574
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+{ + int fd; + + igt_fixture { + fd = drm_open_driver_render(DRIVER_INTEL); + igt_require_gem(fd); + igt_require(has_syncobj_wait(fd)); + + if (is_i915_device(fd)) + i915_init(fd);You asked for i915-only anyway, see
DRIVER_INTEL. You meantDRIVER_ANY, but maybe just usingDRIVER_VGEMand avoiding driver details would be better.
Quoted 2 lines
I was hoping that Dave would come along and add amdgpu bits and then we would need it. But maybe the extra check here is overkill.
We shouldn't need driver specific tests of the syncobj wait-ioctl though. Given driver coverage of fence signaling (required elsewhere) and syncobj interaction, that should then give us coverage of all edges that lead to the wait-ioctl, and so we only need a single central tester for the wait-ioctl ABI.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Chris Wilson
[snip]
Key tests missing here are signal (SIGINT) handling, especially how the timeout parameters is handled on repeats, see
igt_interruptible(), though you must useigt_ioctl().
I'll see what I can do
Quoted 2 lines
Polling multiple handles is not
checked, especially combinations of signaled/unsignaled syncojbs.
Uh... that should be covered (maybe not well enough) by the wait_any and wait_all tests.
--Jason
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Jason,
tests/syncobj_wait.c line 33
Quoted 2 lines · Jason Ekstrand
tests/syncobj_wait.c new file +2
-0+/* One one tenth of a second */ +#define SHORT_TIME_NSEC 100000000ull
Er, a hundredth? Or only one, one tenth?
tests/syncobj_wait.c line 152
Quoted 5 lines
tests/syncobj_wait.c new file +5
-0+static void +test_wait_illegal_handle (int fd) +{ +struct drm_syncobj_wait wait = {0 }; +uint32_t handle =2 ;
Use 0.
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+static void +test_wait_for_submit_unsignaled (int fd) +{ +uint32_t syncobj =syncobj_create (fd);
tests/syncobj_wait.c line 191
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+struct drm_syncobj_wait wait = {0 }; +int ret; + + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ; + wait.flags =DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT ; + wait.timeout_nsec =short_timeout (); + + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_WAIT , &wait); +igt_assert (ret ==-1 && errno ==ETIME );
There's do_ioctl_err() for this pattern BTW, and I think that takes care of EINTR as well.
Quoted 9 lines
tests/syncobj_wait.c new file +9
-0+static void +test_wait_signaled (int fd) +{ +uint32_t syncobj =syncobj_create (fd); +struct drm_syncobj_wait wait = {0 }; +int ret; + + wait.handles =to_user_pointer (&syncobj); + wait.count_handles =1 ;
tests/syncobj_wait.c line 214
Quoted 10 lines
tests/syncobj_wait.c new file +10
-0+ +trigger_syncobj (fd, &syncobj,1 , false); + + wait.timeout_nsec =0 ; + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_WAIT , &wait); +igt_warn_on (ret !=-1 || errno !=ETIME ); + + wait.timeout_nsec =short_timeout (); + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_WAIT , &wait); +igt_assert (ret ==0 );
... and do_ioctl() for this pattern.
tests/syncobj_wait.c line 550
Quoted 4 lines
tests/syncobj_wait.c new file +4
-0+static bool +has_syncobj_wait (int fd) +{ +struct drm_syncobj_wait wait = {0 };
This probably needs a local_ definition.
tests/syncobj_wait.c line 561
Quoted 11 lines
tests/syncobj_wait.c new file +11
-0+uint64_t value; +int ret; + +if (drmGetCap (fd,DRM_CAP_SYNCOBJ , &value)) +return false; +if (!value) +return false; + +/* Try waiting for zero sync objects should fail with EINVAL */ + ret =ioctl (fd,DRM_IOCTL_SYNCOBJ_WAIT , &wait); +return ret ==-1 && errno ==EINVAL ;
Unfortunately an unrecognised ioctl also leads to a failure with EINVAL. Try another test for ioctl presence, e.g. do you get ENOENT if you pass one handle to wait for, but that handle is 0 (invalid GEM object ID)?
I couldn't see much else obvious, and it seems like a decent enough workout of the wait API, so, with these and what Chris suggested:
Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for syncobj: Add some wait and reset tests (rev2)
In reply to Jason Ekstrand== Series Details ==
== Series Details ==
Series: syncobj: Add some wait and reset tests (rev2)
URL : https://patchwork.freedesktop.org/series/28567/
State : failure
== Summary ==
IGT patchset build failed on latest successful build c129026622accef6f54c0cfb0dc55e930cfa60b5 igt: add syncobj_basic.
make all-recursive
Making all in lib
make all-recursive
Making all in .
Making all in tests
make[4]: Nothing to be done for 'all'.
Making all in man
make[2]: Nothing to be done for 'all'.
Making all in tools
Making all in null_state_gen
make[3]: Nothing to be done for 'all'.
Making all in registers
make[3]: Nothing to be done for 'all'.
make[3]: Nothing to be done for 'all-am'.
Making all in scripts
make[2]: Nothing to be done for 'all'.
Making all in benchmarks
make[2]: Nothing to be done for 'all'.
Making all in tests
Making all in intel-ci
make[3]: Nothing to be done for 'all'.
CCLD core_getstats CCLD core_getversion CCLD core_prop_blob CCLD core_setmaster_vs_auth CCLD debugfs_test CCLD drm_import_export CCLD drm_mm CCLD drm_read CCLD drm_vma_limiter CCLD drm_vma_limiter_cached CCLD drm_vma_limiter_cpu CCLD drm_vma_limiter_gtt CCLD drv_getparams_basic CCLD drv_hangman CCLD drv_missed_irq CCLD drv_module_reload CCLD drv_selftest CCLD drv_suspend CCLD gem_bad_length CCLD gem_bad_reloc CCLD gem_basic CCLD gem_busy CCLD gem_caching CCLD gem_close_race CCLD gem_concurrent_blit CCLD gem_cpu_reloc CCLD gem_create CCLD gem_cs_prefetch CCLD gem_cs_tlb CCLD gem_ctx_bad_destroy CCLD gem_ctx_bad_exec CCLD gem_ctx_basic CCLD gem_ctx_create CCLD gem_ctx_exec CCLD gem_ctx_param CCLD gem_ctx_switch CCLD gem_ctx_thrash CCLD gem_double_irq_loop CCLD gem_eio CCLD gem_evict_alignment CCLD gem_evict_everything CCLD gem_exec_alignment CCLD gem_exec_async CCLD gem_exec_await CCLD gem_exec_bad_domains CCLD gem_exec_basic CCLD gem_exec_big CCLD gem_exec_blt CCLD gem_exec_capture CCLD gem_exec_create CCLD gem_exec_faulting_reloc CCLD gem_exec_fence CCLD gem_exec_flush CCLD gem_exec_gttfill CCLD gem_exec_latency CCLD gem_exec_lut_handle CCLD gem_exec_nop CCLD gem_exec_parallel CCLD gem_exec_params CCLD gem_exec_parse CCLD gem_exec_reloc CCLD gem_exec_reuse CCLD gem_exec_schedule CCLD gem_exec_store CCLD gem_exec_suspend CCLD gem_exec_whisper CCLD gem_fd_exhaustion CCLD gem_fence_thrash CCLD gem_fence_upload CCLD gem_fenced_exec_thrash CCLD gem_flink_basic CCLD gem_flink_race CCLD gem_gpgpu_fill CCLD gem_gtt_cpu_tlb CCLD gem_gtt_hog CCLD gem_gtt_speed CCLD gem_hangcheck_forcewake CCLD gem_largeobject CCLD gem_linear_blits CCLD gem_lut_handle CCLD gem_madvise CCLD gem_media_fill CCLD gem_mmap CCLD gem_mmap_gtt CCLD gem_mmap_offset_exhaustion CCLD gem_mmap_wc CCLD gem_mocs_settings CCLD gem_partial_pwrite_pread CCLD gem_persistent_relocs CCLD gem_pin CCLD gem_pipe_control_store_loop CCLD gem_ppgtt CCLD gem_pread CCLD gem_pread_after_blit CCLD gem_pwrite CCLD gem_pwrite_pread CCLD gem_pwrite_snooped CCLD gem_read_read_speed CCLD gem_readwrite CCLD gem_reg_read CCLD gem_reloc_overflow CCLD gem_reloc_vs_gpu CCLD gem_render_copy CCLD gem_render_copy_redux CCLD gem_render_linear_blits CCLD gem_render_tiled_blits CCLD gem_request_retire CCLD gem_reset_stats CCLD gem_ring_sync_copy CCLD gem_ring_sync_loop CCLD gem_ringfill CCLD gem_seqno_wrap CCLD gem_set_tiling_vs_blt CCLD gem_set_tiling_vs_gtt CCLD gem_set_tiling_vs_pwrite CCLD gem_shrink CCLD gem_softpin CCLD gem_spin_batch CCLD gem_stolen CCLD gem_storedw_batches_loop CCLD gem_storedw_loop CCLD gem_streaming_writes CCLD gem_sync CCLD gem_threaded_access_tiled CCLD gem_tiled_blits CCLD gem_tiled_fence_blits CCLD gem_tiled_partial_pwrite_pread CCLD gem_tiled_pread_basic CCLD gem_tiled_pread_pwrite CCLD gem_tiled_swapping CCLD gem_tiled_wb CCLD gem_tiled_wc CCLD gem_tiling_max_stride CCLD gem_unfence_active_buffers CCLD gem_unref_active_buffers CCLD gem_userptr_blits CCLD gem_wait CCLD gem_workarounds CCLD gem_write_read_ring_switch CCLD gen3_mixed_blits CCLD gen3_render_linear_blits CCLD gen3_render_mixed_blits CCLD gen3_render_tiledx_blits CCLD gen3_render_tiledy_blits CCLD gen7_forcewake_mt CCLD gvt_basic CCLD kms_3d CCLD kms_addfb_basic CCLD kms_atomic CCLD kms_atomic_transition CCLD kms_busy CCLD kms_ccs CCLD kms_chv_cursor_fail CCLD kms_concurrent CCLD kms_crtc_background_color CCLD kms_cursor_crc CCLD kms_cursor_legacy CCLD kms_draw_crc CCLD kms_fbc_crc CCLD kms_fbcon_fbt CCLD kms_fence_pin_leak CCLD kms_flip CCLD kms_flip_event_leak CCLD kms_flip_tiling CCLD kms_force_connector_basic CCLD kms_frontbuffer_tracking CCLD kms_hdmi_inject CCLD kms_invalid_dotclock CCLD kms_legacy_colorkey CCLD kms_mmap_write_crc CCLD kms_mmio_vs_cs_flip CCLD kms_panel_fitting CCLD kms_pipe_b_c_ivb CCLD kms_pipe_color CCLD kms_pipe_crc_basic CCLD kms_plane CCLD kms_plane_lowres CCLD kms_plane_multiple CCLD kms_plane_scaling CCLD kms_properties CCLD kms_psr_sink_crc CCLD kms_pwrite_crc CCLD kms_render CCLD kms_rmfb CCLD kms_rotation_crc CCLD kms_setmode CCLD kms_sink_crc_basic CCLD kms_sysfs_edid_timing CCLD kms_tv_load_detect CCLD kms_universal_plane CCLD kms_vblank CCLD meta_test CCLD perf CCLD pm_backlight CCLD pm_lpsp CCLD pm_rc6_residency CCLD pm_rpm CCLD pm_rps CCLD pm_sseu CCLD prime_busy CCLD prime_mmap CCLD prime_mmap_coherency CCLD prime_mmap_kms CCLD prime_self_import CCLD prime_udl CCLD prime_vgem CCLD sw_sync CCLD syncobj_basic CC syncobj_wait.o
Makefile:3912: recipe for target 'syncobj_wait.o' failed Makefile:4383: recipe for target 'all-recursive' failed Makefile:528: recipe for target 'all-recursive' failed Makefile:460: recipe for target 'all' failed
====================================================
intel-gpu-tools 1.19: lib/tests/test-suite.log
====================================================
# TOTAL: 15
# PASS: 2
# SKIP: 0
# XFAIL: 6
# FAIL: 7
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
XFAIL: igt_no_exit
==================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_no_exit:10666) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_exit:10666) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_exit:10666) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_exit:10666) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_no_exit failed.
**** DEBUG ****
(igt_no_exit:10666) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_exit:10666) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_exit:10666) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_exit:10666) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_no_exit: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
XFAIL igt_no_exit (exit status: 134)
XFAIL: igt_no_exit_list_only
============================
igt_no_exit_list_only: igt_core.c:576: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed. A
XFAIL igt_no_exit_list_only (exit status: 134)
XFAIL: igt_no_subtest
=====================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_subtest:10670) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_subtest:10670) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_no_exit failed.
**** DEBUG ****
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_no_subtest:10670) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_no_subtest:10670) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_no_subtest:10670) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_no_subtest: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
XFAIL igt_no_subtest (exit status: 134)
FAIL: igt_simulation
====================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_simulation:10679) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simulation:10679) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simulation:10679) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simulation:10679) igt-debugfs-CRITICAL: error: -1 != 0
Test test failed.
**** DEBUG ****
(igt_simulation:10679) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simulation:10679) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simulation:10679) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simulation:10679) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)igt_simulation: igt_simulation.c:111: main: Assertion `do_fork() == IGT_EXIT_SKIP' failed.
FAIL igt_simulation (exit status: 134)
XFAIL: igt_simple_test_subtests
===============================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_simple_test_subtests failed.
**** DEBUG ****
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_simple_test_subtests:10665) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
XFAIL igt_simple_test_subtests (exit status: 99)
FAIL: igt_stats
===============
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_stats:10693) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_stats:10693) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_stats:10693) igt-debugfs-CRITICAL: Last errno: 13, Permission denied
(igt_stats:10693) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_stats failed.
**** DEBUG ****
(igt_stats:10693) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_stats:10693) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_stats:10693) igt-debugfs-CRITICAL: Last errno: 13, Permission denied
(igt_stats:10693) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
FAIL igt_stats (exit status: 99)
XFAIL: igt_timeout
==================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_timeout:10691) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_timeout:10691) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_timeout:10691) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_timeout:10691) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_timeout failed.
**** DEBUG ****
(igt_timeout:10691) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_timeout:10691) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_timeout:10691) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_timeout:10691) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)
XFAIL igt_timeout (exit status: 99)
XFAIL: igt_invalid_subtest_name
===============================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_invalid_subtest_name failed.
**** DEBUG ****
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_invalid_subtest_name:10684) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_invalid_subtest_name: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
XFAIL igt_invalid_subtest_name (exit status: 134)
FAIL: igt_segfault
==================
Simple test.
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_segfault:10687) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_segfault:10687) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_segfault:10687) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_segfault:10687) igt-debugfs-CRITICAL: error: -1 != 0
Test test failed.
**** DEBUG ****
(igt_segfault:10675) INFO: Simple test.
(igt_segfault:10687) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_segfault:10687) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_segfault:10687) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_segfault:10687) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL (-1.000s)igt_segfault: igt_segfault.c:119: main: Assertion `do_fork() == SIGSEGV + 128' failed.
FAIL igt_segfault (exit status: 134)
FAIL: igt_subtest_group
=======================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_subtest_group:10697) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_subtest_group:10697) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_subtest_group failed.
**** DEBUG ****
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_subtest_group:10697) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_subtest_group:10697) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_subtest_group:10697) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_subtest_group: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL igt_subtest_group (exit status: 134)
FAIL: igt_assert
================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_assert:10681) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_assert:10681) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_assert:10681) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_assert:10681) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_assert failed.
**** DEBUG ****
(igt_assert:10681) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_assert:10681) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_assert:10681) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_assert:10681) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_assert: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]
FAIL igt_assert (exit status: 134)
FAIL: igt_exit_handler
======================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_exit_handler:10700) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_exit_handler:10700) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_no_exit failed.
**** DEBUG ****
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_exit_handler:10700) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_exit_handler:10700) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_exit_handler:10700) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****igt_exit_handler: igt_core.c:1178: igt_fail: Assertion `!test_with_subtests || in_fixture' failed. Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x232]igt_exit_handler: igt_exit_handler.c:106: testfunc: Assertion `read(pipes[0], &tmp, 1) == 1' failed. FAIL igt_exit_handler (exit status: 134)
FAIL: igt_hdmi_inject
=====================
IGT-Version: 1.19-g6913f219 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: error: -1 != 0
Test igt_hdmi_inject failed.
**** DEBUG ****
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Test assertion failure function is_mountpoint, file igt_debugfs.c:94:
(igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Failed assertion: stat(buf, &st) == 0 (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: Last errno: 13, Permission denied (igt_hdmi_inject:10695) igt-debugfs-CRITICAL: error: -1 != 0
**** END ****
Stack trace:
#0 [__igt_fail_assert+0x101]
#1 [igt_debugfs_mount+0x232]
#2 [<unknown>+0x
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for syncobj: Add some wait and reset tests (rev3)
In reply to Jason Ekstrand== Series Details ==
== Series Details ==
Series: syncobj: Add some wait and reset tests (rev3)
URL : https://patchwork.freedesktop.org/series/28567/
State : success
== Summary ==
IGT patchset tested on top of latest successful build c129026622accef6f54c0cfb0dc55e930cfa60b5 igt: add syncobj_basic.
with latest DRM-Tip kernel build CI_DRM_29422d0288b5b28c drm-tip: 2017y-08m-09d-18h-09m-54s UTC integration manifest
Test gem_exec_flush:
Subgroup basic-batch-kernel-default-uc:
fail -> PASS (fi-snb-2600) fdo#100007
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> PASS (fi-byt-n2820) fdo#101705fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705
fi-bdw-5557u total:279 pass:268 dwarn:0 dfail:0 fail:0 skip:11 time:435s fi-bdw-gvtdvm total:279 pass:265 dwarn:0 dfail:0 fail:0 skip:14 time:418s fi-blb-e6850 total:279 pass:224 dwarn:1 dfail:0 fail:0 skip:54 time:359s fi-bsw-n3050 total:279 pass:243 dwarn:0 dfail:0 fail:0 skip:36 time:494s fi-bxt-j4205 total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:495s fi-byt-j1900 total:279 pass:254 dwarn:1 dfail:0 fail:0 skip:24 time:519s fi-byt-n2820 total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:514s fi-glk-2a total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:590s fi-hsw-4770 total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:426s fi-hsw-4770r total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:403s fi-ilk-650 total:279 pass:229 dwarn:0 dfail:0 fail:0 skip:50 time:420s fi-ivb-3520m total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:510s fi-ivb-3770 total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:473s fi-kbl-7500u total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:461s fi-kbl-7560u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:575s fi-kbl-r total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:572s fi-pnv-d510 total:279 pass:223 dwarn:1 dfail:0 fail:0 skip:55 time:518s fi-skl-6260u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:455s fi-skl-6700k total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:639s fi-skl-6770hq total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:468s fi-skl-gvtdvm total:279 pass:266 dwarn:0 dfail:0 fail:0 skip:13 time:425s fi-skl-x1585l total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:486s fi-snb-2520m total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:558s fi-snb-2600 total:279 pass:250 dwarn:0 dfail:0 fail:0 skip:29 time:415s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_47/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx