Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/android: add Doc for SW_SYNC ioctl interface

This interface is hidden from kernel headers and it is intended for use
only for testing. So testers would have to add the ioctl information
internally. This is to prevent misuse of this feature.

v2: take in Eric suggestions for the Documentation

v3: really take in Eric suggestions

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo Padovan and committed by
Greg Kroah-Hartman
fc0c9a03 e912c881

+31
+31
drivers/staging/android/sw_sync.c
··· 25 25 #define CREATE_TRACE_POINTS 26 26 #include "sync_trace.h" 27 27 28 + /* 29 + * SW SYNC validation framework 30 + * 31 + * A sync object driver that uses a 32bit counter to coordinate 32 + * synchronization. Useful when there is no hardware primitive backing 33 + * the synchronization. 34 + * 35 + * To start the framework just open: 36 + * 37 + * <debugfs>/sync/sw_sync 38 + * 39 + * That will create a sync timeline, all fences created under this timeline 40 + * file descriptor will belong to the this timeline. 41 + * 42 + * The 'sw_sync' file can be opened many times as to create different 43 + * timelines. 44 + * 45 + * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct 46 + * sw_sync_ioctl_create_fence as parameter. 47 + * 48 + * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used 49 + * with the increment as u32. This will update the last signaled value 50 + * from the timeline and signal any fence that has a seqno smaller or equal 51 + * to it. 52 + * 53 + * struct sw_sync_ioctl_create_fence 54 + * @value: the seqno to initialise the fence with 55 + * @name: the name of the new sync point 56 + * @fence: return the fd of the new sync_file with the created fence 57 + */ 28 58 struct sw_sync_create_fence_data { 29 59 __u32 value; 30 60 char name[32]; ··· 65 35 66 36 #define SW_SYNC_IOC_CREATE_FENCE _IOWR(SW_SYNC_IOC_MAGIC, 0,\ 67 37 struct sw_sync_create_fence_data) 38 + 68 39 #define SW_SYNC_IOC_INC _IOW(SW_SYNC_IOC_MAGIC, 1, __u32) 69 40 70 41 static const struct fence_ops timeline_fence_ops;