gma edid: Check expected display type
Check that the EDID's digital-input bit matches the expected display
type (i.e. it should only be set for non-VGA displays).
Change-Id: I099112f190f866525e882d5e24a428092d4d8331
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17085
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/common/hw-gfx-edid.adb b/common/hw-gfx-edid.adb
index 64b86a9..44d729f 100644
--- a/common/hw-gfx-edid.adb
+++ b/common/hw-gfx-edid.adb
@@ -68,6 +68,15 @@
----------------------------------------------------------------------------
+ function Compatible_Display
+ (Raw_EDID : Raw_EDID_Data;
+ Display : Display_Type)
+ return Boolean
+ is
+ begin
+ return (Display = VGA) = ((Raw_EDID (INPUT) and INPUT_DIGITAL) = 16#00#);
+ end Compatible_Display;
+
function Read_LE16
(Raw_EDID : Raw_EDID_Data;
Offset : Raw_EDID_Index)