]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libedid/include/edid.h
Update
[l4.git] / l4 / pkg / libedid / include / edid.h
1 /**
2  * \file
3  */
4 /*
5  * (c) 2014 Matthias Lange <matthias.lange@kernkonzept.com>
6  *
7  * This file is part of TUD:OS and distributed under the terms of the
8  * GNU Lesser General Public License 2.1.
9  * Please see the COPYING-LGPL-2.1 file for details.
10  */
11 #pragma once
12
13 #include <l4/sys/compiler.h>
14
15 /**
16  * \defgroup libedid EDID parsing functionality
17  * @{
18  */
19
20 /**
21  * \brief EDID constants
22  */
23 enum Libedid_consts
24 {
25   Libedid_block_size = 128, ///< Size of one EDID block in bytes
26 };
27
28 __BEGIN_DECLS
29
30 /**
31  * \brief Check for valid EDID header
32  *
33  * @param edid Pointer to a 128byte EDID block
34  * @return 0 if the header is correct, -EINVAL otherwise
35  */
36 int libedid_check_header(const unsigned char *edid);
37
38 /**
39  * \brief Calculates the EDID checksum
40  *
41  * @param edid Pointer to a 128byte EDID block
42  * @return 0 if checksum is correct, -EINVAL otherwise
43  */
44 int libedid_checksum(const unsigned char *edid);
45
46 /**
47  * \brief Returns the EDID version number
48  *
49  * @param edid Pointer to a 128byte EDID block
50  * @return Version number
51  */
52 unsigned libedid_version(const unsigned char *edid);
53
54 /**
55  * \brief Returns the EDID revision number
56  *
57  * @param edid Pointer to a 128 EDID block
58  * @return Revision number
59  */
60 unsigned libedid_revision(const unsigned char *edid);
61
62 /**
63  * \brief Extracts the display's PnP ID
64  *
65  * @param edid Pointer to a 128byte EDID block
66  * @retval id Return the PnP id. Must point to 4 bytes.
67  */
68 void libedid_pnp_id(const unsigned char *edid, unsigned char *id);
69
70 /**
71  * \brief Extract the display's prefered mode
72  *
73  * @param edid Pointer to a 128byte EDID block
74  * @retval w X resolution of prefered video mode in pixels.
75  * @retval h Y resolution of prefered video mode in pixels.
76  */
77 void libedid_prefered_resolution(const unsigned char *edid,
78                                  unsigned *w, unsigned *h);
79
80 /**
81  * \brief Get the number of EDID extension blocks
82  *
83  * @param edid Pointer to a 128byte EDID block
84  * @return Number of EDID extension blocks
85  */
86 unsigned libedid_num_ext_blocks(const unsigned char *edid);
87
88 /**
89  * \brief Dump the standard timings to stdout
90  *
91  * @param edid Pointer to a 128byte EDID block
92  * @return Number of standard timings stored in EDID
93  */
94 unsigned libedid_dump_standard_timings(const unsigned char *edid);
95
96 /**
97  * \brief Dump raw EDID data to stdout
98  *
99  * @param edid Pointer to a 128byte EDID block
100  */
101 void libedid_dump(const unsigned char *edid);
102
103 /**@}*/
104
105 __END_DECLS