XenevaOS
Loading...
Searching...
No Matches
drm_mode.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
4 * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>
5 * Copyright (c) 2008 Red Hat Inc.
6 * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
7 * Copyright (c) 2007-2008 Intel Corporation
8 */
9
10#ifndef _DRM_MODE_H
11#define _DRM_MODE_H
12
13#include <linux/bits.h>
14#include <linux/const.h>
15
16#include "drm.h"
17
18#if defined(__cplusplus)
19extern "C" {
20#endif
21
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) /* deprecated */
36#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
37#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
38#define DRM_MODE_TYPE_PREFERRED (1<<3)
39#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */
40#define DRM_MODE_TYPE_USERDEF (1<<5)
41#define DRM_MODE_TYPE_DRIVER (1<<6)
42
43#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \
44 DRM_MODE_TYPE_USERDEF | \
45 DRM_MODE_TYPE_DRIVER)
46
47/* Video mode flags */
48/* bit compatible with the xrandr RR_ definitions (bits 0-13)
49 *
50 * ABI warning: Existing userspace really expects
51 * the mode flags to match the xrandr definitions. Any
52 * changes that don't match the xrandr definitions will
53 * likely need a new client cap or some other mechanism
54 * to avoid breaking existing userspace. This includes
55 * allocating new flags in the previously unused bits!
56 */
57#define DRM_MODE_FLAG_PHSYNC (1<<0)
58#define DRM_MODE_FLAG_NHSYNC (1<<1)
59#define DRM_MODE_FLAG_PVSYNC (1<<2)
60#define DRM_MODE_FLAG_NVSYNC (1<<3)
61#define DRM_MODE_FLAG_INTERLACE (1<<4)
62#define DRM_MODE_FLAG_DBLSCAN (1<<5)
63#define DRM_MODE_FLAG_CSYNC (1<<6)
64#define DRM_MODE_FLAG_PCSYNC (1<<7)
65#define DRM_MODE_FLAG_NCSYNC (1<<8)
66#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */
67#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */
68#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */
69#define DRM_MODE_FLAG_DBLCLK (1<<12)
70#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
71 /*
72 * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX
73 * (define not exposed to user space).
74 */
75#define DRM_MODE_FLAG_3D_MASK (0x1f<<14)
76#define DRM_MODE_FLAG_3D_NONE (0<<14)
77#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14)
78#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14)
79#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14)
80#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14)
81#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14)
82#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14)
83#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14)
84#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14)
85
86/* Picture aspect ratio options */
87#define DRM_MODE_PICTURE_ASPECT_NONE 0
88#define DRM_MODE_PICTURE_ASPECT_4_3 1
89#define DRM_MODE_PICTURE_ASPECT_16_9 2
90#define DRM_MODE_PICTURE_ASPECT_64_27 3
91#define DRM_MODE_PICTURE_ASPECT_256_135 4
92
93/* Content type options */
94#define DRM_MODE_CONTENT_TYPE_NO_DATA 0
95#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1
96#define DRM_MODE_CONTENT_TYPE_PHOTO 2
97#define DRM_MODE_CONTENT_TYPE_CINEMA 3
98#define DRM_MODE_CONTENT_TYPE_GAME 4
99
100/* Aspect ratio flag bitmask (4 bits 22:19) */
101#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19)
102#define DRM_MODE_FLAG_PIC_AR_NONE \
103 (DRM_MODE_PICTURE_ASPECT_NONE<<19)
104#define DRM_MODE_FLAG_PIC_AR_4_3 \
105 (DRM_MODE_PICTURE_ASPECT_4_3<<19)
106#define DRM_MODE_FLAG_PIC_AR_16_9 \
107 (DRM_MODE_PICTURE_ASPECT_16_9<<19)
108#define DRM_MODE_FLAG_PIC_AR_64_27 \
109 (DRM_MODE_PICTURE_ASPECT_64_27<<19)
110#define DRM_MODE_FLAG_PIC_AR_256_135 \
111 (DRM_MODE_PICTURE_ASPECT_256_135<<19)
112
113#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \
114 DRM_MODE_FLAG_NHSYNC | \
115 DRM_MODE_FLAG_PVSYNC | \
116 DRM_MODE_FLAG_NVSYNC | \
117 DRM_MODE_FLAG_INTERLACE | \
118 DRM_MODE_FLAG_DBLSCAN | \
119 DRM_MODE_FLAG_CSYNC | \
120 DRM_MODE_FLAG_PCSYNC | \
121 DRM_MODE_FLAG_NCSYNC | \
122 DRM_MODE_FLAG_HSKEW | \
123 DRM_MODE_FLAG_DBLCLK | \
124 DRM_MODE_FLAG_CLKDIV2 | \
125 DRM_MODE_FLAG_3D_MASK)
126
127/* DPMS flags */
128/* bit compatible with the xorg definitions. */
129#define DRM_MODE_DPMS_ON 0
130#define DRM_MODE_DPMS_STANDBY 1
131#define DRM_MODE_DPMS_SUSPEND 2
132#define DRM_MODE_DPMS_OFF 3
133
134/* Scaling mode options */
135#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or
136 software can still scale) */
137#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */
138#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
139#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
140
141/* Dithering mode options */
142#define DRM_MODE_DITHERING_OFF 0
143#define DRM_MODE_DITHERING_ON 1
144#define DRM_MODE_DITHERING_AUTO 2
145
146/* Dirty info options */
147#define DRM_MODE_DIRTY_OFF 0
148#define DRM_MODE_DIRTY_ON 1
149#define DRM_MODE_DIRTY_ANNOTATE 2
150
151/* Link Status options */
152#define DRM_MODE_LINK_STATUS_GOOD 0
153#define DRM_MODE_LINK_STATUS_BAD 1
154
155/* Panel type property */
156#define DRM_MODE_PANEL_TYPE_UNKNOWN 0
157#define DRM_MODE_PANEL_TYPE_OLED 1
158
159/*
160 * DRM_MODE_ROTATE_<degrees>
161 *
162 * Signals that a drm plane is been rotated <degrees> degrees in counter
163 * clockwise direction.
164 *
165 * This define is provided as a convenience, looking up the property id
166 * using the name->prop id lookup is the preferred method.
167 */
168#define DRM_MODE_ROTATE_0 (1<<0)
169#define DRM_MODE_ROTATE_90 (1<<1)
170#define DRM_MODE_ROTATE_180 (1<<2)
171#define DRM_MODE_ROTATE_270 (1<<3)
172
173/*
174 * DRM_MODE_ROTATE_MASK
175 *
176 * Bitmask used to look for drm plane rotations.
177 */
178#define DRM_MODE_ROTATE_MASK (\
179 DRM_MODE_ROTATE_0 | \
180 DRM_MODE_ROTATE_90 | \
181 DRM_MODE_ROTATE_180 | \
182 DRM_MODE_ROTATE_270)
183
184/*
185 * DRM_MODE_REFLECT_<axis>
186 *
187 * Signals that the contents of a drm plane is reflected along the <axis> axis,
188 * in the same way as mirroring.
189 * See kerneldoc chapter "Plane Composition Properties" for more details.
190 *
191 * This define is provided as a convenience, looking up the property id
192 * using the name->prop id lookup is the preferred method.
193 */
194#define DRM_MODE_REFLECT_X (1<<4)
195#define DRM_MODE_REFLECT_Y (1<<5)
196
197/*
198 * DRM_MODE_REFLECT_MASK
199 *
200 * Bitmask used to look for drm plane reflections.
201 */
202#define DRM_MODE_REFLECT_MASK (\
203 DRM_MODE_REFLECT_X | \
204 DRM_MODE_REFLECT_Y)
205
206/* Content Protection Flags */
207#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0
208#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1
209#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2
210
243 __u16 vscan;
250};
265};
280};
282#define DRM_MODE_PRESENT_TOP_FIELD (1<<0)
283#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1)
284
285/* Planes blend with or override other bits on the CRTC */
289 __u32 fb_id; /* fb object contains surface format type */
290 __u32 flags; /* see above flags */
291
292 /* Signed dest location allows it to be partially off screen */
297
298 /* Source values are 16.16 fixed point */
302 __u32 src_w;
303};
304
319struct drm_mode_get_plane {
325
329 __u32 fb_id;
330
340
348};
353};
355#define DRM_MODE_ENCODER_NONE 0
356#define DRM_MODE_ENCODER_DAC 1
357#define DRM_MODE_ENCODER_TMDS 2
358#define DRM_MODE_ENCODER_LVDS 3
359#define DRM_MODE_ENCODER_TVDAC 4
360#define DRM_MODE_ENCODER_VIRTUAL 5
361#define DRM_MODE_ENCODER_DSI 6
362#define DRM_MODE_ENCODER_DPMST 7
363#define DRM_MODE_ENCODER_DPI 8
373};
374
375/* This is for connectors with multiple signal types. */
376/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
379 DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */
381 DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */
390 DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */
391};
393#define DRM_MODE_CONNECTOR_Unknown 0
394#define DRM_MODE_CONNECTOR_VGA 1
395#define DRM_MODE_CONNECTOR_DVII 2
396#define DRM_MODE_CONNECTOR_DVID 3
397#define DRM_MODE_CONNECTOR_DVIA 4
398#define DRM_MODE_CONNECTOR_Composite 5
399#define DRM_MODE_CONNECTOR_SVIDEO 6
400#define DRM_MODE_CONNECTOR_LVDS 7
401#define DRM_MODE_CONNECTOR_Component 8
402#define DRM_MODE_CONNECTOR_9PinDIN 9
403#define DRM_MODE_CONNECTOR_DisplayPort 10
404#define DRM_MODE_CONNECTOR_HDMIA 11
405#define DRM_MODE_CONNECTOR_HDMIB 12
406#define DRM_MODE_CONNECTOR_TV 13
407#define DRM_MODE_CONNECTOR_eDP 14
408#define DRM_MODE_CONNECTOR_VIRTUAL 15
409#define DRM_MODE_CONNECTOR_DSI 16
410#define DRM_MODE_CONNECTOR_DPI 17
411#define DRM_MODE_CONNECTOR_WRITEBACK 18
412#define DRM_MODE_CONNECTOR_SPI 19
413#define DRM_MODE_CONNECTOR_USB 20
414
457
464
486
503
505 __u32 pad;
506};
508#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */
509#define DRM_MODE_PROP_RANGE (1<<1)
510#define DRM_MODE_PROP_IMMUTABLE (1<<2)
511#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */
512#define DRM_MODE_PROP_BLOB (1<<4)
513#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */
514
515/* non-extended types: legacy bitmask, one bit per type: */
516#define DRM_MODE_PROP_LEGACY_TYPE ( \
517 DRM_MODE_PROP_RANGE | \
518 DRM_MODE_PROP_ENUM | \
519 DRM_MODE_PROP_BLOB | \
520 DRM_MODE_PROP_BITMASK)
521
522/* extended-types: rather than continue to consume a bit per type,
523 * grab a chunk of the bits to use as integer type id.
524 */
525#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0
526#define DRM_MODE_PROP_TYPE(n) ((n) << 6)
527#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
528#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
529
530/* the PROP_ATOMIC flag is used to hide properties from userspace that
531 * is not aware of atomic properties. This is mostly to work around
532 * older userspace (DDX drivers) that read/write each prop they find,
533 * without being aware that this could be triggering a lengthy modeset.
534 */
535#define DRM_MODE_PROP_ATOMIC 0x80000000
536
547};
548
585
595 __u32 flags;
601
606};
612};
614#define DRM_MODE_OBJECT_CRTC 0xcccccccc
615#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
616#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
617#define DRM_MODE_OBJECT_MODE 0xdededede
618#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
619#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
620#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
621#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
622#define DRM_MODE_OBJECT_COLOROP 0xfafafafa
623#define DRM_MODE_OBJECT_ANY 0
631};
638};
644};
655};
657#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
658#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifier[] */
659
694struct drm_mode_fb_cmd2 {
696 __u32 fb_id;
698 __u32 width;
710 __u32 flags;
711
716 __u32 handles[4];
718 __u32 pitches[4];
720 __u32 offsets[4];
726 __u64 modifier[4];
727};
729#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
730#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
731#define DRM_MODE_FB_DIRTY_FLAGS 0x03
733#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
734
735/*
736 * Mark a region of a framebuffer as dirty.
737 *
738 * Some hardware does not automatically update display contents
739 * as a hardware or software draw to a framebuffer. This ioctl
740 * allows userspace to tell the kernel and the hardware what
741 * regions of the framebuffer have changed.
742 *
743 * The kernel or hardware is free to update more then just the
744 * region specified by the clip rects. The kernel or hardware
745 * may also delay and/or coalesce several calls to dirty into a
746 * single update.
747 *
748 * Userspace may annotate the updates, the annotates are a
749 * promise made by the caller that the change is either a copy
750 * of pixels or a fill of a single color in the region specified.
751 *
752 * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then
753 * the number of updated regions are half of num_clips given,
754 * where the clip rects are paired in src and dst. The width and
755 * height of each one of the pairs must match.
756 *
757 * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller
758 * promises that the region specified of the clip rects is filled
759 * completely with a single color as given in the color argument.
760 */
768};
773};
775#define DRM_MODE_CURSOR_BO 0x01
776#define DRM_MODE_CURSOR_MOVE 0x02
777#define DRM_MODE_CURSOR_FLAGS 0x03
778
779/*
780 * depending on the value in flags different members are used.
781 *
782 * CURSOR_BO uses
783 * crtc_id
784 * width
785 * height
786 * handle - if 0 turns the cursor off
787 *
788 * CURSOR_MOVE uses
789 * crtc_id
790 * x
791 * y
802};
815};
825};
827struct drm_color_ctm {
828 /*
829 * Conversion matrix in S31.32 sign-magnitude
830 * (not two's complement!) format.
831 *
832 * out matrix in
833 * |R| |0 1 2| |R|
834 * |G| = |3 4 5| x |G|
835 * |B| |6 7 8| |B|
836 */
837 __u64 matrix[9];
838};
840struct drm_color_ctm_3x4 {
841 /*
842 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
843 * (not two's complement!) format.
844 *
845 * out matrix in
846 * |R| |0 1 2 3 | | R |
847 * |G| = |4 5 6 7 | x | G |
848 * |B| |8 9 10 11| | B |
849 * |1.0|
850 */
851 __u64 matrix[12];
852};
854struct drm_color_lut {
855 /*
856 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
857 * 0xffff == 1.0.
858 */
863};
864
865/*
866 * struct drm_color_lut32
867 *
868 * 32-bit per channel color LUT entry, similar to drm_color_lut.
875};
876
884enum drm_colorop_type {
894
908
924
935
957};
958
969};
970
982};
983
995};
996
1011 __u8 eotf;
1024 struct {
1026 } display_primaries[3];
1035 struct {
1037 } white_point;
1056 __u16 max_cll;
1063};
1064
1070struct hdr_output_metadata {
1078 union {
1080 };
1081};
1082
1098#define DRM_MODE_PAGE_FLIP_EVENT 0x01
1115#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
1116#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
1117#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
1118#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
1119 DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
1125#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
1126 DRM_MODE_PAGE_FLIP_ASYNC | \
1127 DRM_MODE_PAGE_FLIP_TARGET)
1128
1129/*
1130 * Request a page flip on the specified crtc.
1131 *
1132 * This ioctl will ask KMS to schedule a page flip for the specified
1133 * crtc. Once any pending rendering targeting the specified fb (as of
1134 * ioctl time) has completed, the crtc will be reprogrammed to display
1135 * that fb after the next vertical refresh. The ioctl returns
1136 * immediately, but subsequent rendering to the current fb will block
1137 * in the execbuffer ioctl until the page flip happens. If a page
1138 * flip is already pending as the ioctl is called, EBUSY will be
1139 * returned.
1140 *
1141 * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
1142 * event (see drm.h: struct drm_event_vblank) when the page flip is
1143 * done. The user_data field passed in with this ioctl will be
1144 * returned as the user_data field in the vblank event struct.
1145 *
1146 * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
1147 * 'as soon as possible', meaning that it not delay waiting for vblank.
1148 * This may cause tearing on the screen.
1149 *
1150 * The reserved field must be zero.
1151 */
1159};
1160
1161/*
1162 * Request a page flip on the specified crtc.
1163 *
1164 * Same as struct drm_mode_crtc_page_flip, but supports new flags and
1165 * re-purposes the reserved field:
1166 *
1167 * The sequence field must be zero unless either of the
1168 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When
1169 * the ABSOLUTE flag is specified, the sequence field denotes the absolute
1170 * vblank sequence when the flip should take effect. When the RELATIVE
1171 * flag is specified, the sequence field denotes the relative (to the
1172 * current one when the ioctl is called) vblank sequence when the flip
1173 * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to
1174 * make sure the vblank sequence before the target one has passed before
1175 * calling this ioctl. The purpose of the
1176 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify
1177 * the target for when code dealing with a page flip runs during a
1178 * vertical blank period.
1179 */
1187};
1188
1254 __u32 flags;
1258 __u64 size;
1259};
1260
1261/* set up for mmap of a dumb scanout buffer */
1262struct drm_mode_map_dumb {
1265 __u32 pad;
1271 __u64 offset;
1272};
1276};
1277
1287#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
1296#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
1317#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
1318
1325#define DRM_MODE_ATOMIC_FLAGS (\
1326 DRM_MODE_PAGE_FLIP_EVENT |\
1327 DRM_MODE_PAGE_FLIP_ASYNC |\
1328 DRM_MODE_ATOMIC_TEST_ONLY |\
1329 DRM_MODE_ATOMIC_NONBLOCK |\
1330 DRM_MODE_ATOMIC_ALLOW_MODESET)
1341};
1344#define FORMAT_BLOB_CURRENT 1
1345 /* Version of this blob format */
1346 __u32 version;
1347
1348 /* Flags */
1349 __u32 flags;
1350
1351 /* Number of fourcc formats supported */
1353
1354 /* Where in this blob the formats exist (in bytes) */
1356
1357 /* Number of drm_format_modifiers */
1359
1360 /* Where in this blob the modifiers exist (in bytes) */
1362
1363 /* __u32 formats[] */
1364 /* struct drm_format_modifier modifiers[] */
1365};
1367struct drm_format_modifier {
1368 /* Bitmask of formats in get_plane format list this info applies to. The
1369 * offset allows a sliding window of which 64 formats (bits).
1370 *
1371 * Some examples:
1372 * In today's world with < 65 formats, and formats 0, and 2 are
1373 * supported
1374 * 0x0000000000000005
1375 * ^-offset = 0, formats = 5
1376 *
1377 * If the number formats grew to 128, and formats 98-102 are
1378 * supported with the modifier:
1379 *
1380 * 0x0000007c00000000 0000000000000000
1381 * ^
1382 * |__offset = 64, formats = 0x7c00000000
1383 *
1387 __u32 pad;
1388
1389 /* The modifier that applies to the >get_plane format list bitmask. */
1391};
1392
1399struct drm_mode_create_blob {
1401 __u64 data;
1403 __u32 length;
1405 __u32 blob_id;
1406};
1407
1421 __u32 blob_id;
1422};
1423
1433struct drm_mode_create_lease {
1439 __u32 flags;
1440
1444 __u32 fd;
1445};
1446
1452struct drm_mode_list_lessees {
1464 __u32 pad;
1465
1472};
1473
1479struct drm_mode_get_lease {
1491 __u32 pad;
1492
1499};
1500
1504struct drm_mode_revoke_lease {
1507};
1508
1525 __s32 y2;
1526};
1527
1535 __u32 pad;
1536};
1537
1538/*
1539 * Put 16-bit ARGB values into a standard 64-bit representation that can be
1540 * used for ioctl parameters, inter-driver communication, etc.
1541 *
1542 * If the component values being provided contain less than 16 bits of
1543 * precision, use a conversion ratio to get a better color approximation.
1544 * The ratio is computed as (2^16 - 1) / (2^bpc - 1), where bpc and 16 are
1545 * the input and output precision, respectively.
1546 * Also note bpc must be greater than 0.
1548#define __DRM_ARGB64_PREP(c, shift) \
1549 (((__u64)(c) & __GENMASK(15, 0)) << (shift))
1551#define __DRM_ARGB64_PREP_BPC(c, shift, bpc) \
1552({ \
1553 __u16 mask = __GENMASK((bpc) - 1, 0); \
1554 __u16 conv = __KERNEL_DIV_ROUND_CLOSEST((mask & (c)) * \
1555 __GENMASK(15, 0), mask);\
1556 __DRM_ARGB64_PREP(conv, shift); \
1557})
1559#define DRM_ARGB64_PREP(alpha, red, green, blue) \
1560( \
1561 __DRM_ARGB64_PREP(alpha, 48) | \
1562 __DRM_ARGB64_PREP(red, 32) | \
1563 __DRM_ARGB64_PREP(green, 16) | \
1564 __DRM_ARGB64_PREP(blue, 0) \
1565)
1567#define DRM_ARGB64_PREP_BPC(alpha, red, green, blue, bpc) \
1568({ \
1569 __typeof__(bpc) __bpc = bpc; \
1570 __DRM_ARGB64_PREP_BPC(alpha, 48, __bpc) | \
1571 __DRM_ARGB64_PREP_BPC(red, 32, __bpc) | \
1572 __DRM_ARGB64_PREP_BPC(green, 16, __bpc) | \
1573 __DRM_ARGB64_PREP_BPC(blue, 0, __bpc); \
1574})
1575
1576/*
1577 * Extract the specified color component from a standard 64-bit ARGB value.
1578 *
1579 * If the requested precision is less than 16 bits, make use of a conversion
1580 * ratio calculated as (2^bpc - 1) / (2^16 - 1), where bpc and 16 are the
1581 * output and input precision, respectively.
1582 *
1583 * If speed is more important than accuracy, use DRM_ARGB64_GET*_BPCS()
1584 * instead of DRM_ARGB64_GET*_BPC() in order to replace the expensive
1585 * division with a simple bit right-shift operation.
1587#define __DRM_ARGB64_GET(c, shift) \
1588 ((__u16)(((__u64)(c) >> (shift)) & __GENMASK(15, 0)))
1590#define __DRM_ARGB64_GET_BPC(c, shift, bpc) \
1591({ \
1592 __u16 comp = __DRM_ARGB64_GET(c, shift); \
1593 __KERNEL_DIV_ROUND_CLOSEST(comp * __GENMASK((bpc) - 1, 0), \
1594 __GENMASK(15, 0)); \
1595})
1597#define __DRM_ARGB64_GET_BPCS(c, shift, bpc) \
1598 (__DRM_ARGB64_GET(c, shift) >> (16 - (bpc)))
1600#define DRM_ARGB64_GETA(c) __DRM_ARGB64_GET(c, 48)
1601#define DRM_ARGB64_GETR(c) __DRM_ARGB64_GET(c, 32)
1602#define DRM_ARGB64_GETG(c) __DRM_ARGB64_GET(c, 16)
1603#define DRM_ARGB64_GETB(c) __DRM_ARGB64_GET(c, 0)
1605#define DRM_ARGB64_GETA_BPC(c, bpc) __DRM_ARGB64_GET_BPC(c, 48, bpc)
1606#define DRM_ARGB64_GETR_BPC(c, bpc) __DRM_ARGB64_GET_BPC(c, 32, bpc)
1607#define DRM_ARGB64_GETG_BPC(c, bpc) __DRM_ARGB64_GET_BPC(c, 16, bpc)
1608#define DRM_ARGB64_GETB_BPC(c, bpc) __DRM_ARGB64_GET_BPC(c, 0, bpc)
1610#define DRM_ARGB64_GETA_BPCS(c, bpc) __DRM_ARGB64_GET_BPCS(c, 48, bpc)
1611#define DRM_ARGB64_GETR_BPCS(c, bpc) __DRM_ARGB64_GET_BPCS(c, 32, bpc)
1612#define DRM_ARGB64_GETG_BPCS(c, bpc) __DRM_ARGB64_GET_BPCS(c, 16, bpc)
1613#define DRM_ARGB64_GETB_BPCS(c, bpc) __DRM_ARGB64_GET_BPCS(c, 0, bpc)
1614
1615#if defined(__cplusplus)
1616}
1617#endif
1618
1619#endif
int32_t __s32
Definition drm.h:41
uint32_t __u32
Definition drm.h:42
uint8_t __u8
Definition drm.h:38
uint16_t __u16
Definition drm.h:40
uint64_t __u64
Definition drm.h:44
drm_mode_subconnector
Definition drm_mode.h:376
@ DRM_MODE_SUBCONNECTOR_Automatic
Definition drm_mode.h:377
@ DRM_MODE_SUBCONNECTOR_Native
Definition drm_mode.h:388
@ DRM_MODE_SUBCONNECTOR_HDMIA
Definition drm_mode.h:387
@ DRM_MODE_SUBCONNECTOR_Component
Definition drm_mode.h:384
@ DRM_MODE_SUBCONNECTOR_DisplayPort
Definition drm_mode.h:386
@ DRM_MODE_SUBCONNECTOR_SVIDEO
Definition drm_mode.h:383
@ DRM_MODE_SUBCONNECTOR_Composite
Definition drm_mode.h:382
@ DRM_MODE_SUBCONNECTOR_VGA
Definition drm_mode.h:379
@ DRM_MODE_SUBCONNECTOR_Wireless
Definition drm_mode.h:389
@ DRM_MODE_SUBCONNECTOR_DVID
Definition drm_mode.h:380
@ DRM_MODE_SUBCONNECTOR_DVIA
Definition drm_mode.h:381
@ DRM_MODE_SUBCONNECTOR_Unknown
Definition drm_mode.h:378
@ DRM_MODE_SUBCONNECTOR_SCART
Definition drm_mode.h:385
drm_colorop_type
Definition drm_mode.h:883
@ DRM_COLOROP_1D_LUT
Definition drm_mode.h:906
@ DRM_COLOROP_CTM_3X4
Definition drm_mode.h:922
@ DRM_COLOROP_3D_LUT
Definition drm_mode.h:955
@ DRM_COLOROP_MULTIPLIER
Definition drm_mode.h:933
@ DRM_COLOROP_1D_CURVE
Definition drm_mode.h:892
drm_colorop_lut1d_interpolation_type
Definition drm_mode.h:973
@ DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR
Definition drm_mode.h:980
drm_colorop_lut3d_interpolation_type
Definition drm_mode.h:961
@ DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL
Definition drm_mode.h:967
Definition drm_mode.h:839
__u64 matrix[12]
Definition drm_mode.h:850
Definition drm_mode.h:826
__u64 matrix[9]
Definition drm_mode.h:836
Definition drm_mode.h:869
__u32 green
Definition drm_mode.h:871
__u32 blue
Definition drm_mode.h:872
__u32 reserved
Definition drm_mode.h:873
__u32 red
Definition drm_mode.h:870
Definition drm_mode.h:853
__u16 green
Definition drm_mode.h:859
__u16 reserved
Definition drm_mode.h:861
__u16 red
Definition drm_mode.h:858
__u16 blue
Definition drm_mode.h:860
Definition drm_mode.h:1342
__u32 formats_offset
Definition drm_mode.h:1354
__u32 modifiers_offset
Definition drm_mode.h:1360
__u32 flags
Definition drm_mode.h:1348
__u32 version
Definition drm_mode.h:1345
__u32 count_formats
Definition drm_mode.h:1351
__u32 count_modifiers
Definition drm_mode.h:1357
Definition drm_mode.h:1366
__u64 formats
Definition drm_mode.h:1384
__u32 pad
Definition drm_mode.h:1386
__u64 modifier
Definition drm_mode.h:1389
__u32 offset
Definition drm_mode.h:1385
Definition drm_mode.h:1331
__u32 flags
Definition drm_mode.h:1332
__u64 user_data
Definition drm_mode.h:1339
__u32 count_objs
Definition drm_mode.h:1333
__u64 reserved
Definition drm_mode.h:1338
__u64 count_props_ptr
Definition drm_mode.h:1335
__u64 prop_values_ptr
Definition drm_mode.h:1337
__u64 objs_ptr
Definition drm_mode.h:1334
__u64 props_ptr
Definition drm_mode.h:1336
Definition drm_mode.h:251
__u32 min_width
Definition drm_mode.h:260
__u32 max_width
Definition drm_mode.h:261
__u64 encoder_id_ptr
Definition drm_mode.h:255
__u32 min_height
Definition drm_mode.h:262
__u32 max_height
Definition drm_mode.h:263
__u64 fb_id_ptr
Definition drm_mode.h:252
__u32 count_connectors
Definition drm_mode.h:258
__u32 count_crtcs
Definition drm_mode.h:257
__u64 connector_id_ptr
Definition drm_mode.h:254
__u32 count_fbs
Definition drm_mode.h:256
__u64 crtc_id_ptr
Definition drm_mode.h:253
__u32 count_encoders
Definition drm_mode.h:259
Definition drm_mode.h:1532
__u32 pad
Definition drm_mode.h:1534
__u32 fb_id
Definition drm_mode.h:1533
Definition drm_mode.h:607
__u32 prop_id
Definition drm_mode.h:609
__u64 value
Definition drm_mode.h:608
__u32 connector_id
Definition drm_mode.h:610
Definition drm_mode.h:1398
__u64 data
Definition drm_mode.h:1400
__u32 length
Definition drm_mode.h:1402
__u32 blob_id
Definition drm_mode.h:1404
Definition drm_mode.h:1249
__u32 handle
Definition drm_mode.h:1255
__u32 width
Definition drm_mode.h:1251
__u32 flags
Definition drm_mode.h:1253
__u32 height
Definition drm_mode.h:1250
__u32 bpp
Definition drm_mode.h:1252
__u64 size
Definition drm_mode.h:1257
__u32 pitch
Definition drm_mode.h:1256
Definition drm_mode.h:1432
__u64 object_ids
Definition drm_mode.h:1434
__u32 lessee_id
Definition drm_mode.h:1441
__u32 fd
Definition drm_mode.h:1443
__u32 object_count
Definition drm_mode.h:1436
__u32 flags
Definition drm_mode.h:1438
Definition drm_mode.h:816
__u64 red
Definition drm_mode.h:821
__u64 green
Definition drm_mode.h:822
__u32 crtc_id
Definition drm_mode.h:817
__u32 gamma_size
Definition drm_mode.h:818
__u64 blue
Definition drm_mode.h:823
Definition drm_mode.h:1180
__u32 crtc_id
Definition drm_mode.h:1181
__u32 sequence
Definition drm_mode.h:1184
__u32 flags
Definition drm_mode.h:1183
__u64 user_data
Definition drm_mode.h:1185
__u32 fb_id
Definition drm_mode.h:1182
Definition drm_mode.h:1152
__u32 crtc_id
Definition drm_mode.h:1153
__u32 reserved
Definition drm_mode.h:1156
__u64 user_data
Definition drm_mode.h:1157
__u32 flags
Definition drm_mode.h:1155
__u32 fb_id
Definition drm_mode.h:1154
Definition drm_mode.h:266
__u32 crtc_id
Definition drm_mode.h:270
__u32 mode_valid
Definition drm_mode.h:277
__u32 gamma_size
Definition drm_mode.h:276
__u32 y
Definition drm_mode.h:274
__u64 set_connectors_ptr
Definition drm_mode.h:267
__u32 x
Definition drm_mode.h:273
__u32 fb_id
Definition drm_mode.h:271
struct drm_mode_modeinfo mode
Definition drm_mode.h:278
__u32 count_connectors
Definition drm_mode.h:268
Definition drm_mode.h:803
__s32 y
Definition drm_mode.h:807
__u32 width
Definition drm_mode.h:808
__u32 crtc_id
Definition drm_mode.h:805
__s32 hot_y
Definition drm_mode.h:813
__u32 height
Definition drm_mode.h:809
__s32 x
Definition drm_mode.h:806
__s32 hot_x
Definition drm_mode.h:812
__u32 handle
Definition drm_mode.h:811
__u32 flags
Definition drm_mode.h:804
Definition drm_mode.h:792
__s32 x
Definition drm_mode.h:795
__u32 crtc_id
Definition drm_mode.h:794
__u32 width
Definition drm_mode.h:797
__u32 height
Definition drm_mode.h:798
__s32 y
Definition drm_mode.h:796
__u32 flags
Definition drm_mode.h:793
__u32 handle
Definition drm_mode.h:800
Definition drm_mode.h:1419
__u32 blob_id
Definition drm_mode.h:1420
Definition drm_mode.h:1273
__u32 handle
Definition drm_mode.h:1274
Definition drm_mode.h:693
__u32 flags
Definition drm_mode.h:709
__u32 height
Definition drm_mode.h:699
__u32 fb_id
Definition drm_mode.h:695
__u64 modifier[4]
Definition drm_mode.h:725
__u32 pitches[4]
Definition drm_mode.h:717
__u32 offsets[4]
Definition drm_mode.h:719
__u32 width
Definition drm_mode.h:697
__u32 handles[4]
Definition drm_mode.h:715
__u32 pixel_format
Definition drm_mode.h:704
Definition drm_mode.h:645
__u32 depth
Definition drm_mode.h:651
__u32 width
Definition drm_mode.h:647
__u32 handle
Definition drm_mode.h:653
__u32 pitch
Definition drm_mode.h:649
__u32 fb_id
Definition drm_mode.h:646
__u32 bpp
Definition drm_mode.h:650
__u32 height
Definition drm_mode.h:648
Definition drm_mode.h:761
__u32 fb_id
Definition drm_mode.h:762
__u32 flags
Definition drm_mode.h:763
__u32 color
Definition drm_mode.h:764
__u64 clips_ptr
Definition drm_mode.h:766
__u32 num_clips
Definition drm_mode.h:765
Definition drm_mode.h:639
__u64 data
Definition drm_mode.h:642
__u32 length
Definition drm_mode.h:641
__u32 blob_id
Definition drm_mode.h:640
Definition drm_mode.h:447
__u32 pad
Definition drm_mode.h:504
__u64 modes_ptr
Definition drm_mode.h:451
__u32 mm_width
Definition drm_mode.h:493
__u32 connection
Definition drm_mode.h:491
__u32 mm_height
Definition drm_mode.h:495
__u32 connector_type_id
Definition drm_mode.h:484
__u32 connector_id
Definition drm_mode.h:467
__u32 connector_type
Definition drm_mode.h:473
__u32 encoder_id
Definition drm_mode.h:465
__u64 props_ptr
Definition drm_mode.h:453
__u32 count_encoders
Definition drm_mode.h:462
__u64 encoders_ptr
Definition drm_mode.h:449
__u32 count_modes
Definition drm_mode.h:458
__u32 count_props
Definition drm_mode.h:460
__u32 subpixel
Definition drm_mode.h:501
__u64 prop_values_ptr
Definition drm_mode.h:455
Definition drm_mode.h:364
__u32 encoder_id
Definition drm_mode.h:365
__u32 possible_crtcs
Definition drm_mode.h:370
__u32 crtc_id
Definition drm_mode.h:368
__u32 possible_clones
Definition drm_mode.h:371
__u32 encoder_type
Definition drm_mode.h:366
Definition drm_mode.h:1478
__u64 objects_ptr
Definition drm_mode.h:1497
__u32 count_objects
Definition drm_mode.h:1488
__u32 pad
Definition drm_mode.h:1490
Definition drm_mode.h:349
__u64 plane_id_ptr
Definition drm_mode.h:350
__u32 count_planes
Definition drm_mode.h:351
Definition drm_mode.h:318
__u32 plane_id
Definition drm_mode.h:323
__u32 fb_id
Definition drm_mode.h:328
__u32 possible_crtcs
Definition drm_mode.h:336
__u32 crtc_id
Definition drm_mode.h:326
__u32 count_format_types
Definition drm_mode.h:341
__u64 format_type_ptr
Definition drm_mode.h:346
__u32 gamma_size
Definition drm_mode.h:338
Definition drm_mode.h:579
__u32 flags
Definition drm_mode.h:594
__u32 prop_id
Definition drm_mode.h:589
__u64 values_ptr
Definition drm_mode.h:581
__u64 enum_blob_ptr
Definition drm_mode.h:583
__u32 count_values
Definition drm_mode.h:602
char name[DRM_PROP_NAME_LEN]
Definition drm_mode.h:599
__u32 count_enum_blobs
Definition drm_mode.h:604
Definition drm_mode.h:1451
__u32 count_lessees
Definition drm_mode.h:1461
__u32 pad
Definition drm_mode.h:1463
__u64 lessees_ptr
Definition drm_mode.h:1470
Definition drm_mode.h:1261
__u64 offset
Definition drm_mode.h:1270
__u32 pad
Definition drm_mode.h:1264
__u32 handle
Definition drm_mode.h:1263
Definition drm_mode.h:769
struct drm_mode_modeinfo mode
Definition drm_mode.h:771
__u32 connector_id
Definition drm_mode.h:770
Definition drm_mode.h:231
char name[DRM_DISPLAY_MODE_LEN]
Definition drm_mode.h:248
__u16 vsync_start
Definition drm_mode.h:239
__u16 hsync_end
Definition drm_mode.h:235
__u16 hsync_start
Definition drm_mode.h:234
__u16 vdisplay
Definition drm_mode.h:238
__u16 htotal
Definition drm_mode.h:236
__u16 vtotal
Definition drm_mode.h:241
__u16 hskew
Definition drm_mode.h:237
__u32 vrefresh
Definition drm_mode.h:244
__u32 clock
Definition drm_mode.h:232
__u16 vsync_end
Definition drm_mode.h:240
__u32 flags
Definition drm_mode.h:246
__u16 vscan
Definition drm_mode.h:242
__u32 type
Definition drm_mode.h:247
__u16 hdisplay
Definition drm_mode.h:233
Definition drm_mode.h:624
__u64 prop_values_ptr
Definition drm_mode.h:626
__u32 obj_type
Definition drm_mode.h:629
__u32 obj_id
Definition drm_mode.h:628
__u32 count_props
Definition drm_mode.h:627
__u64 props_ptr
Definition drm_mode.h:625
Definition drm_mode.h:632
__u32 obj_id
Definition drm_mode.h:635
__u32 prop_id
Definition drm_mode.h:634
__u32 obj_type
Definition drm_mode.h:636
__u64 value
Definition drm_mode.h:633
Definition drm_mode.h:543
__u64 value
Definition drm_mode.h:544
char name[DRM_PROP_NAME_LEN]
Definition drm_mode.h:545
Definition drm_mode.h:1520
__s32 y1
Definition drm_mode.h:1522
__s32 y2
Definition drm_mode.h:1524
__s32 x1
Definition drm_mode.h:1521
__s32 x2
Definition drm_mode.h:1523
Definition drm_mode.h:1503
__u32 lessee_id
Definition drm_mode.h:1505
Definition drm_mode.h:285
__u32 crtc_h
Definition drm_mode.h:295
__u32 src_y
Definition drm_mode.h:299
__u32 crtc_w
Definition drm_mode.h:294
__s32 crtc_y
Definition drm_mode.h:293
__u32 src_w
Definition drm_mode.h:301
__u32 src_h
Definition drm_mode.h:300
__u32 flags
Definition drm_mode.h:289
__u32 plane_id
Definition drm_mode.h:286
__u32 crtc_id
Definition drm_mode.h:287
__s32 crtc_x
Definition drm_mode.h:292
__u32 src_x
Definition drm_mode.h:298
__u32 fb_id
Definition drm_mode.h:288
Definition drm_mode.h:991
__u16 height
Definition drm_mode.h:993
__u16 width
Definition drm_mode.h:992
Definition drm_mode.h:1005
__u16 x
Definition drm_mode.h:1024
struct hdr_metadata_infoframe::@49 white_point
__u16 max_display_mastering_luminance
Definition drm_mode.h:1042
__u8 eotf
Definition drm_mode.h:1010
__u16 max_fall
Definition drm_mode.h:1061
struct hdr_metadata_infoframe::@48 display_primaries[3]
__u16 y
Definition drm_mode.h:1024
__u16 max_cll
Definition drm_mode.h:1055
__u16 min_display_mastering_luminance
Definition drm_mode.h:1049
__u8 metadata_type
Definition drm_mode.h:1014
Definition drm_mode.h:1069
struct hdr_metadata_infoframe hdmi_metadata_type1
Definition drm_mode.h:1078
__u32 metadata_type
Definition drm_mode.h:1073
#define DRM_PROP_NAME_LEN
Definition drm_mode.h:33
#define DRM_DISPLAY_MODE_LEN
Definition drm_mode.h:32