diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-11-15 09:11:06 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-11-15 09:12:53 -0500 |
commit | 491c059620148403a154b609f1fa54ddd13e9991 (patch) | |
tree | d9e279d1e0fc2a5adfb907504f75a03117b1b461 /src/lib/ecore_drm2/ecore_drm2_private.h | |
parent | c58de1ce1dce70d036fd74b30bb346b1e2ff13b1 (diff) |
ecore-drm2: Add copyright information from included headers
Small patch to reorganize defines & structures from included files,
and to add copyright information related to each file where defines &
structures were borrowed from.
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 | 550 |
1 files changed, 339 insertions, 211 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index 3a26237212..9d5fb60633 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h | |||
@@ -53,9 +53,90 @@ extern Eina_Bool _ecore_drm2_use_atomic; | |||
53 | # endif | 53 | # endif |
54 | # define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__) | 54 | # define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__) |
55 | 55 | ||
56 | # define DRM_MODE_FEATURE_DIRTYFB 1 // drm.h | 56 | /* The following defines and structures were borrowed from drm.h */ |
57 | |||
58 | /** | ||
59 | * \file drm.h | ||
60 | * Header for the Direct Rendering Manager | ||
61 | * | ||
62 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | ||
63 | * | ||
64 | * \par Acknowledgments: | ||
65 | * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg. | ||
66 | */ | ||
67 | |||
68 | /* | ||
69 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | ||
70 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
71 | * All rights reserved. | ||
72 | * | ||
73 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
74 | * copy of this software and associated documentation files (the "Software"), | ||
75 | * to deal in the Software without restriction, including without limitation | ||
76 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
77 | * and/or sell copies of the Software, and to permit persons to whom the | ||
78 | * Software is furnished to do so, subject to the following conditions: | ||
79 | * | ||
80 | * The above copyright notice and this permission notice (including the next | ||
81 | * paragraph) shall be included in all copies or substantial portions of the | ||
82 | * Software. | ||
83 | * | ||
84 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
85 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
86 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
87 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
88 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
89 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
90 | * OTHER DEALINGS IN THE SOFTWARE. | ||
91 | */ | ||
92 | |||
93 | # define DRM_MODE_FEATURE_DIRTYFB 1 | ||
94 | |||
95 | # define DRM_IOCTL_BASE 'd' | ||
96 | # define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) | ||
97 | # define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, drm_mode_fb_cmd2) | ||
98 | |||
99 | # define DRM_CLIENT_CAP_STEREO_3D 1 | ||
100 | # define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 | ||
101 | # define DRM_CLIENT_CAP_ATOMIC 3 | ||
102 | # define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 | ||
103 | |||
104 | # define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, drm_mode_create_dumb) | ||
105 | # define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, drm_mode_map_dumb) | ||
106 | # define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, drm_mode_destroy_dumb) | ||
107 | |||
108 | /* end drm.h */ | ||
109 | |||
110 | /* The following defines and structures were borrowed from drm_mode.h */ | ||
111 | |||
112 | /* | ||
113 | * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> | ||
114 | * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com> | ||
115 | * Copyright (c) 2008 Red Hat Inc. | ||
116 | * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA | ||
117 | * Copyright (c) 2007-2008 Intel Corporation | ||
118 | * | ||
119 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
120 | * copy of this software and associated documentation files (the "Software"), | ||
121 | * to deal in the Software without restriction, including without limitation | ||
122 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
123 | * and/or sell copies of the Software, and to permit persons to whom the | ||
124 | * Software is furnished to do so, subject to the following conditions: | ||
125 | * | ||
126 | * The above copyright notice and this permission notice shall be included in | ||
127 | * all copies or substantial portions of the Software. | ||
128 | * | ||
129 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
130 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
131 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
132 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
133 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
134 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
135 | * IN THE SOFTWARE. | ||
136 | */ | ||
137 | |||
138 | # define DRM_DISPLAY_MODE_LEN 32 | ||
57 | 139 | ||
58 | // drm_mode.h | ||
59 | # define DRM_MODE_TYPE_BUILTIN (1<<0) | 140 | # define DRM_MODE_TYPE_BUILTIN (1<<0) |
60 | # define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) | 141 | # define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) |
61 | # define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) | 142 | # define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) |
@@ -70,9 +151,201 @@ extern Eina_Bool _ecore_drm2_use_atomic; | |||
70 | # define DRM_MODE_DPMS_STANDBY 1 | 151 | # define DRM_MODE_DPMS_STANDBY 1 |
71 | # define DRM_MODE_DPMS_SUSPEND 2 | 152 | # define DRM_MODE_DPMS_SUSPEND 2 |
72 | # define DRM_MODE_DPMS_OFF 3 | 153 | # define DRM_MODE_DPMS_OFF 3 |
73 | // end drm_mode.h | ||
74 | 154 | ||
75 | // xf86drm.h | 155 | # define DRM_MODE_FLAG_PHSYNC (1<<0) |
156 | # define DRM_MODE_FLAG_NHSYNC (1<<1) | ||
157 | # define DRM_MODE_FLAG_PVSYNC (1<<2) | ||
158 | # define DRM_MODE_FLAG_NVSYNC (1<<3) | ||
159 | # define DRM_MODE_FLAG_INTERLACE (1<<4) | ||
160 | # define DRM_MODE_FLAG_DBLSCAN (1<<5) | ||
161 | # define DRM_MODE_FLAG_CSYNC (1<<6) | ||
162 | # define DRM_MODE_FLAG_PCSYNC (1<<7) | ||
163 | # define DRM_MODE_FLAG_NCSYNC (1<<8) | ||
164 | # define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ | ||
165 | # define DRM_MODE_FLAG_BCAST (1<<10) | ||
166 | # define DRM_MODE_FLAG_PIXMUX (1<<11) | ||
167 | # define DRM_MODE_FLAG_DBLCLK (1<<12) | ||
168 | # define DRM_MODE_FLAG_CLKDIV2 (1<<13) | ||
169 | # define DRM_MODE_FLAG_3D_MASK (0x1f<<14) | ||
170 | # define DRM_MODE_FLAG_3D_NONE (0<<14) | ||
171 | # define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) | ||
172 | # define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) | ||
173 | # define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) | ||
174 | # define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) | ||
175 | # define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) | ||
176 | # define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) | ||
177 | # define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) | ||
178 | # define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) | ||
179 | |||
180 | # define DRM_PROP_NAME_LEN 32 | ||
181 | # define DRM_CONNECTOR_NAME_LEN 32 | ||
182 | |||
183 | # define DRM_MODE_CONNECTOR_Unknown 0 | ||
184 | # define DRM_MODE_CONNECTOR_VGA 1 | ||
185 | # define DRM_MODE_CONNECTOR_DVII 2 | ||
186 | # define DRM_MODE_CONNECTOR_DVID 3 | ||
187 | # define DRM_MODE_CONNECTOR_DVIA 4 | ||
188 | # define DRM_MODE_CONNECTOR_Composite 5 | ||
189 | # define DRM_MODE_CONNECTOR_SVIDEO 6 | ||
190 | # define DRM_MODE_CONNECTOR_LVDS 7 | ||
191 | # define DRM_MODE_CONNECTOR_Component 8 | ||
192 | # define DRM_MODE_CONNECTOR_9PinDIN 9 | ||
193 | # define DRM_MODE_CONNECTOR_DisplayPort 10 | ||
194 | # define DRM_MODE_CONNECTOR_HDMIA 11 | ||
195 | # define DRM_MODE_CONNECTOR_HDMIB 12 | ||
196 | # define DRM_MODE_CONNECTOR_TV 13 | ||
197 | # define DRM_MODE_CONNECTOR_eDP 14 | ||
198 | # define DRM_MODE_CONNECTOR_VIRTUAL 15 | ||
199 | # define DRM_MODE_CONNECTOR_DSI 16 | ||
200 | |||
201 | # define DRM_MODE_OBJECT_CRTC 0xcccccccc | ||
202 | # define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 | ||
203 | # define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 | ||
204 | # define DRM_MODE_OBJECT_MODE 0xdededede | ||
205 | # define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 | ||
206 | # define DRM_MODE_OBJECT_FB 0xfbfbfbfb | ||
207 | # define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb | ||
208 | # define DRM_MODE_OBJECT_PLANE 0xeeeeeeee | ||
209 | # define DRM_MODE_OBJECT_ANY 0 | ||
210 | |||
211 | # define DRM_MODE_PAGE_FLIP_EVENT 0x01 | ||
212 | # define DRM_MODE_PAGE_FLIP_ASYNC 0x02 | ||
213 | # define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC) | ||
214 | |||
215 | # define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 | ||
216 | # define DRM_MODE_ATOMIC_NONBLOCK 0x0200 | ||
217 | # define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 | ||
218 | |||
219 | # define DRM_MODE_ATOMIC_FLAGS \ | ||
220 | (DRM_MODE_PAGE_FLIP_EVENT |\ | ||
221 | DRM_MODE_PAGE_FLIP_ASYNC |\ | ||
222 | DRM_MODE_ATOMIC_TEST_ONLY |\ | ||
223 | DRM_MODE_ATOMIC_NONBLOCK |\ | ||
224 | DRM_MODE_ATOMIC_ALLOW_MODESET) | ||
225 | |||
226 | typedef struct _drm_mode_property_enum | ||
227 | { | ||
228 | uint64_t value; | ||
229 | char name[DRM_PROP_NAME_LEN]; | ||
230 | } drm_mode_property_enum; | ||
231 | |||
232 | typedef struct _drmModeProperty | ||
233 | { | ||
234 | uint32_t prop_id; | ||
235 | uint32_t flags; | ||
236 | char name[DRM_PROP_NAME_LEN]; | ||
237 | int count_values; | ||
238 | uint64_t *values; /* store the blob lengths */ | ||
239 | int count_enums; | ||
240 | drm_mode_property_enum *enums; | ||
241 | int count_blobs; | ||
242 | uint32_t *blob_ids; /* store the blob IDs */ | ||
243 | } drmModePropertyRes, *drmModePropertyPtr; | ||
244 | |||
245 | typedef struct _drm_mode_fb_cmd2 | ||
246 | { | ||
247 | uint32_t fb_id; | ||
248 | uint32_t width; | ||
249 | uint32_t height; | ||
250 | uint32_t pixel_format; /* fourcc code from drm_fourcc.h */ | ||
251 | uint32_t flags; /* see above flags */ | ||
252 | |||
253 | /* | ||
254 | * In case of planar formats, this ioctl allows up to 4 | ||
255 | * buffer objects with offsets and pitches per plane. | ||
256 | * The pitch and offset order is dictated by the fourcc, | ||
257 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: | ||
258 | * | ||
259 | * YUV 4:2:0 image with a plane of 8 bit Y samples | ||
260 | * followed by an interleaved U/V plane containing | ||
261 | * 8 bit 2x2 subsampled colour difference samples. | ||
262 | * | ||
263 | * So it would consist of Y as offsets[0] and UV as | ||
264 | * offsets[1]. Note that offsets[0] will generally | ||
265 | * be 0 (but this is not required). | ||
266 | * | ||
267 | * To accommodate tiled, compressed, etc formats, a per-plane | ||
268 | * modifier can be specified. The default value of zero | ||
269 | * indicates "native" format as specified by the fourcc. | ||
270 | * Vendor specific modifier token. This allows, for example, | ||
271 | * different tiling/swizzling pattern on different planes. | ||
272 | * See discussion above of DRM_FORMAT_MOD_xxx. | ||
273 | */ | ||
274 | uint32_t handles[4]; | ||
275 | uint32_t pitches[4]; /* pitch for each plane */ | ||
276 | uint32_t offsets[4]; /* offset of each plane */ | ||
277 | uint64_t modifier[4]; /* ie, tiling, compressed (per plane) */ | ||
278 | } drm_mode_fb_cmd2; | ||
279 | |||
280 | typedef struct _drm_mode_create_dumb | ||
281 | { | ||
282 | uint32_t height; | ||
283 | uint32_t width; | ||
284 | uint32_t bpp; | ||
285 | uint32_t flags; | ||
286 | /* handle, pitch, size will be returned */ | ||
287 | uint32_t handle; | ||
288 | uint32_t pitch; | ||
289 | uint64_t size; | ||
290 | } drm_mode_create_dumb; | ||
291 | |||
292 | typedef struct _drm_mode_map_dumb | ||
293 | { | ||
294 | /** Handle for the object being mapped. */ | ||
295 | uint32_t handle; | ||
296 | uint32_t pad; | ||
297 | /** | ||
298 | * Fake offset to use for subsequent mmap call | ||
299 | * | ||
300 | * This is a fixed-size type for 32/64 compatibility. | ||
301 | */ | ||
302 | uint64_t offset; | ||
303 | } drm_mode_map_dumb; | ||
304 | |||
305 | typedef struct _drm_mode_destroy_dumb | ||
306 | { | ||
307 | uint32_t handle; | ||
308 | } drm_mode_destroy_dumb; | ||
309 | |||
310 | /* end drm_mode.h */ | ||
311 | |||
312 | /* The following defines and structures were borrowed from xf86drm.h */ | ||
313 | |||
314 | /** | ||
315 | * \file xf86drm.h | ||
316 | * OS-independent header for DRM user-level library interface. | ||
317 | * | ||
318 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | ||
319 | */ | ||
320 | |||
321 | /* | ||
322 | * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. | ||
323 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
324 | * All Rights Reserved. | ||
325 | * | ||
326 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
327 | * copy of this software and associated documentation files (the "Software"), | ||
328 | * to deal in the Software without restriction, including without limitation | ||
329 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
330 | * and/or sell copies of the Software, and to permit persons to whom the | ||
331 | * Software is furnished to do so, subject to the following conditions: | ||
332 | * | ||
333 | * The above copyright notice and this permission notice (including the next | ||
334 | * paragraph) shall be included in all copies or substantial portions of the | ||
335 | * Software. | ||
336 | * | ||
337 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
338 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
339 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
340 | * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
341 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
342 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
343 | * DEALINGS IN THE SOFTWARE. | ||
344 | * | ||
345 | */ | ||
346 | |||
347 | # define DRM_EVENT_CONTEXT_VERSION 2 | ||
348 | |||
76 | typedef enum | 349 | typedef enum |
77 | { | 350 | { |
78 | DRM_VBLANK_ABSOLUTE = 0x00000000, | 351 | DRM_VBLANK_ABSOLUTE = 0x00000000, |
@@ -84,24 +357,6 @@ typedef enum | |||
84 | DRM_VBLANK_SIGNAL = 0x40000000 | 357 | DRM_VBLANK_SIGNAL = 0x40000000 |
85 | } drmVBlankSeqType; | 358 | } drmVBlankSeqType; |
86 | 359 | ||
87 | typedef enum | ||
88 | { | ||
89 | DRM_MODE_CONNECTED = 1, | ||
90 | DRM_MODE_DISCONNECTED = 2, | ||
91 | DRM_MODE_UNKNOWNCONNECTION = 3 | ||
92 | } drmModeConnection; | ||
93 | |||
94 | typedef enum | ||
95 | { | ||
96 | DRM_MODE_SUBPIXEL_UNKNOWN = 1, | ||
97 | DRM_MODE_SUBPIXEL_HORIZONTAL_RGB = 2, | ||
98 | DRM_MODE_SUBPIXEL_HORIZONTAL_BGR = 3, | ||
99 | DRM_MODE_SUBPIXEL_VERTICAL_RGB = 4, | ||
100 | DRM_MODE_SUBPIXEL_VERTICAL_BGR = 5, | ||
101 | DRM_MODE_SUBPIXEL_NONE = 6 | ||
102 | } drmModeSubPixel; | ||
103 | |||
104 | // xf86drm.h | ||
105 | typedef struct _drmVBlankReq | 360 | typedef struct _drmVBlankReq |
106 | { | 361 | { |
107 | drmVBlankSeqType type; | 362 | drmVBlankSeqType type; |
@@ -109,7 +364,6 @@ typedef struct _drmVBlankReq | |||
109 | unsigned long signal; | 364 | unsigned long signal; |
110 | } drmVBlankReq; | 365 | } drmVBlankReq; |
111 | 366 | ||
112 | // xf86drm.h | ||
113 | typedef struct _drmVBlankReply | 367 | typedef struct _drmVBlankReply |
114 | { | 368 | { |
115 | drmVBlankSeqType type; | 369 | drmVBlankSeqType type; |
@@ -118,17 +372,12 @@ typedef struct _drmVBlankReply | |||
118 | long tval_usec; | 372 | long tval_usec; |
119 | } drmVBlankReply; | 373 | } drmVBlankReply; |
120 | 374 | ||
121 | // xf86drm.h | ||
122 | typedef union _drmVBlank | 375 | typedef union _drmVBlank |
123 | { | 376 | { |
124 | drmVBlankReq request; | 377 | drmVBlankReq request; |
125 | drmVBlankReply reply; | 378 | drmVBlankReply reply; |
126 | } drmVBlank; | 379 | } drmVBlank; |
127 | 380 | ||
128 | // xf86drm.h | ||
129 | # define DRM_EVENT_CONTEXT_VERSION 2 | ||
130 | |||
131 | // xf86drm.h | ||
132 | typedef struct _drmEventContext | 381 | typedef struct _drmEventContext |
133 | { | 382 | { |
134 | int version; | 383 | int version; |
@@ -144,7 +393,6 @@ typedef struct _drmEventContext | |||
144 | void *user_data); | 393 | void *user_data); |
145 | } drmEventContext; | 394 | } drmEventContext; |
146 | 395 | ||
147 | // xf86drm.h | ||
148 | typedef struct _drmVersionBroken | 396 | typedef struct _drmVersionBroken |
149 | { | 397 | { |
150 | int version_major; | 398 | int version_major; |
@@ -161,7 +409,6 @@ typedef struct _drmVersionBroken | |||
161 | char *desc; | 409 | char *desc; |
162 | } drmVersionBroken; | 410 | } drmVersionBroken; |
163 | 411 | ||
164 | // xf86drm.h | ||
165 | typedef struct _drmVersion | 412 | typedef struct _drmVersion |
166 | { | 413 | { |
167 | int version_major; | 414 | int version_major; |
@@ -178,33 +425,67 @@ typedef struct _drmVersion | |||
178 | char *desc; | 425 | char *desc; |
179 | } drmVersion, *drmVersionPtr; | 426 | } drmVersion, *drmVersionPtr; |
180 | 427 | ||
181 | // drm_mode.h | 428 | /* end xf86drm.h */ |
182 | # define DRM_DISPLAY_MODE_LEN 32 | 429 | |
430 | /* The following defines and structures were borrowed from xf86drmMode.h */ | ||
431 | |||
432 | /* | ||
433 | * \file xf86drmMode.h | ||
434 | * Header for DRM modesetting interface. | ||
435 | * | ||
436 | * \author Jakob Bornecrantz <wallbraker@gmail.com> | ||
437 | * | ||
438 | * \par Acknowledgements: | ||
439 | * Feb 2007, Dave Airlie <airlied@linux.ie> | ||
440 | */ | ||
441 | |||
442 | /* | ||
443 | * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
444 | * Copyright (c) 2007-2008 Dave Airlie <airlied@linux.ie> | ||
445 | * Copyright (c) 2007-2008 Jakob Bornecrantz <wallbraker@gmail.com> | ||
446 | * | ||
447 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
448 | * copy of this software and associated documentation files (the "Software"), | ||
449 | * to deal in the Software without restriction, including without limitation | ||
450 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
451 | * and/or sell copies of the Software, and to permit persons to whom the | ||
452 | * Software is furnished to do so, subject to the following conditions: | ||
453 | * | ||
454 | * The above copyright notice and this permission notice shall be included in | ||
455 | * all copies or substantial portions of the Software. | ||
456 | * | ||
457 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
458 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
459 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
460 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
461 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
462 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
463 | * IN THE SOFTWARE. | ||
464 | * | ||
465 | */ | ||
183 | 466 | ||
184 | # define DRM_MODE_FLAG_PHSYNC (1<<0) | 467 | # define DRM_PLANE_TYPE_OVERLAY 0 |
185 | # define DRM_MODE_FLAG_NHSYNC (1<<1) | 468 | # define DRM_PLANE_TYPE_PRIMARY 1 |
186 | # define DRM_MODE_FLAG_PVSYNC (1<<2) | 469 | # define DRM_PLANE_TYPE_CURSOR 2 |
187 | # define DRM_MODE_FLAG_NVSYNC (1<<3) | 470 | |
188 | # define DRM_MODE_FLAG_INTERLACE (1<<4) | 471 | # define DRM_MODE_PROP_NAME_LEN 32 |
189 | # define DRM_MODE_FLAG_DBLSCAN (1<<5) | 472 | |
190 | # define DRM_MODE_FLAG_CSYNC (1<<6) | 473 | typedef enum |
191 | # define DRM_MODE_FLAG_PCSYNC (1<<7) | 474 | { |
192 | # define DRM_MODE_FLAG_NCSYNC (1<<8) | 475 | DRM_MODE_CONNECTED = 1, |
193 | # define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ | 476 | DRM_MODE_DISCONNECTED = 2, |
194 | # define DRM_MODE_FLAG_BCAST (1<<10) | 477 | DRM_MODE_UNKNOWNCONNECTION = 3 |
195 | # define DRM_MODE_FLAG_PIXMUX (1<<11) | 478 | } drmModeConnection; |
196 | # define DRM_MODE_FLAG_DBLCLK (1<<12) | 479 | |
197 | # define DRM_MODE_FLAG_CLKDIV2 (1<<13) | 480 | typedef enum |
198 | # define DRM_MODE_FLAG_3D_MASK (0x1f<<14) | 481 | { |
199 | # define DRM_MODE_FLAG_3D_NONE (0<<14) | 482 | DRM_MODE_SUBPIXEL_UNKNOWN = 1, |
200 | # define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) | 483 | DRM_MODE_SUBPIXEL_HORIZONTAL_RGB = 2, |
201 | # define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) | 484 | DRM_MODE_SUBPIXEL_HORIZONTAL_BGR = 3, |
202 | # define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) | 485 | DRM_MODE_SUBPIXEL_VERTICAL_RGB = 4, |
203 | # define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) | 486 | DRM_MODE_SUBPIXEL_VERTICAL_BGR = 5, |
204 | # define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) | 487 | DRM_MODE_SUBPIXEL_NONE = 6 |
205 | # define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) | 488 | } drmModeSubPixel; |
206 | # define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) | ||
207 | # define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) | ||
208 | 489 | ||
209 | typedef struct _drmModePropertyBlob | 490 | typedef struct _drmModePropertyBlob |
210 | { | 491 | { |
@@ -239,29 +520,6 @@ typedef struct _drmModeCrtc | |||
239 | int gamma_size; /**< Number of gamma stops */ | 520 | int gamma_size; /**< Number of gamma stops */ |
240 | } drmModeCrtc, *drmModeCrtcPtr; | 521 | } drmModeCrtc, *drmModeCrtcPtr; |
241 | 522 | ||
242 | // drm_mode.h | ||
243 | # define DRM_PROP_NAME_LEN 32 | ||
244 | |||
245 | typedef struct _drm_mode_property_enum | ||
246 | { | ||
247 | uint64_t value; | ||
248 | char name[DRM_PROP_NAME_LEN]; | ||
249 | } drm_mode_property_enum; | ||
250 | |||
251 | // drm_mode.h | ||
252 | typedef struct _drmModeProperty | ||
253 | { | ||
254 | uint32_t prop_id; | ||
255 | uint32_t flags; | ||
256 | char name[DRM_PROP_NAME_LEN]; | ||
257 | int count_values; | ||
258 | uint64_t *values; /* store the blob lengths */ | ||
259 | int count_enums; | ||
260 | drm_mode_property_enum *enums; | ||
261 | int count_blobs; | ||
262 | uint32_t *blob_ids; /* store the blob IDs */ | ||
263 | } drmModePropertyRes, *drmModePropertyPtr; | ||
264 | |||
265 | typedef struct _drmModeEncoder | 523 | typedef struct _drmModeEncoder |
266 | { | 524 | { |
267 | uint32_t encoder_id; | 525 | uint32_t encoder_id; |
@@ -271,28 +529,6 @@ typedef struct _drmModeEncoder | |||
271 | uint32_t possible_clones; | 529 | uint32_t possible_clones; |
272 | } drmModeEncoder, *drmModeEncoderPtr; | 530 | } drmModeEncoder, *drmModeEncoderPtr; |
273 | 531 | ||
274 | // drm_mode.h | ||
275 | # define DRM_CONNECTOR_NAME_LEN 32 | ||
276 | |||
277 | // drm_mode.h | ||
278 | # define DRM_MODE_CONNECTOR_Unknown 0 | ||
279 | # define DRM_MODE_CONNECTOR_VGA 1 | ||
280 | # define DRM_MODE_CONNECTOR_DVII 2 | ||
281 | # define DRM_MODE_CONNECTOR_DVID 3 | ||
282 | # define DRM_MODE_CONNECTOR_DVIA 4 | ||
283 | # define DRM_MODE_CONNECTOR_Composite 5 | ||
284 | # define DRM_MODE_CONNECTOR_SVIDEO 6 | ||
285 | # define DRM_MODE_CONNECTOR_LVDS 7 | ||
286 | # define DRM_MODE_CONNECTOR_Component 8 | ||
287 | # define DRM_MODE_CONNECTOR_9PinDIN 9 | ||
288 | # define DRM_MODE_CONNECTOR_DisplayPort 10 | ||
289 | # define DRM_MODE_CONNECTOR_HDMIA 11 | ||
290 | # define DRM_MODE_CONNECTOR_HDMIB 12 | ||
291 | # define DRM_MODE_CONNECTOR_TV 13 | ||
292 | # define DRM_MODE_CONNECTOR_eDP 14 | ||
293 | # define DRM_MODE_CONNECTOR_VIRTUAL 15 | ||
294 | # define DRM_MODE_CONNECTOR_DSI 16 | ||
295 | |||
296 | typedef struct _drmModeConnector | 532 | typedef struct _drmModeConnector |
297 | { | 533 | { |
298 | uint32_t connector_id; | 534 | uint32_t connector_id; |
@@ -332,105 +568,6 @@ typedef struct _drmModeRes | |||
332 | uint32_t min_height, max_height; | 568 | uint32_t min_height, max_height; |
333 | } drmModeRes, *drmModeResPtr; | 569 | } drmModeRes, *drmModeResPtr; |
334 | 570 | ||
335 | // drm_mode.h | ||
336 | typedef struct _drm_mode_fb_cmd2 | ||
337 | { | ||
338 | uint32_t fb_id; | ||
339 | uint32_t width; | ||
340 | uint32_t height; | ||
341 | uint32_t pixel_format; /* fourcc code from drm_fourcc.h */ | ||
342 | uint32_t flags; /* see above flags */ | ||
343 | |||
344 | /* | ||
345 | * In case of planar formats, this ioctl allows up to 4 | ||
346 | * buffer objects with offsets and pitches per plane. | ||
347 | * The pitch and offset order is dictated by the fourcc, | ||
348 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: | ||
349 | * | ||
350 | * YUV 4:2:0 image with a plane of 8 bit Y samples | ||
351 | * followed by an interleaved U/V plane containing | ||
352 | * 8 bit 2x2 subsampled colour difference samples. | ||
353 | * | ||
354 | * So it would consist of Y as offsets[0] and UV as | ||
355 | * offsets[1]. Note that offsets[0] will generally | ||
356 | * be 0 (but this is not required). | ||
357 | * | ||
358 | * To accommodate tiled, compressed, etc formats, a per-plane | ||
359 | * modifier can be specified. The default value of zero | ||
360 | * indicates "native" format as specified by the fourcc. | ||
361 | * Vendor specific modifier token. This allows, for example, | ||
362 | * different tiling/swizzling pattern on different planes. | ||
363 | * See discussion above of DRM_FORMAT_MOD_xxx. | ||
364 | */ | ||
365 | uint32_t handles[4]; | ||
366 | uint32_t pitches[4]; /* pitch for each plane */ | ||
367 | uint32_t offsets[4]; /* offset of each plane */ | ||
368 | uint64_t modifier[4]; /* ie, tiling, compressed (per plane) */ | ||
369 | } drm_mode_fb_cmd2; | ||
370 | |||
371 | # define DRM_IOCTL_BASE 'd' | ||
372 | # define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) | ||
373 | # define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, drm_mode_fb_cmd2) | ||
374 | |||
375 | # define DRM_CLIENT_CAP_STEREO_3D 1 | ||
376 | # define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 | ||
377 | # define DRM_CLIENT_CAP_ATOMIC 3 | ||
378 | # define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 | ||
379 | |||
380 | # define DRM_MODE_OBJECT_CRTC 0xcccccccc | ||
381 | # define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 | ||
382 | # define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 | ||
383 | # define DRM_MODE_OBJECT_MODE 0xdededede | ||
384 | # define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 | ||
385 | # define DRM_MODE_OBJECT_FB 0xfbfbfbfb | ||
386 | # define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb | ||
387 | # define DRM_MODE_OBJECT_PLANE 0xeeeeeeee | ||
388 | # define DRM_MODE_OBJECT_ANY 0 | ||
389 | |||
390 | # define DRM_PLANE_TYPE_OVERLAY 0 | ||
391 | # define DRM_PLANE_TYPE_PRIMARY 1 | ||
392 | # define DRM_PLANE_TYPE_CURSOR 2 | ||
393 | |||
394 | # define DRM_MODE_PAGE_FLIP_EVENT 0x01 | ||
395 | # define DRM_MODE_PAGE_FLIP_ASYNC 0x02 | ||
396 | # define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC) | ||
397 | |||
398 | typedef struct _drm_mode_create_dumb | ||
399 | { | ||
400 | uint32_t height; | ||
401 | uint32_t width; | ||
402 | uint32_t bpp; | ||
403 | uint32_t flags; | ||
404 | /* handle, pitch, size will be returned */ | ||
405 | uint32_t handle; | ||
406 | uint32_t pitch; | ||
407 | uint64_t size; | ||
408 | } drm_mode_create_dumb; | ||
409 | |||
410 | typedef struct _drm_mode_map_dumb | ||
411 | { | ||
412 | /** Handle for the object being mapped. */ | ||
413 | uint32_t handle; | ||
414 | uint32_t pad; | ||
415 | /** | ||
416 | * Fake offset to use for subsequent mmap call | ||
417 | * | ||
418 | * This is a fixed-size type for 32/64 compatibility. | ||
419 | */ | ||
420 | uint64_t offset; | ||
421 | } drm_mode_map_dumb; | ||
422 | |||
423 | typedef struct _drm_mode_destroy_dumb | ||
424 | { | ||
425 | uint32_t handle; | ||
426 | } drm_mode_destroy_dumb; | ||
427 | |||
428 | # define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, drm_mode_create_dumb) | ||
429 | # define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, drm_mode_map_dumb) | ||
430 | # define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, drm_mode_destroy_dumb) | ||
431 | |||
432 | # define DRM_MODE_PROP_NAME_LEN 32 | ||
433 | |||
434 | typedef struct _drmModeObjectProperties | 571 | typedef struct _drmModeObjectProperties |
435 | { | 572 | { |
436 | uint32_t count_props; | 573 | uint32_t count_props; |
@@ -468,17 +605,6 @@ typedef struct _drmModeClip | |||
468 | 605 | ||
469 | # ifdef HAVE_ATOMIC_DRM | 606 | # ifdef HAVE_ATOMIC_DRM |
470 | 607 | ||
471 | # define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 | ||
472 | # define DRM_MODE_ATOMIC_NONBLOCK 0x0200 | ||
473 | # define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 | ||
474 | |||
475 | # define DRM_MODE_ATOMIC_FLAGS \ | ||
476 | (DRM_MODE_PAGE_FLIP_EVENT |\ | ||
477 | DRM_MODE_PAGE_FLIP_ASYNC |\ | ||
478 | DRM_MODE_ATOMIC_TEST_ONLY |\ | ||
479 | DRM_MODE_ATOMIC_NONBLOCK |\ | ||
480 | DRM_MODE_ATOMIC_ALLOW_MODESET) | ||
481 | |||
482 | typedef struct _drmModeAtomicReqItem | 608 | typedef struct _drmModeAtomicReqItem |
483 | { | 609 | { |
484 | uint32_t object_id; | 610 | uint32_t object_id; |
@@ -493,6 +619,8 @@ typedef struct _drmModeAtomicReq | |||
493 | drmModeAtomicReqItemPtr items; | 619 | drmModeAtomicReqItemPtr items; |
494 | } drmModeAtomicReq, *drmModeAtomicReqPtr; | 620 | } drmModeAtomicReq, *drmModeAtomicReqPtr; |
495 | 621 | ||
622 | /* end xf86drmMode.h */ | ||
623 | |||
496 | typedef struct _Ecore_Drm2_Atomic_State Ecore_Drm2_Atomic_State; | 624 | typedef struct _Ecore_Drm2_Atomic_State Ecore_Drm2_Atomic_State; |
497 | 625 | ||
498 | typedef struct _Ecore_Drm2_Atomic_Blob | 626 | typedef struct _Ecore_Drm2_Atomic_Blob |