hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/include/uapi/drm/drm_mode.h
....@@ -33,7 +33,15 @@
3333 extern "C" {
3434 #endif
3535
36
-#define DRM_DISPLAY_INFO_LEN 32
36
+/**
37
+ * DOC: overview
38
+ *
39
+ * DRM exposes many UAPI and structure definition to have a consistent
40
+ * and standardized interface with user.
41
+ * Userspace can refer to these structure definitions and UAPI formats
42
+ * to communicate to driver
43
+ */
44
+
3745 #define DRM_CONNECTOR_NAME_LEN 32
3846 #define DRM_DISPLAY_MODE_LEN 32
3947 #define DRM_PROP_NAME_LEN 32
....@@ -116,13 +124,6 @@
116124 #define DRM_MODE_FLAG_PIC_AR_256_135 \
117125 (DRM_MODE_PICTURE_ASPECT_256_135<<19)
118126
119
-#define DRM_MODE_FLAG_SUPPORTS_RGB (1<<27)
120
-
121
-#define DRM_MODE_FLAG_SUPPORTS_YUV (1<<28)
122
-#define DRM_MODE_FLAG_VID_MODE_PANEL (1<<29)
123
-#define DRM_MODE_FLAG_CMD_MODE_PANEL (1<<30)
124
-#define DRM_MODE_FLAG_SEAMLESS (1<<31)
125
-
126127 #define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \
127128 DRM_MODE_FLAG_NHSYNC | \
128129 DRM_MODE_FLAG_PVSYNC | \
....@@ -135,10 +136,6 @@
135136 DRM_MODE_FLAG_HSKEW | \
136137 DRM_MODE_FLAG_DBLCLK | \
137138 DRM_MODE_FLAG_CLKDIV2 | \
138
- DRM_MODE_FLAG_SUPPORTS_RGB | \
139
- DRM_MODE_FLAG_SUPPORTS_YUV | \
140
- DRM_MODE_FLAG_VID_MODE_PANEL | \
141
- DRM_MODE_FLAG_CMD_MODE_PANEL | \
142139 DRM_MODE_FLAG_3D_MASK)
143140
144141 /* DPMS flags */
....@@ -197,8 +194,9 @@
197194 /*
198195 * DRM_MODE_REFLECT_<axis>
199196 *
200
- * Signals that the contents of a drm plane is reflected in the <axis> axis,
197
+ * Signals that the contents of a drm plane is reflected along the <axis> axis,
201198 * in the same way as mirroring.
199
+ * See kerneldoc chapter "Plane Composition Properties" for more details.
202200 *
203201 * This define is provided as a convenience, looking up the property id
204202 * using the name->prop id lookup is the preferred method.
....@@ -334,14 +332,19 @@
334332 /* This is for connectors with multiple signal types. */
335333 /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
336334 enum drm_mode_subconnector {
337
- DRM_MODE_SUBCONNECTOR_Automatic = 0,
338
- DRM_MODE_SUBCONNECTOR_Unknown = 0,
339
- DRM_MODE_SUBCONNECTOR_DVID = 3,
340
- DRM_MODE_SUBCONNECTOR_DVIA = 4,
341
- DRM_MODE_SUBCONNECTOR_Composite = 5,
342
- DRM_MODE_SUBCONNECTOR_SVIDEO = 6,
343
- DRM_MODE_SUBCONNECTOR_Component = 8,
344
- DRM_MODE_SUBCONNECTOR_SCART = 9,
335
+ DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */
336
+ DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */
337
+ DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */
338
+ DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */
339
+ DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */
340
+ DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */
341
+ DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */
342
+ DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */
343
+ DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */
344
+ DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */
345
+ DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */
346
+ DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */
347
+ DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */
345348 };
346349
347350 #define DRM_MODE_CONNECTOR_Unknown 0
....@@ -363,6 +366,7 @@
363366 #define DRM_MODE_CONNECTOR_DSI 16
364367 #define DRM_MODE_CONNECTOR_DPI 17
365368 #define DRM_MODE_CONNECTOR_WRITEBACK 18
369
+#define DRM_MODE_CONNECTOR_SPI 19
366370
367371 struct drm_mode_get_connector {
368372
....@@ -486,7 +490,6 @@
486490
487491 #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
488492 #define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
489
-#define DRM_MODE_FB_SECURE (1<<2) /* for secure framebuffers */
490493
491494 struct drm_mode_fb_cmd2 {
492495 __u32 fb_id;
....@@ -499,7 +502,7 @@
499502 * In case of planar formats, this ioctl allows up to 4
500503 * buffer objects with offsets and pitches per plane.
501504 * The pitch and offset order is dictated by the fourcc,
502
- * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as:
505
+ * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as:
503506 *
504507 * YUV 4:2:0 image with a plane of 8 bit Y samples
505508 * followed by an interleaved U/V plane containing
....@@ -633,7 +636,8 @@
633636
634637 struct drm_color_lut {
635638 /*
636
- * Data is U0.16 fixed point format.
639
+ * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
640
+ * 0xffff == 1.0.
637641 */
638642 __u16 red;
639643 __u16 green;
....@@ -641,32 +645,87 @@
641645 __u16 reserved;
642646 };
643647
644
-enum supported_eotf_type {
645
- TRADITIONAL_GAMMA_SDR = 0,
646
- TRADITIONAL_GAMMA_HDR,
647
- SMPTE_ST2084,
648
- HLG,
649
- FUTURE_EOTF
650
-};
651
-
652
-/* HDR Metadata Infoframe as per 861.G spec */
648
+/**
649
+ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
650
+ *
651
+ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected
652
+ * to match exactly with the spec.
653
+ *
654
+ * Userspace is expected to pass the metadata information as per
655
+ * the format described in this structure.
656
+ */
653657 struct hdr_metadata_infoframe {
658
+ /**
659
+ * @eotf: Electro-Optical Transfer Function (EOTF)
660
+ * used in the stream.
661
+ */
654662 __u8 eotf;
663
+ /**
664
+ * @metadata_type: Static_Metadata_Descriptor_ID.
665
+ */
655666 __u8 metadata_type;
667
+ /**
668
+ * @display_primaries: Color Primaries of the Data.
669
+ * These are coded as unsigned 16-bit values in units of
670
+ * 0.00002, where 0x0000 represents zero and 0xC350
671
+ * represents 1.0000.
672
+ * @display_primaries.x: X cordinate of color primary.
673
+ * @display_primaries.y: Y cordinate of color primary.
674
+ */
656675 struct {
657676 __u16 x, y;
658677 } display_primaries[3];
678
+ /**
679
+ * @white_point: White Point of Colorspace Data.
680
+ * These are coded as unsigned 16-bit values in units of
681
+ * 0.00002, where 0x0000 represents zero and 0xC350
682
+ * represents 1.0000.
683
+ * @white_point.x: X cordinate of whitepoint of color primary.
684
+ * @white_point.y: Y cordinate of whitepoint of color primary.
685
+ */
659686 struct {
660687 __u16 x, y;
661688 } white_point;
689
+ /**
690
+ * @max_display_mastering_luminance: Max Mastering Display Luminance.
691
+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
692
+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
693
+ */
662694 __u16 max_display_mastering_luminance;
695
+ /**
696
+ * @min_display_mastering_luminance: Min Mastering Display Luminance.
697
+ * This value is coded as an unsigned 16-bit value in units of
698
+ * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
699
+ * represents 6.5535 cd/m2.
700
+ */
663701 __u16 min_display_mastering_luminance;
702
+ /**
703
+ * @max_cll: Max Content Light Level.
704
+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
705
+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
706
+ */
664707 __u16 max_cll;
708
+ /**
709
+ * @max_fall: Max Frame Average Light Level.
710
+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
711
+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
712
+ */
665713 __u16 max_fall;
666714 };
667715
716
+/**
717
+ * struct hdr_output_metadata - HDR output metadata
718
+ *
719
+ * Metadata Information to be passed from userspace
720
+ */
668721 struct hdr_output_metadata {
722
+ /**
723
+ * @metadata_type: Static_Metadata_Descriptor_ID.
724
+ */
669725 __u32 metadata_type;
726
+ /**
727
+ * @hdmi_metadata_type1: HDR Metadata Infoframe.
728
+ */
670729 union {
671730 struct hdr_metadata_infoframe hdmi_metadata_type1;
672731 };
....@@ -845,6 +904,10 @@
845904 };
846905
847906 /**
907
+ * struct drm_mode_create_blob - Create New block property
908
+ * @data: Pointer to data to copy.
909
+ * @length: Length of data to copy.
910
+ * @blob_id: new property ID.
848911 * Create a new 'blob' data property, copying length bytes from data pointer,
849912 * and returning new blob ID.
850913 */
....@@ -858,6 +921,8 @@
858921 };
859922
860923 /**
924
+ * struct drm_mode_destroy_blob - Destroy user blob
925
+ * @blob_id: blob_id to destroy
861926 * Destroy a user-created blob property.
862927 */
863928 struct drm_mode_destroy_blob {
....@@ -865,6 +930,12 @@
865930 };
866931
867932 /**
933
+ * struct drm_mode_create_lease - Create lease
934
+ * @object_ids: Pointer to array of object ids.
935
+ * @object_count: Number of object ids.
936
+ * @flags: flags for new FD.
937
+ * @lessee_id: unique identifier for lessee.
938
+ * @fd: file descriptor to new drm_master file.
868939 * Lease mode resources, creating another drm_master.
869940 */
870941 struct drm_mode_create_lease {
....@@ -882,6 +953,10 @@
882953 };
883954
884955 /**
956
+ * struct drm_mode_list_lessees - List lessees
957
+ * @count_lessees: Number of lessees.
958
+ * @pad: pad.
959
+ * @lessees_ptr: Pointer to lessess.
885960 * List lesses from a drm_master
886961 */
887962 struct drm_mode_list_lessees {
....@@ -902,6 +977,10 @@
902977 };
903978
904979 /**
980
+ * struct drm_mode_get_lease - Get Lease
981
+ * @count_objects: Number of leased objects.
982
+ * @pad: pad.
983
+ * @objects_ptr: Pointer to objects.
905984 * Get leased objects
906985 */
907986 struct drm_mode_get_lease {
....@@ -922,6 +1001,8 @@
9221001 };
9231002
9241003 /**
1004
+ * struct drm_mode_revoke_lease - Revoke lease
1005
+ * @lessee_id: Unique ID of lessee.
9251006 * Revoke lease
9261007 */
9271008 struct drm_mode_revoke_lease {
....@@ -930,6 +1011,25 @@
9301011 __u32 lessee_id;
9311012 };
9321013
1014
+/**
1015
+ * struct drm_mode_rect - Two dimensional rectangle.
1016
+ * @x1: Horizontal starting coordinate (inclusive).
1017
+ * @y1: Vertical starting coordinate (inclusive).
1018
+ * @x2: Horizontal ending coordinate (exclusive).
1019
+ * @y2: Vertical ending coordinate (exclusive).
1020
+ *
1021
+ * With drm subsystem using struct drm_rect to manage rectangular area this
1022
+ * export it to user-space.
1023
+ *
1024
+ * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.
1025
+ */
1026
+struct drm_mode_rect {
1027
+ __s32 x1;
1028
+ __s32 y1;
1029
+ __s32 x2;
1030
+ __s32 y2;
1031
+};
1032
+
9331033 #if defined(__cplusplus)
9341034 }
9351035 #endif