1
2
3
4
5
6 #ifndef _PANFROST_DRM_H_
7 #define _PANFROST_DRM_H_
8
9 #include "drm.h"
10
11 #if defined(__cplusplus)
12 extern "C" {
13 #endif
14
15 #define DRM_PANFROST_SUBMIT 0x00
16 #define DRM_PANFROST_WAIT_BO 0x01
17 #define DRM_PANFROST_CREATE_BO 0x02
18 #define DRM_PANFROST_MMAP_BO 0x03
19 #define DRM_PANFROST_GET_PARAM 0x04
20 #define DRM_PANFROST_GET_BO_OFFSET 0x05
21 #define DRM_PANFROST_PERFCNT_ENABLE 0x06
22 #define DRM_PANFROST_PERFCNT_DUMP 0x07
23 #define DRM_PANFROST_MADVISE 0x08
24
25 #define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
26 #define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
27 #define DRM_IOCTL_PANFROST_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_CREATE_BO, struct drm_panfrost_create_bo)
28 #define DRM_IOCTL_PANFROST_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MMAP_BO, struct drm_panfrost_mmap_bo)
29 #define DRM_IOCTL_PANFROST_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_PARAM, struct drm_panfrost_get_param)
30 #define DRM_IOCTL_PANFROST_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_BO_OFFSET, struct drm_panfrost_get_bo_offset)
31 #define DRM_IOCTL_PANFROST_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MADVISE, struct drm_panfrost_madvise)
32
33
34
35
36
37
38
39 #define DRM_IOCTL_PANFROST_PERFCNT_ENABLE DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_ENABLE, struct drm_panfrost_perfcnt_enable)
40 #define DRM_IOCTL_PANFROST_PERFCNT_DUMP DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_DUMP, struct drm_panfrost_perfcnt_dump)
41
42 #define PANFROST_JD_REQ_FS (1 << 0)
43
44
45
46
47
48
49 struct drm_panfrost_submit {
50
51
52 __u64 jc;
53
54
55 __u64 in_syncs;
56
57
58 __u32 in_sync_count;
59
60
61 __u32 out_sync;
62
63
64 __u64 bo_handles;
65
66
67 __u32 bo_handle_count;
68
69
70 __u32 requirements;
71 };
72
73
74
75
76
77
78
79
80
81 struct drm_panfrost_wait_bo {
82 __u32 handle;
83 __u32 pad;
84 __s64 timeout_ns;
85 };
86
87 #define PANFROST_BO_NOEXEC 1
88 #define PANFROST_BO_HEAP 2
89
90
91
92
93
94
95
96 struct drm_panfrost_create_bo {
97 __u32 size;
98 __u32 flags;
99
100 __u32 handle;
101
102 __u32 pad;
103
104
105
106
107
108
109
110
111 __u64 offset;
112 };
113
114
115
116
117
118
119
120
121
122
123
124
125 struct drm_panfrost_mmap_bo {
126
127 __u32 handle;
128 __u32 flags;
129
130 __u64 offset;
131 };
132
133 enum drm_panfrost_param {
134 DRM_PANFROST_PARAM_GPU_PROD_ID,
135 DRM_PANFROST_PARAM_GPU_REVISION,
136 DRM_PANFROST_PARAM_SHADER_PRESENT,
137 DRM_PANFROST_PARAM_TILER_PRESENT,
138 DRM_PANFROST_PARAM_L2_PRESENT,
139 DRM_PANFROST_PARAM_STACK_PRESENT,
140 DRM_PANFROST_PARAM_AS_PRESENT,
141 DRM_PANFROST_PARAM_JS_PRESENT,
142 DRM_PANFROST_PARAM_L2_FEATURES,
143 DRM_PANFROST_PARAM_CORE_FEATURES,
144 DRM_PANFROST_PARAM_TILER_FEATURES,
145 DRM_PANFROST_PARAM_MEM_FEATURES,
146 DRM_PANFROST_PARAM_MMU_FEATURES,
147 DRM_PANFROST_PARAM_THREAD_FEATURES,
148 DRM_PANFROST_PARAM_MAX_THREADS,
149 DRM_PANFROST_PARAM_THREAD_MAX_WORKGROUP_SZ,
150 DRM_PANFROST_PARAM_THREAD_MAX_BARRIER_SZ,
151 DRM_PANFROST_PARAM_COHERENCY_FEATURES,
152 DRM_PANFROST_PARAM_TEXTURE_FEATURES0,
153 DRM_PANFROST_PARAM_TEXTURE_FEATURES1,
154 DRM_PANFROST_PARAM_TEXTURE_FEATURES2,
155 DRM_PANFROST_PARAM_TEXTURE_FEATURES3,
156 DRM_PANFROST_PARAM_JS_FEATURES0,
157 DRM_PANFROST_PARAM_JS_FEATURES1,
158 DRM_PANFROST_PARAM_JS_FEATURES2,
159 DRM_PANFROST_PARAM_JS_FEATURES3,
160 DRM_PANFROST_PARAM_JS_FEATURES4,
161 DRM_PANFROST_PARAM_JS_FEATURES5,
162 DRM_PANFROST_PARAM_JS_FEATURES6,
163 DRM_PANFROST_PARAM_JS_FEATURES7,
164 DRM_PANFROST_PARAM_JS_FEATURES8,
165 DRM_PANFROST_PARAM_JS_FEATURES9,
166 DRM_PANFROST_PARAM_JS_FEATURES10,
167 DRM_PANFROST_PARAM_JS_FEATURES11,
168 DRM_PANFROST_PARAM_JS_FEATURES12,
169 DRM_PANFROST_PARAM_JS_FEATURES13,
170 DRM_PANFROST_PARAM_JS_FEATURES14,
171 DRM_PANFROST_PARAM_JS_FEATURES15,
172 DRM_PANFROST_PARAM_NR_CORE_GROUPS,
173 DRM_PANFROST_PARAM_THREAD_TLS_ALLOC,
174 };
175
176 struct drm_panfrost_get_param {
177 __u32 param;
178 __u32 pad;
179 __u64 value;
180 };
181
182
183
184
185
186
187 struct drm_panfrost_get_bo_offset {
188 __u32 handle;
189 __u32 pad;
190 __u64 offset;
191 };
192
193 struct drm_panfrost_perfcnt_enable {
194 __u32 enable;
195
196
197
198
199 __u32 counterset;
200 };
201
202 struct drm_panfrost_perfcnt_dump {
203 __u64 buf_ptr;
204 };
205
206
207
208
209
210
211
212
213
214
215
216
217 #define PANFROST_MADV_WILLNEED 0
218 #define PANFROST_MADV_DONTNEED 1
219
220 struct drm_panfrost_madvise {
221 __u32 handle;
222 __u32 madv;
223 __u32 retained;
224 };
225
226 #if defined(__cplusplus)
227 }
228 #endif
229
230 #endif