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

dma-buf/sync_file: Surface sync-file uABI

We had all of the internal driver APIs, but not the all important
userspace uABI, in the dma-buf doc. Fix that. And re-arrange the
comments slightly as otherwise the comments for the ioctl nr defines
would not show up.

v2: Fix docs build warning coming from newly including the uabi header
in the docs build

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>

+23 -24
+8 -2
Documentation/driver-api/dma-buf.rst
··· 203 203 .. kernel-doc:: include/linux/dma-fence-unwrap.h 204 204 :internal: 205 205 206 - DMA Fence uABI/Sync File 207 - ~~~~~~~~~~~~~~~~~~~~~~~~ 206 + DMA Fence Sync File 207 + ~~~~~~~~~~~~~~~~~~~ 208 208 209 209 .. kernel-doc:: drivers/dma-buf/sync_file.c 210 210 :export: 211 211 212 212 .. kernel-doc:: include/linux/sync_file.h 213 + :internal: 214 + 215 + DMA Fence Sync File uABI 216 + ~~~~~~~~~~~~~~~~~~~~~~~~ 217 + 218 + .. kernel-doc:: include/uapi/linux/sync_file.h 213 219 :internal: 214 220 215 221 Indefinite DMA Fences
+15 -22
include/uapi/linux/sync_file.h
··· 16 16 #include <linux/types.h> 17 17 18 18 /** 19 - * struct sync_merge_data - data passed to merge ioctl 19 + * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences 20 20 * @name: name of new fence 21 21 * @fd2: file descriptor of second fence 22 22 * @fence: returns the fd of the new fence to userspace 23 23 * @flags: merge_data flags 24 24 * @pad: padding for 64-bit alignment, should always be zero 25 + * 26 + * Creates a new fence containing copies of the sync_pts in both 27 + * the calling fd and sync_merge_data.fd2. Returns the new fence's 28 + * fd in sync_merge_data.fence 25 29 */ 26 30 struct sync_merge_data { 27 31 char name[32]; ··· 38 34 /** 39 35 * struct sync_fence_info - detailed fence information 40 36 * @obj_name: name of parent sync_timeline 41 - * @driver_name: name of driver implementing the parent 42 - * @status: status of the fence 0:active 1:signaled <0:error 37 + * @driver_name: name of driver implementing the parent 38 + * @status: status of the fence 0:active 1:signaled <0:error 43 39 * @flags: fence_info flags 44 40 * @timestamp_ns: timestamp of status change in nanoseconds 45 41 */ ··· 52 48 }; 53 49 54 50 /** 55 - * struct sync_file_info - data returned from fence info ioctl 51 + * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file 56 52 * @name: name of fence 57 53 * @status: status of fence. 1: signaled 0:active <0:error 58 54 * @flags: sync_file_info flags 59 55 * @num_fences number of fences in the sync_file 60 56 * @pad: padding for 64-bit alignment, should always be zero 61 - * @sync_fence_info: pointer to array of structs sync_fence_info with all 57 + * @sync_fence_info: pointer to array of struct &sync_fence_info with all 62 58 * fences in the sync_file 59 + * 60 + * Takes a struct sync_file_info. If num_fences is 0, the field is updated 61 + * with the actual number of fences. If num_fences is > 0, the system will 62 + * use the pointer provided on sync_fence_info to return up to num_fences of 63 + * struct sync_fence_info, with detailed fence information. 63 64 */ 64 65 struct sync_file_info { 65 66 char name[32]; ··· 78 69 79 70 #define SYNC_IOC_MAGIC '>' 80 71 81 - /** 72 + /* 82 73 * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the 83 74 * old API to get weird errors when trying to handling sync_files. The API 84 75 * change happened during the de-stage of the Sync Framework when there was 85 76 * no upstream users available. 86 77 */ 87 78 88 - /** 89 - * DOC: SYNC_IOC_MERGE - merge two fences 90 - * 91 - * Takes a struct sync_merge_data. Creates a new fence containing copies of 92 - * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the 93 - * new fence's fd in sync_merge_data.fence 94 - */ 95 79 #define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data) 96 - 97 - /** 98 - * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file 99 - * 100 - * Takes a struct sync_file_info. If num_fences is 0, the field is updated 101 - * with the actual number of fences. If num_fences is > 0, the system will 102 - * use the pointer provided on sync_fence_info to return up to num_fences of 103 - * struct sync_fence_info, with detailed fence information. 104 - */ 105 80 #define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info) 106 81 107 82 #endif /* _UAPI_LINUX_SYNC_H */