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-gma.adb b/common/hw-gfx-gma.adb
index 416117b..cd202be 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -327,7 +327,10 @@
                   Connector_Info.Read_EDID (Raw_EDID, Port_Cfg, Success);
                end if;
 
-               if Success and then EDID.Has_Preferred_Mode (Raw_EDID) then
+               if Success and then
+                  (EDID.Compatible_Display (Raw_EDID, Port_Cfg.Display) and
+                   EDID.Has_Preferred_Mode (Raw_EDID))
+               then
                   Configs (Config_Idx).Mode := EDID.Preferred_Mode (Raw_EDID);
                else
                   Configs (Config_Idx).Port := Disabled;
@@ -428,7 +431,10 @@
                   Success  => Success);
             end if;
 
-            if Success and then EDID.Has_Preferred_Mode (Raw_EDID) then
+            if Success and then
+               (EDID.Compatible_Display (Raw_EDID, Port_Cfg.Display) and
+                EDID.Has_Preferred_Mode (Raw_EDID))
+            then
                Configs (Config_Idx) := Config_Type'
                  (Port        => Port,
                   Framebuffer => Configs (Config_Idx).Framebuffer,