blob: 582da62b9d4fe3130de9518c4c5555988ec5ee3d [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris38062f92014-07-09 15:33:25 -07007#ifndef __MSM_DRM_H__
8#define __MSM_DRM_H__
Christopher Ferris106b3a82016-08-24 12:15:38 -07009#include "drm.h"
10#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080011extern "C" {
Christopher Ferris106b3a82016-08-24 12:15:38 -070012#endif
Christopher Ferris38062f92014-07-09 15:33:25 -070013#define MSM_PIPE_NONE 0x00
14#define MSM_PIPE_2D0 0x01
15#define MSM_PIPE_2D1 0x02
Christopher Ferris106b3a82016-08-24 12:15:38 -070016#define MSM_PIPE_3D0 0x10
Christopher Ferris6a9755d2017-01-13 14:09:31 -080017#define MSM_PIPE_ID_MASK 0xffff
18#define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK)
19#define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK)
Christopher Ferris38062f92014-07-09 15:33:25 -070020struct drm_msm_timespec {
Christopher Ferris05d08e92016-02-04 13:16:38 -080021 __s64 tv_sec;
22 __s64 tv_nsec;
Christopher Ferris106b3a82016-08-24 12:15:38 -070023};
Christopher Ferris38062f92014-07-09 15:33:25 -070024#define MSM_PARAM_GPU_ID 0x01
25#define MSM_PARAM_GMEM_SIZE 0x02
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070026#define MSM_PARAM_CHIP_ID 0x03
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define MSM_PARAM_MAX_FREQ 0x04
28#define MSM_PARAM_TIMESTAMP 0x05
Christopher Ferris525ce912017-07-26 13:12:53 -070029#define MSM_PARAM_GMEM_BASE 0x06
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070030#define MSM_PARAM_PRIORITIES 0x07
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070031#define MSM_PARAM_PP_PGTABLE 0x08
32#define MSM_PARAM_FAULTS 0x09
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000033#define MSM_PARAM_SUSPENDS 0x0a
Christopher Ferris10a76e62022-06-08 13:31:52 -070034#define MSM_PARAM_SYSPROF 0x0b
Christopher Ferris80ae69d2022-08-02 16:32:21 -070035#define MSM_PARAM_COMM 0x0c
36#define MSM_PARAM_CMDLINE 0x0d
37#define MSM_PARAM_VA_START 0x0e
38#define MSM_PARAM_VA_SIZE 0x0f
Christopher Ferrisb830ddf2024-03-28 11:48:08 -070039#define MSM_PARAM_HIGHEST_BANK_BIT 0x10
Christopher Ferris63fcca42024-09-26 01:12:10 +000040#define MSM_PARAM_RAYTRACING 0x11
Christopher Ferris65552ba2024-11-20 17:55:06 +000041#define MSM_PARAM_UBWC_SWIZZLE 0x12
42#define MSM_PARAM_MACROTILE_MODE 0x13
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070043#define MSM_PARAM_NR_RINGS MSM_PARAM_PRIORITIES
Christopher Ferris106b3a82016-08-24 12:15:38 -070044struct drm_msm_param {
Christopher Ferris05d08e92016-02-04 13:16:38 -080045 __u32 pipe;
46 __u32 param;
47 __u64 value;
Christopher Ferris80ae69d2022-08-02 16:32:21 -070048 __u32 len;
49 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -070050};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070051#define MSM_BO_SCANOUT 0x00000001
Christopher Ferris38062f92014-07-09 15:33:25 -070052#define MSM_BO_GPU_READONLY 0x00000002
53#define MSM_BO_CACHE_MASK 0x000f0000
54#define MSM_BO_CACHED 0x00010000
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070055#define MSM_BO_WC 0x00020000
Christopher Ferris38062f92014-07-09 15:33:25 -070056#define MSM_BO_UNCACHED 0x00040000
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000057#define MSM_BO_CACHED_COHERENT 0x080000
58#define MSM_BO_FLAGS (MSM_BO_SCANOUT | MSM_BO_GPU_READONLY | MSM_BO_CACHE_MASK)
Christopher Ferris38062f92014-07-09 15:33:25 -070059struct drm_msm_gem_new {
Christopher Ferris05d08e92016-02-04 13:16:38 -080060 __u64 size;
61 __u32 flags;
62 __u32 handle;
Christopher Ferris38062f92014-07-09 15:33:25 -070063};
Christopher Ferrisd842e432019-03-07 10:21:59 -080064#define MSM_INFO_GET_OFFSET 0x00
65#define MSM_INFO_GET_IOVA 0x01
66#define MSM_INFO_SET_NAME 0x02
67#define MSM_INFO_GET_NAME 0x03
Christopher Ferris80ae69d2022-08-02 16:32:21 -070068#define MSM_INFO_SET_IOVA 0x04
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080069#define MSM_INFO_GET_FLAGS 0x05
Christopher Ferrisb830ddf2024-03-28 11:48:08 -070070#define MSM_INFO_SET_METADATA 0x06
71#define MSM_INFO_GET_METADATA 0x07
Christopher Ferris38062f92014-07-09 15:33:25 -070072struct drm_msm_gem_info {
Christopher Ferris05d08e92016-02-04 13:16:38 -080073 __u32 handle;
Christopher Ferrisd842e432019-03-07 10:21:59 -080074 __u32 info;
75 __u64 value;
76 __u32 len;
77 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -070078};
79#define MSM_PREP_READ 0x01
Christopher Ferris38062f92014-07-09 15:33:25 -070080#define MSM_PREP_WRITE 0x02
81#define MSM_PREP_NOSYNC 0x04
Christopher Ferris37c3f3c2023-07-10 10:59:05 -070082#define MSM_PREP_BOOST 0x08
83#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC | MSM_PREP_BOOST | 0)
Christopher Ferris38062f92014-07-09 15:33:25 -070084struct drm_msm_gem_cpu_prep {
Christopher Ferris05d08e92016-02-04 13:16:38 -080085 __u32 handle;
86 __u32 op;
Tao Baod7db5942015-01-28 10:07:51 -080087 struct drm_msm_timespec timeout;
Christopher Ferris38062f92014-07-09 15:33:25 -070088};
89struct drm_msm_gem_cpu_fini {
Christopher Ferris05d08e92016-02-04 13:16:38 -080090 __u32 handle;
Christopher Ferris38062f92014-07-09 15:33:25 -070091};
92struct drm_msm_gem_submit_reloc {
Christopher Ferris05d08e92016-02-04 13:16:38 -080093 __u32 submit_offset;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -070094#ifdef __cplusplus
95 __u32 _or;
96#else
Christopher Ferris05d08e92016-02-04 13:16:38 -080097 __u32 or;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -070098#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080099 __s32 shift;
100 __u32 reloc_idx;
101 __u64 reloc_offset;
Christopher Ferris38062f92014-07-09 15:33:25 -0700102};
103#define MSM_SUBMIT_CMD_BUF 0x0001
104#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
105#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
Christopher Ferris38062f92014-07-09 15:33:25 -0700106struct drm_msm_gem_submit_cmd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 __u32 type;
108 __u32 submit_idx;
109 __u32 submit_offset;
110 __u32 size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 __u32 pad;
112 __u32 nr_relocs;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800113 __u64 relocs;
Christopher Ferris38062f92014-07-09 15:33:25 -0700114};
115#define MSM_SUBMIT_BO_READ 0x0001
116#define MSM_SUBMIT_BO_WRITE 0x0002
Christopher Ferrisd842e432019-03-07 10:21:59 -0800117#define MSM_SUBMIT_BO_DUMP 0x0004
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000118#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
119#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE | MSM_SUBMIT_BO_DUMP | MSM_SUBMIT_BO_NO_IMPLICIT)
Christopher Ferris38062f92014-07-09 15:33:25 -0700120struct drm_msm_gem_submit_bo {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800121 __u32 flags;
122 __u32 handle;
123 __u64 presumed;
Christopher Ferris38062f92014-07-09 15:33:25 -0700124};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800125#define MSM_SUBMIT_NO_IMPLICIT 0x80000000
126#define MSM_SUBMIT_FENCE_FD_IN 0x40000000
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800127#define MSM_SUBMIT_FENCE_FD_OUT 0x20000000
Christopher Ferris76a1d452018-06-27 14:12:29 -0700128#define MSM_SUBMIT_SUDO 0x10000000
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700129#define MSM_SUBMIT_SYNCOBJ_IN 0x08000000
130#define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000
Christopher Ferris10a76e62022-06-08 13:31:52 -0700131#define MSM_SUBMIT_FENCE_SN_IN 0x02000000
132#define MSM_SUBMIT_FLAGS (MSM_SUBMIT_NO_IMPLICIT | MSM_SUBMIT_FENCE_FD_IN | MSM_SUBMIT_FENCE_FD_OUT | MSM_SUBMIT_SUDO | MSM_SUBMIT_SYNCOBJ_IN | MSM_SUBMIT_SYNCOBJ_OUT | MSM_SUBMIT_FENCE_SN_IN | 0)
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700133#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001
134#define MSM_SUBMIT_SYNCOBJ_FLAGS (MSM_SUBMIT_SYNCOBJ_RESET | 0)
135struct drm_msm_gem_submit_syncobj {
136 __u32 handle;
137 __u32 flags;
138 __u64 point;
139};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800140struct drm_msm_gem_submit {
141 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800142 __u32 fence;
143 __u32 nr_bos;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800144 __u32 nr_cmds;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800145 __u64 bos;
146 __u64 cmds;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800147 __s32 fence_fd;
Christopher Ferris934ec942018-01-31 15:29:16 -0800148 __u32 queueid;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700149 __u64 in_syncobjs;
150 __u64 out_syncobjs;
151 __u32 nr_in_syncobjs;
152 __u32 nr_out_syncobjs;
153 __u32 syncobj_stride;
154 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -0700155};
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700156#define MSM_WAIT_FENCE_BOOST 0x00000001
157#define MSM_WAIT_FENCE_FLAGS (MSM_WAIT_FENCE_BOOST | 0)
Christopher Ferris38062f92014-07-09 15:33:25 -0700158struct drm_msm_wait_fence {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800159 __u32 fence;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700160 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800161 struct drm_msm_timespec timeout;
Christopher Ferris934ec942018-01-31 15:29:16 -0800162 __u32 queueid;
Christopher Ferris38062f92014-07-09 15:33:25 -0700163};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800164#define MSM_MADV_WILLNEED 0
165#define MSM_MADV_DONTNEED 1
166#define __MSM_MADV_PURGED 2
167struct drm_msm_gem_madvise {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800168 __u32 handle;
169 __u32 madv;
170 __u32 retained;
171};
Christopher Ferris934ec942018-01-31 15:29:16 -0800172#define MSM_SUBMITQUEUE_FLAGS (0)
173struct drm_msm_submitqueue {
174 __u32 flags;
175 __u32 prio;
176 __u32 id;
177};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700178#define MSM_SUBMITQUEUE_PARAM_FAULTS 0
179struct drm_msm_submitqueue_query {
180 __u64 data;
181 __u32 id;
182 __u32 param;
183 __u32 len;
184 __u32 pad;
185};
Christopher Ferris38062f92014-07-09 15:33:25 -0700186#define DRM_MSM_GET_PARAM 0x00
Christopher Ferris10a76e62022-06-08 13:31:52 -0700187#define DRM_MSM_SET_PARAM 0x01
Christopher Ferris38062f92014-07-09 15:33:25 -0700188#define DRM_MSM_GEM_NEW 0x02
189#define DRM_MSM_GEM_INFO 0x03
Christopher Ferris38062f92014-07-09 15:33:25 -0700190#define DRM_MSM_GEM_CPU_PREP 0x04
191#define DRM_MSM_GEM_CPU_FINI 0x05
192#define DRM_MSM_GEM_SUBMIT 0x06
193#define DRM_MSM_WAIT_FENCE 0x07
Christopher Ferris49f525c2016-12-12 14:55:36 -0800194#define DRM_MSM_GEM_MADVISE 0x08
Christopher Ferris934ec942018-01-31 15:29:16 -0800195#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
196#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700197#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C
Christopher Ferris38062f92014-07-09 15:33:25 -0700198#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700199#define DRM_IOCTL_MSM_SET_PARAM DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SET_PARAM, struct drm_msm_param)
Christopher Ferris38062f92014-07-09 15:33:25 -0700200#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
201#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800202#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
Tao Baod7db5942015-01-28 10:07:51 -0800203#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
Christopher Ferris38062f92014-07-09 15:33:25 -0700204#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
Tao Baod7db5942015-01-28 10:07:51 -0800205#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800206#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
Christopher Ferris934ec942018-01-31 15:29:16 -0800207#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
208#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700209#define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800210#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -0800211}
Christopher Ferris38062f92014-07-09 15:33:25 -0700212#endif
Christopher Ferris106b3a82016-08-24 12:15:38 -0700213#endif