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 __ETNAVIV_DRM_H__
722851890Sopenharmony_ci#define __ETNAVIV_DRM_H__
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_cistruct drm_etnaviv_timespec {
1322851890Sopenharmony_ci	__s64 tv_sec;
1422851890Sopenharmony_ci	__s64 tv_nsec;
1522851890Sopenharmony_ci};
1622851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_MODEL                     0x01
1722851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_REVISION                  0x02
1822851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_0                0x03
1922851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_1                0x04
2022851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_2                0x05
2122851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_3                0x06
2222851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_4                0x07
2322851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_5                0x08
2422851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_6                0x09
2522851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_7                0x0a
2622851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_8                0x0b
2722851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_9                0x0c
2822851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_10               0x0d
2922851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_11               0x0e
3022851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_FEATURES_12               0x0f
3122851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_STREAM_COUNT              0x10
3222851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_REGISTER_MAX              0x11
3322851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_THREAD_COUNT              0x12
3422851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_VERTEX_CACHE_SIZE         0x13
3522851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_SHADER_CORE_COUNT         0x14
3622851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_PIXEL_PIPES               0x15
3722851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_VERTEX_OUTPUT_BUFFER_SIZE 0x16
3822851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_BUFFER_SIZE               0x17
3922851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT         0x18
4022851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_NUM_CONSTANTS             0x19
4122851890Sopenharmony_ci#define ETNAVIV_PARAM_GPU_NUM_VARYINGS              0x1a
4222851890Sopenharmony_ci#define ETNA_MAX_PIPES 4
4322851890Sopenharmony_cistruct drm_etnaviv_param {
4422851890Sopenharmony_ci	__u32 pipe;
4522851890Sopenharmony_ci	__u32 param;
4622851890Sopenharmony_ci	__u64 value;
4722851890Sopenharmony_ci};
4822851890Sopenharmony_ci#define ETNA_BO_CACHE_MASK   0x000f0000
4922851890Sopenharmony_ci#define ETNA_BO_CACHED       0x00010000
5022851890Sopenharmony_ci#define ETNA_BO_WC           0x00020000
5122851890Sopenharmony_ci#define ETNA_BO_UNCACHED     0x00040000
5222851890Sopenharmony_ci#define ETNA_BO_FORCE_MMU    0x00100000
5322851890Sopenharmony_cistruct drm_etnaviv_gem_new {
5422851890Sopenharmony_ci	__u64 size;
5522851890Sopenharmony_ci	__u32 flags;
5622851890Sopenharmony_ci	__u32 handle;
5722851890Sopenharmony_ci};
5822851890Sopenharmony_cistruct drm_etnaviv_gem_info {
5922851890Sopenharmony_ci	__u32 handle;
6022851890Sopenharmony_ci	__u32 pad;
6122851890Sopenharmony_ci	__u64 offset;
6222851890Sopenharmony_ci};
6322851890Sopenharmony_ci#define ETNA_PREP_READ        0x01
6422851890Sopenharmony_ci#define ETNA_PREP_WRITE       0x02
6522851890Sopenharmony_ci#define ETNA_PREP_NOSYNC      0x04
6622851890Sopenharmony_cistruct drm_etnaviv_gem_cpu_prep {
6722851890Sopenharmony_ci	__u32 handle;
6822851890Sopenharmony_ci	__u32 op;
6922851890Sopenharmony_ci	struct drm_etnaviv_timespec timeout;
7022851890Sopenharmony_ci};
7122851890Sopenharmony_cistruct drm_etnaviv_gem_cpu_fini {
7222851890Sopenharmony_ci	__u32 handle;
7322851890Sopenharmony_ci	__u32 flags;
7422851890Sopenharmony_ci};
7522851890Sopenharmony_cistruct drm_etnaviv_gem_submit_reloc {
7622851890Sopenharmony_ci	__u32 submit_offset;
7722851890Sopenharmony_ci	__u32 reloc_idx;
7822851890Sopenharmony_ci	__u64 reloc_offset;
7922851890Sopenharmony_ci	__u32 flags;
8022851890Sopenharmony_ci};
8122851890Sopenharmony_ci#define ETNA_SUBMIT_BO_READ             0x0001
8222851890Sopenharmony_ci#define ETNA_SUBMIT_BO_WRITE            0x0002
8322851890Sopenharmony_cistruct drm_etnaviv_gem_submit_bo {
8422851890Sopenharmony_ci	__u32 flags;
8522851890Sopenharmony_ci	__u32 handle;
8622851890Sopenharmony_ci	__u64 presumed;
8722851890Sopenharmony_ci};
8822851890Sopenharmony_ci#define ETNA_PM_PROCESS_PRE             0x0001
8922851890Sopenharmony_ci#define ETNA_PM_PROCESS_POST            0x0002
9022851890Sopenharmony_cistruct drm_etnaviv_gem_submit_pmr {
9122851890Sopenharmony_ci	__u32 flags;
9222851890Sopenharmony_ci	__u8  domain;
9322851890Sopenharmony_ci	__u8  pad;
9422851890Sopenharmony_ci	__u16 signal;
9522851890Sopenharmony_ci	__u32 sequence;
9622851890Sopenharmony_ci	__u32 read_offset;
9722851890Sopenharmony_ci	__u32 read_idx;
9822851890Sopenharmony_ci};
9922851890Sopenharmony_ci#define ETNA_SUBMIT_NO_IMPLICIT         0x0001
10022851890Sopenharmony_ci#define ETNA_SUBMIT_FENCE_FD_IN         0x0002
10122851890Sopenharmony_ci#define ETNA_SUBMIT_FENCE_FD_OUT        0x0004
10222851890Sopenharmony_ci#define ETNA_SUBMIT_FLAGS		(ETNA_SUBMIT_NO_IMPLICIT | \
10322851890Sopenharmony_ci					 ETNA_SUBMIT_FENCE_FD_IN | \
10422851890Sopenharmony_ci					 ETNA_SUBMIT_FENCE_FD_OUT)
10522851890Sopenharmony_ci#define ETNA_PIPE_3D      0x00
10622851890Sopenharmony_ci#define ETNA_PIPE_2D      0x01
10722851890Sopenharmony_ci#define ETNA_PIPE_VG      0x02
10822851890Sopenharmony_cistruct drm_etnaviv_gem_submit {
10922851890Sopenharmony_ci	__u32 fence;
11022851890Sopenharmony_ci	__u32 pipe;
11122851890Sopenharmony_ci	__u32 exec_state;
11222851890Sopenharmony_ci	__u32 nr_bos;
11322851890Sopenharmony_ci	__u32 nr_relocs;
11422851890Sopenharmony_ci	__u32 stream_size;
11522851890Sopenharmony_ci	__u64 bos;
11622851890Sopenharmony_ci	__u64 relocs;
11722851890Sopenharmony_ci	__u64 stream;
11822851890Sopenharmony_ci	__u32 flags;
11922851890Sopenharmony_ci	__s32 fence_fd;
12022851890Sopenharmony_ci	__u64 pmrs;
12122851890Sopenharmony_ci	__u32 nr_pmrs;
12222851890Sopenharmony_ci	__u32 pad;
12322851890Sopenharmony_ci};
12422851890Sopenharmony_ci#define ETNA_WAIT_NONBLOCK      0x01
12522851890Sopenharmony_cistruct drm_etnaviv_wait_fence {
12622851890Sopenharmony_ci	__u32 pipe;
12722851890Sopenharmony_ci	__u32 fence;
12822851890Sopenharmony_ci	__u32 flags;
12922851890Sopenharmony_ci	__u32 pad;
13022851890Sopenharmony_ci	struct drm_etnaviv_timespec timeout;
13122851890Sopenharmony_ci};
13222851890Sopenharmony_ci#define ETNA_USERPTR_READ	0x01
13322851890Sopenharmony_ci#define ETNA_USERPTR_WRITE	0x02
13422851890Sopenharmony_cistruct drm_etnaviv_gem_userptr {
13522851890Sopenharmony_ci	__u64 user_ptr;
13622851890Sopenharmony_ci	__u64 user_size;
13722851890Sopenharmony_ci	__u32 flags;
13822851890Sopenharmony_ci	__u32 handle;
13922851890Sopenharmony_ci};
14022851890Sopenharmony_cistruct drm_etnaviv_gem_wait {
14122851890Sopenharmony_ci	__u32 pipe;
14222851890Sopenharmony_ci	__u32 handle;
14322851890Sopenharmony_ci	__u32 flags;
14422851890Sopenharmony_ci	__u32 pad;
14522851890Sopenharmony_ci	struct drm_etnaviv_timespec timeout;
14622851890Sopenharmony_ci};
14722851890Sopenharmony_cistruct drm_etnaviv_pm_domain {
14822851890Sopenharmony_ci	__u32 pipe;
14922851890Sopenharmony_ci	__u8  iter;
15022851890Sopenharmony_ci	__u8  id;
15122851890Sopenharmony_ci	__u16 nr_signals;
15222851890Sopenharmony_ci	char  name[64];
15322851890Sopenharmony_ci};
15422851890Sopenharmony_cistruct drm_etnaviv_pm_signal {
15522851890Sopenharmony_ci	__u32 pipe;
15622851890Sopenharmony_ci	__u8  domain;
15722851890Sopenharmony_ci	__u8  pad;
15822851890Sopenharmony_ci	__u16 iter;
15922851890Sopenharmony_ci	__u16 id;
16022851890Sopenharmony_ci	char  name[64];
16122851890Sopenharmony_ci};
16222851890Sopenharmony_ci#define DRM_ETNAVIV_GET_PARAM          0x00
16322851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_NEW            0x02
16422851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_INFO           0x03
16522851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_CPU_PREP       0x04
16622851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_CPU_FINI       0x05
16722851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_SUBMIT         0x06
16822851890Sopenharmony_ci#define DRM_ETNAVIV_WAIT_FENCE         0x07
16922851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_USERPTR        0x08
17022851890Sopenharmony_ci#define DRM_ETNAVIV_GEM_WAIT           0x09
17122851890Sopenharmony_ci#define DRM_ETNAVIV_PM_QUERY_DOM       0x0a
17222851890Sopenharmony_ci#define DRM_ETNAVIV_PM_QUERY_SIG       0x0b
17322851890Sopenharmony_ci#define DRM_ETNAVIV_NUM_IOCTLS         0x0c
17422851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GET_PARAM    DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GET_PARAM, struct drm_etnaviv_param)
17522851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_NEW      DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_NEW, struct drm_etnaviv_gem_new)
17622851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_INFO     DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_INFO, struct drm_etnaviv_gem_info)
17722851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_PREP, struct drm_etnaviv_gem_cpu_prep)
17822851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_FINI, struct drm_etnaviv_gem_cpu_fini)
17922851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_SUBMIT   DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_SUBMIT, struct drm_etnaviv_gem_submit)
18022851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_WAIT_FENCE   DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_WAIT_FENCE, struct drm_etnaviv_wait_fence)
18122851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_USERPTR  DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_USERPTR, struct drm_etnaviv_gem_userptr)
18222851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_GEM_WAIT     DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_WAIT, struct drm_etnaviv_gem_wait)
18322851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_PM_QUERY_DOM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain)
18422851890Sopenharmony_ci#define DRM_IOCTL_ETNAVIV_PM_QUERY_SIG DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal)
18522851890Sopenharmony_ci#if defined(__cplusplus)
18622851890Sopenharmony_ci}
18722851890Sopenharmony_ci#endif
18822851890Sopenharmony_ci#endif
189