msm_drm.h revision 05d08e9716b5974d6ed08973f44930804890b902
138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/****************************************************************************
238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ****************************************************************************
338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   This header was automatically generated from a Linux kernel header
538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   of the same name, to make information necessary for userspace to
638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   call into the kernel available to libc.  It contains only constants,
738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   structures, and macros generated from the original header, and thus,
838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   contains no copyrightable information.
938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
1038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   To edit the content of this header, modify the corresponding
1138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   source file (e.g. under external/kernel-headers/original/) then
1238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   run bionic/libc/kernel/tools/update_all.py
1338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
1438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   Any manual change here will be lost the next time this script will
1538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   be run. You've been warned!
1638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
1738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ****************************************************************************
1838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ****************************************************************************/
1938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#ifndef __MSM_DRM_H__
2038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define __MSM_DRM_H__
2138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#include <stddef.h>
2238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#include <drm/drm.h>
2338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
2438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_NONE 0x00
2538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_2D0 0x01
2638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_2D1 0x02
2738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_3D0 0x10
2838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
2938062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_timespec {
3005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __s64 tv_sec;
3105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __s64 tv_nsec;
3238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
3338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
3438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PARAM_GPU_ID 0x01
3538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PARAM_GMEM_SIZE 0x02
36ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_PARAM_CHIP_ID 0x03
3738062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_param {
3838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
3905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pipe;
4005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 param;
4105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 value;
4238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
4338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_BO_SCANOUT 0x00000001
4538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_GPU_READONLY 0x00000002
4638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_CACHE_MASK 0x000f0000
4738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_CACHED 0x00010000
4838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_BO_WC 0x00020000
5038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_UNCACHED 0x00040000
51d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define MSM_BO_FLAGS (MSM_BO_SCANOUT | MSM_BO_GPU_READONLY | MSM_BO_CACHED | MSM_BO_WC | MSM_BO_UNCACHED)
5238062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_new {
53ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 size;
5505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 flags;
5605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
5738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
58ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5938062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_info {
6005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
6105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pad;
6205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 offset;
63ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
6538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PREP_READ 0x01
6638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PREP_WRITE 0x02
6738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PREP_NOSYNC 0x04
68ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
7038062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_cpu_prep {
7105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
7205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 op;
73ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  struct drm_msm_timespec timeout;
7538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
7638062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_cpu_fini {
7705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
78ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
8038062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit_reloc {
8105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 submit_offset;
8205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 or;
83ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __s32 shift;
8505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 reloc_idx;
8605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 reloc_offset;
8738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
88ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_CMD_BUF 0x0001
9038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
9138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
9238062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit_cmd {
93ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 type;
9505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 submit_idx;
9605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 submit_offset;
9705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 size;
98ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pad;
10005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 nr_relocs;
10105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 __user relocs;
10238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
103ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
10438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_BO_READ 0x0001
10538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_BO_WRITE 0x0002
106ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
10738062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit_bo {
10838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
10905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 flags;
11005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
11105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 presumed;
11238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
11338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
11438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit {
11505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pipe;
11605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 fence;
11705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 nr_bos;
11838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
11905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 nr_cmds;
12005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 __user bos;
12105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 __user cmds;
12238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
12338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
12438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_wait_fence {
12505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 fence;
12605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pad;
127d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  struct drm_msm_timespec timeout;
12838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
12938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
13038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GET_PARAM 0x00
13138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_NEW 0x02
13238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_INFO 0x03
13338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
13438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_CPU_PREP 0x04
13538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_CPU_FINI 0x05
13638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_SUBMIT 0x06
13738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_WAIT_FENCE 0x07
13838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
13938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_NUM_IOCTLS 0x08
14038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
14138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
14238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
14338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
145d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
14638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
147d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
14838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
14938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#endif
150