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