From 7dbf9c6747ccdfa8b993d3843a22722742957611 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Thu, 30 Jul 2015 18:49:48 -0700 Subject: edid: Use edid_mode struct to reduce redundancy This replaces various timing mode parameters parameters with an edid_mode struct within the edid struct. BUG=none BRANCH=firmware-veyron TEST=built and booted on Mickey, saw display come up, also compiled for link,falco,peppy,rambi,nyan_big,rush,smaug [pg: extended to also cover peach_pit, daisy and lenovo/t530] Change-Id: Icd0d67bfd3c422be087976261806b9525b2b9c7e Signed-off-by: Patrick Georgi Original-Commit-Id: abcbf25c81b25fadf71cae106e01b3e36391f5e9 Original-Change-Id: I1bfba5b06a708d042286db56b37f67302f61fff6 Original-Signed-off-by: David Hendricks Original-Reviewed-on: https://chromium-review.googlesource.com/289964 Original-Reviewed-by: Yakir Yang Original-Reviewed-by: Julius Werner Reviewed-on: http://review.coreboot.org/11388 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/include/edid.h | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'src/include/edid.h') diff --git a/src/include/edid.h b/src/include/edid.h index 1422c1e696..3de4dbc44d 100644 --- a/src/include/edid.h +++ b/src/include/edid.h @@ -20,6 +20,31 @@ #ifndef EDID_H #define EDID_H +enum edid_modes { + EDID_MODE_AUTO = 0, + EDID_MODE_640x480_60Hz, +}; + +struct edid_mode { + const char *name; + unsigned int pixel_clock; + unsigned int refresh; + 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; + unsigned char phsync; + unsigned char pvsync; + unsigned int x_mm; + unsigned int y_mm; +}; + /* 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 @@ -49,20 +74,8 @@ struct edid { */ unsigned int panel_bits_per_pixel; /* used to compute timing for graphics chips. */ - unsigned char phsync; - unsigned char pvsync; - unsigned int pixel_clock; + struct edid_mode mode; unsigned int link_clock; - 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; /* 3 variables needed for coreboot framebuffer. * In most cases, they are the same as the ha * and va variables, but not always, as in the -- cgit v1.2.3