rev |
line source |
nuclear@0
|
1 #include <X11/extensions/Xrandr.h>
|
nuclear@0
|
2 #include <X11/Xlib.h>
|
nuclear@0
|
3
|
nuclear@0
|
4 /*
|
nuclear@0
|
5 * Copyright 2007 Red Hat, Inc.
|
nuclear@0
|
6 *
|
nuclear@0
|
7 * Permission is hereby granted, free of charge, to any person obtaining a
|
nuclear@0
|
8 * copy of this software and associated documentation files (the "Software"),
|
nuclear@0
|
9 * to deal in the Software without restriction, including without limitation
|
nuclear@0
|
10 * on the rights to use, copy, modify, merge, publish, distribute, sub
|
nuclear@0
|
11 * license, and/or sell copies of the Software, and to permit persons to whom
|
nuclear@0
|
12 * the Software is furnished to do so, subject to the following conditions:
|
nuclear@0
|
13 *
|
nuclear@0
|
14 * The above copyright notice and this permission notice (including the next
|
nuclear@0
|
15 * paragraph) shall be included in all copies or substantial portions of the
|
nuclear@0
|
16 * Software.
|
nuclear@0
|
17 *
|
nuclear@0
|
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
nuclear@0
|
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
nuclear@0
|
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
nuclear@0
|
21 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
nuclear@0
|
22 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
nuclear@0
|
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
nuclear@0
|
24 */
|
nuclear@0
|
25
|
nuclear@0
|
26 /* Author: Soren Sandmann <sandmann@redhat.com> */
|
nuclear@0
|
27
|
nuclear@0
|
28 typedef enum {
|
nuclear@0
|
29 UNDEFINED,
|
nuclear@0
|
30 DVI,
|
nuclear@0
|
31 HDMI_A,
|
nuclear@0
|
32 HDMI_B,
|
nuclear@0
|
33 MDDI,
|
nuclear@0
|
34 DISPLAY_PORT
|
nuclear@0
|
35 } Interface;
|
nuclear@0
|
36
|
nuclear@0
|
37 typedef enum {
|
nuclear@0
|
38 UNDEFINED_COLOR,
|
nuclear@0
|
39 MONOCHROME,
|
nuclear@0
|
40 RGB,
|
nuclear@0
|
41 OTHER_COLOR
|
nuclear@0
|
42 } ColorType;
|
nuclear@0
|
43
|
nuclear@0
|
44 typedef enum {
|
nuclear@0
|
45 NO_STEREO,
|
nuclear@0
|
46 FIELD_RIGHT,
|
nuclear@0
|
47 FIELD_LEFT,
|
nuclear@0
|
48 TWO_WAY_RIGHT_ON_EVEN,
|
nuclear@0
|
49 TWO_WAY_LEFT_ON_EVEN,
|
nuclear@0
|
50 FOUR_WAY_INTERLEAVED,
|
nuclear@0
|
51 SIDE_BY_SIDE
|
nuclear@0
|
52 } StereoType;
|
nuclear@0
|
53
|
nuclear@0
|
54 struct Timing {
|
nuclear@0
|
55 int width;
|
nuclear@0
|
56 int height;
|
nuclear@0
|
57 int frequency;
|
nuclear@0
|
58 };
|
nuclear@0
|
59
|
nuclear@0
|
60 struct DetailedTiming {
|
nuclear@0
|
61 int pixel_clock;
|
nuclear@0
|
62 int h_addr;
|
nuclear@0
|
63 int h_blank;
|
nuclear@0
|
64 int h_sync;
|
nuclear@0
|
65 int h_front_porch;
|
nuclear@0
|
66 int v_addr;
|
nuclear@0
|
67 int v_blank;
|
nuclear@0
|
68 int v_sync;
|
nuclear@0
|
69 int v_front_porch;
|
nuclear@0
|
70 int width_mm;
|
nuclear@0
|
71 int height_mm;
|
nuclear@0
|
72 int right_border;
|
nuclear@0
|
73 int top_border;
|
nuclear@0
|
74 int interlaced;
|
nuclear@0
|
75 StereoType stereo;
|
nuclear@0
|
76
|
nuclear@0
|
77 int digital_sync;
|
nuclear@0
|
78 union {
|
nuclear@0
|
79 struct {
|
nuclear@0
|
80 int bipolar;
|
nuclear@0
|
81 int serrations;
|
nuclear@0
|
82 int sync_on_green;
|
nuclear@0
|
83 } analog;
|
nuclear@0
|
84
|
nuclear@0
|
85 struct {
|
nuclear@0
|
86 int composite;
|
nuclear@0
|
87 int serrations;
|
nuclear@0
|
88 int negative_vsync;
|
nuclear@0
|
89 int negative_hsync;
|
nuclear@0
|
90 } digital;
|
nuclear@0
|
91 } connector;
|
nuclear@0
|
92 };
|
nuclear@0
|
93
|
nuclear@0
|
94 struct MonitorInfo {
|
nuclear@0
|
95 int checksum;
|
nuclear@0
|
96 char manufacturer_code[4];
|
nuclear@0
|
97 int product_code;
|
nuclear@0
|
98 unsigned int serial_number;
|
nuclear@0
|
99
|
nuclear@0
|
100 int production_week; /* -1 if not specified */
|
nuclear@0
|
101 int production_year; /* -1 if not specified */
|
nuclear@0
|
102 int model_year; /* -1 if not specified */
|
nuclear@0
|
103
|
nuclear@0
|
104 int major_version;
|
nuclear@0
|
105 int minor_version;
|
nuclear@0
|
106
|
nuclear@0
|
107 int is_digital;
|
nuclear@0
|
108
|
nuclear@0
|
109 union {
|
nuclear@0
|
110 struct {
|
nuclear@0
|
111 int bits_per_primary;
|
nuclear@0
|
112 Interface interface;
|
nuclear@0
|
113 int rgb444;
|
nuclear@0
|
114 int ycrcb444;
|
nuclear@0
|
115 int ycrcb422;
|
nuclear@0
|
116 } digital;
|
nuclear@0
|
117
|
nuclear@0
|
118 struct {
|
nuclear@0
|
119 double video_signal_level;
|
nuclear@0
|
120 double sync_signal_level;
|
nuclear@0
|
121 double total_signal_level;
|
nuclear@0
|
122
|
nuclear@0
|
123 int blank_to_black;
|
nuclear@0
|
124
|
nuclear@0
|
125 int separate_hv_sync;
|
nuclear@0
|
126 int composite_sync_on_h;
|
nuclear@0
|
127 int composite_sync_on_green;
|
nuclear@0
|
128 int serration_on_vsync;
|
nuclear@0
|
129 ColorType color_type;
|
nuclear@0
|
130 } analog;
|
nuclear@0
|
131 } connector;
|
nuclear@0
|
132
|
nuclear@0
|
133 int width_mm; /* -1 if not specified */
|
nuclear@0
|
134 int height_mm; /* -1 if not specified */
|
nuclear@0
|
135 double aspect_ratio; /* -1.0 if not specififed */
|
nuclear@0
|
136
|
nuclear@0
|
137 double gamma; /* -1.0 if not specified */
|
nuclear@0
|
138
|
nuclear@0
|
139 int standby;
|
nuclear@0
|
140 int suspend;
|
nuclear@0
|
141 int active_off;
|
nuclear@0
|
142
|
nuclear@0
|
143 int srgb_is_standard;
|
nuclear@0
|
144 int preferred_timing_includes_native;
|
nuclear@0
|
145 int continuous_frequency;
|
nuclear@0
|
146
|
nuclear@0
|
147 double red_x;
|
nuclear@0
|
148 double red_y;
|
nuclear@0
|
149 double green_x;
|
nuclear@0
|
150 double green_y;
|
nuclear@0
|
151 double blue_x;
|
nuclear@0
|
152 double blue_y;
|
nuclear@0
|
153 double white_x;
|
nuclear@0
|
154 double white_y;
|
nuclear@0
|
155
|
nuclear@0
|
156 Timing established[24]; /* Terminated by 0x0x0 */
|
nuclear@0
|
157 Timing standard[8];
|
nuclear@0
|
158
|
nuclear@0
|
159 int n_detailed_timings;
|
nuclear@0
|
160 DetailedTiming detailed_timings[4]; /* If monitor has a preferred
|
nuclear@0
|
161 * mode, it is the first one
|
nuclear@0
|
162 * (whether it has, is
|
nuclear@0
|
163 * determined by the
|
nuclear@0
|
164 * preferred_timing_includes
|
nuclear@0
|
165 * bit.
|
nuclear@0
|
166 */
|
nuclear@0
|
167
|
nuclear@0
|
168 /* Optional product description */
|
nuclear@0
|
169 char dsc_serial_number[14];
|
nuclear@0
|
170 char dsc_product_name[14];
|
nuclear@0
|
171 char dsc_string[14]; /* Unspecified ASCII data */
|
nuclear@0
|
172 };
|
nuclear@0
|
173
|
nuclear@0
|
174 MonitorInfo * read_edid_data(Display * disp, RROutput id);
|