lib_sw_fence.h (1061B)
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * lib_sw_fence.h - library routines for testing N:M synchronisation points 4 * 5 * Copyright (C) 2017 Intel Corporation 6 */ 7 8#ifndef _LIB_SW_FENCE_H_ 9#define _LIB_SW_FENCE_H_ 10 11#include <linux/timer.h> 12 13#include "../i915_sw_fence.h" 14 15#ifdef CONFIG_LOCKDEP 16#define onstack_fence_init(fence) \ 17do { \ 18 static struct lock_class_key __key; \ 19 \ 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 26 27void __onstack_fence_init(struct i915_sw_fence *fence, 28 const char *name, 29 struct lock_class_key *key); 30void onstack_fence_fini(struct i915_sw_fence *fence); 31 32struct timed_fence { 33 struct i915_sw_fence fence; 34 struct timer_list timer; 35}; 36 37void timed_fence_init(struct timed_fence *tf, unsigned long expires); 38void timed_fence_fini(struct timed_fence *tf); 39 40struct i915_sw_fence *heap_fence_create(gfp_t gfp); 41void heap_fence_put(struct i915_sw_fence *fence); 42 43#endif /* _LIB_SW_FENCE_H_ */