diff options
Diffstat (limited to 'include/drm/drm_mode.h')
-rw-r--r-- | include/drm/drm_mode.h | 277 |
1 files changed, 235 insertions, 42 deletions
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 6708e2b7..74368de3 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -38,16 +38,24 @@ extern "C" { | |||
38 | #define DRM_DISPLAY_MODE_LEN 32 | 38 | #define DRM_DISPLAY_MODE_LEN 32 |
39 | #define DRM_PROP_NAME_LEN 32 | 39 | #define DRM_PROP_NAME_LEN 32 |
40 | 40 | ||
41 | #define DRM_MODE_TYPE_BUILTIN (1<<0) | 41 | #define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */ |
42 | #define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) | 42 | #define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ |
43 | #define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) | 43 | #define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ |
44 | #define DRM_MODE_TYPE_PREFERRED (1<<3) | 44 | #define DRM_MODE_TYPE_PREFERRED (1<<3) |
45 | #define DRM_MODE_TYPE_DEFAULT (1<<4) | 45 | #define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */ |
46 | #define DRM_MODE_TYPE_USERDEF (1<<5) | 46 | #define DRM_MODE_TYPE_USERDEF (1<<5) |
47 | #define DRM_MODE_TYPE_DRIVER (1<<6) | 47 | #define DRM_MODE_TYPE_DRIVER (1<<6) |
48 | 48 | ||
49 | /* Video mode flags */ | 49 | /* Video mode flags */ |
50 | /* bit compatible with the xorg definitions. */ | 50 | /* bit compatible with the xrandr RR_ definitions (bits 0-13) |
51 | * | ||
52 | * ABI warning: Existing userspace really expects | ||
53 | * the mode flags to match the xrandr definitions. Any | ||
54 | * changes that don't match the xrandr definitions will | ||
55 | * likely need a new client cap or some other mechanism | ||
56 | * to avoid breaking existing userspace. This includes | ||
57 | * allocating new flags in the previously unused bits! | ||
58 | */ | ||
51 | #define DRM_MODE_FLAG_PHSYNC (1<<0) | 59 | #define DRM_MODE_FLAG_PHSYNC (1<<0) |
52 | #define DRM_MODE_FLAG_NHSYNC (1<<1) | 60 | #define DRM_MODE_FLAG_NHSYNC (1<<1) |
53 | #define DRM_MODE_FLAG_PVSYNC (1<<2) | 61 | #define DRM_MODE_FLAG_PVSYNC (1<<2) |
@@ -58,8 +66,8 @@ extern "C" { | |||
58 | #define DRM_MODE_FLAG_PCSYNC (1<<7) | 66 | #define DRM_MODE_FLAG_PCSYNC (1<<7) |
59 | #define DRM_MODE_FLAG_NCSYNC (1<<8) | 67 | #define DRM_MODE_FLAG_NCSYNC (1<<8) |
60 | #define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ | 68 | #define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ |
61 | #define DRM_MODE_FLAG_BCAST (1<<10) | 69 | #define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */ |
62 | #define DRM_MODE_FLAG_PIXMUX (1<<11) | 70 | #define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */ |
63 | #define DRM_MODE_FLAG_DBLCLK (1<<12) | 71 | #define DRM_MODE_FLAG_DBLCLK (1<<12) |
64 | #define DRM_MODE_FLAG_CLKDIV2 (1<<13) | 72 | #define DRM_MODE_FLAG_CLKDIV2 (1<<13) |
65 | /* | 73 | /* |
@@ -67,7 +75,7 @@ extern "C" { | |||
67 | * (define not exposed to user space). | 75 | * (define not exposed to user space). |
68 | */ | 76 | */ |
69 | #define DRM_MODE_FLAG_3D_MASK (0x1f<<14) | 77 | #define DRM_MODE_FLAG_3D_MASK (0x1f<<14) |
70 | #define DRM_MODE_FLAG_3D_NONE (0<<14) | 78 | #define DRM_MODE_FLAG_3D_NONE (0<<14) |
71 | #define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) | 79 | #define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) |
72 | #define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) | 80 | #define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) |
73 | #define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) | 81 | #define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) |
@@ -77,6 +85,19 @@ extern "C" { | |||
77 | #define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) | 85 | #define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) |
78 | #define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) | 86 | #define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) |
79 | 87 | ||
88 | /* Picture aspect ratio options */ | ||
89 | #define DRM_MODE_PICTURE_ASPECT_NONE 0 | ||
90 | #define DRM_MODE_PICTURE_ASPECT_4_3 1 | ||
91 | #define DRM_MODE_PICTURE_ASPECT_16_9 2 | ||
92 | |||
93 | /* Aspect ratio flag bitmask (4 bits 22:19) */ | ||
94 | #define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19) | ||
95 | #define DRM_MODE_FLAG_PIC_AR_NONE \ | ||
96 | (DRM_MODE_PICTURE_ASPECT_NONE<<19) | ||
97 | #define DRM_MODE_FLAG_PIC_AR_4_3 \ | ||
98 | (DRM_MODE_PICTURE_ASPECT_4_3<<19) | ||
99 | #define DRM_MODE_FLAG_PIC_AR_16_9 \ | ||
100 | (DRM_MODE_PICTURE_ASPECT_16_9<<19) | ||
80 | 101 | ||
81 | /* DPMS flags */ | 102 | /* DPMS flags */ |
82 | /* bit compatible with the xorg definitions. */ | 103 | /* bit compatible with the xorg definitions. */ |
@@ -92,11 +113,6 @@ extern "C" { | |||
92 | #define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ | 113 | #define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ |
93 | #define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ | 114 | #define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ |
94 | 115 | ||
95 | /* Picture aspect ratio options */ | ||
96 | #define DRM_MODE_PICTURE_ASPECT_NONE 0 | ||
97 | #define DRM_MODE_PICTURE_ASPECT_4_3 1 | ||
98 | #define DRM_MODE_PICTURE_ASPECT_16_9 2 | ||
99 | |||
100 | /* Dithering mode options */ | 116 | /* Dithering mode options */ |
101 | #define DRM_MODE_DITHERING_OFF 0 | 117 | #define DRM_MODE_DITHERING_OFF 0 |
102 | #define DRM_MODE_DITHERING_ON 1 | 118 | #define DRM_MODE_DITHERING_ON 1 |
@@ -107,13 +123,73 @@ extern "C" { | |||
107 | #define DRM_MODE_DIRTY_ON 1 | 123 | #define DRM_MODE_DIRTY_ON 1 |
108 | #define DRM_MODE_DIRTY_ANNOTATE 2 | 124 | #define DRM_MODE_DIRTY_ANNOTATE 2 |
109 | 125 | ||
126 | /* Link Status options */ | ||
127 | #define DRM_MODE_LINK_STATUS_GOOD 0 | ||
128 | #define DRM_MODE_LINK_STATUS_BAD 1 | ||
129 | |||
130 | /* | ||
131 | * DRM_MODE_ROTATE_<degrees> | ||
132 | * | ||
133 | * Signals that a drm plane is been rotated <degrees> degrees in counter | ||
134 | * clockwise direction. | ||
135 | * | ||
136 | * This define is provided as a convenience, looking up the property id | ||
137 | * using the name->prop id lookup is the preferred method. | ||
138 | */ | ||
139 | #define DRM_MODE_ROTATE_0 (1<<0) | ||
140 | #define DRM_MODE_ROTATE_90 (1<<1) | ||
141 | #define DRM_MODE_ROTATE_180 (1<<2) | ||
142 | #define DRM_MODE_ROTATE_270 (1<<3) | ||
143 | |||
144 | /* | ||
145 | * DRM_MODE_ROTATE_MASK | ||
146 | * | ||
147 | * Bitmask used to look for drm plane rotations. | ||
148 | */ | ||
149 | #define DRM_MODE_ROTATE_MASK (\ | ||
150 | DRM_MODE_ROTATE_0 | \ | ||
151 | DRM_MODE_ROTATE_90 | \ | ||
152 | DRM_MODE_ROTATE_180 | \ | ||
153 | DRM_MODE_ROTATE_270) | ||
154 | |||
155 | /* | ||
156 | * DRM_MODE_REFLECT_<axis> | ||
157 | * | ||
158 | * Signals that the contents of a drm plane is reflected in the <axis> axis, | ||
159 | * in the same way as mirroring. | ||
160 | * | ||
161 | * This define is provided as a convenience, looking up the property id | ||
162 | * using the name->prop id lookup is the preferred method. | ||
163 | */ | ||
164 | #define DRM_MODE_REFLECT_X (1<<4) | ||
165 | #define DRM_MODE_REFLECT_Y (1<<5) | ||
166 | |||
167 | /* | ||
168 | * DRM_MODE_REFLECT_MASK | ||
169 | * | ||
170 | * Bitmask used to look for drm plane reflections. | ||
171 | */ | ||
172 | #define DRM_MODE_REFLECT_MASK (\ | ||
173 | DRM_MODE_REFLECT_X | \ | ||
174 | DRM_MODE_REFLECT_Y) | ||
175 | |||
176 | |||
177 | /* | ||
178 | * Legacy definitions for old code that doesn't use | ||
179 | * the above mask definitions. Don't use in future code. | ||
180 | */ | ||
110 | /* rotation property bits */ | 181 | /* rotation property bits */ |
111 | #define DRM_ROTATE_0 0 | 182 | #define DRM_ROTATE_0 0 |
112 | #define DRM_ROTATE_90 1 | 183 | #define DRM_ROTATE_90 1 |
113 | #define DRM_ROTATE_180 2 | 184 | #define DRM_ROTATE_180 2 |
114 | #define DRM_ROTATE_270 3 | 185 | #define DRM_ROTATE_270 3 |
115 | #define DRM_REFLECT_X 4 | 186 | #define DRM_REFLECT_X 4 |
116 | #define DRM_REFLECT_Y 5 | 187 | #define DRM_REFLECT_Y 5 |
188 | |||
189 | /* Content Protection Flags */ | ||
190 | #define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0 | ||
191 | #define DRM_MODE_CONTENT_PROTECTION_DESIRED 1 | ||
192 | #define DRM_MODE_CONTENT_PROTECTION_ENABLED 2 | ||
117 | 193 | ||
118 | struct drm_mode_modeinfo { | 194 | struct drm_mode_modeinfo { |
119 | __u32 clock; | 195 | __u32 clock; |
@@ -228,14 +304,16 @@ struct drm_mode_get_encoder { | |||
228 | 304 | ||
229 | /* This is for connectors with multiple signal types. */ | 305 | /* This is for connectors with multiple signal types. */ |
230 | /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ | 306 | /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ |
231 | #define DRM_MODE_SUBCONNECTOR_Automatic 0 | 307 | enum drm_mode_subconnector { |
232 | #define DRM_MODE_SUBCONNECTOR_Unknown 0 | 308 | DRM_MODE_SUBCONNECTOR_Automatic = 0, |
233 | #define DRM_MODE_SUBCONNECTOR_DVID 3 | 309 | DRM_MODE_SUBCONNECTOR_Unknown = 0, |
234 | #define DRM_MODE_SUBCONNECTOR_DVIA 4 | 310 | DRM_MODE_SUBCONNECTOR_DVID = 3, |
235 | #define DRM_MODE_SUBCONNECTOR_Composite 5 | 311 | DRM_MODE_SUBCONNECTOR_DVIA = 4, |
236 | #define DRM_MODE_SUBCONNECTOR_SVIDEO 6 | 312 | DRM_MODE_SUBCONNECTOR_Composite = 5, |
237 | #define DRM_MODE_SUBCONNECTOR_Component 8 | 313 | DRM_MODE_SUBCONNECTOR_SVIDEO = 6, |
238 | #define DRM_MODE_SUBCONNECTOR_SCART 9 | 314 | DRM_MODE_SUBCONNECTOR_Component = 8, |
315 | DRM_MODE_SUBCONNECTOR_SCART = 9, | ||
316 | }; | ||
239 | 317 | ||
240 | #define DRM_MODE_CONNECTOR_Unknown 0 | 318 | #define DRM_MODE_CONNECTOR_Unknown 0 |
241 | #define DRM_MODE_CONNECTOR_VGA 1 | 319 | #define DRM_MODE_CONNECTOR_VGA 1 |
@@ -280,7 +358,7 @@ struct drm_mode_get_connector { | |||
280 | __u32 pad; | 358 | __u32 pad; |
281 | }; | 359 | }; |
282 | 360 | ||
283 | #define DRM_MODE_PROP_PENDING (1<<0) | 361 | #define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */ |
284 | #define DRM_MODE_PROP_RANGE (1<<1) | 362 | #define DRM_MODE_PROP_RANGE (1<<1) |
285 | #define DRM_MODE_PROP_IMMUTABLE (1<<2) | 363 | #define DRM_MODE_PROP_IMMUTABLE (1<<2) |
286 | #define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ | 364 | #define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ |
@@ -400,17 +478,20 @@ struct drm_mode_fb_cmd2 { | |||
400 | * offsets[1]. Note that offsets[0] will generally | 478 | * offsets[1]. Note that offsets[0] will generally |
401 | * be 0 (but this is not required). | 479 | * be 0 (but this is not required). |
402 | * | 480 | * |
403 | * To accommodate tiled, compressed, etc formats, a per-plane | 481 | * To accommodate tiled, compressed, etc formats, a |
404 | * modifier can be specified. The default value of zero | 482 | * modifier can be specified. The default value of zero |
405 | * indicates "native" format as specified by the fourcc. | 483 | * indicates "native" format as specified by the fourcc. |
406 | * Vendor specific modifier token. This allows, for example, | 484 | * Vendor specific modifier token. Note that even though |
407 | * different tiling/swizzling pattern on different planes. | 485 | * it looks like we have a modifier per-plane, we in fact |
408 | * See discussion above of DRM_FORMAT_MOD_xxx. | 486 | * do not. The modifier for each plane must be identical. |
487 | * Thus all combinations of different data layouts for | ||
488 | * multi plane formats must be enumerated as separate | ||
489 | * modifiers. | ||
409 | */ | 490 | */ |
410 | __u32 handles[4]; | 491 | __u32 handles[4]; |
411 | __u32 pitches[4]; /* pitch for each plane */ | 492 | __u32 pitches[4]; /* pitch for each plane */ |
412 | __u32 offsets[4]; /* offset of each plane */ | 493 | __u32 offsets[4]; /* offset of each plane */ |
413 | __u64 modifier[4]; /* ie, tiling, compressed (per plane) */ | 494 | __u64 modifier[4]; /* ie, tiling, compress */ |
414 | }; | 495 | }; |
415 | 496 | ||
416 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 | 497 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 |
@@ -512,8 +593,11 @@ struct drm_mode_crtc_lut { | |||
512 | }; | 593 | }; |
513 | 594 | ||
514 | struct drm_color_ctm { | 595 | struct drm_color_ctm { |
515 | /* Conversion matrix in S31.32 format. */ | 596 | /* |
516 | __s64 matrix[9]; | 597 | * Conversion matrix in S31.32 sign-magnitude |
598 | * (not two's complement!) format. | ||
599 | */ | ||
600 | __u64 matrix[9]; | ||
517 | }; | 601 | }; |
518 | 602 | ||
519 | struct drm_color_lut { | 603 | struct drm_color_lut { |
@@ -637,13 +721,6 @@ struct drm_mode_destroy_dumb { | |||
637 | DRM_MODE_ATOMIC_NONBLOCK |\ | 721 | DRM_MODE_ATOMIC_NONBLOCK |\ |
638 | DRM_MODE_ATOMIC_ALLOW_MODESET) | 722 | DRM_MODE_ATOMIC_ALLOW_MODESET) |
639 | 723 | ||
640 | #define DRM_MODE_ATOMIC_FLAGS (\ | ||
641 | DRM_MODE_PAGE_FLIP_EVENT |\ | ||
642 | DRM_MODE_PAGE_FLIP_ASYNC |\ | ||
643 | DRM_MODE_ATOMIC_TEST_ONLY |\ | ||
644 | DRM_MODE_ATOMIC_NONBLOCK |\ | ||
645 | DRM_MODE_ATOMIC_ALLOW_MODESET) | ||
646 | |||
647 | struct drm_mode_atomic { | 724 | struct drm_mode_atomic { |
648 | __u32 flags; | 725 | __u32 flags; |
649 | __u32 count_objs; | 726 | __u32 count_objs; |
@@ -655,6 +732,56 @@ struct drm_mode_atomic { | |||
655 | __u64 user_data; | 732 | __u64 user_data; |
656 | }; | 733 | }; |
657 | 734 | ||
735 | struct drm_format_modifier_blob { | ||
736 | #define FORMAT_BLOB_CURRENT 1 | ||
737 | /* Version of this blob format */ | ||
738 | __u32 version; | ||
739 | |||
740 | /* Flags */ | ||
741 | __u32 flags; | ||
742 | |||
743 | /* Number of fourcc formats supported */ | ||
744 | __u32 count_formats; | ||
745 | |||
746 | /* Where in this blob the formats exist (in bytes) */ | ||
747 | __u32 formats_offset; | ||
748 | |||
749 | /* Number of drm_format_modifiers */ | ||
750 | __u32 count_modifiers; | ||
751 | |||
752 | /* Where in this blob the modifiers exist (in bytes) */ | ||
753 | __u32 modifiers_offset; | ||
754 | |||
755 | /* __u32 formats[] */ | ||
756 | /* struct drm_format_modifier modifiers[] */ | ||
757 | }; | ||
758 | |||
759 | struct drm_format_modifier { | ||
760 | /* Bitmask of formats in get_plane format list this info applies to. The | ||
761 | * offset allows a sliding window of which 64 formats (bits). | ||
762 | * | ||
763 | * Some examples: | ||
764 | * In today's world with < 65 formats, and formats 0, and 2 are | ||
765 | * supported | ||
766 | * 0x0000000000000005 | ||
767 | * ^-offset = 0, formats = 5 | ||
768 | * | ||
769 | * If the number formats grew to 128, and formats 98-102 are | ||
770 | * supported with the modifier: | ||
771 | * | ||
772 | * 0x0000007c00000000 0000000000000000 | ||
773 | * ^ | ||
774 | * |__offset = 64, formats = 0x7c00000000 | ||
775 | * | ||
776 | */ | ||
777 | __u64 formats; | ||
778 | __u32 offset; | ||
779 | __u32 pad; | ||
780 | |||
781 | /* The modifier that applies to the >get_plane format list bitmask. */ | ||
782 | __u64 modifier; | ||
783 | }; | ||
784 | |||
658 | /** | 785 | /** |
659 | * Create a new 'blob' data property, copying length bytes from data pointer, | 786 | * Create a new 'blob' data property, copying length bytes from data pointer, |
660 | * and returning new blob ID. | 787 | * and returning new blob ID. |
@@ -675,6 +802,72 @@ struct drm_mode_destroy_blob { | |||
675 | __u32 blob_id; | 802 | __u32 blob_id; |
676 | }; | 803 | }; |
677 | 804 | ||
805 | /** | ||
806 | * Lease mode resources, creating another drm_master. | ||
807 | */ | ||
808 | struct drm_mode_create_lease { | ||
809 | /** Pointer to array of object ids (__u32) */ | ||
810 | __u64 object_ids; | ||
811 | /** Number of object ids */ | ||
812 | __u32 object_count; | ||
813 | /** flags for new FD (O_CLOEXEC, etc) */ | ||
814 | __u32 flags; | ||
815 | |||
816 | /** Return: unique identifier for lessee. */ | ||
817 | __u32 lessee_id; | ||
818 | /** Return: file descriptor to new drm_master file */ | ||
819 | __u32 fd; | ||
820 | }; | ||
821 | |||
822 | /** | ||
823 | * List lesses from a drm_master | ||
824 | */ | ||
825 | struct drm_mode_list_lessees { | ||
826 | /** Number of lessees. | ||
827 | * On input, provides length of the array. | ||
828 | * On output, provides total number. No | ||
829 | * more than the input number will be written | ||
830 | * back, so two calls can be used to get | ||
831 | * the size and then the data. | ||
832 | */ | ||
833 | __u32 count_lessees; | ||
834 | __u32 pad; | ||
835 | |||
836 | /** Pointer to lessees. | ||
837 | * pointer to __u64 array of lessee ids | ||
838 | */ | ||
839 | __u64 lessees_ptr; | ||
840 | }; | ||
841 | |||
842 | /** | ||
843 | * Get leased objects | ||
844 | */ | ||
845 | struct drm_mode_get_lease { | ||
846 | /** Number of leased objects. | ||
847 | * On input, provides length of the array. | ||
848 | * On output, provides total number. No | ||
849 | * more than the input number will be written | ||
850 | * back, so two calls can be used to get | ||
851 | * the size and then the data. | ||
852 | */ | ||
853 | __u32 count_objects; | ||
854 | __u32 pad; | ||
855 | |||
856 | /** Pointer to objects. | ||
857 | * pointer to __u32 array of object ids | ||
858 | */ | ||
859 | __u64 objects_ptr; | ||
860 | }; | ||
861 | |||
862 | /** | ||
863 | * Revoke lease | ||
864 | */ | ||
865 | struct drm_mode_revoke_lease { | ||
866 | /** Unique ID of lessee | ||
867 | */ | ||
868 | __u32 lessee_id; | ||
869 | }; | ||
870 | |||
678 | #if defined(__cplusplus) | 871 | #if defined(__cplusplus) |
679 | } | 872 | } |
680 | #endif | 873 | #endif |