/*1* Sync File validation framework and debug infomation2*3* Copyright (C) 2012 Google, Inc.4*5* This program is distributed in the hope that it will be useful,6* but WITHOUT ANY WARRANTY; without even the implied warranty of7* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the8* GNU General Public License for more details.9*10*/1112#ifndef _LINUX_SYNC_H13#define _LINUX_SYNC_H1415#include <linux/list.h>16#include <linux/rbtree.h>17#include <linux/spinlock.h>18#include <linux/dma-fence.h>1920#include <linux/sync_file.h>21#include <uapi/linux/sync_file.h>2223/**24* struct sync_timeline - sync object25* @kref: reference count on fence.26* @name: name of the sync_timeline. Useful for debugging27* @lock: lock protecting @pt_list and @value28* @pt_tree: rbtree of active (unsignaled/errored) sync_pts29* @pt_list: list of active (unsignaled/errored) sync_pts30* @sync_timeline_list: membership in global sync_timeline_list31*/32struct sync_timeline {33struct kref kref;34char name[32];3536/* protected by lock */37u64 context;38int value;3940struct rb_root pt_tree;41struct list_head pt_list;42spinlock_t lock;4344struct list_head sync_timeline_list;45};4647static inline struct sync_timeline *dma_fence_parent(struct dma_fence *fence)48{49return container_of(fence->lock, struct sync_timeline, lock);50}5152/**53* struct sync_pt - sync_pt object54* @base: base fence object55* @link: link on the sync timeline's list56* @node: node in the sync timeline's tree57* @deadline: the earliest fence deadline hint58*/59struct sync_pt {60struct dma_fence base;61struct list_head link;62struct rb_node node;63ktime_t deadline;64};6566extern const struct file_operations sw_sync_debugfs_fops;6768void sync_timeline_debug_add(struct sync_timeline *obj);69void sync_timeline_debug_remove(struct sync_timeline *obj);7071#endif /* _LINUX_SYNC_H */727374