LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
xenos_edid.h
Go to the documentation of this file.
1/*
2 * Copyright © 2007-2008 Intel Corporation
3 * Jesse Barnes <jesse.barnes@intel.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 */
24/* edited to fit in libxenon */
26#ifndef __DRM_EDID_H__
27#define __DRM_EDID_H__
29#include <xetypes.h>
31typedef unsigned short __le16;
33#define EDID_LENGTH 128
34#define DDC_ADDR 0x50
35
40} __attribute__((packed));
41
42/* 00=16:10, 01=4:3, 10=5:4, 11=16:9 */
43#define EDID_TIMING_ASPECT_SHIFT 6
44#define EDID_TIMING_ASPECT_MASK (0x3 << EDID_TIMING_ASPECT_SHIFT)
45
46/* need to add 60 */
47#define EDID_TIMING_VFREQ_SHIFT 0
48#define EDID_TIMING_VFREQ_MASK (0x3f << EDID_TIMING_VFREQ_SHIFT)
49
50struct std_timing {
51 u8 hsize; /* need to multiply by 8 then add 248 */
53} __attribute__((packed));
54
55#define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1)
56#define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
57#define DRM_EDID_PT_SEPARATE_SYNC (3 << 3)
58#define DRM_EDID_PT_STEREO (1 << 5)
59#define DRM_EDID_PT_INTERLACED (1 << 7)
60
61/* If detailed data is pixel timing */
79} __attribute__((packed));
80
81/* If it's not pixel timing, it'll be one of the below */
83 u8 str[13];
84} __attribute__((packed));
85
91 u8 pixel_clock_mhz; /* need to multiply by 10 */
92 __le16 sec_gtf_toggle; /* A000=use above, 20=use below */
93 u8 hfreq_start_khz; /* need to multiply by 2 */
94 u8 c; /* need to divide by 2 */
97 u8 j; /* need to divide by 2 */
98} __attribute__((packed));
99
101 u8 white_yx_lo; /* Lower 2 bits each */
104 u8 gamma; /* need to divide by 100 then add 1 */
105} __attribute__((packed));
106
112} __attribute__((packed));
113
116} __attribute__((packed));
117
120 u8 type; /* ff=serial, fe=string, fd=monitor range, fc=monitor name
121 fb=color point data, fa=standard timing data,
122 f9=undefined, f8=mfg. reserved */
124 union {
129 struct cvt_timing cvt[4];
131} __attribute__((packed));
132
133#define EDID_DETAIL_EST_TIMINGS 0xf7
134#define EDID_DETAIL_CVT_3BYTE 0xf8
135#define EDID_DETAIL_COLOR_MGMT_DATA 0xf9
136#define EDID_DETAIL_STD_MODES 0xfa
137#define EDID_DETAIL_MONITOR_CPDATA 0xfb
138#define EDID_DETAIL_MONITOR_NAME 0xfc
139#define EDID_DETAIL_MONITOR_RANGE 0xfd
140#define EDID_DETAIL_MONITOR_STRING 0xfe
141#define EDID_DETAIL_MONITOR_SERIAL 0xff
142
144 __le16 pixel_clock; /* need to multiply by 10 KHz */
145 union {
149} __attribute__((packed));
150
151#define DRM_EDID_INPUT_SERRATION_VSYNC (1 << 0)
152#define DRM_EDID_INPUT_SYNC_ON_GREEN (1 << 1)
153#define DRM_EDID_INPUT_COMPOSITE_SYNC (1 << 2)
154#define DRM_EDID_INPUT_SEPARATE_SYNCS (1 << 3)
155#define DRM_EDID_INPUT_BLANK_TO_BLACK (1 << 4)
156#define DRM_EDID_INPUT_VIDEO_LEVEL (3 << 5)
157#define DRM_EDID_INPUT_DIGITAL (1 << 7) /* bits below must be zero if set */
158
159#define DRM_EDID_FEATURE_DEFAULT_GTF (1 << 0)
160#define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 1)
161#define DRM_EDID_FEATURE_STANDARD_COLOR (1 << 2)
162#define DRM_EDID_FEATURE_DISPLAY_TYPE (3 << 3) /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */
163#define DRM_EDID_FEATURE_PM_ACTIVE_OFF (1 << 5)
164#define DRM_EDID_FEATURE_PM_SUSPEND (1 << 6)
165#define DRM_EDID_FEATURE_PM_STANDBY (1 << 7)
166
167struct edid {
169 /* Vendor & product info */
172 u32 serial; /* FIXME: byte order */
175 /* EDID version */
178 /* Display info: */
184 /* Color characteristics */
195 /* Est. timings and mfg rsvd timings*/
197 /* Standard timings 1-8*/
199 /* Detailing timings 1-4 */
201 /* Number of 128 byte ext. blocks */
203 /* Checksum */
205} __attribute__((packed));
206
207#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
208
209struct edid *xenos_get_edid();
211
212
213#endif /* __DRM_EDID_H__ */
unsigned int __mf_uintptr_t __attribute__((__mode__(__pointer__)))
Definition: mf-runtime.h:34
u8 code[3]
Definition: xenos_edid.h:115
struct cvt_timing cvt[4]
Definition: xenos_edid.h:129
struct detailed_data_string str
Definition: xenos_edid.h:125
struct detailed_data_monitor_range range
Definition: xenos_edid.h:126
struct std_timing timings[5]
Definition: xenos_edid.h:128
union detailed_non_pixel::@14 data
struct detailed_data_wpindex color
Definition: xenos_edid.h:127
u8 hsync_vsync_offset_pulse_width_hi
Definition: xenos_edid.h:72
union detailed_timing::@16 data
__le16 pixel_clock
Definition: xenos_edid.h:144
struct detailed_non_pixel other_data
Definition: xenos_edid.h:147
struct detailed_pixel_timing pixel_data
Definition: xenos_edid.h:146
u8 header[8]
Definition: xenos_edid.h:168
u8 features
Definition: xenos_edid.h:183
u32 serial
Definition: xenos_edid.h:172
u8 height_cm
Definition: xenos_edid.h:181
u8 green_x
Definition: xenos_edid.h:189
u8 red_green_lo
Definition: xenos_edid.h:185
struct detailed_timing detailed_timings[4]
Definition: xenos_edid.h:200
struct est_timings established_timings
Definition: xenos_edid.h:196
u8 version
Definition: xenos_edid.h:176
u8 checksum
Definition: xenos_edid.h:204
u8 input
Definition: xenos_edid.h:179
u8 width_cm
Definition: xenos_edid.h:180
u8 blue_y
Definition: xenos_edid.h:192
u8 red_x
Definition: xenos_edid.h:187
u8 white_x
Definition: xenos_edid.h:193
u8 revision
Definition: xenos_edid.h:177
u8 blue_x
Definition: xenos_edid.h:191
u8 prod_code[2]
Definition: xenos_edid.h:171
u8 mfg_week
Definition: xenos_edid.h:173
u8 mfg_year
Definition: xenos_edid.h:174
u8 green_y
Definition: xenos_edid.h:190
struct std_timing standard_timings[8]
Definition: xenos_edid.h:198
u8 mfg_id[2]
Definition: xenos_edid.h:170
u8 gamma
Definition: xenos_edid.h:182
u8 red_y
Definition: xenos_edid.h:188
u8 extensions
Definition: xenos_edid.h:202
u8 black_white_lo
Definition: xenos_edid.h:186
u8 white_y
Definition: xenos_edid.h:194
u8 vfreq_aspect
Definition: xenos_edid.h:52
unsigned short __le16
Definition: xenos_edid.h:31
BOOL xenos_detect_hdmi_monitor(struct edid *edid)
Definition: xenos_edid.c:264
struct edid * xenos_get_edid()
Definition: xenos_edid.c:209
uint8_t u8
8bit unsigned integer
Definition: xetypes.h:12
unsigned int BOOL
Definition: xetypes.h:46
uint32_t u32
32bit unsigned integer
Definition: xetypes.h:14