igt: add timeline test cases
Subsystems (2)
PATCH 1/1 igt: add timeline test cases
Signed-off-by Chunming Zhou <[email protected]>
--- include/drm-uapi/drm.h | 33 ++ lib/igt_syncobj.c | 204 +++++++ lib/igt_syncobj.h | 19 + tests/gem_ctx_bad_exec | Bin 0 -> 1284384 bytes tests/meson.build | 1 + tests/syncobj_timeline.c | 1100 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 1357 insertions(+) create mode 100755 tests/gem_ctx_bad_exec create mode 100644 tests/syncobj_timeline.c
include/drm-uapi/drm.h +33 -0
@@ -715,6 +715,8 @@ struct drm_syncobj_handle {#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) +/* wait for time point to become available */ +#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2)struct drm_syncobj_wait {__u64 handles;/* absolute timeout */
@@ -725,11 +727,37 @@ struct drm_syncobj_wait {__u32 pad; }; +struct drm_syncobj_timeline_wait { +__u64 handles; +/* wait on specific timeline point for every handles*/ +__u64 points; +/* absolute timeout */ +__s64 timeout_nsec; +__u32 count_handles; +__u32 flags; +__u32 first_signaled;/* only valid when not waiting all */ +__u32 pad; +}; +struct drm_syncobj_array {__u64 handles;__u32 count_handles;__u32 pad; }; +struct drm_syncobj_timeline_array { +__u64 handles; +__u64 points; +__u32 count_handles; +__u32 pad; +}; + +struct drm_syncobj_transfer { +__u32 binary_handle; +__u32 timeline_handle; +__u64 point; +__u32 flags; +__u32 pad; +};/* Query current scanout sequence number */ struct drm_crtc_get_sequence {
@@ -886,6 +914,11 @@ extern "C" {#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) +#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) +#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) +#define DRM_IOCTL_SYNCOBJ_BINARY_TO_TIMELINE DRM_IOWR(0xCC, struct drm_syncobj_transfer) +#define DRM_IOCTL_SYNCOBJ_TIMELINE_TO_BINARY DRM_IOWR(0xCD, struct drm_syncobj_transfer) +#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCE, struct drm_syncobj_timeline_array)/** * Device specific ioctls should only be in their respective headers
lib/igt_syncobj.c +204 -0
207 lines not on this page · raw message
lib/igt_syncobj.h +19 -0
@@ -65,7 +65,26 @@ int syncobj_wait_err(int fd, uint32_t *handles, uint32_t count,bool syncobj_wait (int fd,uint32_t *handles,uint32_t count,uint64_t abs_timeout_nsec,uint32_t flags,uint32_t *first_signaled); +int __syncobj_timeline_wait_ioctl (int fd, +struct drm_syncobj_timeline_wait *args); +bool syncobj_timeline_wait (int fd,uint32_t *handles,uint64_t *points, +unsigned num_handles, +int64_t timeout_nsec,unsigned flags, +uint32_t *first_signaled); +int syncobj_timeline_wait_err (int fd,uint32_t *handles,uint64_t *points, +unsigned num_handles, +int64_t timeout_nsec,unsigned flags);void syncobj_reset (int fd,uint32_t *handles,uint32_t count);void syncobj_signal (int fd,uint32_t *handles,uint32_t count); +void syncobj_timeline_query (int fd,uint32_t *handles,uint64_t **points, +uint32_t count); +void syncobj_binary_to_timeline (int fd,uint32_t timeline_handle, +uint64_t point,uint32_t binary_handle); +void syncobj_timeline_to_binary (int fd,uint32_t binary_handle, +uint32_t timeline_handle, +uint64_t point, +uint32_t flags); +void syncobj_timeline_signal (int fd,uint32_t *handles,uint64_t *points, +uint32_t count);#endif /* IGT_SYNCOBJ_H */
tests/gem_ctx_bad_exec new file binary +0 -0
tests/meson.build +1 -0
@@ -83,6 +83,7 @@ test_progs = [ 'sw_sync', 'syncobj_basic', 'syncobj_wait', + 'syncobj_timeline', 'template', 'tools_test', 'vc4_create_bo',
tests/syncobj_timeline.c new file +1100 -0
1,100 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Chunming Zhou
Signed-off-by Chunming Zhou <[email protected]>--- include/drm-uapi/drm.h | 33 ++ lib/igt_syncobj.c | 204 +++++++ lib/igt_syncobj.h | 19 + tests/gem_ctx_bad_exec | Bin 0 -> 1284384 bytes
Please run
git rm tests/gem_ctx_bad_exec
and re-send the patch.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx