.. | .. |
---|
33 | 33 | extern "C" { |
---|
34 | 34 | #endif |
---|
35 | 35 | |
---|
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 | + |
---|
37 | 45 | #define DRM_CONNECTOR_NAME_LEN 32 |
---|
38 | 46 | #define DRM_DISPLAY_MODE_LEN 32 |
---|
39 | 47 | #define DRM_PROP_NAME_LEN 32 |
---|
.. | .. |
---|
116 | 124 | #define DRM_MODE_FLAG_PIC_AR_256_135 \ |
---|
117 | 125 | (DRM_MODE_PICTURE_ASPECT_256_135<<19) |
---|
118 | 126 | |
---|
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 | | - |
---|
126 | 127 | #define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \ |
---|
127 | 128 | DRM_MODE_FLAG_NHSYNC | \ |
---|
128 | 129 | DRM_MODE_FLAG_PVSYNC | \ |
---|
.. | .. |
---|
135 | 136 | DRM_MODE_FLAG_HSKEW | \ |
---|
136 | 137 | DRM_MODE_FLAG_DBLCLK | \ |
---|
137 | 138 | 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 | \ |
---|
142 | 139 | DRM_MODE_FLAG_3D_MASK) |
---|
143 | 140 | |
---|
144 | 141 | /* DPMS flags */ |
---|
.. | .. |
---|
197 | 194 | /* |
---|
198 | 195 | * DRM_MODE_REFLECT_<axis> |
---|
199 | 196 | * |
---|
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, |
---|
201 | 198 | * in the same way as mirroring. |
---|
| 199 | + * See kerneldoc chapter "Plane Composition Properties" for more details. |
---|
202 | 200 | * |
---|
203 | 201 | * This define is provided as a convenience, looking up the property id |
---|
204 | 202 | * using the name->prop id lookup is the preferred method. |
---|
.. | .. |
---|
334 | 332 | /* This is for connectors with multiple signal types. */ |
---|
335 | 333 | /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ |
---|
336 | 334 | 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 */ |
---|
345 | 348 | }; |
---|
346 | 349 | |
---|
347 | 350 | #define DRM_MODE_CONNECTOR_Unknown 0 |
---|
.. | .. |
---|
363 | 366 | #define DRM_MODE_CONNECTOR_DSI 16 |
---|
364 | 367 | #define DRM_MODE_CONNECTOR_DPI 17 |
---|
365 | 368 | #define DRM_MODE_CONNECTOR_WRITEBACK 18 |
---|
| 369 | +#define DRM_MODE_CONNECTOR_SPI 19 |
---|
366 | 370 | |
---|
367 | 371 | struct drm_mode_get_connector { |
---|
368 | 372 | |
---|
.. | .. |
---|
486 | 490 | |
---|
487 | 491 | #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ |
---|
488 | 492 | #define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ |
---|
489 | | -#define DRM_MODE_FB_SECURE (1<<2) /* for secure framebuffers */ |
---|
490 | 493 | |
---|
491 | 494 | struct drm_mode_fb_cmd2 { |
---|
492 | 495 | __u32 fb_id; |
---|
.. | .. |
---|
499 | 502 | * In case of planar formats, this ioctl allows up to 4 |
---|
500 | 503 | * buffer objects with offsets and pitches per plane. |
---|
501 | 504 | * 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: |
---|
503 | 506 | * |
---|
504 | 507 | * YUV 4:2:0 image with a plane of 8 bit Y samples |
---|
505 | 508 | * followed by an interleaved U/V plane containing |
---|
.. | .. |
---|
633 | 636 | |
---|
634 | 637 | struct drm_color_lut { |
---|
635 | 638 | /* |
---|
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. |
---|
637 | 641 | */ |
---|
638 | 642 | __u16 red; |
---|
639 | 643 | __u16 green; |
---|
.. | .. |
---|
641 | 645 | __u16 reserved; |
---|
642 | 646 | }; |
---|
643 | 647 | |
---|
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 | + */ |
---|
653 | 657 | struct hdr_metadata_infoframe { |
---|
| 658 | + /** |
---|
| 659 | + * @eotf: Electro-Optical Transfer Function (EOTF) |
---|
| 660 | + * used in the stream. |
---|
| 661 | + */ |
---|
654 | 662 | __u8 eotf; |
---|
| 663 | + /** |
---|
| 664 | + * @metadata_type: Static_Metadata_Descriptor_ID. |
---|
| 665 | + */ |
---|
655 | 666 | __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 | + */ |
---|
656 | 675 | struct { |
---|
657 | 676 | __u16 x, y; |
---|
658 | 677 | } 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 | + */ |
---|
659 | 686 | struct { |
---|
660 | 687 | __u16 x, y; |
---|
661 | 688 | } 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 | + */ |
---|
662 | 694 | __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 | + */ |
---|
663 | 701 | __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 | + */ |
---|
664 | 707 | __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 | + */ |
---|
665 | 713 | __u16 max_fall; |
---|
666 | 714 | }; |
---|
667 | 715 | |
---|
| 716 | +/** |
---|
| 717 | + * struct hdr_output_metadata - HDR output metadata |
---|
| 718 | + * |
---|
| 719 | + * Metadata Information to be passed from userspace |
---|
| 720 | + */ |
---|
668 | 721 | struct hdr_output_metadata { |
---|
| 722 | + /** |
---|
| 723 | + * @metadata_type: Static_Metadata_Descriptor_ID. |
---|
| 724 | + */ |
---|
669 | 725 | __u32 metadata_type; |
---|
| 726 | + /** |
---|
| 727 | + * @hdmi_metadata_type1: HDR Metadata Infoframe. |
---|
| 728 | + */ |
---|
670 | 729 | union { |
---|
671 | 730 | struct hdr_metadata_infoframe hdmi_metadata_type1; |
---|
672 | 731 | }; |
---|
.. | .. |
---|
845 | 904 | }; |
---|
846 | 905 | |
---|
847 | 906 | /** |
---|
| 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. |
---|
848 | 911 | * Create a new 'blob' data property, copying length bytes from data pointer, |
---|
849 | 912 | * and returning new blob ID. |
---|
850 | 913 | */ |
---|
.. | .. |
---|
858 | 921 | }; |
---|
859 | 922 | |
---|
860 | 923 | /** |
---|
| 924 | + * struct drm_mode_destroy_blob - Destroy user blob |
---|
| 925 | + * @blob_id: blob_id to destroy |
---|
861 | 926 | * Destroy a user-created blob property. |
---|
862 | 927 | */ |
---|
863 | 928 | struct drm_mode_destroy_blob { |
---|
.. | .. |
---|
865 | 930 | }; |
---|
866 | 931 | |
---|
867 | 932 | /** |
---|
| 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. |
---|
868 | 939 | * Lease mode resources, creating another drm_master. |
---|
869 | 940 | */ |
---|
870 | 941 | struct drm_mode_create_lease { |
---|
.. | .. |
---|
882 | 953 | }; |
---|
883 | 954 | |
---|
884 | 955 | /** |
---|
| 956 | + * struct drm_mode_list_lessees - List lessees |
---|
| 957 | + * @count_lessees: Number of lessees. |
---|
| 958 | + * @pad: pad. |
---|
| 959 | + * @lessees_ptr: Pointer to lessess. |
---|
885 | 960 | * List lesses from a drm_master |
---|
886 | 961 | */ |
---|
887 | 962 | struct drm_mode_list_lessees { |
---|
.. | .. |
---|
902 | 977 | }; |
---|
903 | 978 | |
---|
904 | 979 | /** |
---|
| 980 | + * struct drm_mode_get_lease - Get Lease |
---|
| 981 | + * @count_objects: Number of leased objects. |
---|
| 982 | + * @pad: pad. |
---|
| 983 | + * @objects_ptr: Pointer to objects. |
---|
905 | 984 | * Get leased objects |
---|
906 | 985 | */ |
---|
907 | 986 | struct drm_mode_get_lease { |
---|
.. | .. |
---|
922 | 1001 | }; |
---|
923 | 1002 | |
---|
924 | 1003 | /** |
---|
| 1004 | + * struct drm_mode_revoke_lease - Revoke lease |
---|
| 1005 | + * @lessee_id: Unique ID of lessee. |
---|
925 | 1006 | * Revoke lease |
---|
926 | 1007 | */ |
---|
927 | 1008 | struct drm_mode_revoke_lease { |
---|
.. | .. |
---|
930 | 1011 | __u32 lessee_id; |
---|
931 | 1012 | }; |
---|
932 | 1013 | |
---|
| 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 | + |
---|
933 | 1033 | #if defined(__cplusplus) |
---|
934 | 1034 | } |
---|
935 | 1035 | #endif |
---|