summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorDmitry Antipov <dantipov@nvidia.com>2018-08-14 07:17:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-28 12:24:21 -0400
commitc9d85a691fc2421c9bbf5b70091bfd591d4d11ef (patch)
tree251379111446a4fb2de3b6f48533517d8f10c120 /include/uapi/linux
parent5fc742cd01013e801c90fd834c49cfbdebf53f7c (diff)
eventlib: unify NVDLA/PVA fence types and add fence recording
Bug 2170736 Change-Id: If4fdeda140bf2474a08beb2a0d7c3fc1737a1a66 Signed-off-by: Dmitry Antipov <dantipov@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1750906 Reviewed-by: Saleh Dindar <sdindar@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Colin Tracey <ctracey@nvidia.com> Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nvdev_fence.h58
-rw-r--r--include/uapi/linux/nvhost_events.h30
-rw-r--r--include/uapi/linux/nvhost_pva_ioctl.h9
3 files changed, 89 insertions, 8 deletions
diff --git a/include/uapi/linux/nvdev_fence.h b/include/uapi/linux/nvdev_fence.h
new file mode 100644
index 000000000..37d81be43
--- /dev/null
+++ b/include/uapi/linux/nvdev_fence.h
@@ -0,0 +1,58 @@
1/*
2 * include/uapi/linux/nvdev_fence.h
3 *
4 * Tegra PVA/DLA fence support
5 *
6 * Copyright (c) 2018, NVIDIA Corporation. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef LINUX_NVDEV_FENCE_H
23#define LINUX_NVDEV_FENCE_H
24
25#include <linux/types.h>
26
27/* used for the recording with keventlib */
28enum nvdev_fence_kind {
29 NVDEV_FENCE_KIND_PRE = 0,
30 NVDEV_FENCE_KIND_POST
31};
32
33/**
34 * struct nvdev_fence structure for passing fence information
35 *
36 * @type: Type of the fence (syncpoint, sync fd or semaphore)
37 * @syncpoint_index: Syncpoint id
38 * @syncpoint_value: Value of syncpoint id
39 * @sync_fd: Linux sync FD handle
40 * @semaphore_handle: File handle to the semaphore memory buffer
41 * @semaphore_offset: Offset to the semaphore within the buffer
42 * @semaphore_value: Value of the semaphore
43 */
44struct nvdev_fence {
45 __u32 type;
46#define NVDEV_FENCE_TYPE_SYNCPT 0
47#define NVDEV_FENCE_TYPE_SYNC_FD 1
48#define NVDEV_FENCE_TYPE_SEMAPHORE 2
49#define NVDEV_FENCE_TYPE_SEMAPHORE_TS 3
50 __u32 syncpoint_index;
51 __u32 syncpoint_value;
52 __u32 sync_fd;
53 __u32 semaphore_handle;
54 __u32 semaphore_offset;
55 __u32 semaphore_value;
56};
57
58#endif /* LINUX_NVDEV_FENCE_H */
diff --git a/include/uapi/linux/nvhost_events.h b/include/uapi/linux/nvhost_events.h
index 1282ee38a..1c9bc4cef 100644
--- a/include/uapi/linux/nvhost_events.h
+++ b/include/uapi/linux/nvhost_events.h
@@ -77,6 +77,31 @@ struct nvhost_vpu_perf_counter {
77 u32 maximum; 77 u32 maximum;
78} __packed; 78} __packed;
79 79
80/* Marks the pre/postfence associated with the task */
81struct nvhost_task_fence {
82 /* Engine class ID */
83 u32 class_id;
84
85 /* Kind (prefence or postfence) */
86 u32 kind;
87
88 /* Type (see nvdev_fence.h) */
89 u32 type;
90
91 /* Valid for NVDEV_FENCE_TYPE_SYNCPT only */
92 u32 syncpoint_index;
93 u32 syncpoint_value;
94
95 /* Valid for NVDEV_FENCE_TYPE_SYNC_FD only */
96 u32 sync_fd;
97
98 /* Valid for NVDEV_FENCE_TYPE_SEMAPHORE
99 and NVDEV_FENCE_TYPE_SEMAPHORE_TS */
100 u32 semaphore_handle;
101 u32 semaphore_offset;
102 u32 semaphore_value;
103} __packed;
104
80enum { 105enum {
81 /* struct nvhost_task_submit */ 106 /* struct nvhost_task_submit */
82 NVHOST_TASK_SUBMIT = 0, 107 NVHOST_TASK_SUBMIT = 0,
@@ -90,7 +115,10 @@ enum {
90 /* struct nvhost_vpu_perf_counter */ 115 /* struct nvhost_vpu_perf_counter */
91 NVHOST_VPU_PERF_COUNTER = 3, 116 NVHOST_VPU_PERF_COUNTER = 3,
92 117
93 NVHOST_NUM_EVENT_TYPES = 4 118 /* struct nvhost_task_fence */
119 NVHOST_TASK_FENCE = 4,
120
121 NVHOST_NUM_EVENT_TYPES = 5
94}; 122};
95 123
96enum { 124enum {
diff --git a/include/uapi/linux/nvhost_pva_ioctl.h b/include/uapi/linux/nvhost_pva_ioctl.h
index c09e1ba71..fc0940e95 100644
--- a/include/uapi/linux/nvhost_pva_ioctl.h
+++ b/include/uapi/linux/nvhost_pva_ioctl.h
@@ -164,13 +164,8 @@ struct pva_task_parameter {
164/** 164/**
165 * struct pva_ioctl_fence structure for passing fence information 165 * struct pva_ioctl_fence structure for passing fence information
166 * 166 *
167 * @type: Type of the fence (syncpoint, sync fd or semaphore) 167 * NOTE: this will be removed soon, please use generic fence type
168 * @syncpoint_index: Syncpoint id 168 * from nvdev_fence.h
169 * @syncpoint_value: Value of syncpoint id
170 * @sync_fd: Linux sync FD handle
171 * @semaphore_handle: File handle to the semaphore memory buffer
172 * @semaphore_offset: Offset to the semaphore within the buffer
173 * @semaphore_value: Value of the semaphore
174 */ 169 */
175struct pva_fence { 170struct pva_fence {
176 __u32 type; 171 __u32 type;