Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 1 | /* |
| 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 |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 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 | |
| 29 | struct edid { |
| 30 | char manuf_name[4]; |
| 31 | unsigned int model; |
| 32 | unsigned int serial; |
| 33 | unsigned int year; |
| 34 | unsigned int week; |
| 35 | unsigned int version[2]; |
| 36 | unsigned int nonconformant; |
| 37 | unsigned int type; |
| 38 | unsigned int bpp; |
Ronald G. Minnich | b2893a01 | 2013-04-23 10:59:11 -0700 | [diff] [blame] | 39 | unsigned int xres; |
| 40 | unsigned int yres; |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 41 | unsigned int voltage; |
| 42 | unsigned int sync; |
| 43 | unsigned int xsize_cm; |
| 44 | unsigned int ysize_cm; |
| 45 | /* used to compute timing for graphics chips. */ |
| 46 | unsigned char phsync; |
| 47 | unsigned char pvsync; |
Furquan Shaikh | aa04ed6 | 2013-07-23 15:53:02 -0700 | [diff] [blame] | 48 | unsigned int x_mm; |
| 49 | unsigned int y_mm; |
Furquan Shaikh | 6b19071 | 2013-07-22 16:18:31 -0700 | [diff] [blame] | 50 | unsigned int pixel_clock; |
| 51 | unsigned int link_clock; |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 52 | unsigned int ha; |
| 53 | unsigned int hbl; |
| 54 | unsigned int hso; |
| 55 | unsigned int hspw; |
| 56 | unsigned int hborder; |
| 57 | unsigned int va; |
| 58 | unsigned int vbl; |
| 59 | unsigned int vso; |
| 60 | unsigned int vspw; |
| 61 | unsigned int vborder; |
Ronald G. Minnich | 4c5b161 | 2013-06-28 14:33:30 -0700 | [diff] [blame] | 62 | /* 3 variables needed for coreboot framebuffer. |
| 63 | * In most cases, they are the same as the ha |
| 64 | * and va variables, but not always, as in the |
| 65 | * case of a 1366 wide display. |
| 66 | */ |
| 67 | u32 x_resolution; |
| 68 | u32 y_resolution; |
| 69 | u32 bytes_per_line; |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 70 | /* it is unlikely we need these things. */ |
| 71 | /* if one of these is non-zero, use that one. */ |
| 72 | unsigned int aspect_landscape; |
| 73 | unsigned int aspect_portrait; |
| 74 | const char *range_class; |
| 75 | const char *syncmethod; |
| 76 | const char *stereo; |
| 77 | }; |
| 78 | |
Ronald G. Minnich | b2893a01 | 2013-04-23 10:59:11 -0700 | [diff] [blame] | 79 | /* Defined in src/lib/edid.c */ |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 80 | int decode_edid(unsigned char *edid, int size, struct edid *out); |
Ronald G. Minnich | 78c3e33 | 2013-04-24 09:50:56 -0700 | [diff] [blame] | 81 | void set_vbe_mode_info_valid(struct edid *edid, uintptr_t fb_addr); |
Ronald G. Minnich | b2893a01 | 2013-04-23 10:59:11 -0700 | [diff] [blame] | 82 | |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 83 | #endif /* EDID_H */ |