1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#ifndef _DRM_MODE_H
28#define _DRM_MODE_H
29
30#define DRM_DISPLAY_INFO_LEN 32
31#define DRM_CONNECTOR_NAME_LEN 32
32#define DRM_DISPLAY_MODE_LEN 32
33#define DRM_PROP_NAME_LEN 32
34
35#define DRM_MODE_TYPE_BUILTIN (1<<0)
36#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN)
37#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN)
38#define DRM_MODE_TYPE_PREFERRED (1<<3)
39#define DRM_MODE_TYPE_DEFAULT (1<<4)
40#define DRM_MODE_TYPE_USERDEF (1<<5)
41#define DRM_MODE_TYPE_DRIVER (1<<6)
42
43
44
45#define DRM_MODE_FLAG_PHSYNC (1<<0)
46#define DRM_MODE_FLAG_NHSYNC (1<<1)
47#define DRM_MODE_FLAG_PVSYNC (1<<2)
48#define DRM_MODE_FLAG_NVSYNC (1<<3)
49#define DRM_MODE_FLAG_INTERLACE (1<<4)
50#define DRM_MODE_FLAG_DBLSCAN (1<<5)
51#define DRM_MODE_FLAG_CSYNC (1<<6)
52#define DRM_MODE_FLAG_PCSYNC (1<<7)
53#define DRM_MODE_FLAG_NCSYNC (1<<8)
54#define DRM_MODE_FLAG_HSKEW (1<<9)
55#define DRM_MODE_FLAG_BCAST (1<<10)
56#define DRM_MODE_FLAG_PIXMUX (1<<11)
57#define DRM_MODE_FLAG_DBLCLK (1<<12)
58#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
59
60
61
62#define DRM_MODE_DPMS_ON 0
63#define DRM_MODE_DPMS_STANDBY 1
64#define DRM_MODE_DPMS_SUSPEND 2
65#define DRM_MODE_DPMS_OFF 3
66
67
68#define DRM_MODE_SCALE_NONE 0
69
70#define DRM_MODE_SCALE_FULLSCREEN 1
71#define DRM_MODE_SCALE_CENTER 2
72#define DRM_MODE_SCALE_ASPECT 3
73
74
75#define DRM_MODE_DITHERING_OFF 0
76#define DRM_MODE_DITHERING_ON 1
77
78
79#define DRM_MODE_DIRTY_OFF 0
80#define DRM_MODE_DIRTY_ON 1
81#define DRM_MODE_DIRTY_ANNOTATE 2
82
83struct drm_mode_modeinfo {
84 __u32 clock;
85 __u16 hdisplay, hsync_start, hsync_end, htotal, hskew;
86 __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan;
87
88 __u32 vrefresh;
89
90 __u32 flags;
91 __u32 type;
92 char name[DRM_DISPLAY_MODE_LEN];
93};
94
95struct drm_mode_card_res {
96 __u64 fb_id_ptr;
97 __u64 crtc_id_ptr;
98 __u64 connector_id_ptr;
99 __u64 encoder_id_ptr;
100 __u32 count_fbs;
101 __u32 count_crtcs;
102 __u32 count_connectors;
103 __u32 count_encoders;
104 __u32 min_width, max_width;
105 __u32 min_height, max_height;
106};
107
108struct drm_mode_crtc {
109 __u64 set_connectors_ptr;
110 __u32 count_connectors;
111
112 __u32 crtc_id;
113 __u32 fb_id;
114
115 __u32 x, y;
116
117 __u32 gamma_size;
118 __u32 mode_valid;
119 struct drm_mode_modeinfo mode;
120};
121
122#define DRM_MODE_ENCODER_NONE 0
123#define DRM_MODE_ENCODER_DAC 1
124#define DRM_MODE_ENCODER_TMDS 2
125#define DRM_MODE_ENCODER_LVDS 3
126#define DRM_MODE_ENCODER_TVDAC 4
127
128struct drm_mode_get_encoder {
129 __u32 encoder_id;
130 __u32 encoder_type;
131
132 __u32 crtc_id;
133
134 __u32 possible_crtcs;
135 __u32 possible_clones;
136};
137
138
139
140#define DRM_MODE_SUBCONNECTOR_Automatic 0
141#define DRM_MODE_SUBCONNECTOR_Unknown 0
142#define DRM_MODE_SUBCONNECTOR_DVID 3
143#define DRM_MODE_SUBCONNECTOR_DVIA 4
144#define DRM_MODE_SUBCONNECTOR_Composite 5
145#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
146#define DRM_MODE_SUBCONNECTOR_Component 8
147#define DRM_MODE_SUBCONNECTOR_SCART 9
148
149#define DRM_MODE_CONNECTOR_Unknown 0
150#define DRM_MODE_CONNECTOR_VGA 1
151#define DRM_MODE_CONNECTOR_DVII 2
152#define DRM_MODE_CONNECTOR_DVID 3
153#define DRM_MODE_CONNECTOR_DVIA 4
154#define DRM_MODE_CONNECTOR_Composite 5
155#define DRM_MODE_CONNECTOR_SVIDEO 6
156#define DRM_MODE_CONNECTOR_LVDS 7
157#define DRM_MODE_CONNECTOR_Component 8
158#define DRM_MODE_CONNECTOR_9PinDIN 9
159#define DRM_MODE_CONNECTOR_DisplayPort 10
160#define DRM_MODE_CONNECTOR_HDMIA 11
161#define DRM_MODE_CONNECTOR_HDMIB 12
162#define DRM_MODE_CONNECTOR_TV 13
163#define DRM_MODE_CONNECTOR_eDP 14
164
165struct drm_mode_get_connector {
166
167 __u64 encoders_ptr;
168 __u64 modes_ptr;
169 __u64 props_ptr;
170 __u64 prop_values_ptr;
171
172 __u32 count_modes;
173 __u32 count_props;
174 __u32 count_encoders;
175
176 __u32 encoder_id;
177 __u32 connector_id;
178 __u32 connector_type;
179 __u32 connector_type_id;
180
181 __u32 connection;
182 __u32 mm_width, mm_height;
183 __u32 subpixel;
184};
185
186#define DRM_MODE_PROP_PENDING (1<<0)
187#define DRM_MODE_PROP_RANGE (1<<1)
188#define DRM_MODE_PROP_IMMUTABLE (1<<2)
189#define DRM_MODE_PROP_ENUM (1<<3)
190#define DRM_MODE_PROP_BLOB (1<<4)
191
192struct drm_mode_property_enum {
193 __u64 value;
194 char name[DRM_PROP_NAME_LEN];
195};
196
197struct drm_mode_get_property {
198 __u64 values_ptr;
199 __u64 enum_blob_ptr;
200
201 __u32 prop_id;
202 __u32 flags;
203 char name[DRM_PROP_NAME_LEN];
204
205 __u32 count_values;
206 __u32 count_enum_blobs;
207};
208
209struct drm_mode_connector_set_property {
210 __u64 value;
211 __u32 prop_id;
212 __u32 connector_id;
213};
214
215struct drm_mode_get_blob {
216 __u32 blob_id;
217 __u32 length;
218 __u64 data;
219};
220
221struct drm_mode_fb_cmd {
222 __u32 fb_id;
223 __u32 width, height;
224 __u32 pitch;
225 __u32 bpp;
226 __u32 depth;
227
228 __u32 handle;
229};
230
231#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
232#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
233#define DRM_MODE_FB_DIRTY_FLAGS 0x03
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262struct drm_mode_fb_dirty_cmd {
263 __u32 fb_id;
264 __u32 flags;
265 __u32 color;
266 __u32 num_clips;
267 __u64 clips_ptr;
268};
269
270struct drm_mode_mode_cmd {
271 __u32 connector_id;
272 struct drm_mode_modeinfo mode;
273};
274
275#define DRM_MODE_CURSOR_BO (1<<0)
276#define DRM_MODE_CURSOR_MOVE (1<<1)
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292struct drm_mode_cursor {
293 __u32 flags;
294 __u32 crtc_id;
295 __s32 x;
296 __s32 y;
297 __u32 width;
298 __u32 height;
299
300 __u32 handle;
301};
302
303struct drm_mode_crtc_lut {
304 __u32 crtc_id;
305 __u32 gamma_size;
306
307
308 __u64 red;
309 __u64 green;
310 __u64 blue;
311};
312
313#define DRM_MODE_PAGE_FLIP_EVENT 0x01
314#define DRM_MODE_PAGE_FLIP_FLAGS DRM_MODE_PAGE_FLIP_EVENT
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338struct drm_mode_crtc_page_flip {
339 __u32 crtc_id;
340 __u32 fb_id;
341 __u32 flags;
342 __u32 reserved;
343 __u64 user_data;
344};
345
346#endif
347