brintos

brintos / linux-shallow public Read only

0
0
Text · 1.0 KiB · e54d6bc Raw
44 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * lib_sw_fence.h - library routines for testing N:M synchronisation points4 *5 * Copyright (C) 2017 Intel Corporation6 */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_LOCKDEP16#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#else23#define onstack_fence_init(fence)				\24	__onstack_fence_init((fence), NULL, NULL)25#endif26 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_ */44