Path: blob/21.2-virgl/include/drm-uapi/sync_file.h
4545 views
/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */1/*2* Copyright (C) 2012 Google, Inc.3*4* This program is distributed in the hope that it will be useful,5* but WITHOUT ANY WARRANTY; without even the implied warranty of6* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the7* GNU General Public License for more details.8*9*/1011#ifndef _UAPI_LINUX_SYNC_H12#define _UAPI_LINUX_SYNC_H1314#if defined(__linux__)1516#include <linux/ioctl.h>17#include <linux/types.h>1819#else /* One of the BSDs */2021#include <sys/types.h>22#include <sys/ioccom.h>2324typedef int8_t __s8;25typedef uint8_t __u8;26typedef int16_t __s16;27typedef uint16_t __u16;28typedef int32_t __s32;29typedef uint32_t __u32;30typedef int64_t __s64;31typedef uint64_t __u64;3233#endif3435/**36* struct sync_merge_data - data passed to merge ioctl37* @name: name of new fence38* @fd2: file descriptor of second fence39* @fence: returns the fd of the new fence to userspace40* @flags: merge_data flags41* @pad: padding for 64-bit alignment, should always be zero42*/43struct sync_merge_data {44char name[32];45__s32 fd2;46__s32 fence;47__u32 flags;48__u32 pad;49};5051/**52* struct sync_fence_info - detailed fence information53* @obj_name: name of parent sync_timeline54* @driver_name: name of driver implementing the parent55* @status: status of the fence 0:active 1:signaled <0:error56* @flags: fence_info flags57* @timestamp_ns: timestamp of status change in nanoseconds58*/59struct sync_fence_info {60char obj_name[32];61char driver_name[32];62__s32 status;63__u32 flags;64__u64 timestamp_ns;65};6667/**68* struct sync_file_info - data returned from fence info ioctl69* @name: name of fence70* @status: status of fence. 1: signaled 0:active <0:error71* @flags: sync_file_info flags72* @num_fences number of fences in the sync_file73* @pad: padding for 64-bit alignment, should always be zero74* @sync_fence_info: pointer to array of structs sync_fence_info with all75* fences in the sync_file76*/77struct sync_file_info {78char name[32];79__s32 status;80__u32 flags;81__u32 num_fences;82__u32 pad;8384__u64 sync_fence_info;85};8687#define SYNC_IOC_MAGIC '>'8889/**90* Opcodes 0, 1 and 2 were burned during a API change to avoid users of the91* old API to get weird errors when trying to handling sync_files. The API92* change happened during the de-stage of the Sync Framework when there was93* no upstream users available.94*/9596/**97* DOC: SYNC_IOC_MERGE - merge two fences98*99* Takes a struct sync_merge_data. Creates a new fence containing copies of100* the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the101* new fence's fd in sync_merge_data.fence102*/103#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)104105/**106* DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file107*108* Takes a struct sync_file_info. If num_fences is 0, the field is updated109* with the actual number of fences. If num_fences is > 0, the system will110* use the pointer provided on sync_fence_info to return up to num_fences of111* struct sync_fence_info, with detailed fence information.112*/113#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)114115#endif /* _UAPI_LINUX_SYNC_H */116117118