msm_drm.h revision 49f525c47bd383cd6a87db8f067cddb3ab620d17
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__
21106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#include "drm.h"
22106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#ifdef __cplusplus
2338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#endif
2538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_NONE 0x00
2638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_2D0 0x01
2738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PIPE_2D1 0x02
2838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define MSM_PIPE_3D0 0x10
3038062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_timespec {
3105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __s64 tv_sec;
3205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __s64 tv_nsec;
3338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris};
3538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PARAM_GPU_ID 0x01
3638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PARAM_GMEM_SIZE 0x02
37ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_PARAM_CHIP_ID 0x03
3838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define MSM_PARAM_MAX_FREQ 0x04
40106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#define MSM_PARAM_TIMESTAMP 0x05
41106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferrisstruct drm_msm_param {
4205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pipe;
43106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
4405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 param;
4505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 value;
4638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
47ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_BO_SCANOUT 0x00000001
48106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
4938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_GPU_READONLY 0x00000002
5038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_CACHE_MASK 0x000f0000
5138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_CACHED 0x00010000
52ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_BO_WC 0x00020000
53106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_BO_UNCACHED 0x00040000
55d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define MSM_BO_FLAGS (MSM_BO_SCANOUT | MSM_BO_GPU_READONLY | MSM_BO_CACHED | MSM_BO_WC | MSM_BO_UNCACHED)
5638062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_new {
5705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 size;
58106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 flags;
6005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
6138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
6238062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_info {
63106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
6505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pad;
6605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 offset;
6738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
68106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PREP_READ 0x01
7038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PREP_WRITE 0x02
7138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_PREP_NOSYNC 0x04
72ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
73106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_cpu_prep {
7505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
7605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 op;
77d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  struct drm_msm_timespec timeout;
78106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
8038062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_cpu_fini {
8105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
8238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
83106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit_reloc {
8505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 submit_offset;
8605d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 or;
8705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __s32 shift;
88106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 reloc_idx;
9005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 reloc_offset;
9138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
9238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_CMD_BUF 0x0001
93106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
9538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
9638062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit_cmd {
9705d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 type;
98106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 submit_idx;
10005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 submit_offset;
10105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 size;
10205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pad;
103106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
10405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 nr_relocs;
10505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 __user relocs;
10638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
10738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_BO_READ 0x0001
108106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
10938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MSM_SUBMIT_BO_WRITE 0x0002
110ba8d4f460b51161eb82cf1006cb34a3cc1389f47Christopher Ferris#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
11138062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit_bo {
11205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 flags;
113106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
11405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 handle;
11505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 presumed;
11638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
11738062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_gem_submit {
118106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
11905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pipe;
12005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 fence;
12105d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 nr_bos;
12205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 nr_cmds;
123106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
12405d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 __user bos;
12505d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u64 __user cmds;
12638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
12738062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct drm_msm_wait_fence {
128106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
12905d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 fence;
13005d08e9716b5974d6ed08973f44930804890b902Christopher Ferris  __u32 pad;
131d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  struct drm_msm_timespec timeout;
13238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
133106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
13449f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define MSM_MADV_WILLNEED 0
13549f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define MSM_MADV_DONTNEED 1
13649f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define __MSM_MADV_PURGED 2
13749f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferrisstruct drm_msm_gem_madvise {
13849f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
13949f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris  __u32 handle;
14049f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris  __u32 madv;
14149f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris  __u32 retained;
14249f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris};
14349f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
14438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GET_PARAM 0x00
14538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_NEW 0x02
14638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_INFO 0x03
14738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_CPU_PREP 0x04
148106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
14938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_CPU_FINI 0x05
15038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_GEM_SUBMIT 0x06
15138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_MSM_WAIT_FENCE 0x07
15249f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define DRM_MSM_GEM_MADVISE 0x08
153106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
15449f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define DRM_MSM_NUM_IOCTLS 0x09
15538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
15638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
15738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
158106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
15949f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
160d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
16138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
162d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
16338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
16449f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
16549f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#ifdef __cplusplus
16638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#endif
167106b3a8a7dc03c19a45e322de425ac56aafac358Christopher Ferris#endif
16849f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169