Module Name: src
Committed By: riastradh
Date: Mon Aug 27 07:34:32 UTC 2018
Modified Files:
src/sys/external/bsd/drm2/include/linux: fence.h
Log Message:
Fill out <linux/fence.h>, pending implementing the symbols.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/fence.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/fence.h
diff -u src/sys/external/bsd/drm2/include/linux/fence.h:1.6 src/sys/external/bsd/drm2/include/linux/fence.h:1.7
--- src/sys/external/bsd/drm2/include/linux/fence.h:1.6 Mon Aug 27 07:32:00 2018
+++ src/sys/external/bsd/drm2/include/linux/fence.h Mon Aug 27 07:34:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fence.h,v 1.6 2018/08/27 07:32:00 riastradh Exp $ */
+/* $NetBSD: fence.h,v 1.7 2018/08/27 07:34:32 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,22 +32,69 @@
#ifndef _LINUX_FENCE_H_
#define _LINUX_FENCE_H_
+#include <sys/types.h>
+
+#include <linux/mutex.h>
#include <linux/rcupdate.h>
-struct fence_ops {
-};
+struct fence_cb;
struct fence {
+ struct kref refcount;
+ spinlock_t *lock;
+ unsigned long flags;
+ unsigned context;
+ unsigned seqno;
const struct fence_ops *ops;
};
+#define FENCE_FLAG_SIGNALED_BIT __BIT(0)
+#define FENCE_FLAG_USER_BITS __BIT(1)
+
+struct fence_ops {
+ const char *(*get_driver_name)(struct fence *);
+ const char *(*get_timeline_name)(struct fence *);
+ bool (*enable_signaling)(struct fence *);
+ bool (*signaled)(struct fence *);
+ long (*wait)(struct fence *, bool, long);
+ void (*release)(struct fence *);
+};
+
+typedef void (*fence_func_t)(struct fence *, struct fence_cb *);
+
+struct fence_cb {
+ fence_func_t fcb_func;
+};
+
+#define fence_add_callback linux_fence_add_callback
+#define fence_context_alloc linux_fence_context_alloc
#define fence_get linux_fence_get
+#define fence_init linux_fence_init
#define fence_put linux_fence_put
+#define fence_remove_callback linux_fence_remove_callback
+#define fence_signal_locked linux_fence_signal_locked
#define fence_wait linux_fence_wait
+#define fence_wait_timeout linux_fence_wait_timeout
+
+void fence_init(struct fence *, const struct fence_ops *, spinlock_t *,
+ unsigned, unsigned);
+void fence_free(struct fence *);
+
+unsigned
+ fence_context_alloc(unsigned);
-long fence_wait(struct fence *, bool);
struct fence *
fence_get(struct fence *);
void fence_put(struct fence *);
+int fence_add_callback(struct fence *, struct fence_cb *, fence_func_t);
+bool fence_remove_callback(struct fence *, struct fence_cb *);
+
+bool fence_is_signaled(struct fence *);
+bool fence_is_signaled_locked(struct fence *);
+int fence_signal_locked(struct fence *);
+long fence_default_wait(struct fence *, bool, long);
+long fence_wait(struct fence *, bool);
+long fence_wait_timeout(struct fence *, bool, int);
+
#endif /* _LINUX_FENCE_H_ */