blob: 9e7ee923fdf17f4944232147ea7fee5fc2dd95b4 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _DRM_MODE_H
20#define _DRM_MODE_H
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include "drm.h"
22#ifdef __cplusplus
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#endif
24#define DRM_DISPLAY_INFO_LEN 32
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define DRM_CONNECTOR_NAME_LEN 32
26#define DRM_DISPLAY_MODE_LEN 32
27#define DRM_PROP_NAME_LEN 32
Tao Baod7db5942015-01-28 10:07:51 -080028#define DRM_MODE_TYPE_BUILTIN (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -080029#define DRM_MODE_TYPE_CLOCK_C ((1 << 1) | DRM_MODE_TYPE_BUILTIN)
30#define DRM_MODE_TYPE_CRTC_C ((1 << 2) | DRM_MODE_TYPE_BUILTIN)
31#define DRM_MODE_TYPE_PREFERRED (1 << 3)
32#define DRM_MODE_TYPE_DEFAULT (1 << 4)
Tao Baod7db5942015-01-28 10:07:51 -080033#define DRM_MODE_TYPE_USERDEF (1 << 5)
34#define DRM_MODE_TYPE_DRIVER (1 << 6)
35#define DRM_MODE_FLAG_PHSYNC (1 << 0)
36#define DRM_MODE_FLAG_NHSYNC (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -080037#define DRM_MODE_FLAG_PVSYNC (1 << 2)
38#define DRM_MODE_FLAG_NVSYNC (1 << 3)
39#define DRM_MODE_FLAG_INTERLACE (1 << 4)
40#define DRM_MODE_FLAG_DBLSCAN (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -080041#define DRM_MODE_FLAG_CSYNC (1 << 6)
42#define DRM_MODE_FLAG_PCSYNC (1 << 7)
43#define DRM_MODE_FLAG_NCSYNC (1 << 8)
44#define DRM_MODE_FLAG_HSKEW (1 << 9)
Tao Baod7db5942015-01-28 10:07:51 -080045#define DRM_MODE_FLAG_BCAST (1 << 10)
46#define DRM_MODE_FLAG_PIXMUX (1 << 11)
47#define DRM_MODE_FLAG_DBLCLK (1 << 12)
48#define DRM_MODE_FLAG_CLKDIV2 (1 << 13)
Tao Baod7db5942015-01-28 10:07:51 -080049#define DRM_MODE_FLAG_3D_MASK (0x1f << 14)
50#define DRM_MODE_FLAG_3D_NONE (0 << 14)
51#define DRM_MODE_FLAG_3D_FRAME_PACKING (1 << 14)
52#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2 << 14)
Tao Baod7db5942015-01-28 10:07:51 -080053#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3 << 14)
54#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4 << 14)
55#define DRM_MODE_FLAG_3D_L_DEPTH (5 << 14)
56#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6 << 14)
Tao Baod7db5942015-01-28 10:07:51 -080057#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7 << 14)
58#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8 << 14)
Christopher Ferris82d75042015-01-26 10:57:07 -080059#define DRM_MODE_PICTURE_ASPECT_NONE 0
60#define DRM_MODE_PICTURE_ASPECT_4_3 1
Christopher Ferris82d75042015-01-26 10:57:07 -080061#define DRM_MODE_PICTURE_ASPECT_16_9 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -080062#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F << 19)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080063#define DRM_MODE_FLAG_PIC_AR_NONE (DRM_MODE_PICTURE_ASPECT_NONE << 19)
64#define DRM_MODE_FLAG_PIC_AR_4_3 (DRM_MODE_PICTURE_ASPECT_4_3 << 19)
65#define DRM_MODE_FLAG_PIC_AR_16_9 (DRM_MODE_PICTURE_ASPECT_16_9 << 19)
66#define DRM_MODE_DPMS_ON 0
Christopher Ferris48af7cb2017-02-21 12:35:09 -080067#define DRM_MODE_DPMS_STANDBY 1
68#define DRM_MODE_DPMS_SUSPEND 2
69#define DRM_MODE_DPMS_OFF 3
70#define DRM_MODE_SCALE_NONE 0
Christopher Ferris48af7cb2017-02-21 12:35:09 -080071#define DRM_MODE_SCALE_FULLSCREEN 1
72#define DRM_MODE_SCALE_CENTER 2
73#define DRM_MODE_SCALE_ASPECT 3
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define DRM_MODE_DITHERING_OFF 0
75#define DRM_MODE_DITHERING_ON 1
76#define DRM_MODE_DITHERING_AUTO 2
77#define DRM_MODE_DIRTY_OFF 0
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define DRM_MODE_DIRTY_ON 1
79#define DRM_MODE_DIRTY_ANNOTATE 2
Christopher Ferris525ce912017-07-26 13:12:53 -070080#define DRM_MODE_LINK_STATUS_GOOD 0
81#define DRM_MODE_LINK_STATUS_BAD 1
Ben Cheng655a7c02013-10-16 16:09:24 -070082struct drm_mode_modeinfo {
Tao Baod7db5942015-01-28 10:07:51 -080083 __u32 clock;
Christopher Ferris05d08e92016-02-04 13:16:38 -080084 __u16 hdisplay;
85 __u16 hsync_start;
86 __u16 hsync_end;
Christopher Ferris05d08e92016-02-04 13:16:38 -080087 __u16 htotal;
88 __u16 hskew;
89 __u16 vdisplay;
90 __u16 vsync_start;
Christopher Ferris05d08e92016-02-04 13:16:38 -080091 __u16 vsync_end;
92 __u16 vtotal;
93 __u16 vscan;
Tao Baod7db5942015-01-28 10:07:51 -080094 __u32 vrefresh;
Tao Baod7db5942015-01-28 10:07:51 -080095 __u32 flags;
96 __u32 type;
97 char name[DRM_DISPLAY_MODE_LEN];
Ben Cheng655a7c02013-10-16 16:09:24 -070098};
99struct drm_mode_card_res {
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u64 fb_id_ptr;
101 __u64 crtc_id_ptr;
102 __u64 connector_id_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800103 __u64 encoder_id_ptr;
104 __u32 count_fbs;
105 __u32 count_crtcs;
106 __u32 count_connectors;
Tao Baod7db5942015-01-28 10:07:51 -0800107 __u32 count_encoders;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800108 __u32 min_width;
109 __u32 max_width;
110 __u32 min_height;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 __u32 max_height;
112};
Ben Cheng655a7c02013-10-16 16:09:24 -0700113struct drm_mode_crtc {
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u64 set_connectors_ptr;
115 __u32 count_connectors;
116 __u32 crtc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800117 __u32 fb_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118 __u32 x;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119 __u32 y;
Tao Baod7db5942015-01-28 10:07:51 -0800120 __u32 gamma_size;
121 __u32 mode_valid;
Tao Baod7db5942015-01-28 10:07:51 -0800122 struct drm_mode_modeinfo mode;
Ben Cheng655a7c02013-10-16 16:09:24 -0700123};
Tao Baod7db5942015-01-28 10:07:51 -0800124#define DRM_MODE_PRESENT_TOP_FIELD (1 << 0)
125#define DRM_MODE_PRESENT_BOTTOM_FIELD (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700126struct drm_mode_set_plane {
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u32 plane_id;
128 __u32 crtc_id;
129 __u32 fb_id;
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800131 __s32 crtc_x;
132 __s32 crtc_y;
133 __u32 crtc_w;
134 __u32 crtc_h;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800135 __u32 src_x;
136 __u32 src_y;
137 __u32 src_h;
138 __u32 src_w;
Ben Cheng655a7c02013-10-16 16:09:24 -0700139};
140struct drm_mode_get_plane {
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u32 plane_id;
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 crtc_id;
143 __u32 fb_id;
144 __u32 possible_crtcs;
145 __u32 gamma_size;
Tao Baod7db5942015-01-28 10:07:51 -0800146 __u32 count_format_types;
147 __u64 format_type_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700148};
149struct drm_mode_get_plane_res {
Tao Baod7db5942015-01-28 10:07:51 -0800150 __u64 plane_id_ptr;
151 __u32 count_planes;
Ben Cheng655a7c02013-10-16 16:09:24 -0700152};
153#define DRM_MODE_ENCODER_NONE 0
154#define DRM_MODE_ENCODER_DAC 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define DRM_MODE_ENCODER_TMDS 2
156#define DRM_MODE_ENCODER_LVDS 3
157#define DRM_MODE_ENCODER_TVDAC 4
158#define DRM_MODE_ENCODER_VIRTUAL 5
Christopher Ferris38062f92014-07-09 15:33:25 -0700159#define DRM_MODE_ENCODER_DSI 6
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700160#define DRM_MODE_ENCODER_DPMST 7
Christopher Ferris106b3a82016-08-24 12:15:38 -0700161#define DRM_MODE_ENCODER_DPI 8
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700162struct drm_mode_get_encoder {
Tao Baod7db5942015-01-28 10:07:51 -0800163 __u32 encoder_id;
164 __u32 encoder_type;
165 __u32 crtc_id;
166 __u32 possible_crtcs;
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u32 possible_clones;
Ben Cheng655a7c02013-10-16 16:09:24 -0700168};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800169enum drm_mode_subconnector {
170 DRM_MODE_SUBCONNECTOR_Automatic = 0,
171 DRM_MODE_SUBCONNECTOR_Unknown = 0,
172 DRM_MODE_SUBCONNECTOR_DVID = 3,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800173 DRM_MODE_SUBCONNECTOR_DVIA = 4,
174 DRM_MODE_SUBCONNECTOR_Composite = 5,
175 DRM_MODE_SUBCONNECTOR_SVIDEO = 6,
176 DRM_MODE_SUBCONNECTOR_Component = 8,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800177 DRM_MODE_SUBCONNECTOR_SCART = 9,
178};
Ben Cheng655a7c02013-10-16 16:09:24 -0700179#define DRM_MODE_CONNECTOR_Unknown 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700180#define DRM_MODE_CONNECTOR_VGA 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700181#define DRM_MODE_CONNECTOR_DVII 2
182#define DRM_MODE_CONNECTOR_DVID 3
183#define DRM_MODE_CONNECTOR_DVIA 4
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700184#define DRM_MODE_CONNECTOR_Composite 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700185#define DRM_MODE_CONNECTOR_SVIDEO 6
186#define DRM_MODE_CONNECTOR_LVDS 7
187#define DRM_MODE_CONNECTOR_Component 8
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700188#define DRM_MODE_CONNECTOR_9PinDIN 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700189#define DRM_MODE_CONNECTOR_DisplayPort 10
190#define DRM_MODE_CONNECTOR_HDMIA 11
191#define DRM_MODE_CONNECTOR_HDMIB 12
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700192#define DRM_MODE_CONNECTOR_TV 13
Ben Cheng655a7c02013-10-16 16:09:24 -0700193#define DRM_MODE_CONNECTOR_eDP 14
194#define DRM_MODE_CONNECTOR_VIRTUAL 15
Christopher Ferris38062f92014-07-09 15:33:25 -0700195#define DRM_MODE_CONNECTOR_DSI 16
Christopher Ferris106b3a82016-08-24 12:15:38 -0700196#define DRM_MODE_CONNECTOR_DPI 17
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700197struct drm_mode_get_connector {
Tao Baod7db5942015-01-28 10:07:51 -0800198 __u64 encoders_ptr;
199 __u64 modes_ptr;
200 __u64 props_ptr;
201 __u64 prop_values_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800202 __u32 count_modes;
203 __u32 count_props;
204 __u32 count_encoders;
205 __u32 encoder_id;
Tao Baod7db5942015-01-28 10:07:51 -0800206 __u32 connector_id;
207 __u32 connector_type;
208 __u32 connector_type_id;
209 __u32 connection;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800210 __u32 mm_width;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800211 __u32 mm_height;
Tao Baod7db5942015-01-28 10:07:51 -0800212 __u32 subpixel;
213 __u32 pad;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700214};
Tao Baod7db5942015-01-28 10:07:51 -0800215#define DRM_MODE_PROP_PENDING (1 << 0)
216#define DRM_MODE_PROP_RANGE (1 << 1)
217#define DRM_MODE_PROP_IMMUTABLE (1 << 2)
218#define DRM_MODE_PROP_ENUM (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -0800219#define DRM_MODE_PROP_BLOB (1 << 4)
220#define DRM_MODE_PROP_BITMASK (1 << 5)
221#define DRM_MODE_PROP_LEGACY_TYPE (DRM_MODE_PROP_RANGE | DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BLOB | DRM_MODE_PROP_BITMASK)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700222#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0
223#define DRM_MODE_PROP_TYPE(n) ((n) << 6)
224#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
225#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800226#define DRM_MODE_PROP_ATOMIC 0x80000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800227struct drm_mode_property_enum {
Tao Baod7db5942015-01-28 10:07:51 -0800228 __u64 value;
229 char name[DRM_PROP_NAME_LEN];
Ben Cheng655a7c02013-10-16 16:09:24 -0700230};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800231struct drm_mode_get_property {
Tao Baod7db5942015-01-28 10:07:51 -0800232 __u64 values_ptr;
233 __u64 enum_blob_ptr;
234 __u32 prop_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800235 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800236 char name[DRM_PROP_NAME_LEN];
237 __u32 count_values;
238 __u32 count_enum_blobs;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800239};
Ben Cheng655a7c02013-10-16 16:09:24 -0700240struct drm_mode_connector_set_property {
Tao Baod7db5942015-01-28 10:07:51 -0800241 __u64 value;
242 __u32 prop_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800243 __u32 connector_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700244};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700245#define DRM_MODE_OBJECT_CRTC 0xcccccccc
246#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700247#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
248#define DRM_MODE_OBJECT_MODE 0xdededede
249#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
250#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
Christopher Ferris106b3a82016-08-24 12:15:38 -0700251#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
252#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
253#define DRM_MODE_OBJECT_ANY 0
254struct drm_mode_obj_get_properties {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700255 __u64 props_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800256 __u64 prop_values_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800257 __u32 count_props;
258 __u32 obj_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700259 __u32 obj_type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800260};
Ben Cheng655a7c02013-10-16 16:09:24 -0700261struct drm_mode_obj_set_property {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __u64 value;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700263 __u32 prop_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800264 __u32 obj_id;
Tao Baod7db5942015-01-28 10:07:51 -0800265 __u32 obj_type;
Christopher Ferris38062f92014-07-09 15:33:25 -0700266};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700267struct drm_mode_get_blob {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800268 __u32 blob_id;
Tao Baod7db5942015-01-28 10:07:51 -0800269 __u32 length;
270 __u64 data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700271};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800272struct drm_mode_fb_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800273 __u32 fb_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800274 __u32 width;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700275 __u32 height;
Tao Baod7db5942015-01-28 10:07:51 -0800276 __u32 pitch;
277 __u32 bpp;
Tao Baod7db5942015-01-28 10:07:51 -0800278 __u32 depth;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700279 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700280};
Tao Baod7db5942015-01-28 10:07:51 -0800281#define DRM_MODE_FB_INTERLACED (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800282#define DRM_MODE_FB_MODIFIERS (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700283struct drm_mode_fb_cmd2 {
Tao Baod7db5942015-01-28 10:07:51 -0800284 __u32 fb_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800285 __u32 width;
286 __u32 height;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700287 __u32 pixel_format;
Tao Baod7db5942015-01-28 10:07:51 -0800288 __u32 flags;
289 __u32 handles[4];
290 __u32 pitches[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700291 __u32 offsets[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800292 __u64 modifier[4];
Ben Cheng655a7c02013-10-16 16:09:24 -0700293};
Christopher Ferris38062f92014-07-09 15:33:25 -0700294#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
Christopher Ferris106b3a82016-08-24 12:15:38 -0700295#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
Christopher Ferris05d08e92016-02-04 13:16:38 -0800296#define DRM_MODE_FB_DIRTY_FLAGS 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700297#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
Christopher Ferris38062f92014-07-09 15:33:25 -0700298struct drm_mode_fb_dirty_cmd {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700299 __u32 fb_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800300 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800301 __u32 color;
302 __u32 num_clips;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700303 __u64 clips_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800304};
Ben Cheng655a7c02013-10-16 16:09:24 -0700305struct drm_mode_mode_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800306 __u32 connector_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700307 struct drm_mode_modeinfo mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800308};
Ben Cheng655a7c02013-10-16 16:09:24 -0700309#define DRM_MODE_CURSOR_BO 0x01
Christopher Ferris38062f92014-07-09 15:33:25 -0700310#define DRM_MODE_CURSOR_MOVE 0x02
Christopher Ferris106b3a82016-08-24 12:15:38 -0700311#define DRM_MODE_CURSOR_FLAGS 0x03
Christopher Ferris05d08e92016-02-04 13:16:38 -0800312struct drm_mode_cursor {
Tao Baod7db5942015-01-28 10:07:51 -0800313 __u32 flags;
314 __u32 crtc_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700315 __s32 x;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800316 __s32 y;
Tao Baod7db5942015-01-28 10:07:51 -0800317 __u32 width;
318 __u32 height;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700319 __u32 handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800320};
Christopher Ferris38062f92014-07-09 15:33:25 -0700321struct drm_mode_cursor2 {
Tao Baod7db5942015-01-28 10:07:51 -0800322 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700323 __u32 crtc_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800324 __s32 x;
Tao Baod7db5942015-01-28 10:07:51 -0800325 __s32 y;
326 __u32 width;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700327 __u32 height;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800328 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800329 __s32 hot_x;
330 __s32 hot_y;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700331};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800332struct drm_mode_crtc_lut {
Tao Baod7db5942015-01-28 10:07:51 -0800333 __u32 crtc_id;
334 __u32 gamma_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700335 __u64 red;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800336 __u64 green;
Tao Baod7db5942015-01-28 10:07:51 -0800337 __u64 blue;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800338};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700339struct drm_color_ctm {
340 __s64 matrix[9];
341};
342struct drm_color_lut {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700343 __u16 red;
344 __u16 green;
345 __u16 blue;
346 __u16 reserved;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700347};
348#define DRM_MODE_PAGE_FLIP_EVENT 0x01
Christopher Ferris05d08e92016-02-04 13:16:38 -0800349#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800350#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800351#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
352#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
353#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_PAGE_FLIP_TARGET)
Christopher Ferris38062f92014-07-09 15:33:25 -0700354struct drm_mode_crtc_page_flip {
Tao Baod7db5942015-01-28 10:07:51 -0800355 __u32 crtc_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800356 __u32 fb_id;
Tao Baod7db5942015-01-28 10:07:51 -0800357 __u32 flags;
358 __u32 reserved;
359 __u64 user_data;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800360};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800361struct drm_mode_crtc_page_flip_target {
362 __u32 crtc_id;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800363 __u32 fb_id;
364 __u32 flags;
365 __u32 sequence;
366 __u64 user_data;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800367};
Ben Cheng655a7c02013-10-16 16:09:24 -0700368struct drm_mode_create_dumb {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700369 __u32 height;
370 __u32 width;
371 __u32 bpp;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800372 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700373 __u32 handle;
374 __u32 pitch;
375 __u64 size;
376};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700377struct drm_mode_map_dumb {
378 __u32 handle;
379 __u32 pad;
380 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700381};
382struct drm_mode_destroy_dumb {
383 __u32 handle;
384};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700385#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
386#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
387#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
388#define DRM_MODE_ATOMIC_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_ATOMIC_ALLOW_MODESET)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700389struct drm_mode_atomic {
390 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800391 __u32 count_objs;
392 __u64 objs_ptr;
393 __u64 count_props_ptr;
394 __u64 props_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800395 __u64 prop_values_ptr;
396 __u64 reserved;
397 __u64 user_data;
398};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800399struct drm_mode_create_blob {
400 __u64 data;
401 __u32 length;
402 __u32 blob_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700403};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800404struct drm_mode_destroy_blob {
405 __u32 blob_id;
406};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700407#ifdef __cplusplus
408#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700409#endif