5 * (c) 2014 Matthias Lange <matthias.lange@kernkonzept.com>
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.
13 #include <l4/sys/compiler.h>
16 * \defgroup libedid EDID parsing functionality
21 * \brief EDID constants
25 Libedid_block_size = 128, ///< Size of one EDID block in bytes
31 * \brief Check for valid EDID header
33 * @param edid Pointer to a 128byte EDID block
34 * @return 0 if the header is correct, -EINVAL otherwise
36 int libedid_check_header(const unsigned char *edid);
39 * \brief Calculates the EDID checksum
41 * @param edid Pointer to a 128byte EDID block
42 * @return 0 if checksum is correct, -EINVAL otherwise
44 int libedid_checksum(const unsigned char *edid);
47 * \brief Returns the EDID version number
49 * @param edid Pointer to a 128byte EDID block
50 * @return Version number
52 unsigned libedid_version(const unsigned char *edid);
55 * \brief Returns the EDID revision number
57 * @param edid Pointer to a 128 EDID block
58 * @return Revision number
60 unsigned libedid_revision(const unsigned char *edid);
63 * \brief Extracts the display's PnP ID
65 * @param edid Pointer to a 128byte EDID block
66 * @retval id Return the PnP id. Must point to 4 bytes.
68 void libedid_pnp_id(const unsigned char *edid, unsigned char *id);
71 * \brief Extract the display's prefered mode
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.
77 void libedid_prefered_resolution(const unsigned char *edid,
78 unsigned *w, unsigned *h);
81 * \brief Get the number of EDID extension blocks
83 * @param edid Pointer to a 128byte EDID block
84 * @return Number of EDID extension blocks
86 unsigned libedid_num_ext_blocks(const unsigned char *edid);
89 * \brief Dump the standard timings to stdout
91 * @param edid Pointer to a 128byte EDID block
92 * @return Number of standard timings stored in EDID
94 unsigned libedid_dump_standard_timings(const unsigned char *edid);
97 * \brief Dump raw EDID data to stdout
99 * @param edid Pointer to a 128byte EDID block
101 void libedid_dump(const unsigned char *edid);