Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / gpu / drm / i915 / selftests / lib_sw_fence.h
blob474aafb92ae1afa5d7c5408afdc950ca55065473
1 /*
2 * lib_sw_fence.h - library routines for testing N:M synchronisation points
4 * Copyright (C) 2017 Intel Corporation
6 * This file is released under the GPLv2.
8 */
10 #ifndef _LIB_SW_FENCE_H_
11 #define _LIB_SW_FENCE_H_
13 #include <linux/timer.h>
15 #include "../i915_sw_fence.h"
17 #ifdef CONFIG_LOCKDEP
18 #define onstack_fence_init(fence) \
19 do { \
20 static struct lock_class_key __key; \
22 __onstack_fence_init((fence), #fence, &__key); \
23 } while (0)
24 #else
25 #define onstack_fence_init(fence) \
26 __onstack_fence_init((fence), NULL, NULL)
27 #endif
29 void __onstack_fence_init(struct i915_sw_fence *fence,
30 const char *name,
31 struct lock_class_key *key);
32 void onstack_fence_fini(struct i915_sw_fence *fence);
34 struct timed_fence {
35 struct i915_sw_fence fence;
36 struct timer_list timer;
39 void timed_fence_init(struct timed_fence *tf, unsigned long expires);
40 void timed_fence_fini(struct timed_fence *tf);
42 #endif /* _LIB_SW_FENCE_H_ */