WIP FPC-III support
[linux/fpc-iii.git] / drivers / gpu / drm / i915 / selftests / lib_sw_fence.h
blobe54d6bc23dc3a9a0f780fdf8d7918fda0d25163c
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * lib_sw_fence.h - library routines for testing N:M synchronisation points
5 * Copyright (C) 2017 Intel Corporation
6 */
8 #ifndef _LIB_SW_FENCE_H_
9 #define _LIB_SW_FENCE_H_
11 #include <linux/timer.h>
13 #include "../i915_sw_fence.h"
15 #ifdef CONFIG_LOCKDEP
16 #define onstack_fence_init(fence) \
17 do { \
18 static struct lock_class_key __key; \
20 __onstack_fence_init((fence), #fence, &__key); \
21 } while (0)
22 #else
23 #define onstack_fence_init(fence) \
24 __onstack_fence_init((fence), NULL, NULL)
25 #endif
27 void __onstack_fence_init(struct i915_sw_fence *fence,
28 const char *name,
29 struct lock_class_key *key);
30 void onstack_fence_fini(struct i915_sw_fence *fence);
32 struct timed_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_ */