gma ilk hdmi: Add workaround for enable-bit quirk

The HDMI-enable bit is quirky, too. We are supposed to always set
it twice.

Change-Id: I9d093ff9a3178e01638f65b0607bc8d08c009978
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35784
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/ironlake/hw-gfx-gma-pch-hdmi.adb b/common/ironlake/hw-gfx-gma-pch-hdmi.adb
index 9426a86..15d4e9f 100644
--- a/common/ironlake/hw-gfx-gma-pch-hdmi.adb
+++ b/common/ironlake/hw-gfx-gma-pch-hdmi.adb
@@ -66,6 +66,10 @@
                         PCH_TRANSCODER_SELECT (FDI_Port) or
                         PCH_HDMI_SDVO_ENCODING_HDMI or
                         Polarity);
+      Registers.Posting_Read (PCH_HDMI (Port_Cfg.PCH_Port));
+      -- Set enable a second time, hardware may miss the first.
+      Registers.Set_Mask (PCH_HDMI (Port_Cfg.PCH_Port), PCH_HDMI_ENABLE);
+      Registers.Posting_Read (PCH_HDMI (Port_Cfg.PCH_Port));
    end On;
 
    ----------------------------------------------------------------------------
@@ -97,6 +101,9 @@
          -- Reenable with transcoder A selected to switch.
          Registers.Set_Mask (PCH_HDMI (Port), PCH_HDMI_ENABLE);
          Registers.Posting_Read (PCH_HDMI (Port));
+         -- Set enable a second time, hardware may miss the first.
+         Registers.Set_Mask (PCH_HDMI (Port), PCH_HDMI_ENABLE);
+         Registers.Posting_Read (PCH_HDMI (Port));
          Registers.Unset_Mask (PCH_HDMI (Port), PCH_HDMI_ENABLE);
          Registers.Posting_Read (PCH_HDMI (Port));
       end if;