forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/arm/bifrost/tl/mali_kbase_timeline_priv.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -51,7 +51,7 @@
5151 * @event_queue: Timeline stream event queue
5252 * @bytes_collected: Number of bytes read by user
5353 * @timeline_flags: Zero, if timeline is disabled. Timeline stream flags
54
- * otherwise. See kbase_timeline_io_acquire().
54
+ * otherwise. See kbase_timeline_acquire().
5555 * @obj_header_btc: Remaining bytes to copy for the object stream header
5656 * @aux_header_btc: Remaining bytes to copy for the aux stream header
5757 * @last_acquire_time: The time at which timeline was last acquired.
....@@ -77,8 +77,27 @@
7777 #endif
7878 };
7979
80
-extern const struct file_operations kbasep_tlstream_fops;
81
-
8280 void kbase_create_timeline_objects(struct kbase_device *kbdev);
8381
82
+/**
83
+ * kbase_timeline_acquire - acquire timeline for a userspace client.
84
+ * @kbdev: An instance of the GPU platform device, allocated from the probe
85
+ * method of the driver.
86
+ * @flags: Timeline stream flags
87
+ *
88
+ * Each timeline instance can be acquired by only one userspace client at a time.
89
+ *
90
+ * Return: Zero on success, error number on failure (e.g. if already acquired).
91
+ */
92
+int kbase_timeline_acquire(struct kbase_device *kbdev, u32 flags);
93
+
94
+/**
95
+ * kbase_timeline_release - release timeline for a userspace client.
96
+ * @timeline: Timeline instance to be stopped. It must be previously acquired
97
+ * with kbase_timeline_acquire().
98
+ *
99
+ * Releasing the timeline instance allows it to be acquired by another userspace client.
100
+ */
101
+void kbase_timeline_release(struct kbase_timeline *timeline);
102
+
84103 #endif /* _KBASE_TIMELINE_PRIV_H */