1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2022 Intel Corporation
4  */
5 
6 #ifndef _XE_PREEMPT_FENCE_TYPES_H_
7 #define _XE_PREEMPT_FENCE_TYPES_H_
8 
9 #include <linux/dma-fence.h>
10 #include <linux/workqueue.h>
11 
12 struct xe_exec_queue;
13 
14 /**
15  * struct xe_preempt_fence - XE preempt fence
16  *
17  * hardware and triggers a callback once the xe_engine is complete.
18  */
19 struct xe_preempt_fence {
20 	/** @base: dma fence base */
21 	struct dma_fence base;
22 	/** @link: link into list of pending preempt fences */
23 	struct list_head link;
24 	/** @q: exec queue for this preempt fence */
25 	struct xe_exec_queue *q;
26 	/** @preempt_work: work struct which issues preemption */
27 	struct work_struct preempt_work;
28 	/** @lock: dma-fence fence lock */
29 	spinlock_t lock;
30 	/** @error: preempt fence is in error state */
31 	int error;
32 };
33 
34 #endif
35