2 * Copyright © 2014 Red Hat Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef DRM_DISPLAYID_H
23 #define DRM_DISPLAYID_H
25 #include <linux/types.h>
26 #include <linux/bits.h>
30 #define VESA_IEEE_OUI 0x3a0292
32 /* DisplayID Structure versions */
33 #define DISPLAY_ID_STRUCTURE_VER_20 0x20
35 /* DisplayID Structure v1r2 Data Blocks */
36 #define DATA_BLOCK_PRODUCT_ID 0x00
37 #define DATA_BLOCK_DISPLAY_PARAMETERS 0x01
38 #define DATA_BLOCK_COLOR_CHARACTERISTICS 0x02
39 #define DATA_BLOCK_TYPE_1_DETAILED_TIMING 0x03
40 #define DATA_BLOCK_TYPE_2_DETAILED_TIMING 0x04
41 #define DATA_BLOCK_TYPE_3_SHORT_TIMING 0x05
42 #define DATA_BLOCK_TYPE_4_DMT_TIMING 0x06
43 #define DATA_BLOCK_VESA_TIMING 0x07
44 #define DATA_BLOCK_CEA_TIMING 0x08
45 #define DATA_BLOCK_VIDEO_TIMING_RANGE 0x09
46 #define DATA_BLOCK_PRODUCT_SERIAL_NUMBER 0x0a
47 #define DATA_BLOCK_GP_ASCII_STRING 0x0b
48 #define DATA_BLOCK_DISPLAY_DEVICE_DATA 0x0c
49 #define DATA_BLOCK_INTERFACE_POWER_SEQUENCING 0x0d
50 #define DATA_BLOCK_TRANSFER_CHARACTERISTICS 0x0e
51 #define DATA_BLOCK_DISPLAY_INTERFACE 0x0f
52 #define DATA_BLOCK_STEREO_DISPLAY_INTERFACE 0x10
53 #define DATA_BLOCK_TILED_DISPLAY 0x12
54 #define DATA_BLOCK_VENDOR_SPECIFIC 0x7f
55 #define DATA_BLOCK_CTA 0x81
57 /* DisplayID Structure v2r0 Data Blocks */
58 #define DATA_BLOCK_2_PRODUCT_ID 0x20
59 #define DATA_BLOCK_2_DISPLAY_PARAMETERS 0x21
60 #define DATA_BLOCK_2_TYPE_7_DETAILED_TIMING 0x22
61 #define DATA_BLOCK_2_TYPE_8_ENUMERATED_TIMING 0x23
62 #define DATA_BLOCK_2_TYPE_9_FORMULA_TIMING 0x24
63 #define DATA_BLOCK_2_DYNAMIC_VIDEO_TIMING 0x25
64 #define DATA_BLOCK_2_DISPLAY_INTERFACE_FEATURES 0x26
65 #define DATA_BLOCK_2_STEREO_DISPLAY_INTERFACE 0x27
66 #define DATA_BLOCK_2_TILED_DISPLAY_TOPOLOGY 0x28
67 #define DATA_BLOCK_2_CONTAINER_ID 0x29
68 #define DATA_BLOCK_2_VENDOR_SPECIFIC 0x7e
69 #define DATA_BLOCK_2_CTA_DISPLAY_ID 0x81
71 /* DisplayID Structure v1r2 Product Type */
72 #define PRODUCT_TYPE_EXTENSION 0
73 #define PRODUCT_TYPE_TEST 1
74 #define PRODUCT_TYPE_PANEL 2
75 #define PRODUCT_TYPE_MONITOR 3
76 #define PRODUCT_TYPE_TV 4
77 #define PRODUCT_TYPE_REPEATER 5
78 #define PRODUCT_TYPE_DIRECT_DRIVE 6
80 /* DisplayID Structure v2r0 Display Product Primary Use Case (~Product Type) */
81 #define PRIMARY_USE_EXTENSION 0
82 #define PRIMARY_USE_TEST 1
83 #define PRIMARY_USE_GENERIC 2
84 #define PRIMARY_USE_TV 3
85 #define PRIMARY_USE_DESKTOP_PRODUCTIVITY 4
86 #define PRIMARY_USE_DESKTOP_GAMING 5
87 #define PRIMARY_USE_PRESENTATION 6
88 #define PRIMARY_USE_HEAD_MOUNTED_VR 7
89 #define PRIMARY_USE_HEAD_MOUNTED_AR 8
91 struct displayid_header {
98 struct displayid_block {
104 struct displayid_tiled_block {
105 struct displayid_block base;
109 u8 tile_pixel_bezel[5];
113 struct displayid_detailed_timings_1 {
126 struct displayid_detailed_timing_block {
127 struct displayid_block base;
128 struct displayid_detailed_timings_1 timings[];
131 #define DISPLAYID_VESA_MSO_OVERLAP GENMASK(3, 0)
132 #define DISPLAYID_VESA_MSO_MODE GENMASK(6, 5)
134 struct displayid_vesa_vendor_specific_block {
135 struct displayid_block base;
137 u8 data_structure_type;
142 * DisplayID iteration.
144 * Do not access directly, this is private.
146 struct displayid_iter {
147 const struct drm_edid *drm_edid;
158 void displayid_iter_edid_begin(const struct drm_edid *drm_edid,
159 struct displayid_iter *iter);
160 const struct displayid_block *
161 __displayid_iter_next(struct displayid_iter *iter);
162 #define displayid_iter_for_each(__block, __iter) \
163 while (((__block) = __displayid_iter_next(__iter)))
164 void displayid_iter_end(struct displayid_iter *iter);
166 u8 displayid_version(const struct displayid_iter *iter);
167 u8 displayid_primary_use(const struct displayid_iter *iter);