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 __MSM_DRM_H__
722851890Sopenharmony_ci#define __MSM_DRM_H__
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_ci#define MSM_PIPE_NONE        0x00
1322851890Sopenharmony_ci#define MSM_PIPE_2D0         0x01
1422851890Sopenharmony_ci#define MSM_PIPE_2D1         0x02
1522851890Sopenharmony_ci#define MSM_PIPE_3D0         0x10
1622851890Sopenharmony_ci#define MSM_PIPE_ID_MASK     0xffff
1722851890Sopenharmony_ci#define MSM_PIPE_ID(x)       ((x) & MSM_PIPE_ID_MASK)
1822851890Sopenharmony_ci#define MSM_PIPE_FLAGS(x)    ((x) & ~MSM_PIPE_ID_MASK)
1922851890Sopenharmony_cistruct drm_msm_timespec {
2022851890Sopenharmony_ci	__s64 tv_sec;
2122851890Sopenharmony_ci	__s64 tv_nsec;
2222851890Sopenharmony_ci};
2322851890Sopenharmony_ci#define MSM_PARAM_GPU_ID     0x01
2422851890Sopenharmony_ci#define MSM_PARAM_GMEM_SIZE  0x02
2522851890Sopenharmony_ci#define MSM_PARAM_CHIP_ID    0x03
2622851890Sopenharmony_ci#define MSM_PARAM_MAX_FREQ   0x04
2722851890Sopenharmony_ci#define MSM_PARAM_TIMESTAMP  0x05
2822851890Sopenharmony_ci#define MSM_PARAM_GMEM_BASE  0x06
2922851890Sopenharmony_ci#define MSM_PARAM_NR_RINGS   0x07
3022851890Sopenharmony_cistruct drm_msm_param {
3122851890Sopenharmony_ci	__u32 pipe;
3222851890Sopenharmony_ci	__u32 param;
3322851890Sopenharmony_ci	__u64 value;
3422851890Sopenharmony_ci};
3522851890Sopenharmony_ci#define MSM_BO_SCANOUT       0x00000001
3622851890Sopenharmony_ci#define MSM_BO_GPU_READONLY  0x00000002
3722851890Sopenharmony_ci#define MSM_BO_CACHE_MASK    0x000f0000
3822851890Sopenharmony_ci#define MSM_BO_CACHED        0x00010000
3922851890Sopenharmony_ci#define MSM_BO_WC            0x00020000
4022851890Sopenharmony_ci#define MSM_BO_UNCACHED      0x00040000
4122851890Sopenharmony_ci#define MSM_BO_FLAGS         (MSM_BO_SCANOUT | \
4222851890Sopenharmony_ci                              MSM_BO_GPU_READONLY | \
4322851890Sopenharmony_ci                              MSM_BO_CACHED | \
4422851890Sopenharmony_ci                              MSM_BO_WC | \
4522851890Sopenharmony_ci                              MSM_BO_UNCACHED)
4622851890Sopenharmony_cistruct drm_msm_gem_new {
4722851890Sopenharmony_ci	__u64 size;
4822851890Sopenharmony_ci	__u32 flags;
4922851890Sopenharmony_ci	__u32 handle;
5022851890Sopenharmony_ci};
5122851890Sopenharmony_ci#define MSM_INFO_IOVA	0x01
5222851890Sopenharmony_ci#define MSM_INFO_FLAGS (MSM_INFO_IOVA)
5322851890Sopenharmony_cistruct drm_msm_gem_info {
5422851890Sopenharmony_ci	__u32 handle;
5522851890Sopenharmony_ci	__u32 flags;
5622851890Sopenharmony_ci	__u64 offset;
5722851890Sopenharmony_ci};
5822851890Sopenharmony_ci#define MSM_PREP_READ        0x01
5922851890Sopenharmony_ci#define MSM_PREP_WRITE       0x02
6022851890Sopenharmony_ci#define MSM_PREP_NOSYNC      0x04
6122851890Sopenharmony_ci#define MSM_PREP_FLAGS       (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
6222851890Sopenharmony_cistruct drm_msm_gem_cpu_prep {
6322851890Sopenharmony_ci	__u32 handle;
6422851890Sopenharmony_ci	__u32 op;
6522851890Sopenharmony_ci	struct drm_msm_timespec timeout;
6622851890Sopenharmony_ci};
6722851890Sopenharmony_cistruct drm_msm_gem_cpu_fini {
6822851890Sopenharmony_ci	__u32 handle;
6922851890Sopenharmony_ci};
7022851890Sopenharmony_cistruct drm_msm_gem_submit_reloc {
7122851890Sopenharmony_ci	__u32 submit_offset;
7222851890Sopenharmony_ci	__u32 or;
7322851890Sopenharmony_ci	__s32 shift;
7422851890Sopenharmony_ci	__u32 reloc_idx;
7522851890Sopenharmony_ci	__u64 reloc_offset;
7622851890Sopenharmony_ci};
7722851890Sopenharmony_ci#define MSM_SUBMIT_CMD_BUF             0x0001
7822851890Sopenharmony_ci#define MSM_SUBMIT_CMD_IB_TARGET_BUF   0x0002
7922851890Sopenharmony_ci#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
8022851890Sopenharmony_cistruct drm_msm_gem_submit_cmd {
8122851890Sopenharmony_ci	__u32 type;
8222851890Sopenharmony_ci	__u32 submit_idx;
8322851890Sopenharmony_ci	__u32 submit_offset;
8422851890Sopenharmony_ci	__u32 size;
8522851890Sopenharmony_ci	__u32 pad;
8622851890Sopenharmony_ci	__u32 nr_relocs;
8722851890Sopenharmony_ci	__u64 relocs;
8822851890Sopenharmony_ci};
8922851890Sopenharmony_ci#define MSM_SUBMIT_BO_READ             0x0001
9022851890Sopenharmony_ci#define MSM_SUBMIT_BO_WRITE            0x0002
9122851890Sopenharmony_ci#define MSM_SUBMIT_BO_FLAGS            (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
9222851890Sopenharmony_cistruct drm_msm_gem_submit_bo {
9322851890Sopenharmony_ci	__u32 flags;
9422851890Sopenharmony_ci	__u32 handle;
9522851890Sopenharmony_ci	__u64 presumed;
9622851890Sopenharmony_ci};
9722851890Sopenharmony_ci#define MSM_SUBMIT_NO_IMPLICIT   0x80000000
9822851890Sopenharmony_ci#define MSM_SUBMIT_FENCE_FD_IN   0x40000000
9922851890Sopenharmony_ci#define MSM_SUBMIT_FENCE_FD_OUT  0x20000000
10022851890Sopenharmony_ci#define MSM_SUBMIT_SUDO          0x10000000
10122851890Sopenharmony_ci#define MSM_SUBMIT_FLAGS                ( \
10222851890Sopenharmony_ci		MSM_SUBMIT_NO_IMPLICIT   | \
10322851890Sopenharmony_ci		MSM_SUBMIT_FENCE_FD_IN   | \
10422851890Sopenharmony_ci		MSM_SUBMIT_FENCE_FD_OUT  | \
10522851890Sopenharmony_ci		MSM_SUBMIT_SUDO          | \
10622851890Sopenharmony_ci		0)
10722851890Sopenharmony_cistruct drm_msm_gem_submit {
10822851890Sopenharmony_ci	__u32 flags;
10922851890Sopenharmony_ci	__u32 fence;
11022851890Sopenharmony_ci	__u32 nr_bos;
11122851890Sopenharmony_ci	__u32 nr_cmds;
11222851890Sopenharmony_ci	__u64 bos;
11322851890Sopenharmony_ci	__u64 cmds;
11422851890Sopenharmony_ci	__s32 fence_fd;
11522851890Sopenharmony_ci	__u32 queueid;
11622851890Sopenharmony_ci};
11722851890Sopenharmony_cistruct drm_msm_wait_fence {
11822851890Sopenharmony_ci	__u32 fence;
11922851890Sopenharmony_ci	__u32 pad;
12022851890Sopenharmony_ci	struct drm_msm_timespec timeout;
12122851890Sopenharmony_ci	__u32 queueid;
12222851890Sopenharmony_ci};
12322851890Sopenharmony_ci#define MSM_MADV_WILLNEED 0
12422851890Sopenharmony_ci#define MSM_MADV_DONTNEED 1
12522851890Sopenharmony_ci#define __MSM_MADV_PURGED 2
12622851890Sopenharmony_cistruct drm_msm_gem_madvise {
12722851890Sopenharmony_ci	__u32 handle;
12822851890Sopenharmony_ci	__u32 madv;
12922851890Sopenharmony_ci	__u32 retained;
13022851890Sopenharmony_ci};
13122851890Sopenharmony_ci#define MSM_SUBMITQUEUE_FLAGS (0)
13222851890Sopenharmony_cistruct drm_msm_submitqueue {
13322851890Sopenharmony_ci	__u32 flags;
13422851890Sopenharmony_ci	__u32 prio;
13522851890Sopenharmony_ci	__u32 id;
13622851890Sopenharmony_ci};
13722851890Sopenharmony_ci#define DRM_MSM_GET_PARAM              0x00
13822851890Sopenharmony_ci#define DRM_MSM_GEM_NEW                0x02
13922851890Sopenharmony_ci#define DRM_MSM_GEM_INFO               0x03
14022851890Sopenharmony_ci#define DRM_MSM_GEM_CPU_PREP           0x04
14122851890Sopenharmony_ci#define DRM_MSM_GEM_CPU_FINI           0x05
14222851890Sopenharmony_ci#define DRM_MSM_GEM_SUBMIT             0x06
14322851890Sopenharmony_ci#define DRM_MSM_WAIT_FENCE             0x07
14422851890Sopenharmony_ci#define DRM_MSM_GEM_MADVISE            0x08
14522851890Sopenharmony_ci#define DRM_MSM_SUBMITQUEUE_NEW        0x0A
14622851890Sopenharmony_ci#define DRM_MSM_SUBMITQUEUE_CLOSE      0x0B
14722851890Sopenharmony_ci#define DRM_IOCTL_MSM_GET_PARAM        DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
14822851890Sopenharmony_ci#define DRM_IOCTL_MSM_GEM_NEW          DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
14922851890Sopenharmony_ci#define DRM_IOCTL_MSM_GEM_INFO         DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
15022851890Sopenharmony_ci#define DRM_IOCTL_MSM_GEM_CPU_PREP     DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
15122851890Sopenharmony_ci#define DRM_IOCTL_MSM_GEM_CPU_FINI     DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
15222851890Sopenharmony_ci#define DRM_IOCTL_MSM_GEM_SUBMIT       DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
15322851890Sopenharmony_ci#define DRM_IOCTL_MSM_WAIT_FENCE       DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
15422851890Sopenharmony_ci#define DRM_IOCTL_MSM_GEM_MADVISE      DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
15522851890Sopenharmony_ci#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW    DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
15622851890Sopenharmony_ci#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE  DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
15722851890Sopenharmony_ci#if defined(__cplusplus)
15822851890Sopenharmony_ci}
15922851890Sopenharmony_ci#endif
16022851890Sopenharmony_ci#endif
161