aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-05-16 10:43:11 -0400
committerThierry Reding <treding@nvidia.com>2018-05-18 18:21:20 -0400
commit6134534ca24f42043cacdd7108026803577f6c59 (patch)
tree2bbbb6a7da971137dc8308ae56623f84b729e894
parentacae8a9d054daa75a01e34b18f3627e6df330622 (diff)
drm/tegra: Add kerneldoc for UAPI
Document the userspace ABI with kerneldoc to provide some information on how to use it. v3: - reword description of arrays and array lengths v2: - keep GEM object creation flags for ABI compatibility - fix typo in struct drm_tegra_syncpt_incr kerneldoc - fix typos in struct drm_tegra_submit kerneldoc - reworded some descriptions as suggested Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--include/uapi/drm/tegra_drm.h490
1 files changed, 481 insertions, 9 deletions
diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index 99e15d82d1e9..c4df3c3668b3 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -32,143 +32,615 @@ extern "C" {
32#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0) 32#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
33#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1) 33#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
34 34
35/**
36 * struct drm_tegra_gem_create - parameters for the GEM object creation IOCTL
37 */
35struct drm_tegra_gem_create { 38struct drm_tegra_gem_create {
39 /**
40 * @size:
41 *
42 * The size, in bytes, of the buffer object to be created.
43 */
36 __u64 size; 44 __u64 size;
45
46 /**
47 * @flags:
48 *
49 * A bitmask of flags that influence the creation of GEM objects:
50 *
51 * DRM_TEGRA_GEM_CREATE_TILED
52 * Use the 16x16 tiling format for this buffer.
53 *
54 * DRM_TEGRA_GEM_CREATE_BOTTOM_UP
55 * The buffer has a bottom-up layout.
56 */
37 __u32 flags; 57 __u32 flags;
58
59 /**
60 * @handle:
61 *
62 * The handle of the created GEM object. Set by the kernel upon
63 * successful completion of the IOCTL.
64 */
38 __u32 handle; 65 __u32 handle;
39}; 66};
40 67
68/**
69 * struct drm_tegra_gem_mmap - parameters for the GEM mmap IOCTL
70 */
41struct drm_tegra_gem_mmap { 71struct drm_tegra_gem_mmap {
72 /**
73 * @handle:
74 *
75 * Handle of the GEM object to obtain an mmap offset for.
76 */
42 __u32 handle; 77 __u32 handle;
78
79 /**
80 * @pad:
81 *
82 * Structure padding that may be used in the future. Must be 0.
83 */
43 __u32 pad; 84 __u32 pad;
85
86 /**
87 * @offset:
88 *
89 * The mmap offset for the given GEM object. Set by the kernel upon
90 * successful completion of the IOCTL.
91 */
44 __u64 offset; 92 __u64 offset;
45}; 93};
46 94
95/**
96 * struct drm_tegra_syncpt_read - parameters for the read syncpoint IOCTL
97 */
47struct drm_tegra_syncpt_read { 98struct drm_tegra_syncpt_read {
99 /**
100 * @id:
101 *
102 * ID of the syncpoint to read the current value from.
103 */
48 __u32 id; 104 __u32 id;
105
106 /**
107 * @value:
108 *
109 * The current syncpoint value. Set by the kernel upon successful
110 * completion of the IOCTL.
111 */
49 __u32 value; 112 __u32 value;
50}; 113};
51 114
115/**
116 * struct drm_tegra_syncpt_incr - parameters for the increment syncpoint IOCTL
117 */
52struct drm_tegra_syncpt_incr { 118struct drm_tegra_syncpt_incr {
119 /**
120 * @id:
121 *
122 * ID of the syncpoint to increment.
123 */
53 __u32 id; 124 __u32 id;
125
126 /**
127 * @pad:
128 *
129 * Structure padding that may be used in the future. Must be 0.
130 */
54 __u32 pad; 131 __u32 pad;
55}; 132};
56 133
134/**
135 * struct drm_tegra_syncpt_wait - parameters for the wait syncpoint IOCTL
136 */
57struct drm_tegra_syncpt_wait { 137struct drm_tegra_syncpt_wait {
138 /**
139 * @id:
140 *
141 * ID of the syncpoint to wait on.
142 */
58 __u32 id; 143 __u32 id;
144
145 /**
146 * @thresh:
147 *
148 * Threshold value for which to wait.
149 */
59 __u32 thresh; 150 __u32 thresh;
151
152 /**
153 * @timeout:
154 *
155 * Timeout, in milliseconds, to wait.
156 */
60 __u32 timeout; 157 __u32 timeout;
158
159 /**
160 * @value:
161 *
162 * The new syncpoint value after the wait. Set by the kernel upon
163 * successful completion of the IOCTL.
164 */
61 __u32 value; 165 __u32 value;
62}; 166};
63 167
64#define DRM_TEGRA_NO_TIMEOUT (0xffffffff) 168#define DRM_TEGRA_NO_TIMEOUT (0xffffffff)
65 169
170/**
171 * struct drm_tegra_open_channel - parameters for the open channel IOCTL
172 */
66struct drm_tegra_open_channel { 173struct drm_tegra_open_channel {
174 /**
175 * @client:
176 *
177 * The client ID for this channel.
178 */
67 __u32 client; 179 __u32 client;
180
181 /**
182 * @pad:
183 *
184 * Structure padding that may be used in the future. Must be 0.
185 */
68 __u32 pad; 186 __u32 pad;
187
188 /**
189 * @context:
190 *
191 * The application context of this channel. Set by the kernel upon
192 * successful completion of the IOCTL. This context needs to be passed
193 * to the DRM_TEGRA_CHANNEL_CLOSE or the DRM_TEGRA_SUBMIT IOCTLs.
194 */
69 __u64 context; 195 __u64 context;
70}; 196};
71 197
198/**
199 * struct drm_tegra_close_channel - parameters for the close channel IOCTL
200 */
72struct drm_tegra_close_channel { 201struct drm_tegra_close_channel {
202 /**
203 * @context:
204 *
205 * The application context of this channel. This is obtained from the
206 * DRM_TEGRA_OPEN_CHANNEL IOCTL.
207 */
73 __u64 context; 208 __u64 context;
74}; 209};
75 210
211/**
212 * struct drm_tegra_get_syncpt - parameters for the get syncpoint IOCTL
213 */
76struct drm_tegra_get_syncpt { 214struct drm_tegra_get_syncpt {
215 /**
216 * @context:
217 *
218 * The application context identifying the channel for which to obtain
219 * the syncpoint ID.
220 */
77 __u64 context; 221 __u64 context;
222
223 /**
224 * @index:
225 *
226 * Index of the client syncpoint for which to obtain the ID.
227 */
78 __u32 index; 228 __u32 index;
229
230 /**
231 * @id:
232 *
233 * The ID of the given syncpoint. Set by the kernel upon successful
234 * completion of the IOCTL.
235 */
79 __u32 id; 236 __u32 id;
80}; 237};
81 238
239/**
240 * struct drm_tegra_get_syncpt_base - parameters for the get wait base IOCTL
241 */
82struct drm_tegra_get_syncpt_base { 242struct drm_tegra_get_syncpt_base {
243 /**
244 * @context:
245 *
246 * The application context identifying for which channel to obtain the
247 * wait base.
248 */
83 __u64 context; 249 __u64 context;
250
251 /**
252 * @syncpt:
253 *
254 * ID of the syncpoint for which to obtain the wait base.
255 */
84 __u32 syncpt; 256 __u32 syncpt;
257
258 /**
259 * @id:
260 *
261 * The ID of the wait base corresponding to the client syncpoint. Set
262 * by the kernel upon successful completion of the IOCTL.
263 */
85 __u32 id; 264 __u32 id;
86}; 265};
87 266
267/**
268 * struct drm_tegra_syncpt - syncpoint increment operation
269 */
88struct drm_tegra_syncpt { 270struct drm_tegra_syncpt {
271 /**
272 * @id:
273 *
274 * ID of the syncpoint to operate on.
275 */
89 __u32 id; 276 __u32 id;
277
278 /**
279 * @incrs:
280 *
281 * Number of increments to perform for the syncpoint.
282 */
90 __u32 incrs; 283 __u32 incrs;
91}; 284};
92 285
286/**
287 * struct drm_tegra_cmdbuf - structure describing a command buffer
288 */
93struct drm_tegra_cmdbuf { 289struct drm_tegra_cmdbuf {
290 /**
291 * @handle:
292 *
293 * Handle to a GEM object containing the command buffer.
294 */
94 __u32 handle; 295 __u32 handle;
296
297 /**
298 * @offset:
299 *
300 * Offset, in bytes, into the GEM object identified by @handle at
301 * which the command buffer starts.
302 */
95 __u32 offset; 303 __u32 offset;
304
305 /**
306 * @words:
307 *
308 * Number of 32-bit words in this command buffer.
309 */
96 __u32 words; 310 __u32 words;
311
312 /**
313 * @pad:
314 *
315 * Structure padding that may be used in the future. Must be 0.
316 */
97 __u32 pad; 317 __u32 pad;
98}; 318};
99 319
320/**
321 * struct drm_tegra_reloc - GEM object relocation structure
322 */
100struct drm_tegra_reloc { 323struct drm_tegra_reloc {
101 struct { 324 struct {
325 /**
326 * @cmdbuf.handle:
327 *
328 * Handle to the GEM object containing the command buffer for
329 * which to perform this GEM object relocation.
330 */
102 __u32 handle; 331 __u32 handle;
332
333 /**
334 * @cmdbuf.offset:
335 *
336 * Offset, in bytes, into the command buffer at which to
337 * insert the relocated address.
338 */
103 __u32 offset; 339 __u32 offset;
104 } cmdbuf; 340 } cmdbuf;
105 struct { 341 struct {
342 /**
343 * @target.handle:
344 *
345 * Handle to the GEM object to be relocated.
346 */
106 __u32 handle; 347 __u32 handle;
348
349 /**
350 * @target.offset:
351 *
352 * Offset, in bytes, into the target GEM object at which the
353 * relocated data starts.
354 */
107 __u32 offset; 355 __u32 offset;
108 } target; 356 } target;
357
358 /**
359 * @shift:
360 *
361 * The number of bits by which to shift relocated addresses.
362 */
109 __u32 shift; 363 __u32 shift;
364
365 /**
366 * @pad:
367 *
368 * Structure padding that may be used in the future. Must be 0.
369 */
110 __u32 pad; 370 __u32 pad;
111}; 371};
112 372
373/**
374 * struct drm_tegra_waitchk - wait check structure
375 */
113struct drm_tegra_waitchk { 376struct drm_tegra_waitchk {
377 /**
378 * @handle:
379 *
380 * Handle to the GEM object containing a command stream on which to
381 * perform the wait check.
382 */
114 __u32 handle; 383 __u32 handle;
384
385 /**
386 * @offset:
387 *
388 * Offset, in bytes, of the location in the command stream to perform
389 * the wait check on.
390 */
115 __u32 offset; 391 __u32 offset;
392
393 /**
394 * @syncpt:
395 *
396 * ID of the syncpoint to wait check.
397 */
116 __u32 syncpt; 398 __u32 syncpt;
399
400 /**
401 * @thresh:
402 *
403 * Threshold value for which to check.
404 */
117 __u32 thresh; 405 __u32 thresh;
118}; 406};
119 407
408/**
409 * struct drm_tegra_submit - job submission structure
410 */
120struct drm_tegra_submit { 411struct drm_tegra_submit {
412 /**
413 * @context:
414 *
415 * The application context identifying the channel to use for the
416 * execution of this job.
417 */
121 __u64 context; 418 __u64 context;
419
420 /**
421 * @num_syncpts:
422 *
423 * The number of syncpoints operated on by this job. This defines the
424 * length of the array pointed to by @syncpts.
425 */
122 __u32 num_syncpts; 426 __u32 num_syncpts;
427
428 /**
429 * @num_cmdbufs:
430 *
431 * The number of command buffers to execute as part of this job. This
432 * defines the length of the array pointed to by @cmdbufs.
433 */
123 __u32 num_cmdbufs; 434 __u32 num_cmdbufs;
435
436 /**
437 * @num_relocs:
438 *
439 * The number of relocations to perform before executing this job.
440 * This defines the length of the array pointed to by @relocs.
441 */
124 __u32 num_relocs; 442 __u32 num_relocs;
443
444 /**
445 * @num_waitchks:
446 *
447 * The number of wait checks to perform as part of this job. This
448 * defines the length of the array pointed to by @waitchks.
449 */
125 __u32 num_waitchks; 450 __u32 num_waitchks;
451
452 /**
453 * @waitchk_mask:
454 *
455 * Bitmask of valid wait checks.
456 */
126 __u32 waitchk_mask; 457 __u32 waitchk_mask;
458
459 /**
460 * @timeout:
461 *
462 * Timeout, in milliseconds, before this job is cancelled.
463 */
127 __u32 timeout; 464 __u32 timeout;
465
466 /**
467 * @syncpts:
468 *
469 * A pointer to an array of &struct drm_tegra_syncpt structures that
470 * specify the syncpoint operations performed as part of this job.
471 * The number of elements in the array must be equal to the value
472 * given by @num_syncpts.
473 */
128 __u64 syncpts; 474 __u64 syncpts;
475
476 /**
477 * @cmdbufs:
478 *
479 * A pointer to an array of &struct drm_tegra_cmdbuf structures that
480 * define the command buffers to execute as part of this job. The
481 * number of elements in the array must be equal to the value given
482 * by @num_syncpts.
483 */
129 __u64 cmdbufs; 484 __u64 cmdbufs;
485
486 /**
487 * @relocs:
488 *
489 * A pointer to an array of &struct drm_tegra_reloc structures that
490 * specify the relocations that need to be performed before executing
491 * this job. The number of elements in the array must be equal to the
492 * value given by @num_relocs.
493 */
130 __u64 relocs; 494 __u64 relocs;
495
496 /**
497 * @waitchks:
498 *
499 * A pointer to an array of &struct drm_tegra_waitchk structures that
500 * specify the wait checks to be performed while executing this job.
501 * The number of elements in the array must be equal to the value
502 * given by @num_waitchks.
503 */
131 __u64 waitchks; 504 __u64 waitchks;
132 __u32 fence; /* Return value */
133 505
134 __u32 reserved[5]; /* future expansion */ 506 /**
507 * @fence:
508 *
509 * The threshold of the syncpoint associated with this job after it
510 * has been completed. Set by the kernel upon successful completion of
511 * the IOCTL. This can be used with the DRM_TEGRA_SYNCPT_WAIT IOCTL to
512 * wait for this job to be finished.
513 */
514 __u32 fence;
515
516 /**
517 * @reserved:
518 *
519 * This field is reserved for future use. Must be 0.
520 */
521 __u32 reserved[5];
135}; 522};
136 523
137#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0 524#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0
138#define DRM_TEGRA_GEM_TILING_MODE_TILED 1 525#define DRM_TEGRA_GEM_TILING_MODE_TILED 1
139#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2 526#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2
140 527
528/**
529 * struct drm_tegra_gem_set_tiling - parameters for the set tiling IOCTL
530 */
141struct drm_tegra_gem_set_tiling { 531struct drm_tegra_gem_set_tiling {
142 /* input */ 532 /**
533 * @handle:
534 *
535 * Handle to the GEM object for which to set the tiling parameters.
536 */
143 __u32 handle; 537 __u32 handle;
538
539 /**
540 * @mode:
541 *
542 * The tiling mode to set. Must be one of:
543 *
544 * DRM_TEGRA_GEM_TILING_MODE_PITCH
545 * pitch linear format
546 *
547 * DRM_TEGRA_GEM_TILING_MODE_TILED
548 * 16x16 tiling format
549 *
550 * DRM_TEGRA_GEM_TILING_MODE_BLOCK
551 * 16Bx2 tiling format
552 */
144 __u32 mode; 553 __u32 mode;
554
555 /**
556 * @value:
557 *
558 * The value to set for the tiling mode parameter.
559 */
145 __u32 value; 560 __u32 value;
561
562 /**
563 * @pad:
564 *
565 * Structure padding that may be used in the future. Must be 0.
566 */
146 __u32 pad; 567 __u32 pad;
147}; 568};
148 569
570/**
571 * struct drm_tegra_gem_get_tiling - parameters for the get tiling IOCTL
572 */
149struct drm_tegra_gem_get_tiling { 573struct drm_tegra_gem_get_tiling {
150 /* input */ 574 /**
575 * @handle:
576 *
577 * Handle to the GEM object for which to query the tiling parameters.
578 */
151 __u32 handle; 579 __u32 handle;
152 /* output */ 580
581 /**
582 * @mode:
583 *
584 * The tiling mode currently associated with the GEM object. Set by
585 * the kernel upon successful completion of the IOCTL.
586 */
153 __u32 mode; 587 __u32 mode;
588
589 /**
590 * @value:
591 *
592 * The tiling mode parameter currently associated with the GEM object.
593 * Set by the kernel upon successful completion of the IOCTL.
594 */
154 __u32 value; 595 __u32 value;
596
597 /**
598 * @pad:
599 *
600 * Structure padding that may be used in the future. Must be 0.
601 */
155 __u32 pad; 602 __u32 pad;
156}; 603};
157 604
158#define DRM_TEGRA_GEM_BOTTOM_UP (1 << 0) 605#define DRM_TEGRA_GEM_BOTTOM_UP (1 << 0)
159#define DRM_TEGRA_GEM_FLAGS (DRM_TEGRA_GEM_BOTTOM_UP) 606#define DRM_TEGRA_GEM_FLAGS (DRM_TEGRA_GEM_BOTTOM_UP)
160 607
608/**
609 * struct drm_tegra_gem_set_flags - parameters for the set flags IOCTL
610 */
161struct drm_tegra_gem_set_flags { 611struct drm_tegra_gem_set_flags {
162 /* input */ 612 /**
613 * @handle:
614 *
615 * Handle to the GEM object for which to set the flags.
616 */
163 __u32 handle; 617 __u32 handle;
164 /* output */ 618
619 /**
620 * @flags:
621 *
622 * The flags to set for the GEM object.
623 */
165 __u32 flags; 624 __u32 flags;
166}; 625};
167 626
627/**
628 * struct drm_tegra_gem_get_flags - parameters for the get flags IOCTL
629 */
168struct drm_tegra_gem_get_flags { 630struct drm_tegra_gem_get_flags {
169 /* input */ 631 /**
632 * @handle:
633 *
634 * Handle to the GEM object for which to query the flags.
635 */
170 __u32 handle; 636 __u32 handle;
171 /* output */ 637
638 /**
639 * @flags:
640 *
641 * The flags currently associated with the GEM object. Set by the
642 * kernel upon successful completion of the IOCTL.
643 */
172 __u32 flags; 644 __u32 flags;
173}; 645};
174 646