blob: 1422c1e696ba60324557569f5885a9010dc815f0 [file] [log] [blame]
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2013 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010017 * Foundation, Inc.
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070018 */
19
20#ifndef EDID_H
21#define EDID_H
22
23/* structure for communicating EDID information from a raw EDID block to
24 * higher level functions.
25 * The size of the data types is not critical, so we leave them as
26 * unsigned int. We can move more into into this struct as needed.
27 */
28
29struct edid {
Ronald G. Minnich9518b562013-09-19 16:45:22 -070030 /* These next three things used to all be called bpp.
31 * Merriment ensued. The identifier
32 * 'bpp' is herewith banished from our
33 * Kingdom.
34 */
35 /* How many bits in the framebuffer per pixel.
36 * Under all reasonable circumstances, it's 32.
37 */
38 unsigned int framebuffer_bits_per_pixel;
39 /* On the panel, how many bits per color?
40 * In almost all cases, it's 6 or 8.
41 * The standard allows for much more!
42 */
43 unsigned int panel_bits_per_color;
44 /* On the panel, how many bits per pixel.
45 * On Planet Earth, there are three colors
46 * per pixel, but this is convenient to have here
47 * instead of having 3*panel_bits_per_color
48 * all over the place.
49 */
50 unsigned int panel_bits_per_pixel;
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070051 /* used to compute timing for graphics chips. */
52 unsigned char phsync;
53 unsigned char pvsync;
Furquan Shaikh6b190712013-07-22 16:18:31 -070054 unsigned int pixel_clock;
55 unsigned int link_clock;
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070056 unsigned int ha;
57 unsigned int hbl;
58 unsigned int hso;
59 unsigned int hspw;
60 unsigned int hborder;
61 unsigned int va;
62 unsigned int vbl;
63 unsigned int vso;
64 unsigned int vspw;
65 unsigned int vborder;
Ronald G. Minnich4c5b1612013-06-28 14:33:30 -070066 /* 3 variables needed for coreboot framebuffer.
67 * In most cases, they are the same as the ha
68 * and va variables, but not always, as in the
69 * case of a 1366 wide display.
70 */
71 u32 x_resolution;
72 u32 y_resolution;
73 u32 bytes_per_line;
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070074};
75
Ronald G. Minnichb2893a012013-04-23 10:59:11 -070076/* Defined in src/lib/edid.c */
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070077int decode_edid(unsigned char *edid, int size, struct edid *out);
Ronald G. Minnich78c3e332013-04-24 09:50:56 -070078void set_vbe_mode_info_valid(struct edid *edid, uintptr_t fb_addr);
Ronald G. Minnichb2893a012013-04-23 10:59:11 -070079
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070080#endif /* EDID_H */