diff options
author | Chris Michael <cp.michael@samsung.com> | 2017-06-09 13:48:55 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2017-06-09 13:48:55 -0400 |
commit | 6e37d13a1c1df29a12b0d15d89aa549d5c01f265 (patch) | |
tree | ccb7e0b30913851294f81ba2b1e94bd722943e60 /src/lib/ecore_drm2/ecore_drm2_private.h | |
parent | 53bfe003513b7b309b1e2f8b29be07c61801a1b7 (diff) |
ecore-drm2: Use static libdrm to build ecore-drm2
As we will now use static_libs/libdrm to build ecore_drm2, we no
longer need to include the copied code from the libdrm headers so
remove all of the copied code from our source files.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_private.h')
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_private.h | 555 |
1 files changed, 6 insertions, 549 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index 1d3300ea11..55b6fef424 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h | |||
@@ -20,6 +20,12 @@ | |||
20 | # include <sys/ioctl.h> | 20 | # include <sys/ioctl.h> |
21 | # include <dlfcn.h> | 21 | # include <dlfcn.h> |
22 | 22 | ||
23 | # include <drm.h> | ||
24 | # include <drm_mode.h> | ||
25 | # include <drm_fourcc.h> | ||
26 | # include <xf86drm.h> | ||
27 | # include <xf86drmMode.h> | ||
28 | |||
23 | #ifndef DRM2_NODEFS | 29 | #ifndef DRM2_NODEFS |
24 | extern int _ecore_drm2_log_dom; | 30 | extern int _ecore_drm2_log_dom; |
25 | extern Eina_Bool _ecore_drm2_use_atomic; | 31 | extern Eina_Bool _ecore_drm2_use_atomic; |
@@ -54,555 +60,6 @@ extern Eina_Bool _ecore_drm2_use_atomic; | |||
54 | # endif | 60 | # endif |
55 | # define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__) | 61 | # define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__) |
56 | #endif | 62 | #endif |
57 | /* The following defines and structures were borrowed from drm.h */ | ||
58 | |||
59 | /** | ||
60 | * \file drm.h | ||
61 | * Header for the Direct Rendering Manager | ||
62 | * | ||
63 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | ||
64 | * | ||
65 | * \par Acknowledgments: | ||
66 | * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg. | ||
67 | */ | ||
68 | |||
69 | /* | ||
70 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | ||
71 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
72 | * All rights reserved. | ||
73 | * | ||
74 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
75 | * copy of this software and associated documentation files (the "Software"), | ||
76 | * to deal in the Software without restriction, including without limitation | ||
77 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
78 | * and/or sell copies of the Software, and to permit persons to whom the | ||
79 | * Software is furnished to do so, subject to the following conditions: | ||
80 | * | ||
81 | * The above copyright notice and this permission notice (including the next | ||
82 | * paragraph) shall be included in all copies or substantial portions of the | ||
83 | * Software. | ||
84 | * | ||
85 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
86 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
87 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
88 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
89 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
90 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
91 | * OTHER DEALINGS IN THE SOFTWARE. | ||
92 | */ | ||
93 | |||
94 | # define DRM_MODE_FEATURE_DIRTYFB 1 | ||
95 | |||
96 | # define DRM_IOCTL_BASE 'd' | ||
97 | # define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) | ||
98 | # define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, drm_mode_fb_cmd2) | ||
99 | |||
100 | # define DRM_CLIENT_CAP_STEREO_3D 1 | ||
101 | # define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 | ||
102 | # define DRM_CLIENT_CAP_ATOMIC 3 | ||
103 | # define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 | ||
104 | |||
105 | # define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, drm_mode_create_dumb) | ||
106 | # define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, drm_mode_map_dumb) | ||
107 | # define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, drm_mode_destroy_dumb) | ||
108 | |||
109 | /* end drm.h */ | ||
110 | |||
111 | /* The following defines and structures were borrowed from drm_mode.h */ | ||
112 | |||
113 | /* | ||
114 | * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> | ||
115 | * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com> | ||
116 | * Copyright (c) 2008 Red Hat Inc. | ||
117 | * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA | ||
118 | * Copyright (c) 2007-2008 Intel Corporation | ||
119 | * | ||
120 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
121 | * copy of this software and associated documentation files (the "Software"), | ||
122 | * to deal in the Software without restriction, including without limitation | ||
123 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
124 | * and/or sell copies of the Software, and to permit persons to whom the | ||
125 | * Software is furnished to do so, subject to the following conditions: | ||
126 | * | ||
127 | * The above copyright notice and this permission notice shall be included in | ||
128 | * all copies or substantial portions of the Software. | ||
129 | * | ||
130 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
131 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
132 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
133 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
134 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
135 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
136 | * IN THE SOFTWARE. | ||
137 | */ | ||
138 | |||
139 | # define DRM_DISPLAY_MODE_LEN 32 | ||
140 | |||
141 | # define DRM_MODE_TYPE_BUILTIN (1<<0) | ||
142 | # define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) | ||
143 | # define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) | ||
144 | # define DRM_MODE_TYPE_PREFERRED (1<<3) | ||
145 | # define DRM_MODE_TYPE_DEFAULT (1<<4) | ||
146 | # define DRM_MODE_TYPE_USERDEF (1<<5) | ||
147 | # define DRM_MODE_TYPE_DRIVER (1<<6) | ||
148 | |||
149 | # define DRM_MODE_PROP_BLOB (1<<4) | ||
150 | |||
151 | # define DRM_MODE_DPMS_ON 0 | ||
152 | # define DRM_MODE_DPMS_STANDBY 1 | ||
153 | # define DRM_MODE_DPMS_SUSPEND 2 | ||
154 | # define DRM_MODE_DPMS_OFF 3 | ||
155 | |||
156 | # define DRM_MODE_FLAG_PHSYNC (1<<0) | ||
157 | # define DRM_MODE_FLAG_NHSYNC (1<<1) | ||
158 | # define DRM_MODE_FLAG_PVSYNC (1<<2) | ||
159 | # define DRM_MODE_FLAG_NVSYNC (1<<3) | ||
160 | # define DRM_MODE_FLAG_INTERLACE (1<<4) | ||
161 | # define DRM_MODE_FLAG_DBLSCAN (1<<5) | ||
162 | # define DRM_MODE_FLAG_CSYNC (1<<6) | ||
163 | # define DRM_MODE_FLAG_PCSYNC (1<<7) | ||
164 | # define DRM_MODE_FLAG_NCSYNC (1<<8) | ||
165 | # define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ | ||
166 | # define DRM_MODE_FLAG_BCAST (1<<10) | ||
167 | # define DRM_MODE_FLAG_PIXMUX (1<<11) | ||
168 | # define DRM_MODE_FLAG_DBLCLK (1<<12) | ||
169 | # define DRM_MODE_FLAG_CLKDIV2 (1<<13) | ||
170 | # define DRM_MODE_FLAG_3D_MASK (0x1f<<14) | ||
171 | # define DRM_MODE_FLAG_3D_NONE (0<<14) | ||
172 | # define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) | ||
173 | # define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) | ||
174 | # define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) | ||
175 | # define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) | ||
176 | # define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) | ||
177 | # define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) | ||
178 | # define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) | ||
179 | # define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) | ||
180 | |||
181 | # define DRM_PROP_NAME_LEN 32 | ||
182 | # define DRM_CONNECTOR_NAME_LEN 32 | ||
183 | |||
184 | # define DRM_MODE_CONNECTOR_Unknown 0 | ||
185 | # define DRM_MODE_CONNECTOR_VGA 1 | ||
186 | # define DRM_MODE_CONNECTOR_DVII 2 | ||
187 | # define DRM_MODE_CONNECTOR_DVID 3 | ||
188 | # define DRM_MODE_CONNECTOR_DVIA 4 | ||
189 | # define DRM_MODE_CONNECTOR_Composite 5 | ||
190 | # define DRM_MODE_CONNECTOR_SVIDEO 6 | ||
191 | # define DRM_MODE_CONNECTOR_LVDS 7 | ||
192 | # define DRM_MODE_CONNECTOR_Component 8 | ||
193 | # define DRM_MODE_CONNECTOR_9PinDIN 9 | ||
194 | # define DRM_MODE_CONNECTOR_DisplayPort 10 | ||
195 | # define DRM_MODE_CONNECTOR_HDMIA 11 | ||
196 | # define DRM_MODE_CONNECTOR_HDMIB 12 | ||
197 | # define DRM_MODE_CONNECTOR_TV 13 | ||
198 | # define DRM_MODE_CONNECTOR_eDP 14 | ||
199 | # define DRM_MODE_CONNECTOR_VIRTUAL 15 | ||
200 | # define DRM_MODE_CONNECTOR_DSI 16 | ||
201 | |||
202 | # define DRM_MODE_OBJECT_CRTC 0xcccccccc | ||
203 | # define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 | ||
204 | # define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 | ||
205 | # define DRM_MODE_OBJECT_MODE 0xdededede | ||
206 | # define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 | ||
207 | # define DRM_MODE_OBJECT_FB 0xfbfbfbfb | ||
208 | # define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb | ||
209 | # define DRM_MODE_OBJECT_PLANE 0xeeeeeeee | ||
210 | # define DRM_MODE_OBJECT_ANY 0 | ||
211 | |||
212 | # define DRM_MODE_PAGE_FLIP_EVENT 0x01 | ||
213 | # define DRM_MODE_PAGE_FLIP_ASYNC 0x02 | ||
214 | # define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC) | ||
215 | |||
216 | # define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 | ||
217 | # define DRM_MODE_ATOMIC_NONBLOCK 0x0200 | ||
218 | # define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 | ||
219 | |||
220 | # define DRM_MODE_ATOMIC_FLAGS \ | ||
221 | (DRM_MODE_PAGE_FLIP_EVENT |\ | ||
222 | DRM_MODE_PAGE_FLIP_ASYNC |\ | ||
223 | DRM_MODE_ATOMIC_TEST_ONLY |\ | ||
224 | DRM_MODE_ATOMIC_NONBLOCK |\ | ||
225 | DRM_MODE_ATOMIC_ALLOW_MODESET) | ||
226 | |||
227 | typedef struct _drm_mode_property_enum | ||
228 | { | ||
229 | uint64_t value; | ||
230 | char name[DRM_PROP_NAME_LEN]; | ||
231 | } drm_mode_property_enum; | ||
232 | |||
233 | typedef struct _drmModeProperty | ||
234 | { | ||
235 | uint32_t prop_id; | ||
236 | uint32_t flags; | ||
237 | char name[DRM_PROP_NAME_LEN]; | ||
238 | int count_values; | ||
239 | uint64_t *values; /* store the blob lengths */ | ||
240 | int count_enums; | ||
241 | drm_mode_property_enum *enums; | ||
242 | int count_blobs; | ||
243 | uint32_t *blob_ids; /* store the blob IDs */ | ||
244 | } drmModePropertyRes, *drmModePropertyPtr; | ||
245 | |||
246 | typedef struct _drm_mode_fb_cmd2 | ||
247 | { | ||
248 | uint32_t fb_id; | ||
249 | uint32_t width; | ||
250 | uint32_t height; | ||
251 | uint32_t pixel_format; /* fourcc code from drm_fourcc.h */ | ||
252 | uint32_t flags; /* see above flags */ | ||
253 | |||
254 | /* | ||
255 | * In case of planar formats, this ioctl allows up to 4 | ||
256 | * buffer objects with offsets and pitches per plane. | ||
257 | * The pitch and offset order is dictated by the fourcc, | ||
258 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: | ||
259 | * | ||
260 | * YUV 4:2:0 image with a plane of 8 bit Y samples | ||
261 | * followed by an interleaved U/V plane containing | ||
262 | * 8 bit 2x2 subsampled colour difference samples. | ||
263 | * | ||
264 | * So it would consist of Y as offsets[0] and UV as | ||
265 | * offsets[1]. Note that offsets[0] will generally | ||
266 | * be 0 (but this is not required). | ||
267 | * | ||
268 | * To accommodate tiled, compressed, etc formats, a per-plane | ||
269 | * modifier can be specified. The default value of zero | ||
270 | * indicates "native" format as specified by the fourcc. | ||
271 | * Vendor specific modifier token. This allows, for example, | ||
272 | * different tiling/swizzling pattern on different planes. | ||
273 | * See discussion above of DRM_FORMAT_MOD_xxx. | ||
274 | */ | ||
275 | uint32_t handles[4]; | ||
276 | uint32_t pitches[4]; /* pitch for each plane */ | ||
277 | uint32_t offsets[4]; /* offset of each plane */ | ||
278 | uint64_t modifier[4]; /* ie, tiling, compressed (per plane) */ | ||
279 | } drm_mode_fb_cmd2; | ||
280 | |||
281 | typedef struct _drm_mode_create_dumb | ||
282 | { | ||
283 | uint32_t height; | ||
284 | uint32_t width; | ||
285 | uint32_t bpp; | ||
286 | uint32_t flags; | ||
287 | /* handle, pitch, size will be returned */ | ||
288 | uint32_t handle; | ||
289 | uint32_t pitch; | ||
290 | uint64_t size; | ||
291 | } drm_mode_create_dumb; | ||
292 | |||
293 | typedef struct _drm_mode_map_dumb | ||
294 | { | ||
295 | /** Handle for the object being mapped. */ | ||
296 | uint32_t handle; | ||
297 | uint32_t pad; | ||
298 | /** | ||
299 | * Fake offset to use for subsequent mmap call | ||
300 | * | ||
301 | * This is a fixed-size type for 32/64 compatibility. | ||
302 | */ | ||
303 | uint64_t offset; | ||
304 | } drm_mode_map_dumb; | ||
305 | |||
306 | typedef struct _drm_mode_destroy_dumb | ||
307 | { | ||
308 | uint32_t handle; | ||
309 | } drm_mode_destroy_dumb; | ||
310 | |||
311 | /* end drm_mode.h */ | ||
312 | |||
313 | /* The following defines and structures were borrowed from xf86drm.h */ | ||
314 | |||
315 | /** | ||
316 | * \file xf86drm.h | ||
317 | * OS-independent header for DRM user-level library interface. | ||
318 | * | ||
319 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | ||
320 | */ | ||
321 | |||
322 | /* | ||
323 | * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. | ||
324 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
325 | * All Rights Reserved. | ||
326 | * | ||
327 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
328 | * copy of this software and associated documentation files (the "Software"), | ||
329 | * to deal in the Software without restriction, including without limitation | ||
330 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
331 | * and/or sell copies of the Software, and to permit persons to whom the | ||
332 | * Software is furnished to do so, subject to the following conditions: | ||
333 | * | ||
334 | * The above copyright notice and this permission notice (including the next | ||
335 | * paragraph) shall be included in all copies or substantial portions of the | ||
336 | * Software. | ||
337 | * | ||
338 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
339 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
340 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
341 | * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
342 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
343 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
344 | * DEALINGS IN THE SOFTWARE. | ||
345 | * | ||
346 | */ | ||
347 | |||
348 | # define DRM_EVENT_CONTEXT_VERSION 2 | ||
349 | |||
350 | typedef enum | ||
351 | { | ||
352 | DRM_VBLANK_ABSOLUTE = 0x00000000, | ||
353 | DRM_VBLANK_RELATIVE = 0x00000001, | ||
354 | DRM_VBLANK_EVENT = 0x04000000, | ||
355 | DRM_VBLANK_FLIP = 0x08000000, | ||
356 | DRM_VBLANK_NEXTONMISS = 0x10000000, | ||
357 | DRM_VBLANK_SECONDARY = 0x20000000, | ||
358 | DRM_VBLANK_SIGNAL = 0x40000000 | ||
359 | } drmVBlankSeqType; | ||
360 | |||
361 | typedef struct _drmVBlankReq | ||
362 | { | ||
363 | drmVBlankSeqType type; | ||
364 | unsigned int sequence; | ||
365 | unsigned long signal; | ||
366 | } drmVBlankReq; | ||
367 | |||
368 | typedef struct _drmVBlankReply | ||
369 | { | ||
370 | drmVBlankSeqType type; | ||
371 | unsigned int sequence; | ||
372 | long tval_sec; | ||
373 | long tval_usec; | ||
374 | } drmVBlankReply; | ||
375 | |||
376 | typedef union _drmVBlank | ||
377 | { | ||
378 | drmVBlankReq request; | ||
379 | drmVBlankReply reply; | ||
380 | } drmVBlank; | ||
381 | |||
382 | typedef struct _drmEventContext | ||
383 | { | ||
384 | int version; | ||
385 | void (*vblank_handler)(int fd, | ||
386 | unsigned int sequence, | ||
387 | unsigned int tv_sec, | ||
388 | unsigned int tv_usec, | ||
389 | void *user_data); | ||
390 | void (*page_flip_handler)(int fd, | ||
391 | unsigned int sequence, | ||
392 | unsigned int tv_sec, | ||
393 | unsigned int tv_usec, | ||
394 | void *user_data); | ||
395 | } drmEventContext; | ||
396 | |||
397 | typedef struct _drmVersion | ||
398 | { | ||
399 | int version_major; | ||
400 | int version_minor; | ||
401 | int version_patchlevel; | ||
402 | int name_len; | ||
403 | char *name; | ||
404 | int date_len; | ||
405 | char *date; | ||
406 | int desc_len; | ||
407 | char *desc; | ||
408 | } drmVersion, *drmVersionPtr; | ||
409 | |||
410 | /* end xf86drm.h */ | ||
411 | |||
412 | /* The following defines and structures were borrowed from xf86drmMode.h */ | ||
413 | |||
414 | /* | ||
415 | * \file xf86drmMode.h | ||
416 | * Header for DRM modesetting interface. | ||
417 | * | ||
418 | * \author Jakob Bornecrantz <wallbraker@gmail.com> | ||
419 | * | ||
420 | * \par Acknowledgements: | ||
421 | * Feb 2007, Dave Airlie <airlied@linux.ie> | ||
422 | */ | ||
423 | |||
424 | /* | ||
425 | * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
426 | * Copyright (c) 2007-2008 Dave Airlie <airlied@linux.ie> | ||
427 | * Copyright (c) 2007-2008 Jakob Bornecrantz <wallbraker@gmail.com> | ||
428 | * | ||
429 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
430 | * copy of this software and associated documentation files (the "Software"), | ||
431 | * to deal in the Software without restriction, including without limitation | ||
432 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
433 | * and/or sell copies of the Software, and to permit persons to whom the | ||
434 | * Software is furnished to do so, subject to the following conditions: | ||
435 | * | ||
436 | * The above copyright notice and this permission notice shall be included in | ||
437 | * all copies or substantial portions of the Software. | ||
438 | * | ||
439 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
440 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
441 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
442 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
443 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
444 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
445 | * IN THE SOFTWARE. | ||
446 | * | ||
447 | */ | ||
448 | |||
449 | # define DRM_PLANE_TYPE_OVERLAY 0 | ||
450 | # define DRM_PLANE_TYPE_PRIMARY 1 | ||
451 | # define DRM_PLANE_TYPE_CURSOR 2 | ||
452 | |||
453 | # define DRM_MODE_PROP_NAME_LEN 32 | ||
454 | |||
455 | typedef enum | ||
456 | { | ||
457 | DRM_MODE_CONNECTED = 1, | ||
458 | DRM_MODE_DISCONNECTED = 2, | ||
459 | DRM_MODE_UNKNOWNCONNECTION = 3 | ||
460 | } drmModeConnection; | ||
461 | |||
462 | typedef enum | ||
463 | { | ||
464 | DRM_MODE_SUBPIXEL_UNKNOWN = 1, | ||
465 | DRM_MODE_SUBPIXEL_HORIZONTAL_RGB = 2, | ||
466 | DRM_MODE_SUBPIXEL_HORIZONTAL_BGR = 3, | ||
467 | DRM_MODE_SUBPIXEL_VERTICAL_RGB = 4, | ||
468 | DRM_MODE_SUBPIXEL_VERTICAL_BGR = 5, | ||
469 | DRM_MODE_SUBPIXEL_NONE = 6 | ||
470 | } drmModeSubPixel; | ||
471 | |||
472 | typedef struct _drmModePropertyBlob | ||
473 | { | ||
474 | uint32_t id; | ||
475 | uint32_t length; | ||
476 | void *data; | ||
477 | } drmModePropertyBlobRes, *drmModePropertyBlobPtr; | ||
478 | |||
479 | typedef struct _drmModeModeInfo | ||
480 | { | ||
481 | uint32_t clock; | ||
482 | uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew; | ||
483 | uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan; | ||
484 | |||
485 | uint32_t vrefresh; | ||
486 | |||
487 | uint32_t flags; | ||
488 | uint32_t type; | ||
489 | char name[DRM_DISPLAY_MODE_LEN]; | ||
490 | } drmModeModeInfo, *drmModeModeInfoPtr; | ||
491 | |||
492 | typedef struct _drmModeCrtc | ||
493 | { | ||
494 | uint32_t crtc_id; | ||
495 | uint32_t buffer_id; /**< FB id to connect to 0 = disconnect */ | ||
496 | |||
497 | uint32_t x, y; /**< Position on the framebuffer */ | ||
498 | uint32_t width, height; | ||
499 | int mode_valid; | ||
500 | drmModeModeInfo mode; | ||
501 | |||
502 | int gamma_size; /**< Number of gamma stops */ | ||
503 | } drmModeCrtc, *drmModeCrtcPtr; | ||
504 | |||
505 | typedef struct _drmModeEncoder | ||
506 | { | ||
507 | uint32_t encoder_id; | ||
508 | uint32_t encoder_type; | ||
509 | uint32_t crtc_id; | ||
510 | uint32_t possible_crtcs; | ||
511 | uint32_t possible_clones; | ||
512 | } drmModeEncoder, *drmModeEncoderPtr; | ||
513 | |||
514 | typedef struct _drmModeConnector | ||
515 | { | ||
516 | uint32_t connector_id; | ||
517 | uint32_t encoder_id; /**< Encoder currently connected to */ | ||
518 | uint32_t connector_type; | ||
519 | uint32_t connector_type_id; | ||
520 | drmModeConnection connection; | ||
521 | uint32_t mmWidth, mmHeight; /**< HxW in millimeters */ | ||
522 | drmModeSubPixel subpixel; | ||
523 | |||
524 | int count_modes; | ||
525 | drmModeModeInfoPtr modes; | ||
526 | |||
527 | int count_props; | ||
528 | uint32_t *props; /**< List of property ids */ | ||
529 | uint64_t *prop_values; /**< List of property values */ | ||
530 | |||
531 | int count_encoders; | ||
532 | uint32_t *encoders; /**< List of encoder ids */ | ||
533 | } drmModeConnector, *drmModeConnectorPtr; | ||
534 | |||
535 | typedef struct _drmModeRes | ||
536 | { | ||
537 | int count_fbs; | ||
538 | uint32_t *fbs; | ||
539 | |||
540 | int count_crtcs; | ||
541 | uint32_t *crtcs; | ||
542 | |||
543 | int count_connectors; | ||
544 | uint32_t *connectors; | ||
545 | |||
546 | int count_encoders; | ||
547 | uint32_t *encoders; | ||
548 | |||
549 | uint32_t min_width, max_width; | ||
550 | uint32_t min_height, max_height; | ||
551 | } drmModeRes, *drmModeResPtr; | ||
552 | |||
553 | typedef struct _drmModeObjectProperties | ||
554 | { | ||
555 | uint32_t count_props; | ||
556 | uint32_t *props; | ||
557 | uint64_t *prop_values; | ||
558 | } drmModeObjectProperties, *drmModeObjectPropertiesPtr; | ||
559 | |||
560 | typedef struct _drmModePlane | ||
561 | { | ||
562 | uint32_t count_formats; | ||
563 | uint32_t *formats; | ||
564 | uint32_t plane_id; | ||
565 | |||
566 | uint32_t crtc_id; | ||
567 | uint32_t fb_id; | ||
568 | |||
569 | uint32_t crtc_x, crtc_y; | ||
570 | uint32_t x, y; | ||
571 | |||
572 | uint32_t possible_crtcs; | ||
573 | uint32_t gamma_size; | ||
574 | } drmModePlane, *drmModePlanePtr; | ||
575 | |||
576 | typedef struct _drmModePlaneRes | ||
577 | { | ||
578 | uint32_t count_planes; | ||
579 | uint32_t *planes; | ||
580 | } drmModePlaneRes, *drmModePlaneResPtr; | ||
581 | |||
582 | typedef struct _drmModeClip | ||
583 | { | ||
584 | unsigned short x1, y1; | ||
585 | unsigned short x2, y2; | ||
586 | } drmModeClip, *drmModeClipPtr; | ||
587 | |||
588 | # ifdef HAVE_ATOMIC_DRM | ||
589 | |||
590 | typedef struct _drmModeAtomicReqItem | ||
591 | { | ||
592 | uint32_t object_id; | ||
593 | uint32_t property_id; | ||
594 | uint64_t value; | ||
595 | } drmModeAtomicReqItem, *drmModeAtomicReqItemPtr; | ||
596 | |||
597 | typedef struct _drmModeAtomicReq | ||
598 | { | ||
599 | uint32_t cursor; | ||
600 | uint32_t size_items; | ||
601 | drmModeAtomicReqItemPtr items; | ||
602 | } drmModeAtomicReq, *drmModeAtomicReqPtr; | ||
603 | |||
604 | /* end xf86drmMode.h */ | ||
605 | #endif | ||
606 | 63 | ||
607 | typedef struct _Ecore_Drm2_Atomic_State Ecore_Drm2_Atomic_State; | 64 | typedef struct _Ecore_Drm2_Atomic_State Ecore_Drm2_Atomic_State; |
608 | 65 | ||