122851890Sopenharmony_ci/*
222851890Sopenharmony_ci * This header was generated from the Linux kernel headers by update_headers.py,
322851890Sopenharmony_ci * to provide necessary information from kernel to userspace, such as constants,
422851890Sopenharmony_ci * structures, and macros, and thus, contains no copyrightable information.
522851890Sopenharmony_ci */
622851890Sopenharmony_ci#ifndef _UAPI_TEGRA_DRM_H_
722851890Sopenharmony_ci#define _UAPI_TEGRA_DRM_H_
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_ci#define DRM_TEGRA_GEM_CREATE_TILED     (1 << 0)
1322851890Sopenharmony_ci#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
1422851890Sopenharmony_cistruct drm_tegra_gem_create {
1522851890Sopenharmony_ci
1622851890Sopenharmony_ci	__u64 size;
1722851890Sopenharmony_ci
1822851890Sopenharmony_ci	__u32 flags;
1922851890Sopenharmony_ci
2022851890Sopenharmony_ci	__u32 handle;
2122851890Sopenharmony_ci};
2222851890Sopenharmony_cistruct drm_tegra_gem_mmap {
2322851890Sopenharmony_ci
2422851890Sopenharmony_ci	__u32 handle;
2522851890Sopenharmony_ci
2622851890Sopenharmony_ci	__u32 pad;
2722851890Sopenharmony_ci
2822851890Sopenharmony_ci	__u64 offset;
2922851890Sopenharmony_ci};
3022851890Sopenharmony_cistruct drm_tegra_syncpt_read {
3122851890Sopenharmony_ci
3222851890Sopenharmony_ci	__u32 id;
3322851890Sopenharmony_ci
3422851890Sopenharmony_ci	__u32 value;
3522851890Sopenharmony_ci};
3622851890Sopenharmony_cistruct drm_tegra_syncpt_incr {
3722851890Sopenharmony_ci
3822851890Sopenharmony_ci	__u32 id;
3922851890Sopenharmony_ci
4022851890Sopenharmony_ci	__u32 pad;
4122851890Sopenharmony_ci};
4222851890Sopenharmony_cistruct drm_tegra_syncpt_wait {
4322851890Sopenharmony_ci
4422851890Sopenharmony_ci	__u32 id;
4522851890Sopenharmony_ci
4622851890Sopenharmony_ci	__u32 thresh;
4722851890Sopenharmony_ci
4822851890Sopenharmony_ci	__u32 timeout;
4922851890Sopenharmony_ci
5022851890Sopenharmony_ci	__u32 value;
5122851890Sopenharmony_ci};
5222851890Sopenharmony_ci#define DRM_TEGRA_NO_TIMEOUT	(0xffffffff)
5322851890Sopenharmony_cistruct drm_tegra_open_channel {
5422851890Sopenharmony_ci
5522851890Sopenharmony_ci	__u32 client;
5622851890Sopenharmony_ci
5722851890Sopenharmony_ci	__u32 pad;
5822851890Sopenharmony_ci
5922851890Sopenharmony_ci	__u64 context;
6022851890Sopenharmony_ci};
6122851890Sopenharmony_cistruct drm_tegra_close_channel {
6222851890Sopenharmony_ci
6322851890Sopenharmony_ci	__u64 context;
6422851890Sopenharmony_ci};
6522851890Sopenharmony_cistruct drm_tegra_get_syncpt {
6622851890Sopenharmony_ci
6722851890Sopenharmony_ci	__u64 context;
6822851890Sopenharmony_ci
6922851890Sopenharmony_ci	__u32 index;
7022851890Sopenharmony_ci
7122851890Sopenharmony_ci	__u32 id;
7222851890Sopenharmony_ci};
7322851890Sopenharmony_cistruct drm_tegra_get_syncpt_base {
7422851890Sopenharmony_ci
7522851890Sopenharmony_ci	__u64 context;
7622851890Sopenharmony_ci
7722851890Sopenharmony_ci	__u32 syncpt;
7822851890Sopenharmony_ci
7922851890Sopenharmony_ci	__u32 id;
8022851890Sopenharmony_ci};
8122851890Sopenharmony_cistruct drm_tegra_syncpt {
8222851890Sopenharmony_ci
8322851890Sopenharmony_ci	__u32 id;
8422851890Sopenharmony_ci
8522851890Sopenharmony_ci	__u32 incrs;
8622851890Sopenharmony_ci};
8722851890Sopenharmony_cistruct drm_tegra_cmdbuf {
8822851890Sopenharmony_ci
8922851890Sopenharmony_ci	__u32 handle;
9022851890Sopenharmony_ci
9122851890Sopenharmony_ci	__u32 offset;
9222851890Sopenharmony_ci
9322851890Sopenharmony_ci	__u32 words;
9422851890Sopenharmony_ci
9522851890Sopenharmony_ci	__u32 pad;
9622851890Sopenharmony_ci};
9722851890Sopenharmony_cistruct drm_tegra_reloc {
9822851890Sopenharmony_ci	struct {
9922851890Sopenharmony_ci
10022851890Sopenharmony_ci		__u32 handle;
10122851890Sopenharmony_ci
10222851890Sopenharmony_ci		__u32 offset;
10322851890Sopenharmony_ci	} cmdbuf;
10422851890Sopenharmony_ci	struct {
10522851890Sopenharmony_ci
10622851890Sopenharmony_ci		__u32 handle;
10722851890Sopenharmony_ci
10822851890Sopenharmony_ci		__u32 offset;
10922851890Sopenharmony_ci	} target;
11022851890Sopenharmony_ci
11122851890Sopenharmony_ci	__u32 shift;
11222851890Sopenharmony_ci
11322851890Sopenharmony_ci	__u32 pad;
11422851890Sopenharmony_ci};
11522851890Sopenharmony_cistruct drm_tegra_waitchk {
11622851890Sopenharmony_ci
11722851890Sopenharmony_ci	__u32 handle;
11822851890Sopenharmony_ci
11922851890Sopenharmony_ci	__u32 offset;
12022851890Sopenharmony_ci
12122851890Sopenharmony_ci	__u32 syncpt;
12222851890Sopenharmony_ci
12322851890Sopenharmony_ci	__u32 thresh;
12422851890Sopenharmony_ci};
12522851890Sopenharmony_cistruct drm_tegra_submit {
12622851890Sopenharmony_ci
12722851890Sopenharmony_ci	__u64 context;
12822851890Sopenharmony_ci
12922851890Sopenharmony_ci	__u32 num_syncpts;
13022851890Sopenharmony_ci
13122851890Sopenharmony_ci	__u32 num_cmdbufs;
13222851890Sopenharmony_ci
13322851890Sopenharmony_ci	__u32 num_relocs;
13422851890Sopenharmony_ci
13522851890Sopenharmony_ci	__u32 num_waitchks;
13622851890Sopenharmony_ci
13722851890Sopenharmony_ci	__u32 waitchk_mask;
13822851890Sopenharmony_ci
13922851890Sopenharmony_ci	__u32 timeout;
14022851890Sopenharmony_ci
14122851890Sopenharmony_ci	__u64 syncpts;
14222851890Sopenharmony_ci
14322851890Sopenharmony_ci	__u64 cmdbufs;
14422851890Sopenharmony_ci
14522851890Sopenharmony_ci	__u64 relocs;
14622851890Sopenharmony_ci
14722851890Sopenharmony_ci	__u64 waitchks;
14822851890Sopenharmony_ci
14922851890Sopenharmony_ci	__u32 fence;
15022851890Sopenharmony_ci
15122851890Sopenharmony_ci	__u32 reserved[5];
15222851890Sopenharmony_ci};
15322851890Sopenharmony_ci#define DRM_TEGRA_GEM_TILING_MODE_PITCH 0
15422851890Sopenharmony_ci#define DRM_TEGRA_GEM_TILING_MODE_TILED 1
15522851890Sopenharmony_ci#define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2
15622851890Sopenharmony_cistruct drm_tegra_gem_set_tiling {
15722851890Sopenharmony_ci
15822851890Sopenharmony_ci	__u32 handle;
15922851890Sopenharmony_ci
16022851890Sopenharmony_ci	__u32 mode;
16122851890Sopenharmony_ci
16222851890Sopenharmony_ci	__u32 value;
16322851890Sopenharmony_ci
16422851890Sopenharmony_ci	__u32 pad;
16522851890Sopenharmony_ci};
16622851890Sopenharmony_cistruct drm_tegra_gem_get_tiling {
16722851890Sopenharmony_ci
16822851890Sopenharmony_ci	__u32 handle;
16922851890Sopenharmony_ci
17022851890Sopenharmony_ci	__u32 mode;
17122851890Sopenharmony_ci
17222851890Sopenharmony_ci	__u32 value;
17322851890Sopenharmony_ci
17422851890Sopenharmony_ci	__u32 pad;
17522851890Sopenharmony_ci};
17622851890Sopenharmony_ci#define DRM_TEGRA_GEM_BOTTOM_UP		(1 << 0)
17722851890Sopenharmony_ci#define DRM_TEGRA_GEM_FLAGS		(DRM_TEGRA_GEM_BOTTOM_UP)
17822851890Sopenharmony_cistruct drm_tegra_gem_set_flags {
17922851890Sopenharmony_ci
18022851890Sopenharmony_ci	__u32 handle;
18122851890Sopenharmony_ci
18222851890Sopenharmony_ci	__u32 flags;
18322851890Sopenharmony_ci};
18422851890Sopenharmony_cistruct drm_tegra_gem_get_flags {
18522851890Sopenharmony_ci
18622851890Sopenharmony_ci	__u32 handle;
18722851890Sopenharmony_ci
18822851890Sopenharmony_ci	__u32 flags;
18922851890Sopenharmony_ci};
19022851890Sopenharmony_ci#define DRM_TEGRA_GEM_CREATE		0x00
19122851890Sopenharmony_ci#define DRM_TEGRA_GEM_MMAP		0x01
19222851890Sopenharmony_ci#define DRM_TEGRA_SYNCPT_READ		0x02
19322851890Sopenharmony_ci#define DRM_TEGRA_SYNCPT_INCR		0x03
19422851890Sopenharmony_ci#define DRM_TEGRA_SYNCPT_WAIT		0x04
19522851890Sopenharmony_ci#define DRM_TEGRA_OPEN_CHANNEL		0x05
19622851890Sopenharmony_ci#define DRM_TEGRA_CLOSE_CHANNEL		0x06
19722851890Sopenharmony_ci#define DRM_TEGRA_GET_SYNCPT		0x07
19822851890Sopenharmony_ci#define DRM_TEGRA_SUBMIT		0x08
19922851890Sopenharmony_ci#define DRM_TEGRA_GET_SYNCPT_BASE	0x09
20022851890Sopenharmony_ci#define DRM_TEGRA_GEM_SET_TILING	0x0a
20122851890Sopenharmony_ci#define DRM_TEGRA_GEM_GET_TILING	0x0b
20222851890Sopenharmony_ci#define DRM_TEGRA_GEM_SET_FLAGS		0x0c
20322851890Sopenharmony_ci#define DRM_TEGRA_GEM_GET_FLAGS		0x0d
20422851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
20522851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
20622851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
20722851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
20822851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
20922851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
21022851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_close_channel)
21122851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
21222851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
21322851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
21422851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling)
21522851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling)
21622851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
21722851890Sopenharmony_ci#define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
21822851890Sopenharmony_ci#if defined(__cplusplus)
21922851890Sopenharmony_ci}
22022851890Sopenharmony_ci#endif
22122851890Sopenharmony_ci#endif
222