Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Fill out <linux/fence.h>...



details:   https://anonhg.NetBSD.org/src/rev/c276c82b1093
branches:  trunk
changeset: 835095:c276c82b1093
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:34:32 2018 +0000

description:
Fill out <linux/fence.h>, pending implementing the symbols.

diffstat:

 sys/external/bsd/drm2/include/linux/fence.h |  55 ++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 4 deletions(-)

diffs (82 lines):

diff -r 0c66f707e844 -r c276c82b1093 sys/external/bsd/drm2/include/linux/fence.h
--- a/sys/external/bsd/drm2/include/linux/fence.h       Mon Aug 27 07:34:23 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/fence.h       Mon Aug 27 07:34:32 2018 +0000
@@ -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
 
-long   fence_wait(struct fence *, bool);
+void   fence_init(struct fence *, const struct fence_ops *, spinlock_t *,
+           unsigned, unsigned);
+void   fence_free(struct fence *);
+
+unsigned
+       fence_context_alloc(unsigned);
+
 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_ */



Home | Main Index | Thread Index | Old Index