HDMI driver need to know whether the monitor is DVI or HDMI interface, so this commit just introduce a new number 'hdmi_monitor_detected' to struct edid. There were four bits to indicate the monitor interfaces, it's better to take use of that. But those bits only existed in EDID 1.4 version, but didn't persented in the previous EDID version, so I decided to detect the hdmi cea block. BRANCH=none BUG=chrome-os-partner:43789 TEST=When mickey connect with HDMI monitor, see 'hdmi_monitor_detected' is 'true'. When mickey connect with DVI monitor, see 'hdmi_monitor_detected' is 'false'. Change-Id: I1a4f1410e1cce1474ffae858db161a18578cac3a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 409f041805d9fdff2d49faa1a3a262cf4dc609c2 Original-Change-Id: Ife770898b0f2b4f58b8259711101a0cab4a5e4ac Original-Signed-off-by: Yakir Yang <ykk@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/309055 Original-Tested-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/12345 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
100 lines
2.7 KiB
C
100 lines
2.7 KiB
C
/*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef EDID_H
|
|
#define EDID_H
|
|
|
|
enum edid_modes {
|
|
EDID_MODE_640x480_60Hz,
|
|
EDID_MODE_720x480_60Hz,
|
|
EDID_MODE_1280x720_60Hz,
|
|
EDID_MODE_1920x1080_60Hz,
|
|
NUM_KNOWN_MODES,
|
|
|
|
EDID_MODE_AUTO
|
|
};
|
|
|
|
struct edid_mode {
|
|
const char *name;
|
|
unsigned int pixel_clock;
|
|
int lvds_dual_channel;
|
|
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
|
|
* unsigned int. We can move more into into this struct as needed.
|
|
*/
|
|
|
|
struct edid {
|
|
/* These next three things used to all be called bpp.
|
|
* Merriment ensued. The identifier
|
|
* 'bpp' is herewith banished from our
|
|
* Kingdom.
|
|
*/
|
|
/* How many bits in the framebuffer per pixel.
|
|
* Under all reasonable circumstances, it's 32.
|
|
*/
|
|
unsigned int framebuffer_bits_per_pixel;
|
|
/* On the panel, how many bits per color?
|
|
* In almost all cases, it's 6 or 8.
|
|
* The standard allows for much more!
|
|
*/
|
|
unsigned int panel_bits_per_color;
|
|
/* On the panel, how many bits per pixel.
|
|
* On Planet Earth, there are three colors
|
|
* per pixel, but this is convenient to have here
|
|
* instead of having 3*panel_bits_per_color
|
|
* all over the place.
|
|
*/
|
|
unsigned int panel_bits_per_pixel;
|
|
/* used to compute timing for graphics chips. */
|
|
struct edid_mode mode;
|
|
u8 mode_is_supported[NUM_KNOWN_MODES];
|
|
unsigned int link_clock;
|
|
/* 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
|
|
* case of a 1366 wide display.
|
|
*/
|
|
u32 x_resolution;
|
|
u32 y_resolution;
|
|
u32 bytes_per_line;
|
|
|
|
int hdmi_monitor_detected;
|
|
};
|
|
|
|
/* Defined in src/lib/edid.c */
|
|
int decode_edid(unsigned char *edid, int size, struct edid *out);
|
|
void set_vbe_mode_info_valid(struct edid *edid, uintptr_t fb_addr);
|
|
int set_display_mode(struct edid *edid, enum edid_modes mode);
|
|
|
|
#endif /* EDID_H */
|