1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * lib_sw_fence.h - library routines for testing N:M synchronisation points
5 * Copyright (C) 2017 Intel Corporation
8 #ifndef _LIB_SW_FENCE_H_
9 #define _LIB_SW_FENCE_H_
11 #include <linux/timer.h>
13 #include "../i915_sw_fence.h"
16 #define onstack_fence_init(fence) \
18 static struct lock_class_key __key; \
20 __onstack_fence_init((fence), #fence, &__key); \
23 #define onstack_fence_init(fence) \
24 __onstack_fence_init((fence), NULL, NULL)
27 void __onstack_fence_init(struct i915_sw_fence
*fence
,
29 struct lock_class_key
*key
);
30 void onstack_fence_fini(struct i915_sw_fence
*fence
);
33 struct i915_sw_fence fence
;
34 struct timer_list timer
;
37 void timed_fence_init(struct timed_fence
*tf
, unsigned long expires
);
38 void timed_fence_fini(struct timed_fence
*tf
);
40 struct i915_sw_fence
*heap_fence_create(gfp_t gfp
);
41 void heap_fence_put(struct i915_sw_fence
*fence
);
43 #endif /* _LIB_SW_FENCE_H_ */