edidvar.h revision 1.2.6.2 1 1.2.6.2 yamt /* $NetBSD: edidvar.h,v 1.2.6.2 2006/05/24 10:58:31 yamt Exp $ */
2 1.2.6.2 yamt
3 1.2.6.2 yamt /*-
4 1.2.6.2 yamt * Copyright (c) 2006 Itronix Inc.
5 1.2.6.2 yamt * All rights reserved.
6 1.2.6.2 yamt *
7 1.2.6.2 yamt * Written by Garrett D'Amore for Itronix Inc.
8 1.2.6.2 yamt *
9 1.2.6.2 yamt * Redistribution and use in source and binary forms, with or without
10 1.2.6.2 yamt * modification, are permitted provided that the following conditions
11 1.2.6.2 yamt * are met:
12 1.2.6.2 yamt * 1. Redistributions of source code must retain the above copyright
13 1.2.6.2 yamt * notice, this list of conditions and the following disclaimer.
14 1.2.6.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
15 1.2.6.2 yamt * notice, this list of conditions and the following disclaimer in the
16 1.2.6.2 yamt * documentation and/or other materials provided with the distribution.
17 1.2.6.2 yamt * 3. The name of Itronix Inc. may not be used to endorse
18 1.2.6.2 yamt * or promote products derived from this software without specific
19 1.2.6.2 yamt * prior written permission.
20 1.2.6.2 yamt *
21 1.2.6.2 yamt * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND ANY EXPRESS
22 1.2.6.2 yamt * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 1.2.6.2 yamt * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.2.6.2 yamt * ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
25 1.2.6.2 yamt * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.2.6.2 yamt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 1.2.6.2 yamt * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 1.2.6.2 yamt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 1.2.6.2 yamt * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 1.2.6.2 yamt * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 1.2.6.2 yamt * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.2.6.2 yamt */
33 1.2.6.2 yamt
34 1.2.6.2 yamt #ifndef _DEV_VIDEOMODE_EDIDVAR_H
35 1.2.6.2 yamt #define _DEV_VIDEOMODE_EDIDVAR_H
36 1.2.6.2 yamt
37 1.2.6.2 yamt struct edid_chroma {
38 1.2.6.2 yamt uint16_t ec_redx;
39 1.2.6.2 yamt uint16_t ec_redy;
40 1.2.6.2 yamt uint16_t ec_greenx;
41 1.2.6.2 yamt uint16_t ec_greeny;
42 1.2.6.2 yamt uint16_t ec_bluex;
43 1.2.6.2 yamt uint16_t ec_bluey;
44 1.2.6.2 yamt uint16_t ec_whitex;
45 1.2.6.2 yamt uint16_t ec_whitey;
46 1.2.6.2 yamt };
47 1.2.6.2 yamt
48 1.2.6.2 yamt struct edid_range {
49 1.2.6.2 yamt uint16_t er_min_vfreq; /* Hz */
50 1.2.6.2 yamt uint16_t er_max_vfreq; /* Hz */
51 1.2.6.2 yamt uint16_t er_min_hfreq; /* kHz */
52 1.2.6.2 yamt uint16_t er_max_hfreq; /* kHz */
53 1.2.6.2 yamt uint16_t er_max_clock; /* MHz */
54 1.2.6.2 yamt int er_have_gtf2;
55 1.2.6.2 yamt uint16_t er_gtf2_hfreq;
56 1.2.6.2 yamt uint16_t er_gtf2_c;
57 1.2.6.2 yamt uint16_t er_gtf2_m;
58 1.2.6.2 yamt uint16_t er_gtf2_k;
59 1.2.6.2 yamt uint16_t er_gtf2_j;
60 1.2.6.2 yamt };
61 1.2.6.2 yamt
62 1.2.6.2 yamt struct edid_info {
63 1.2.6.2 yamt uint8_t edid_vendor[4];
64 1.2.6.2 yamt char edid_vendorname[16];
65 1.2.6.2 yamt char edid_productname[16];
66 1.2.6.2 yamt char edid_comment[16];
67 1.2.6.2 yamt char edid_serial[16];
68 1.2.6.2 yamt uint16_t edid_product;
69 1.2.6.2 yamt uint8_t edid_version;
70 1.2.6.2 yamt uint8_t edid_revision;
71 1.2.6.2 yamt int edid_year;
72 1.2.6.2 yamt int edid_week;
73 1.2.6.2 yamt uint8_t edid_video_input; /* see edidregs.h */
74 1.2.6.2 yamt uint8_t edid_max_hsize; /* in cm */
75 1.2.6.2 yamt uint8_t edid_max_vsize; /* in cm */
76 1.2.6.2 yamt uint8_t edid_gamma;
77 1.2.6.2 yamt uint8_t edid_features;
78 1.2.6.2 yamt
79 1.2.6.2 yamt int edid_have_range;
80 1.2.6.2 yamt struct edid_range edid_range;
81 1.2.6.2 yamt
82 1.2.6.2 yamt struct edid_chroma edid_chroma;
83 1.2.6.2 yamt
84 1.2.6.2 yamt /* parsed modes */
85 1.2.6.2 yamt struct videomode *edid_preferred_mode;
86 1.2.6.2 yamt int edid_nmodes;
87 1.2.6.2 yamt struct videomode edid_modes[64];
88 1.2.6.2 yamt };
89 1.2.6.2 yamt
90 1.2.6.2 yamt int edid_is_valid(uint8_t *);
91 1.2.6.2 yamt int edid_parse(uint8_t *, struct edid_info *);
92 1.2.6.2 yamt void edid_print(struct edid_info *);
93 1.2.6.2 yamt
94 1.2.6.2 yamt #endif /* _DEV_VIDEOMODE_EDIDVAR_H */
95