aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie2017-10-25 01:37:44 -0500
committerDave Airlie2017-10-25 01:38:13 -0500
commit0d889201d106f7f440a0e45b3fef554c31e2a551 (patch)
treea60d5591b65dc8b2e81b10e849674203a1325ef0 /include
parente580be90e88eeed95faa5452e343f3ec509517e5 (diff)
downloadexternal-libgbm-0d889201d106f7f440a0e45b3fef554c31e2a551.tar.gz
external-libgbm-0d889201d106f7f440a0e45b3fef554c31e2a551.tar.xz
external-libgbm-0d889201d106f7f440a0e45b3fef554c31e2a551.zip
drm: sync drm headers from drm-next.
This updates the headers with the contents in drm-next at 62884cd386b876638720ef88374b31a84ca7ee5f This adds leasing and aspect ratio.
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm.h41
-rw-r--r--include/drm/drm_mode.h92
2 files changed, 124 insertions, 9 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 4737261a..f0bd91de 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -731,6 +731,28 @@ struct drm_syncobj_array {
731 __u32 pad; 731 __u32 pad;
732}; 732};
733 733
734/* Query current scanout sequence number */
735struct drm_crtc_get_sequence {
736 __u32 crtc_id; /* requested crtc_id */
737 __u32 active; /* return: crtc output is active */
738 __u64 sequence; /* return: most recent vblank sequence */
739 __s64 sequence_ns; /* return: most recent time of first pixel out */
740};
741
742/* Queue event to be delivered at specified sequence. Time stamp marks
743 * when the first pixel of the refresh cycle leaves the display engine
744 * for the display
745 */
746#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */
747#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */
748
749struct drm_crtc_queue_sequence {
750 __u32 crtc_id;
751 __u32 flags;
752 __u64 sequence; /* on input, target sequence. on output, actual sequence */
753 __u64 user_data; /* user data passed to event */
754};
755
734#if defined(__cplusplus) 756#if defined(__cplusplus)
735} 757}
736#endif 758#endif
@@ -813,6 +835,9 @@ extern "C" {
813 835
814#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) 836#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
815 837
838#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)
839#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)
840
816#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) 841#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
817 842
818#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) 843#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
@@ -857,6 +882,11 @@ extern "C" {
857#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) 882#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
858#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) 883#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
859 884
885#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease)
886#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)
887#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
888#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
889
860/** 890/**
861 * Device specific ioctls should only be in their respective headers 891 * Device specific ioctls should only be in their respective headers
862 * The device specific ioctl range is from 0x40 to 0x9f. 892 * The device specific ioctl range is from 0x40 to 0x9f.
@@ -887,6 +917,7 @@ struct drm_event {
887 917
888#define DRM_EVENT_VBLANK 0x01 918#define DRM_EVENT_VBLANK 0x01
889#define DRM_EVENT_FLIP_COMPLETE 0x02 919#define DRM_EVENT_FLIP_COMPLETE 0x02
920#define DRM_EVENT_CRTC_SEQUENCE 0x03
890 921
891struct drm_event_vblank { 922struct drm_event_vblank {
892 struct drm_event base; 923 struct drm_event base;
@@ -897,6 +928,16 @@ struct drm_event_vblank {
897 __u32 crtc_id; /* 0 on older kernels that do not support this */ 928 __u32 crtc_id; /* 0 on older kernels that do not support this */
898}; 929};
899 930
931/* Event delivered at sequence. Time stamp marks when the first pixel
932 * of the refresh cycle leaves the display engine for the display
933 */
934struct drm_event_crtc_sequence {
935 struct drm_event base;
936 __u64 user_data;
937 __s64 time_ns;
938 __u64 sequence;
939};
940
900/* typedef area */ 941/* typedef area */
901typedef struct drm_clip_rect drm_clip_rect_t; 942typedef struct drm_clip_rect drm_clip_rect_t;
902typedef struct drm_drawable_info drm_drawable_info_t; 943typedef struct drm_drawable_info drm_drawable_info_t;
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index e01f129c..5597a871 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -75,7 +75,7 @@ extern "C" {
75 * (define not exposed to user space). 75 * (define not exposed to user space).
76 */ 76 */
77#define DRM_MODE_FLAG_3D_MASK (0x1f<<14) 77#define DRM_MODE_FLAG_3D_MASK (0x1f<<14)
78#define DRM_MODE_FLAG_3D_NONE (0<<14) 78#define DRM_MODE_FLAG_3D_NONE (0<<14)
79#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) 79#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14)
80#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) 80#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14)
81#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) 81#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14)
@@ -85,6 +85,19 @@ extern "C" {
85#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) 85#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14)
86#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) 86#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14)
87 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)
88 101
89/* DPMS flags */ 102/* DPMS flags */
90/* bit compatible with the xorg definitions. */ 103/* bit compatible with the xorg definitions. */
@@ -100,11 +113,6 @@ extern "C" {
100#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ 113#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
101#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ 114#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
102 115
103/* Picture aspect ratio options */
104#define DRM_MODE_PICTURE_ASPECT_NONE 0
105#define DRM_MODE_PICTURE_ASPECT_4_3 1
106#define DRM_MODE_PICTURE_ASPECT_16_9 2
107
108/* Dithering mode options */ 116/* Dithering mode options */
109#define DRM_MODE_DITHERING_OFF 0 117#define DRM_MODE_DITHERING_OFF 0
110#define DRM_MODE_DITHERING_ON 1 118#define DRM_MODE_DITHERING_ON 1
@@ -724,7 +732,7 @@ struct drm_format_modifier_blob {
724 /* Where in this blob the modifiers exist (in bytes) */ 732 /* Where in this blob the modifiers exist (in bytes) */
725 __u32 modifiers_offset; 733 __u32 modifiers_offset;
726 734
727 /* u32 formats[] */ 735 /* __u32 formats[] */
728 /* struct drm_format_modifier modifiers[] */ 736 /* struct drm_format_modifier modifiers[] */
729}; 737};
730 738
@@ -741,9 +749,9 @@ struct drm_format_modifier {
741 * If the number formats grew to 128, and formats 98-102 are 749 * If the number formats grew to 128, and formats 98-102 are
742 * supported with the modifier: 750 * supported with the modifier:
743 * 751 *
744 * 0x0000003c00000000 0000000000000000 752 * 0x0000007c00000000 0000000000000000
745 * ^ 753 * ^
746 * |__offset = 64, formats = 0x3c00000000 754 * |__offset = 64, formats = 0x7c00000000
747 * 755 *
748 */ 756 */
749 __u64 formats; 757 __u64 formats;
@@ -774,6 +782,72 @@ struct drm_mode_destroy_blob {
774 __u32 blob_id; 782 __u32 blob_id;
775}; 783};
776 784
785/**
786 * Lease mode resources, creating another drm_master.
787 */
788struct drm_mode_create_lease {
789 /** Pointer to array of object ids (__u32) */
790 __u64 object_ids;
791 /** Number of object ids */
792 __u32 object_count;
793 /** flags for new FD (O_CLOEXEC, etc) */
794 __u32 flags;
795
796 /** Return: unique identifier for lessee. */
797 __u32 lessee_id;
798 /** Return: file descriptor to new drm_master file */
799 __u32 fd;
800};
801
802/**
803 * List lesses from a drm_master
804 */
805struct drm_mode_list_lessees {
806 /** Number of lessees.
807 * On input, provides length of the array.
808 * On output, provides total number. No
809 * more than the input number will be written
810 * back, so two calls can be used to get
811 * the size and then the data.
812 */
813 __u32 count_lessees;
814 __u32 pad;
815
816 /** Pointer to lessees.
817 * pointer to __u64 array of lessee ids
818 */
819 __u64 lessees_ptr;
820};
821
822/**
823 * Get leased objects
824 */
825struct drm_mode_get_lease {
826 /** Number of leased objects.
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_objects;
834 __u32 pad;
835
836 /** Pointer to objects.
837 * pointer to __u32 array of object ids
838 */
839 __u64 objects_ptr;
840};
841
842/**
843 * Revoke lease
844 */
845struct drm_mode_revoke_lease {
846 /** Unique ID of lessee
847 */
848 __u32 lessee_id;
849};
850
777#if defined(__cplusplus) 851#if defined(__cplusplus)
778} 852}
779#endif 853#endif