From ca6513d23e50e532da0415639ede0f91187fa978 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 26 Jun 2015 12:57:15 -0700 Subject: man: add android native sync man page Maybe not the right package for the man page, but at least it's a start. --- man/Makefile.am | 3 +- man/android-native-sync.xml | 133 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 man/android-native-sync.xml diff --git a/man/Makefile.am b/man/Makefile.am index ad0a40d94..0f6d16731 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -8,7 +8,8 @@ libman_PRE = \ drmAvailable.xml \ drmHandleEvent.xml \ drmModeGetResources.xml \ - drm_intel_exec_mm.3 + drm_intel_exec_mm.3 \ + android-native-sync.7 miscman_PRE = \ drm.xml \ diff --git a/man/android-native-sync.xml b/man/android-native-sync.xml new file mode 100644 index 000000000..900bba221 --- /dev/null +++ b/man/android-native-sync.xml @@ -0,0 +1,133 @@ + + + + + + + + Android Native Sync + linux + June 2015 + + + Developer + Erik + Gilling + konkers@android.com + + + + + + android-native-sync + 7 + + + + android-native-sync + Manage inter-device and software synchronization + + + + + + #include <sync.h> + + + + + + Description + The Android Native Sync framework can be used to monitor and + synchronize activity between multiple devices, logical contexts, or + other events that occur in a monotonic fashion. This is achived through + the use of fence objects and ioctls, in cooperation with device drivers + supporting the interface. + + The fundamental unit of the sync framework is the fd. + It's generally returned by a device driver as part of an execution request + or specific ioctl. A native sync fd has several + operations: SYNC_IOC_WAIT, + SYNC_IOC_MERGE, and + SYNC_IOC_FENCE_INFO. In addition, a native sync + fd can be poll()2'd. + + + Polling + Native sync fds can be poll()'d for completion. If the sync + object has been signaled, poll() will return POLLIN. + On error, POLLERR will be returned. Otherwise, + 0 will be returned. + + + + Ioctls + SYNC_IOC_WAIT can be used like poll() to block + the caller until the sync object signals. It takes a single argument, + a pointer to a timeout parameter, in milliseconds, which determines how + long the call will block before returning. Passing a variable containing + -1 (or any <0 number) will use the maximum timeout + possible and 0 will simply return whether the fence + has passed or not. If the fence signals before the timeout has passed, + 0 will be returned. Otherwise, + ETIME will be returned, or an appropriate errno. + + SYNC_IOC_MERGE allows the caller to merge two + sync objects into a single object, which can be useful if the caller + simply needs to monitor the longer of two events that may be occuring + in parallel. The ioctl takes a pointer to a structure as its argument, + describing the objects to merge, and returning the new fd if successful: + + struct sync_merge_data { + __s32 fd2; /* fd of second fence */ + char name[32]; /* name of new fence */ + __s32 fence; /* fd on newly created fence */ + }; + + This function returns 0 on success or an appropriate + errno on failure. + + SYNC_IOC_FENCE_INFO returns information about + a given fence, listing its constituent sync points and other data: + + struct sync_pt_info { + __u32 len; + char obj_name[32]; + char driver_name[32]; + __s32 status; + __u64 timestamp_ns; + + __u8 driver_data[0]; + }; + + struct sync_fence_info_data { + __u32 len; + char name[32]; + __s32 status; + + __u8 pt_info[0]; + }; + + + + + + + Reporting Bugs + Bugs in this function should be reported to + http://bugs.freedesktop.org under the "Mesa" product, with "Other" or + "libdrm" as the component. + + + + See Also + + poll2 + + + -- cgit v1.2.3