gfxtest: Handle 64-bit aperture base and register location

Commit 1b65b84bc2 (gma: Update BDSM register offset for TGL onwards)
updated libgfxinit for a new aperture base register, but gfxtest was
missed. Update here as well.

Change-Id: I4c92190719bd2a066f77061a86b38faa59c6dfb8
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/83597
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/gfxtest/hw-gfx-gma-gfx_test.adb b/gfxtest/hw-gfx-gma-gfx_test.adb
index a7579a0..6a10657 100644
--- a/gfxtest/hw-gfx-gma-gfx_test.adb
+++ b/gfxtest/hw-gfx-gma-gfx_test.adb
@@ -302,13 +302,20 @@
      (Cursors  :    out Cursor_Array;
       Offset   : in out Word32)
    is
-      GMA_Phys_Base      : constant PCI.Index := 16#5c#;
       GMA_Phys_Base_Mask : constant := 16#fff0_0000#;
 
       Phys_Base : Word32;
       Success : Boolean;
    begin
-      Dev.Read32 (Phys_Base, GMA_Phys_Base);
+      if Config.GMA_Base_Is_64bit then
+         Dev.Read32 (Phys_Base, Config.GMA_Phys_Base_Index + 4);
+         if Phys_Base /= 0 then
+            pragma Debug (Debug.Put_Line ("Cannot handle 64-bit DSM yet."));
+            return;
+         end if;
+      end if;
+
+      Dev.Read32 (Phys_Base, Config.GMA_Phys_Base_Index);
       Phys_Base := Phys_Base and GMA_Phys_Base_Mask;
       Success := Phys_Base /= GMA_Phys_Base_Mask and Phys_Base /= 0;
       if not Success then