10ed5401bSmrg/* SPDX-License-Identifier: MIT */
20ed5401bSmrg/* Copyright (c) 2012-2020 NVIDIA Corporation */
308d7334dSsnj
40ed5401bSmrg#ifndef _UAPI_TEGRA_DRM_H_
50ed5401bSmrg#define _UAPI_TEGRA_DRM_H_
608d7334dSsnj
700a23bdaSmrg#include "drm.h"
800a23bdaSmrg
900a23bdaSmrg#if defined(__cplusplus)
1000a23bdaSmrgextern "C" {
1100a23bdaSmrg#endif
1208d7334dSsnj
130ed5401bSmrg/* Tegra DRM legacy UAPI. Only enabled with STAGING */
140ed5401bSmrg
1508d7334dSsnj#define DRM_TEGRA_GEM_CREATE_TILED     (1 << 0)
1608d7334dSsnj#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
1708d7334dSsnj
187cdc0497Smrg/**
197cdc0497Smrg * struct drm_tegra_gem_create - parameters for the GEM object creation IOCTL
207cdc0497Smrg */
2108d7334dSsnjstruct drm_tegra_gem_create {
227cdc0497Smrg	/**
237cdc0497Smrg	 * @size:
247cdc0497Smrg	 *
257cdc0497Smrg	 * The size, in bytes, of the buffer object to be created.
267cdc0497Smrg	 */
2708d7334dSsnj	__u64 size;
287cdc0497Smrg
297cdc0497Smrg	/**
307cdc0497Smrg	 * @flags:
317cdc0497Smrg	 *
327cdc0497Smrg	 * A bitmask of flags that influence the creation of GEM objects:
337cdc0497Smrg	 *
347cdc0497Smrg	 * DRM_TEGRA_GEM_CREATE_TILED
357cdc0497Smrg	 *   Use the 16x16 tiling format for this buffer.
367cdc0497Smrg	 *
377cdc0497Smrg	 * DRM_TEGRA_GEM_CREATE_BOTTOM_UP
387cdc0497Smrg	 *   The buffer has a bottom-up layout.
397cdc0497Smrg	 */
4008d7334dSsnj	__u32 flags;
417cdc0497Smrg
427cdc0497Smrg	/**
437cdc0497Smrg	 * @handle:
447cdc0497Smrg	 *
457cdc0497Smrg	 * The handle of the created GEM object. Set by the kernel upon
467cdc0497Smrg	 * successful completion of the IOCTL.
477cdc0497Smrg	 */
4808d7334dSsnj	__u32 handle;
4908d7334dSsnj};
5008d7334dSsnj
517cdc0497Smrg/**
527cdc0497Smrg * struct drm_tegra_gem_mmap - parameters for the GEM mmap IOCTL
537cdc0497Smrg */
5408d7334dSsnjstruct drm_tegra_gem_mmap {
557cdc0497Smrg	/**
567cdc0497Smrg	 * @handle:
577cdc0497Smrg	 *
587cdc0497Smrg	 * Handle of the GEM object to obtain an mmap offset for.
597cdc0497Smrg	 */
6008d7334dSsnj	__u32 handle;
617cdc0497Smrg
627cdc0497Smrg	/**
637cdc0497Smrg	 * @pad:
647cdc0497Smrg	 *
657cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
667cdc0497Smrg	 */
673f012e29Smrg	__u32 pad;
687cdc0497Smrg
697cdc0497Smrg	/**
707cdc0497Smrg	 * @offset:
717cdc0497Smrg	 *
727cdc0497Smrg	 * The mmap offset for the given GEM object. Set by the kernel upon
737cdc0497Smrg	 * successful completion of the IOCTL.
747cdc0497Smrg	 */
753f012e29Smrg	__u64 offset;
7608d7334dSsnj};
7708d7334dSsnj
787cdc0497Smrg/**
797cdc0497Smrg * struct drm_tegra_syncpt_read - parameters for the read syncpoint IOCTL
807cdc0497Smrg */
8108d7334dSsnjstruct drm_tegra_syncpt_read {
827cdc0497Smrg	/**
837cdc0497Smrg	 * @id:
847cdc0497Smrg	 *
857cdc0497Smrg	 * ID of the syncpoint to read the current value from.
867cdc0497Smrg	 */
8708d7334dSsnj	__u32 id;
887cdc0497Smrg
897cdc0497Smrg	/**
907cdc0497Smrg	 * @value:
917cdc0497Smrg	 *
927cdc0497Smrg	 * The current syncpoint value. Set by the kernel upon successful
937cdc0497Smrg	 * completion of the IOCTL.
947cdc0497Smrg	 */
9508d7334dSsnj	__u32 value;
9608d7334dSsnj};
9708d7334dSsnj
987cdc0497Smrg/**
997cdc0497Smrg * struct drm_tegra_syncpt_incr - parameters for the increment syncpoint IOCTL
1007cdc0497Smrg */
10108d7334dSsnjstruct drm_tegra_syncpt_incr {
1027cdc0497Smrg	/**
1037cdc0497Smrg	 * @id:
1047cdc0497Smrg	 *
1057cdc0497Smrg	 * ID of the syncpoint to increment.
1067cdc0497Smrg	 */
10708d7334dSsnj	__u32 id;
1087cdc0497Smrg
1097cdc0497Smrg	/**
1107cdc0497Smrg	 * @pad:
1117cdc0497Smrg	 *
1127cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
1137cdc0497Smrg	 */
11408d7334dSsnj	__u32 pad;
11508d7334dSsnj};
11608d7334dSsnj
1177cdc0497Smrg/**
1187cdc0497Smrg * struct drm_tegra_syncpt_wait - parameters for the wait syncpoint IOCTL
1197cdc0497Smrg */
12008d7334dSsnjstruct drm_tegra_syncpt_wait {
1217cdc0497Smrg	/**
1227cdc0497Smrg	 * @id:
1237cdc0497Smrg	 *
1247cdc0497Smrg	 * ID of the syncpoint to wait on.
1257cdc0497Smrg	 */
12608d7334dSsnj	__u32 id;
1277cdc0497Smrg
1287cdc0497Smrg	/**
1297cdc0497Smrg	 * @thresh:
1307cdc0497Smrg	 *
1317cdc0497Smrg	 * Threshold value for which to wait.
1327cdc0497Smrg	 */
13308d7334dSsnj	__u32 thresh;
1347cdc0497Smrg
1357cdc0497Smrg	/**
1367cdc0497Smrg	 * @timeout:
1377cdc0497Smrg	 *
1387cdc0497Smrg	 * Timeout, in milliseconds, to wait.
1397cdc0497Smrg	 */
14008d7334dSsnj	__u32 timeout;
1417cdc0497Smrg
1427cdc0497Smrg	/**
1437cdc0497Smrg	 * @value:
1447cdc0497Smrg	 *
1457cdc0497Smrg	 * The new syncpoint value after the wait. Set by the kernel upon
1467cdc0497Smrg	 * successful completion of the IOCTL.
1477cdc0497Smrg	 */
14808d7334dSsnj	__u32 value;
14908d7334dSsnj};
15008d7334dSsnj
15108d7334dSsnj#define DRM_TEGRA_NO_TIMEOUT	(0xffffffff)
15208d7334dSsnj
1537cdc0497Smrg/**
1547cdc0497Smrg * struct drm_tegra_open_channel - parameters for the open channel IOCTL
1557cdc0497Smrg */
15608d7334dSsnjstruct drm_tegra_open_channel {
1577cdc0497Smrg	/**
1587cdc0497Smrg	 * @client:
1597cdc0497Smrg	 *
1607cdc0497Smrg	 * The client ID for this channel.
1617cdc0497Smrg	 */
16208d7334dSsnj	__u32 client;
1637cdc0497Smrg
1647cdc0497Smrg	/**
1657cdc0497Smrg	 * @pad:
1667cdc0497Smrg	 *
1677cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
1687cdc0497Smrg	 */
16908d7334dSsnj	__u32 pad;
1707cdc0497Smrg
1717cdc0497Smrg	/**
1727cdc0497Smrg	 * @context:
1737cdc0497Smrg	 *
1747cdc0497Smrg	 * The application context of this channel. Set by the kernel upon
1757cdc0497Smrg	 * successful completion of the IOCTL. This context needs to be passed
1767cdc0497Smrg	 * to the DRM_TEGRA_CHANNEL_CLOSE or the DRM_TEGRA_SUBMIT IOCTLs.
1777cdc0497Smrg	 */
17808d7334dSsnj	__u64 context;
17908d7334dSsnj};
18008d7334dSsnj
1817cdc0497Smrg/**
1827cdc0497Smrg * struct drm_tegra_close_channel - parameters for the close channel IOCTL
1837cdc0497Smrg */
18408d7334dSsnjstruct drm_tegra_close_channel {
1857cdc0497Smrg	/**
1867cdc0497Smrg	 * @context:
1877cdc0497Smrg	 *
1887cdc0497Smrg	 * The application context of this channel. This is obtained from the
1897cdc0497Smrg	 * DRM_TEGRA_OPEN_CHANNEL IOCTL.
1907cdc0497Smrg	 */
19108d7334dSsnj	__u64 context;
19208d7334dSsnj};
19308d7334dSsnj
1947cdc0497Smrg/**
1957cdc0497Smrg * struct drm_tegra_get_syncpt - parameters for the get syncpoint IOCTL
1967cdc0497Smrg */
19708d7334dSsnjstruct drm_tegra_get_syncpt {
1987cdc0497Smrg	/**
1997cdc0497Smrg	 * @context:
2007cdc0497Smrg	 *
2017cdc0497Smrg	 * The application context identifying the channel for which to obtain
2027cdc0497Smrg	 * the syncpoint ID.
2037cdc0497Smrg	 */
20408d7334dSsnj	__u64 context;
2057cdc0497Smrg
2067cdc0497Smrg	/**
2077cdc0497Smrg	 * @index:
2087cdc0497Smrg	 *
2097cdc0497Smrg	 * Index of the client syncpoint for which to obtain the ID.
2107cdc0497Smrg	 */
21108d7334dSsnj	__u32 index;
2127cdc0497Smrg
2137cdc0497Smrg	/**
2147cdc0497Smrg	 * @id:
2157cdc0497Smrg	 *
2167cdc0497Smrg	 * The ID of the given syncpoint. Set by the kernel upon successful
2177cdc0497Smrg	 * completion of the IOCTL.
2187cdc0497Smrg	 */
21908d7334dSsnj	__u32 id;
22008d7334dSsnj};
22108d7334dSsnj
2227cdc0497Smrg/**
2237cdc0497Smrg * struct drm_tegra_get_syncpt_base - parameters for the get wait base IOCTL
2247cdc0497Smrg */
22508d7334dSsnjstruct drm_tegra_get_syncpt_base {
2267cdc0497Smrg	/**
2277cdc0497Smrg	 * @context:
2287cdc0497Smrg	 *
2297cdc0497Smrg	 * The application context identifying for which channel to obtain the
2307cdc0497Smrg	 * wait base.
2317cdc0497Smrg	 */
23208d7334dSsnj	__u64 context;
2337cdc0497Smrg
2347cdc0497Smrg	/**
2357cdc0497Smrg	 * @syncpt:
2367cdc0497Smrg	 *
2377cdc0497Smrg	 * ID of the syncpoint for which to obtain the wait base.
2387cdc0497Smrg	 */
23908d7334dSsnj	__u32 syncpt;
2407cdc0497Smrg
2417cdc0497Smrg	/**
2427cdc0497Smrg	 * @id:
2437cdc0497Smrg	 *
2447cdc0497Smrg	 * The ID of the wait base corresponding to the client syncpoint. Set
2457cdc0497Smrg	 * by the kernel upon successful completion of the IOCTL.
2467cdc0497Smrg	 */
24708d7334dSsnj	__u32 id;
24808d7334dSsnj};
24908d7334dSsnj
2507cdc0497Smrg/**
2517cdc0497Smrg * struct drm_tegra_syncpt - syncpoint increment operation
2527cdc0497Smrg */
25308d7334dSsnjstruct drm_tegra_syncpt {
2547cdc0497Smrg	/**
2557cdc0497Smrg	 * @id:
2567cdc0497Smrg	 *
2577cdc0497Smrg	 * ID of the syncpoint to operate on.
2587cdc0497Smrg	 */
25908d7334dSsnj	__u32 id;
2607cdc0497Smrg
2617cdc0497Smrg	/**
2627cdc0497Smrg	 * @incrs:
2637cdc0497Smrg	 *
2647cdc0497Smrg	 * Number of increments to perform for the syncpoint.
2657cdc0497Smrg	 */
26608d7334dSsnj	__u32 incrs;
26708d7334dSsnj};
26808d7334dSsnj
2697cdc0497Smrg/**
2707cdc0497Smrg * struct drm_tegra_cmdbuf - structure describing a command buffer
2717cdc0497Smrg */
27208d7334dSsnjstruct drm_tegra_cmdbuf {
2737cdc0497Smrg	/**
2747cdc0497Smrg	 * @handle:
2757cdc0497Smrg	 *
2767cdc0497Smrg	 * Handle to a GEM object containing the command buffer.
2777cdc0497Smrg	 */
27808d7334dSsnj	__u32 handle;
2797cdc0497Smrg
2807cdc0497Smrg	/**
2817cdc0497Smrg	 * @offset:
2827cdc0497Smrg	 *
2837cdc0497Smrg	 * Offset, in bytes, into the GEM object identified by @handle at
2847cdc0497Smrg	 * which the command buffer starts.
2857cdc0497Smrg	 */
28608d7334dSsnj	__u32 offset;
2877cdc0497Smrg
2887cdc0497Smrg	/**
2897cdc0497Smrg	 * @words:
2907cdc0497Smrg	 *
2917cdc0497Smrg	 * Number of 32-bit words in this command buffer.
2927cdc0497Smrg	 */
29308d7334dSsnj	__u32 words;
2947cdc0497Smrg
2957cdc0497Smrg	/**
2967cdc0497Smrg	 * @pad:
2977cdc0497Smrg	 *
2987cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
2997cdc0497Smrg	 */
30008d7334dSsnj	__u32 pad;
30108d7334dSsnj};
30208d7334dSsnj
3037cdc0497Smrg/**
3047cdc0497Smrg * struct drm_tegra_reloc - GEM object relocation structure
3057cdc0497Smrg */
30608d7334dSsnjstruct drm_tegra_reloc {
30708d7334dSsnj	struct {
3087cdc0497Smrg		/**
3097cdc0497Smrg		 * @cmdbuf.handle:
3107cdc0497Smrg		 *
3117cdc0497Smrg		 * Handle to the GEM object containing the command buffer for
3127cdc0497Smrg		 * which to perform this GEM object relocation.
3137cdc0497Smrg		 */
31408d7334dSsnj		__u32 handle;
3157cdc0497Smrg
3167cdc0497Smrg		/**
3177cdc0497Smrg		 * @cmdbuf.offset:
3187cdc0497Smrg		 *
3197cdc0497Smrg		 * Offset, in bytes, into the command buffer at which to
3207cdc0497Smrg		 * insert the relocated address.
3217cdc0497Smrg		 */
32208d7334dSsnj		__u32 offset;
32308d7334dSsnj	} cmdbuf;
32408d7334dSsnj	struct {
3257cdc0497Smrg		/**
3267cdc0497Smrg		 * @target.handle:
3277cdc0497Smrg		 *
3287cdc0497Smrg		 * Handle to the GEM object to be relocated.
3297cdc0497Smrg		 */
33008d7334dSsnj		__u32 handle;
3317cdc0497Smrg
3327cdc0497Smrg		/**
3337cdc0497Smrg		 * @target.offset:
3347cdc0497Smrg		 *
3357cdc0497Smrg		 * Offset, in bytes, into the target GEM object at which the
3367cdc0497Smrg		 * relocated data starts.
3377cdc0497Smrg		 */
33808d7334dSsnj		__u32 offset;
33908d7334dSsnj	} target;
3407cdc0497Smrg
3417cdc0497Smrg	/**
3427cdc0497Smrg	 * @shift:
3437cdc0497Smrg	 *
3447cdc0497Smrg	 * The number of bits by which to shift relocated addresses.
3457cdc0497Smrg	 */
34608d7334dSsnj	__u32 shift;
3477cdc0497Smrg
3487cdc0497Smrg	/**
3497cdc0497Smrg	 * @pad:
3507cdc0497Smrg	 *
3517cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
3527cdc0497Smrg	 */
35308d7334dSsnj	__u32 pad;
35408d7334dSsnj};
35508d7334dSsnj
3567cdc0497Smrg/**
3577cdc0497Smrg * struct drm_tegra_waitchk - wait check structure
3587cdc0497Smrg */
35908d7334dSsnjstruct drm_tegra_waitchk {
3607cdc0497Smrg	/**
3617cdc0497Smrg	 * @handle:
3627cdc0497Smrg	 *
3637cdc0497Smrg	 * Handle to the GEM object containing a command stream on which to
3647cdc0497Smrg	 * perform the wait check.
3657cdc0497Smrg	 */
36608d7334dSsnj	__u32 handle;
3677cdc0497Smrg
3687cdc0497Smrg	/**
3697cdc0497Smrg	 * @offset:
3707cdc0497Smrg	 *
3717cdc0497Smrg	 * Offset, in bytes, of the location in the command stream to perform
3727cdc0497Smrg	 * the wait check on.
3737cdc0497Smrg	 */
37408d7334dSsnj	__u32 offset;
3757cdc0497Smrg
3767cdc0497Smrg	/**
3777cdc0497Smrg	 * @syncpt:
3787cdc0497Smrg	 *
3797cdc0497Smrg	 * ID of the syncpoint to wait check.
3807cdc0497Smrg	 */
38108d7334dSsnj	__u32 syncpt;
3827cdc0497Smrg
3837cdc0497Smrg	/**
3847cdc0497Smrg	 * @thresh:
3857cdc0497Smrg	 *
3867cdc0497Smrg	 * Threshold value for which to check.
3877cdc0497Smrg	 */
38808d7334dSsnj	__u32 thresh;
38908d7334dSsnj};
39008d7334dSsnj
3917cdc0497Smrg/**
3927cdc0497Smrg * struct drm_tegra_submit - job submission structure
3937cdc0497Smrg */
39408d7334dSsnjstruct drm_tegra_submit {
3957cdc0497Smrg	/**
3967cdc0497Smrg	 * @context:
3977cdc0497Smrg	 *
3987cdc0497Smrg	 * The application context identifying the channel to use for the
3997cdc0497Smrg	 * execution of this job.
4007cdc0497Smrg	 */
40108d7334dSsnj	__u64 context;
4027cdc0497Smrg
4037cdc0497Smrg	/**
4047cdc0497Smrg	 * @num_syncpts:
4057cdc0497Smrg	 *
4067cdc0497Smrg	 * The number of syncpoints operated on by this job. This defines the
4077cdc0497Smrg	 * length of the array pointed to by @syncpts.
4087cdc0497Smrg	 */
40908d7334dSsnj	__u32 num_syncpts;
4107cdc0497Smrg
4117cdc0497Smrg	/**
4127cdc0497Smrg	 * @num_cmdbufs:
4137cdc0497Smrg	 *
4147cdc0497Smrg	 * The number of command buffers to execute as part of this job. This
4157cdc0497Smrg	 * defines the length of the array pointed to by @cmdbufs.
4167cdc0497Smrg	 */
41708d7334dSsnj	__u32 num_cmdbufs;
4187cdc0497Smrg
4197cdc0497Smrg	/**
4207cdc0497Smrg	 * @num_relocs:
4217cdc0497Smrg	 *
4227cdc0497Smrg	 * The number of relocations to perform before executing this job.
4237cdc0497Smrg	 * This defines the length of the array pointed to by @relocs.
4247cdc0497Smrg	 */
42508d7334dSsnj	__u32 num_relocs;
4267cdc0497Smrg
4277cdc0497Smrg	/**
4287cdc0497Smrg	 * @num_waitchks:
4297cdc0497Smrg	 *
4307cdc0497Smrg	 * The number of wait checks to perform as part of this job. This
4317cdc0497Smrg	 * defines the length of the array pointed to by @waitchks.
4327cdc0497Smrg	 */
43308d7334dSsnj	__u32 num_waitchks;
4347cdc0497Smrg
4357cdc0497Smrg	/**
4367cdc0497Smrg	 * @waitchk_mask:
4377cdc0497Smrg	 *
4387cdc0497Smrg	 * Bitmask of valid wait checks.
4397cdc0497Smrg	 */
44008d7334dSsnj	__u32 waitchk_mask;
4417cdc0497Smrg
4427cdc0497Smrg	/**
4437cdc0497Smrg	 * @timeout:
4447cdc0497Smrg	 *
4457cdc0497Smrg	 * Timeout, in milliseconds, before this job is cancelled.
4467cdc0497Smrg	 */
44708d7334dSsnj	__u32 timeout;
4487cdc0497Smrg
4497cdc0497Smrg	/**
4507cdc0497Smrg	 * @syncpts:
4517cdc0497Smrg	 *
4527cdc0497Smrg	 * A pointer to an array of &struct drm_tegra_syncpt structures that
4537cdc0497Smrg	 * specify the syncpoint operations performed as part of this job.
4547cdc0497Smrg	 * The number of elements in the array must be equal to the value
4557cdc0497Smrg	 * given by @num_syncpts.
4567cdc0497Smrg	 */
45708d7334dSsnj	__u64 syncpts;
4587cdc0497Smrg
4597cdc0497Smrg	/**
4607cdc0497Smrg	 * @cmdbufs:
4617cdc0497Smrg	 *
4627cdc0497Smrg	 * A pointer to an array of &struct drm_tegra_cmdbuf structures that
4637cdc0497Smrg	 * define the command buffers to execute as part of this job. The
4647cdc0497Smrg	 * number of elements in the array must be equal to the value given
4657cdc0497Smrg	 * by @num_syncpts.
4667cdc0497Smrg	 */
46708d7334dSsnj	__u64 cmdbufs;
4687cdc0497Smrg
4697cdc0497Smrg	/**
4707cdc0497Smrg	 * @relocs:
4717cdc0497Smrg	 *
4727cdc0497Smrg	 * A pointer to an array of &struct drm_tegra_reloc structures that
4737cdc0497Smrg	 * specify the relocations that need to be performed before executing
4747cdc0497Smrg	 * this job. The number of elements in the array must be equal to the
4757cdc0497Smrg	 * value given by @num_relocs.
4767cdc0497Smrg	 */
47708d7334dSsnj	__u64 relocs;
4787cdc0497Smrg
4797cdc0497Smrg	/**
4807cdc0497Smrg	 * @waitchks:
4817cdc0497Smrg	 *
4827cdc0497Smrg	 * A pointer to an array of &struct drm_tegra_waitchk structures that
4837cdc0497Smrg	 * specify the wait checks to be performed while executing this job.
4847cdc0497Smrg	 * The number of elements in the array must be equal to the value
4857cdc0497Smrg	 * given by @num_waitchks.
4867cdc0497Smrg	 */
48708d7334dSsnj	__u64 waitchks;
48808d7334dSsnj
4897cdc0497Smrg	/**
4907cdc0497Smrg	 * @fence:
4917cdc0497Smrg	 *
4927cdc0497Smrg	 * The threshold of the syncpoint associated with this job after it
4937cdc0497Smrg	 * has been completed. Set by the kernel upon successful completion of
4947cdc0497Smrg	 * the IOCTL. This can be used with the DRM_TEGRA_SYNCPT_WAIT IOCTL to
4957cdc0497Smrg	 * wait for this job to be finished.
4967cdc0497Smrg	 */
4977cdc0497Smrg	__u32 fence;
4987cdc0497Smrg
4997cdc0497Smrg	/**
5007cdc0497Smrg	 * @reserved:
5017cdc0497Smrg	 *
5027cdc0497Smrg	 * This field is reserved for future use. Must be 0.
5037cdc0497Smrg	 */
5047cdc0497Smrg	__u32 reserved[5];
50508d7334dSsnj};
50608d7334dSsnj
50708d7334dSsnj#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0
50808d7334dSsnj#define DRM_TEGRA_GEM_TILING_MODE_TILED 1
50908d7334dSsnj#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2
51008d7334dSsnj
5117cdc0497Smrg/**
5127cdc0497Smrg * struct drm_tegra_gem_set_tiling - parameters for the set tiling IOCTL
5137cdc0497Smrg */
51408d7334dSsnjstruct drm_tegra_gem_set_tiling {
5157cdc0497Smrg	/**
5167cdc0497Smrg	 * @handle:
5177cdc0497Smrg	 *
5187cdc0497Smrg	 * Handle to the GEM object for which to set the tiling parameters.
5197cdc0497Smrg	 */
52008d7334dSsnj	__u32 handle;
5217cdc0497Smrg
5227cdc0497Smrg	/**
5237cdc0497Smrg	 * @mode:
5247cdc0497Smrg	 *
5257cdc0497Smrg	 * The tiling mode to set. Must be one of:
5267cdc0497Smrg	 *
5277cdc0497Smrg	 * DRM_TEGRA_GEM_TILING_MODE_PITCH
5287cdc0497Smrg	 *   pitch linear format
5297cdc0497Smrg	 *
5307cdc0497Smrg	 * DRM_TEGRA_GEM_TILING_MODE_TILED
5317cdc0497Smrg	 *   16x16 tiling format
5327cdc0497Smrg	 *
5337cdc0497Smrg	 * DRM_TEGRA_GEM_TILING_MODE_BLOCK
5347cdc0497Smrg	 *   16Bx2 tiling format
5357cdc0497Smrg	 */
53608d7334dSsnj	__u32 mode;
5377cdc0497Smrg
5387cdc0497Smrg	/**
5397cdc0497Smrg	 * @value:
5407cdc0497Smrg	 *
5417cdc0497Smrg	 * The value to set for the tiling mode parameter.
5427cdc0497Smrg	 */
54308d7334dSsnj	__u32 value;
5447cdc0497Smrg
5457cdc0497Smrg	/**
5467cdc0497Smrg	 * @pad:
5477cdc0497Smrg	 *
5487cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
5497cdc0497Smrg	 */
55008d7334dSsnj	__u32 pad;
55108d7334dSsnj};
55208d7334dSsnj
5537cdc0497Smrg/**
5547cdc0497Smrg * struct drm_tegra_gem_get_tiling - parameters for the get tiling IOCTL
5557cdc0497Smrg */
55608d7334dSsnjstruct drm_tegra_gem_get_tiling {
5577cdc0497Smrg	/**
5587cdc0497Smrg	 * @handle:
5597cdc0497Smrg	 *
5607cdc0497Smrg	 * Handle to the GEM object for which to query the tiling parameters.
5617cdc0497Smrg	 */
56208d7334dSsnj	__u32 handle;
5637cdc0497Smrg
5647cdc0497Smrg	/**
5657cdc0497Smrg	 * @mode:
5667cdc0497Smrg	 *
5677cdc0497Smrg	 * The tiling mode currently associated with the GEM object. Set by
5687cdc0497Smrg	 * the kernel upon successful completion of the IOCTL.
5697cdc0497Smrg	 */
57008d7334dSsnj	__u32 mode;
5717cdc0497Smrg
5727cdc0497Smrg	/**
5737cdc0497Smrg	 * @value:
5747cdc0497Smrg	 *
5757cdc0497Smrg	 * The tiling mode parameter currently associated with the GEM object.
5767cdc0497Smrg	 * Set by the kernel upon successful completion of the IOCTL.
5777cdc0497Smrg	 */
57808d7334dSsnj	__u32 value;
5797cdc0497Smrg
5807cdc0497Smrg	/**
5817cdc0497Smrg	 * @pad:
5827cdc0497Smrg	 *
5837cdc0497Smrg	 * Structure padding that may be used in the future. Must be 0.
5847cdc0497Smrg	 */
58508d7334dSsnj	__u32 pad;
58608d7334dSsnj};
58708d7334dSsnj
58808d7334dSsnj#define DRM_TEGRA_GEM_BOTTOM_UP		(1 << 0)
58908d7334dSsnj#define DRM_TEGRA_GEM_FLAGS		(DRM_TEGRA_GEM_BOTTOM_UP)
59008d7334dSsnj
5917cdc0497Smrg/**
5927cdc0497Smrg * struct drm_tegra_gem_set_flags - parameters for the set flags IOCTL
5937cdc0497Smrg */
59408d7334dSsnjstruct drm_tegra_gem_set_flags {
5957cdc0497Smrg	/**
5967cdc0497Smrg	 * @handle:
5977cdc0497Smrg	 *
5987cdc0497Smrg	 * Handle to the GEM object for which to set the flags.
5997cdc0497Smrg	 */
60008d7334dSsnj	__u32 handle;
6017cdc0497Smrg
6027cdc0497Smrg	/**
6037cdc0497Smrg	 * @flags:
6047cdc0497Smrg	 *
6057cdc0497Smrg	 * The flags to set for the GEM object.
6067cdc0497Smrg	 */
60708d7334dSsnj	__u32 flags;
60808d7334dSsnj};
60908d7334dSsnj
6107cdc0497Smrg/**
6117cdc0497Smrg * struct drm_tegra_gem_get_flags - parameters for the get flags IOCTL
6127cdc0497Smrg */
61308d7334dSsnjstruct drm_tegra_gem_get_flags {
6147cdc0497Smrg	/**
6157cdc0497Smrg	 * @handle:
6167cdc0497Smrg	 *
6177cdc0497Smrg	 * Handle to the GEM object for which to query the flags.
6187cdc0497Smrg	 */
61908d7334dSsnj	__u32 handle;
6207cdc0497Smrg
6217cdc0497Smrg	/**
6227cdc0497Smrg	 * @flags:
6237cdc0497Smrg	 *
6247cdc0497Smrg	 * The flags currently associated with the GEM object. Set by the
6257cdc0497Smrg	 * kernel upon successful completion of the IOCTL.
6267cdc0497Smrg	 */
62708d7334dSsnj	__u32 flags;
62808d7334dSsnj};
62908d7334dSsnj
63008d7334dSsnj#define DRM_TEGRA_GEM_CREATE		0x00
63108d7334dSsnj#define DRM_TEGRA_GEM_MMAP		0x01
63208d7334dSsnj#define DRM_TEGRA_SYNCPT_READ		0x02
63308d7334dSsnj#define DRM_TEGRA_SYNCPT_INCR		0x03
63408d7334dSsnj#define DRM_TEGRA_SYNCPT_WAIT		0x04
6350ed5401bSmrg#define DRM_TEGRA_OPEN_CHANNEL	        0x05
6360ed5401bSmrg#define DRM_TEGRA_CLOSE_CHANNEL	        0x06
63708d7334dSsnj#define DRM_TEGRA_GET_SYNCPT		0x07
63808d7334dSsnj#define DRM_TEGRA_SUBMIT		0x08
63908d7334dSsnj#define DRM_TEGRA_GET_SYNCPT_BASE	0x09
64008d7334dSsnj#define DRM_TEGRA_GEM_SET_TILING	0x0a
64108d7334dSsnj#define DRM_TEGRA_GEM_GET_TILING	0x0b
64208d7334dSsnj#define DRM_TEGRA_GEM_SET_FLAGS		0x0c
64308d7334dSsnj#define DRM_TEGRA_GEM_GET_FLAGS		0x0d
64408d7334dSsnj
64508d7334dSsnj#define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
64608d7334dSsnj#define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
64708d7334dSsnj#define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
64808d7334dSsnj#define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
64908d7334dSsnj#define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
65008d7334dSsnj#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
6517cdc0497Smrg#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_close_channel)
65208d7334dSsnj#define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
65308d7334dSsnj#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
65408d7334dSsnj#define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
65508d7334dSsnj#define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling)
65608d7334dSsnj#define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling)
65708d7334dSsnj#define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
65808d7334dSsnj#define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
65908d7334dSsnj
6600ed5401bSmrg/* New Tegra DRM UAPI */
6610ed5401bSmrg
6620ed5401bSmrg/*
6630ed5401bSmrg * Reported by the driver in the `capabilities` field.
6640ed5401bSmrg *
6650ed5401bSmrg * DRM_TEGRA_CHANNEL_CAP_CACHE_COHERENT: If set, the engine is cache coherent
6660ed5401bSmrg * with regard to the system memory.
6670ed5401bSmrg */
6680ed5401bSmrg#define DRM_TEGRA_CHANNEL_CAP_CACHE_COHERENT (1 << 0)
6690ed5401bSmrg
6700ed5401bSmrgstruct drm_tegra_channel_open {
6710ed5401bSmrg	/**
6720ed5401bSmrg	 * @host1x_class: [in]
6730ed5401bSmrg	 *
6740ed5401bSmrg	 * Host1x class of the engine that will be programmed using this
6750ed5401bSmrg	 * channel.
6760ed5401bSmrg	 */
6770ed5401bSmrg	__u32 host1x_class;
6780ed5401bSmrg
6790ed5401bSmrg	/**
6800ed5401bSmrg	 * @flags: [in]
6810ed5401bSmrg	 *
6820ed5401bSmrg	 * Flags.
6830ed5401bSmrg	 */
6840ed5401bSmrg	__u32 flags;
6850ed5401bSmrg
6860ed5401bSmrg	/**
6870ed5401bSmrg	 * @context: [out]
6880ed5401bSmrg	 *
6890ed5401bSmrg	 * Opaque identifier corresponding to the opened channel.
6900ed5401bSmrg	 */
6910ed5401bSmrg	__u32 context;
6920ed5401bSmrg
6930ed5401bSmrg	/**
6940ed5401bSmrg	 * @version: [out]
6950ed5401bSmrg	 *
6960ed5401bSmrg	 * Version of the engine hardware. This can be used by userspace
6970ed5401bSmrg	 * to determine how the engine needs to be programmed.
6980ed5401bSmrg	 */
6990ed5401bSmrg	__u32 version;
7000ed5401bSmrg
7010ed5401bSmrg	/**
7020ed5401bSmrg	 * @capabilities: [out]
7030ed5401bSmrg	 *
7040ed5401bSmrg	 * Flags describing the hardware capabilities.
7050ed5401bSmrg	 */
7060ed5401bSmrg	__u32 capabilities;
7070ed5401bSmrg	__u32 padding;
7080ed5401bSmrg};
7090ed5401bSmrg
7100ed5401bSmrgstruct drm_tegra_channel_close {
7110ed5401bSmrg	/**
7120ed5401bSmrg	 * @context: [in]
7130ed5401bSmrg	 *
7140ed5401bSmrg	 * Identifier of the channel to close.
7150ed5401bSmrg	 */
7160ed5401bSmrg	__u32 context;
7170ed5401bSmrg	__u32 padding;
7180ed5401bSmrg};
7190ed5401bSmrg
7200ed5401bSmrg/*
7210ed5401bSmrg * Mapping flags that can be used to influence how the mapping is created.
7220ed5401bSmrg *
7230ed5401bSmrg * DRM_TEGRA_CHANNEL_MAP_READ: create mapping that allows HW read access
7240ed5401bSmrg * DRM_TEGRA_CHANNEL_MAP_WRITE: create mapping that allows HW write access
7250ed5401bSmrg */
7260ed5401bSmrg#define DRM_TEGRA_CHANNEL_MAP_READ  (1 << 0)
7270ed5401bSmrg#define DRM_TEGRA_CHANNEL_MAP_WRITE (1 << 1)
7280ed5401bSmrg#define DRM_TEGRA_CHANNEL_MAP_READ_WRITE (DRM_TEGRA_CHANNEL_MAP_READ | \
7290ed5401bSmrg					  DRM_TEGRA_CHANNEL_MAP_WRITE)
7300ed5401bSmrg
7310ed5401bSmrgstruct drm_tegra_channel_map {
7320ed5401bSmrg	/**
7330ed5401bSmrg	 * @context: [in]
7340ed5401bSmrg	 *
7350ed5401bSmrg	 * Identifier of the channel to which make memory available for.
7360ed5401bSmrg	 */
7370ed5401bSmrg	__u32 context;
7380ed5401bSmrg
7390ed5401bSmrg	/**
7400ed5401bSmrg	 * @handle: [in]
7410ed5401bSmrg	 *
7420ed5401bSmrg	 * GEM handle of the memory to map.
7430ed5401bSmrg	 */
7440ed5401bSmrg	__u32 handle;
7450ed5401bSmrg
7460ed5401bSmrg	/**
7470ed5401bSmrg	 * @flags: [in]
7480ed5401bSmrg	 *
7490ed5401bSmrg	 * Flags.
7500ed5401bSmrg	 */
7510ed5401bSmrg	__u32 flags;
7520ed5401bSmrg
7530ed5401bSmrg	/**
7540ed5401bSmrg	 * @mapping: [out]
7550ed5401bSmrg	 *
7560ed5401bSmrg	 * Identifier corresponding to the mapping, to be used for
7570ed5401bSmrg	 * relocations or unmapping later.
7580ed5401bSmrg	 */
7590ed5401bSmrg	__u32 mapping;
7600ed5401bSmrg};
7610ed5401bSmrg
7620ed5401bSmrgstruct drm_tegra_channel_unmap {
7630ed5401bSmrg	/**
7640ed5401bSmrg	 * @context: [in]
7650ed5401bSmrg	 *
7660ed5401bSmrg	 * Channel identifier of the channel to unmap memory from.
7670ed5401bSmrg	 */
7680ed5401bSmrg	__u32 context;
7690ed5401bSmrg
7700ed5401bSmrg	/**
7710ed5401bSmrg	 * @mapping: [in]
7720ed5401bSmrg	 *
7730ed5401bSmrg	 * Mapping identifier of the memory mapping to unmap.
7740ed5401bSmrg	 */
7750ed5401bSmrg	__u32 mapping;
7760ed5401bSmrg};
7770ed5401bSmrg
7780ed5401bSmrg/* Submission */
7790ed5401bSmrg
7800ed5401bSmrg/**
7810ed5401bSmrg * Specify that bit 39 of the patched-in address should be set to switch
7820ed5401bSmrg * swizzling between Tegra and non-Tegra sector layout on systems that store
7830ed5401bSmrg * surfaces in system memory in non-Tegra sector layout.
7840ed5401bSmrg */
7850ed5401bSmrg#define DRM_TEGRA_SUBMIT_RELOC_SECTOR_LAYOUT (1 << 0)
7860ed5401bSmrg
7870ed5401bSmrgstruct drm_tegra_submit_buf {
7880ed5401bSmrg	/**
7890ed5401bSmrg	 * @mapping: [in]
7900ed5401bSmrg	 *
7910ed5401bSmrg	 * Identifier of the mapping to use in the submission.
7920ed5401bSmrg	 */
7930ed5401bSmrg	__u32 mapping;
7940ed5401bSmrg
7950ed5401bSmrg	/**
7960ed5401bSmrg	 * @flags: [in]
7970ed5401bSmrg	 *
7980ed5401bSmrg	 * Flags.
7990ed5401bSmrg	 */
8000ed5401bSmrg	__u32 flags;
8010ed5401bSmrg
8020ed5401bSmrg	/**
8030ed5401bSmrg	 * Information for relocation patching.
8040ed5401bSmrg	 */
8050ed5401bSmrg	struct {
8060ed5401bSmrg		/**
8070ed5401bSmrg		 * @target_offset: [in]
8080ed5401bSmrg		 *
8090ed5401bSmrg		 * Offset from the start of the mapping of the data whose
8100ed5401bSmrg		 * address is to be patched into the gather.
8110ed5401bSmrg		 */
8120ed5401bSmrg		__u64 target_offset;
8130ed5401bSmrg
8140ed5401bSmrg		/**
8150ed5401bSmrg		 * @gather_offset_words: [in]
8160ed5401bSmrg		 *
8170ed5401bSmrg		 * Offset in words from the start of the gather data to
8180ed5401bSmrg		 * where the address should be patched into.
8190ed5401bSmrg		 */
8200ed5401bSmrg		__u32 gather_offset_words;
8210ed5401bSmrg
8220ed5401bSmrg		/**
8230ed5401bSmrg		 * @shift: [in]
8240ed5401bSmrg		 *
8250ed5401bSmrg		 * Number of bits the address should be shifted right before
8260ed5401bSmrg		 * patching in.
8270ed5401bSmrg		 */
8280ed5401bSmrg		__u32 shift;
8290ed5401bSmrg	} reloc;
8300ed5401bSmrg};
8310ed5401bSmrg
8320ed5401bSmrg/**
8330ed5401bSmrg * Execute `words` words of Host1x opcodes specified in the `gather_data_ptr`
8340ed5401bSmrg * buffer. Each GATHER_UPTR command uses successive words from the buffer.
8350ed5401bSmrg */
8360ed5401bSmrg#define DRM_TEGRA_SUBMIT_CMD_GATHER_UPTR		0
8370ed5401bSmrg/**
8380ed5401bSmrg * Wait for a syncpoint to reach a value before continuing with further
8390ed5401bSmrg * commands.
8400ed5401bSmrg */
8410ed5401bSmrg#define DRM_TEGRA_SUBMIT_CMD_WAIT_SYNCPT		1
8420ed5401bSmrg/**
8430ed5401bSmrg * Wait for a syncpoint to reach a value before continuing with further
8440ed5401bSmrg * commands. The threshold is calculated relative to the start of the job.
8450ed5401bSmrg */
8460ed5401bSmrg#define DRM_TEGRA_SUBMIT_CMD_WAIT_SYNCPT_RELATIVE	2
8470ed5401bSmrg
8480ed5401bSmrgstruct drm_tegra_submit_cmd_gather_uptr {
8490ed5401bSmrg	__u32 words;
8500ed5401bSmrg	__u32 reserved[3];
8510ed5401bSmrg};
8520ed5401bSmrg
8530ed5401bSmrgstruct drm_tegra_submit_cmd_wait_syncpt {
8540ed5401bSmrg	__u32 id;
8550ed5401bSmrg	__u32 value;
8560ed5401bSmrg	__u32 reserved[2];
8570ed5401bSmrg};
8580ed5401bSmrg
8590ed5401bSmrgstruct drm_tegra_submit_cmd {
8600ed5401bSmrg	/**
8610ed5401bSmrg	 * @type: [in]
8620ed5401bSmrg	 *
8630ed5401bSmrg	 * Command type to execute. One of the DRM_TEGRA_SUBMIT_CMD*
8640ed5401bSmrg	 * defines.
8650ed5401bSmrg	 */
8660ed5401bSmrg	__u32 type;
8670ed5401bSmrg
8680ed5401bSmrg	/**
8690ed5401bSmrg	 * @flags: [in]
8700ed5401bSmrg	 *
8710ed5401bSmrg	 * Flags.
8720ed5401bSmrg	 */
8730ed5401bSmrg	__u32 flags;
8740ed5401bSmrg
8750ed5401bSmrg	union {
8760ed5401bSmrg		struct drm_tegra_submit_cmd_gather_uptr gather_uptr;
8770ed5401bSmrg		struct drm_tegra_submit_cmd_wait_syncpt wait_syncpt;
8780ed5401bSmrg		__u32 reserved[4];
8790ed5401bSmrg	};
8800ed5401bSmrg};
8810ed5401bSmrg
8820ed5401bSmrgstruct drm_tegra_submit_syncpt {
8830ed5401bSmrg	/**
8840ed5401bSmrg	 * @id: [in]
8850ed5401bSmrg	 *
8860ed5401bSmrg	 * ID of the syncpoint that the job will increment.
8870ed5401bSmrg	 */
8880ed5401bSmrg	__u32 id;
8890ed5401bSmrg
8900ed5401bSmrg	/**
8910ed5401bSmrg	 * @flags: [in]
8920ed5401bSmrg	 *
8930ed5401bSmrg	 * Flags.
8940ed5401bSmrg	 */
8950ed5401bSmrg	__u32 flags;
8960ed5401bSmrg
8970ed5401bSmrg	/**
8980ed5401bSmrg	 * @increments: [in]
8990ed5401bSmrg	 *
9000ed5401bSmrg	 * Number of times the job will increment this syncpoint.
9010ed5401bSmrg	 */
9020ed5401bSmrg	__u32 increments;
9030ed5401bSmrg
9040ed5401bSmrg	/**
9050ed5401bSmrg	 * @value: [out]
9060ed5401bSmrg	 *
9070ed5401bSmrg	 * Value the syncpoint will have once the job has completed all
9080ed5401bSmrg	 * its specified syncpoint increments.
9090ed5401bSmrg	 *
9100ed5401bSmrg	 * Note that the kernel may increment the syncpoint before or after
9110ed5401bSmrg	 * the job. These increments are not reflected in this field.
9120ed5401bSmrg	 *
9130ed5401bSmrg	 * If the job hangs or times out, not all of the increments may
9140ed5401bSmrg	 * get executed.
9150ed5401bSmrg	 */
9160ed5401bSmrg	__u32 value;
9170ed5401bSmrg};
9180ed5401bSmrg
9190ed5401bSmrgstruct drm_tegra_channel_submit {
9200ed5401bSmrg	/**
9210ed5401bSmrg	 * @context: [in]
9220ed5401bSmrg	 *
9230ed5401bSmrg	 * Identifier of the channel to submit this job to.
9240ed5401bSmrg	 */
9250ed5401bSmrg	__u32 context;
9260ed5401bSmrg
9270ed5401bSmrg	/**
9280ed5401bSmrg	 * @num_bufs: [in]
9290ed5401bSmrg	 *
9300ed5401bSmrg	 * Number of elements in the `bufs_ptr` array.
9310ed5401bSmrg	 */
9320ed5401bSmrg	__u32 num_bufs;
9330ed5401bSmrg
9340ed5401bSmrg	/**
9350ed5401bSmrg	 * @num_cmds: [in]
9360ed5401bSmrg	 *
9370ed5401bSmrg	 * Number of elements in the `cmds_ptr` array.
9380ed5401bSmrg	 */
9390ed5401bSmrg	__u32 num_cmds;
9400ed5401bSmrg
9410ed5401bSmrg	/**
9420ed5401bSmrg	 * @gather_data_words: [in]
9430ed5401bSmrg	 *
9440ed5401bSmrg	 * Number of 32-bit words in the `gather_data_ptr` array.
9450ed5401bSmrg	 */
9460ed5401bSmrg	__u32 gather_data_words;
9470ed5401bSmrg
9480ed5401bSmrg	/**
9490ed5401bSmrg	 * @bufs_ptr: [in]
9500ed5401bSmrg	 *
9510ed5401bSmrg	 * Pointer to an array of drm_tegra_submit_buf structures.
9520ed5401bSmrg	 */
9530ed5401bSmrg	__u64 bufs_ptr;
9540ed5401bSmrg
9550ed5401bSmrg	/**
9560ed5401bSmrg	 * @cmds_ptr: [in]
9570ed5401bSmrg	 *
9580ed5401bSmrg	 * Pointer to an array of drm_tegra_submit_cmd structures.
9590ed5401bSmrg	 */
9600ed5401bSmrg	__u64 cmds_ptr;
9610ed5401bSmrg
9620ed5401bSmrg	/**
9630ed5401bSmrg	 * @gather_data_ptr: [in]
9640ed5401bSmrg	 *
9650ed5401bSmrg	 * Pointer to an array of Host1x opcodes to be used by GATHER_UPTR
9660ed5401bSmrg	 * commands.
9670ed5401bSmrg	 */
9680ed5401bSmrg	__u64 gather_data_ptr;
9690ed5401bSmrg
9700ed5401bSmrg	/**
9710ed5401bSmrg	 * @syncobj_in: [in]
9720ed5401bSmrg	 *
9730ed5401bSmrg	 * Handle for DRM syncobj that will be waited before submission.
9740ed5401bSmrg	 * Ignored if zero.
9750ed5401bSmrg	 */
9760ed5401bSmrg	__u32 syncobj_in;
9770ed5401bSmrg
9780ed5401bSmrg	/**
9790ed5401bSmrg	 * @syncobj_out: [in]
9800ed5401bSmrg	 *
9810ed5401bSmrg	 * Handle for DRM syncobj that will have its fence replaced with
9820ed5401bSmrg	 * the job's completion fence. Ignored if zero.
9830ed5401bSmrg	 */
9840ed5401bSmrg	__u32 syncobj_out;
9850ed5401bSmrg
9860ed5401bSmrg	/**
9870ed5401bSmrg	 * @syncpt_incr: [in,out]
9880ed5401bSmrg	 *
9890ed5401bSmrg	 * Information about the syncpoint the job will increment.
9900ed5401bSmrg	 */
9910ed5401bSmrg	struct drm_tegra_submit_syncpt syncpt;
9920ed5401bSmrg};
9930ed5401bSmrg
9940ed5401bSmrgstruct drm_tegra_syncpoint_allocate {
9950ed5401bSmrg	/**
9960ed5401bSmrg	 * @id: [out]
9970ed5401bSmrg	 *
9980ed5401bSmrg	 * ID of allocated syncpoint.
9990ed5401bSmrg	 */
10000ed5401bSmrg	__u32 id;
10010ed5401bSmrg	__u32 padding;
10020ed5401bSmrg};
10030ed5401bSmrg
10040ed5401bSmrgstruct drm_tegra_syncpoint_free {
10050ed5401bSmrg	/**
10060ed5401bSmrg	 * @id: [in]
10070ed5401bSmrg	 *
10080ed5401bSmrg	 * ID of syncpoint to free.
10090ed5401bSmrg	 */
10100ed5401bSmrg	__u32 id;
10110ed5401bSmrg	__u32 padding;
10120ed5401bSmrg};
10130ed5401bSmrg
10140ed5401bSmrgstruct drm_tegra_syncpoint_wait {
10150ed5401bSmrg	/**
10160ed5401bSmrg	 * @timeout: [in]
10170ed5401bSmrg	 *
10180ed5401bSmrg	 * Absolute timestamp at which the wait will time out.
10190ed5401bSmrg	 */
10200ed5401bSmrg	__s64 timeout_ns;
10210ed5401bSmrg
10220ed5401bSmrg	/**
10230ed5401bSmrg	 * @id: [in]
10240ed5401bSmrg	 *
10250ed5401bSmrg	 * ID of syncpoint to wait on.
10260ed5401bSmrg	 */
10270ed5401bSmrg	__u32 id;
10280ed5401bSmrg
10290ed5401bSmrg	/**
10300ed5401bSmrg	 * @threshold: [in]
10310ed5401bSmrg	 *
10320ed5401bSmrg	 * Threshold to wait for.
10330ed5401bSmrg	 */
10340ed5401bSmrg	__u32 threshold;
10350ed5401bSmrg
10360ed5401bSmrg	/**
10370ed5401bSmrg	 * @value: [out]
10380ed5401bSmrg	 *
10390ed5401bSmrg	 * Value of the syncpoint upon wait completion.
10400ed5401bSmrg	 */
10410ed5401bSmrg	__u32 value;
10420ed5401bSmrg
10430ed5401bSmrg	__u32 padding;
10440ed5401bSmrg};
10450ed5401bSmrg
10460ed5401bSmrg#define DRM_IOCTL_TEGRA_CHANNEL_OPEN DRM_IOWR(DRM_COMMAND_BASE + 0x10, struct drm_tegra_channel_open)
10470ed5401bSmrg#define DRM_IOCTL_TEGRA_CHANNEL_CLOSE DRM_IOWR(DRM_COMMAND_BASE + 0x11, struct drm_tegra_channel_close)
10480ed5401bSmrg#define DRM_IOCTL_TEGRA_CHANNEL_MAP DRM_IOWR(DRM_COMMAND_BASE + 0x12, struct drm_tegra_channel_map)
10490ed5401bSmrg#define DRM_IOCTL_TEGRA_CHANNEL_UNMAP DRM_IOWR(DRM_COMMAND_BASE + 0x13, struct drm_tegra_channel_unmap)
10500ed5401bSmrg#define DRM_IOCTL_TEGRA_CHANNEL_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + 0x14, struct drm_tegra_channel_submit)
10510ed5401bSmrg
10520ed5401bSmrg#define DRM_IOCTL_TEGRA_SYNCPOINT_ALLOCATE DRM_IOWR(DRM_COMMAND_BASE + 0x20, struct drm_tegra_syncpoint_allocate)
10530ed5401bSmrg#define DRM_IOCTL_TEGRA_SYNCPOINT_FREE DRM_IOWR(DRM_COMMAND_BASE + 0x21, struct drm_tegra_syncpoint_free)
10540ed5401bSmrg#define DRM_IOCTL_TEGRA_SYNCPOINT_WAIT DRM_IOWR(DRM_COMMAND_BASE + 0x22, struct drm_tegra_syncpoint_wait)
10550ed5401bSmrg
105600a23bdaSmrg#if defined(__cplusplus)
105700a23bdaSmrg}
105800a23bdaSmrg#endif
105900a23bdaSmrg
106008d7334dSsnj#endif
1061