blob: b5f22e90f800456802ade6833e209715cf6d2d08 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001From e379c6a137bba5c40d9a126b71a667b4d7f5697a Mon Sep 17 00:00:00 2001
2From: Daniel Stone <daniels@collabora.com>
3Date: Tue, 4 Apr 2017 21:38:56 +0100
4Subject: [PATCH] Headers: Sync drm{,_mode}.h with the kernel
5
6Generated using make headers_install, based on drm-misc-next commit
75db06a8a98f515f67446a69c57577c4c363ec65d.
8
9This clarifies the comments around modifiers such that they are
10per-framebuffer rather than per-plane, adds the beginnings of aspect
11ratio mode flags, link status properties, and updates the 'reserved'
12field from vblank events to include the CRTC ID.
13
14v2: Split into separate patch, pull in full kernel changes.
15v3: Undo revert of connector-type enums, since it is not actually
16 harmful.
17
18Signed-off-by: Daniel Stone <daniels@collabora.com>
19Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
20---
21 include/drm/drm.h | 3 ++-
22 include/drm/drm_mode.h | 45 +++++++++++++++++++++++++++++++--------------
23 2 files changed, 33 insertions(+), 15 deletions(-)
24
25diff --git a/include/drm/drm.h b/include/drm/drm.h
26index f6fd5c2..1e7a4bc 100644
27--- a/include/drm/drm.h
28+++ b/include/drm/drm.h
29@@ -641,6 +641,7 @@ struct drm_gem_open {
30 #define DRM_CAP_CURSOR_HEIGHT 0x9
31 #define DRM_CAP_ADDFB2_MODIFIERS 0x10
32 #define DRM_CAP_PAGE_FLIP_TARGET 0x11
33+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
34
35 /** DRM_IOCTL_GET_CAP ioctl argument type */
36 struct drm_get_cap {
37@@ -845,7 +846,7 @@ struct drm_event_vblank {
38 __u32 tv_sec;
39 __u32 tv_usec;
40 __u32 sequence;
41- __u32 reserved;
42+ __u32 crtc_id; /* 0 on older kernels that do not support this */
43 };
44
45 /* typedef area */
46diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
47index df0e350..70571af 100644
48--- a/include/drm/drm_mode.h
49+++ b/include/drm/drm_mode.h
50@@ -47,7 +47,15 @@ extern "C" {
51 #define DRM_MODE_TYPE_DRIVER (1<<6)
52
53 /* Video mode flags */
54-/* bit compatible with the xorg definitions. */
55+/* bit compatible with the xrandr RR_ definitions (bits 0-13)
56+ *
57+ * ABI warning: Existing userspace really expects
58+ * the mode flags to match the xrandr definitions. Any
59+ * changes that don't match the xrandr definitions will
60+ * likely need a new client cap or some other mechanism
61+ * to avoid breaking existing userspace. This includes
62+ * allocating new flags in the previously unused bits!
63+ */
64 #define DRM_MODE_FLAG_PHSYNC (1<<0)
65 #define DRM_MODE_FLAG_NHSYNC (1<<1)
66 #define DRM_MODE_FLAG_PVSYNC (1<<2)
67@@ -107,6 +115,10 @@ extern "C" {
68 #define DRM_MODE_DIRTY_ON 1
69 #define DRM_MODE_DIRTY_ANNOTATE 2
70
71+/* Link Status options */
72+#define DRM_MODE_LINK_STATUS_GOOD 0
73+#define DRM_MODE_LINK_STATUS_BAD 1
74+
75 struct drm_mode_modeinfo {
76 __u32 clock;
77 __u16 hdisplay;
78@@ -220,14 +232,16 @@ struct drm_mode_get_encoder {
79
80 /* This is for connectors with multiple signal types. */
81 /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
82-#define DRM_MODE_SUBCONNECTOR_Automatic 0
83-#define DRM_MODE_SUBCONNECTOR_Unknown 0
84-#define DRM_MODE_SUBCONNECTOR_DVID 3
85-#define DRM_MODE_SUBCONNECTOR_DVIA 4
86-#define DRM_MODE_SUBCONNECTOR_Composite 5
87-#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
88-#define DRM_MODE_SUBCONNECTOR_Component 8
89-#define DRM_MODE_SUBCONNECTOR_SCART 9
90+enum drm_mode_subconnector {
91+ DRM_MODE_SUBCONNECTOR_Automatic = 0,
92+ DRM_MODE_SUBCONNECTOR_Unknown = 0,
93+ DRM_MODE_SUBCONNECTOR_DVID = 3,
94+ DRM_MODE_SUBCONNECTOR_DVIA = 4,
95+ DRM_MODE_SUBCONNECTOR_Composite = 5,
96+ DRM_MODE_SUBCONNECTOR_SVIDEO = 6,
97+ DRM_MODE_SUBCONNECTOR_Component = 8,
98+ DRM_MODE_SUBCONNECTOR_SCART = 9,
99+};
100
101 #define DRM_MODE_CONNECTOR_Unknown 0
102 #define DRM_MODE_CONNECTOR_VGA 1
103@@ -392,17 +406,20 @@ struct drm_mode_fb_cmd2 {
104 * offsets[1]. Note that offsets[0] will generally
105 * be 0 (but this is not required).
106 *
107- * To accommodate tiled, compressed, etc formats, a per-plane
108+ * To accommodate tiled, compressed, etc formats, a
109 * modifier can be specified. The default value of zero
110 * indicates "native" format as specified by the fourcc.
111- * Vendor specific modifier token. This allows, for example,
112- * different tiling/swizzling pattern on different planes.
113- * See discussion above of DRM_FORMAT_MOD_xxx.
114+ * Vendor specific modifier token. Note that even though
115+ * it looks like we have a modifier per-plane, we in fact
116+ * do not. The modifier for each plane must be identical.
117+ * Thus all combinations of different data layouts for
118+ * multi plane formats must be enumerated as separate
119+ * modifiers.
120 */
121 __u32 handles[4];
122 __u32 pitches[4]; /* pitch for each plane */
123 __u32 offsets[4]; /* offset of each plane */
124- __u64 modifier[4]; /* ie, tiling, compressed (per plane) */
125+ __u64 modifier[4]; /* ie, tiling, compress */
126 };
127
128 #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
129--
130libgit2 0.26.0
131