weston/libweston/linux-sync-file-uapi.h
Alexandros Frantzis c0e2f9261f libweston: Introduce an internal linux sync file API
Introduce an internal API for dealing with linux sync files,
and use it in the codebase to replace ad-hoc sync file management.

The linux_sync_file_is_valid function is not currently used, but will be
utilized in upcoming commits to implement the
zwp_linux_explicit_synchronization_unstable_v1 protocol.

Changes in v5:
  - Meson support.

Changes in v3:
  - Use parameter name in function documentation.
  - Move kernel UAPI to separate header file.

Changes in v2:
  - Add function documentation
  - Remove linux_sync_file_wait()

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-02-06 12:21:56 +00:00

31 lines
560 B
C

/* Sync file Linux kernel UAPI */
#ifndef WESTON_LINUX_SYNC_FILE_UAPI_H
#define WESTON_LINUX_SYNC_FILE_UAPI_H
#include <linux/ioctl.h>
#include <linux/types.h>
struct sync_fence_info {
char obj_name[32];
char driver_name[32];
__s32 status;
__u32 flags;
__u64 timestamp_ns;
};
struct sync_file_info {
char name[32];
__s32 status;
__u32 flags;
__u32 num_fences;
__u32 pad;
__u64 sync_fence_info;
};
#define SYNC_IOC_MAGIC '>'
#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
#endif /* WESTON_LINUX_SYNC_FILE_UAPI_H */