summaryrefslogtreecommitdiff
path: root/src/include/edid.h
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@google.com>2013-03-13 14:35:01 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-03-20 05:35:50 +0100
commitb3b72f350e22ecdfa8e228b820f46da805d4f230 (patch)
tree95774693b92c4bf889710eda6970ff6437e8aa13 /src/include/edid.h
parenta95a13bd474fa7738840496b657cd46784e3f6b2 (diff)
downloadcoreboot-b3b72f350e22ecdfa8e228b820f46da805d4f230.tar.xz
link/graphics: Add support for EDID
This code is taken from an EDID reader written at Red Hat. The key function is int decode_edid(unsigned char *edid, int size, struct edid *out) Which takes a pointer to an EDID blob, and a size, and decodes it into a machine-independent format in out, which may be used for driving chipsets. The EDID blob might come for IO, or a compiled-in EDID BLOB, or CBFS. Also included are the changes needed to use the EDID code on Link. Change-Id: I66b275b8ed28fd77cfa5978bdec1eeef9e9425f1 Signed-off-by: Ronald G. Minnich <rminnich@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2837 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include/edid.h')
-rw-r--r--src/include/edid.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/include/edid.h b/src/include/edid.h
new file mode 100644
index 0000000000..6d76bb7efb
--- /dev/null
+++ b/src/include/edid.h
@@ -0,0 +1,66 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2013 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef EDID_H
+#define EDID_H
+
+/* structure for communicating EDID information from a raw EDID block to
+ * higher level functions.
+ * The size of the data types is not critical, so we leave them as
+ * unsigned int. We can move more into into this struct as needed.
+ */
+
+struct edid {
+ char manuf_name[4];
+ unsigned int model;
+ unsigned int serial;
+ unsigned int year;
+ unsigned int week;
+ unsigned int version[2];
+ unsigned int nonconformant;
+ unsigned int type;
+ unsigned int bpp;
+ unsigned int voltage;
+ unsigned int sync;
+ unsigned int xsize_cm;
+ unsigned int ysize_cm;
+ /* used to compute timing for graphics chips. */
+ unsigned char phsync;
+ unsigned char pvsync;
+ unsigned int ha;
+ unsigned int hbl;
+ unsigned int hso;
+ unsigned int hspw;
+ unsigned int hborder;
+ unsigned int va;
+ unsigned int vbl;
+ unsigned int vso;
+ unsigned int vspw;
+ unsigned int vborder;
+ /* it is unlikely we need these things. */
+ /* if one of these is non-zero, use that one. */
+ unsigned int aspect_landscape;
+ unsigned int aspect_portrait;
+ const char *range_class;
+ const char *syncmethod;
+ const char *stereo;
+};
+
+int decode_edid(unsigned char *edid, int size, struct edid *out);
+#endif /* EDID_H */