| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 1 | with Ada.Numerics.Discrete_Random; |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 2 | with Ada.Unchecked_Conversion; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 3 | with Ada.Command_Line; |
| 4 | with Interfaces.C; |
| 5 | |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 6 | with HW.Time; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 7 | with HW.Debug; |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 8 | with HW.PCI.Dev; |
| 9 | with HW.MMIO_Range; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 10 | with HW.GFX.GMA; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 11 | with HW.GFX.GMA.Config; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 12 | with HW.GFX.GMA.Display_Probing; |
| 13 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 14 | package body HW.GFX.GMA.GFX_Test |
| 15 | is |
| 16 | pragma Disable_Atomic_Synchronization; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 17 | |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 18 | Primary_Delay_MS : constant := 8_000; |
| 19 | Secondary_Delay_MS : constant := 4_000; |
| 20 | Seed : constant := 12345; |
| 21 | |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 22 | package Rand_P is new Ada.Numerics.Discrete_Random (Natural); |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 23 | Gen : Rand_P.Generator; |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 24 | function Rand return Int32 is (Int32 (Rand_P.Random (Gen))); |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 25 | |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 26 | Start_X : constant := 0; |
| 27 | Start_Y : constant := 0; |
| 28 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 29 | package Dev is new PCI.Dev (PCI.Address'(0, 2, 0)); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 30 | |
| Nico Huber | c76749d | 2018-06-09 22:04:55 +0200 | [diff] [blame^] | 31 | type GTT_Entry is record |
| 32 | Addr : GTT_Address_Type; |
| 33 | Valid : Boolean; |
| 34 | end record; |
| 35 | GTT_Backup : array (GTT_Range) of GTT_Entry; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 36 | |
| 37 | procedure Backup_GTT |
| 38 | is |
| 39 | begin |
| 40 | for Idx in GTT_Range loop |
| Nico Huber | c76749d | 2018-06-09 22:04:55 +0200 | [diff] [blame^] | 41 | Read_GTT (GTT_Backup (Idx).Addr, GTT_Backup (Idx).Valid, Idx); |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 42 | end loop; |
| 43 | end Backup_GTT; |
| 44 | |
| 45 | procedure Restore_GTT |
| 46 | is |
| 47 | begin |
| 48 | for Idx in GTT_Range loop |
| Nico Huber | c76749d | 2018-06-09 22:04:55 +0200 | [diff] [blame^] | 49 | Write_GTT (Idx, GTT_Backup (Idx).Addr, GTT_Backup (Idx).Valid); |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 50 | end loop; |
| 51 | end Restore_GTT; |
| 52 | |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 53 | type Pixel_Type is record |
| 54 | Red : Byte; |
| 55 | Green : Byte; |
| 56 | Blue : Byte; |
| 57 | Alpha : Byte; |
| 58 | end record; |
| 59 | |
| 60 | for Pixel_Type use record |
| 61 | Blue at 0 range 0 .. 7; |
| 62 | Green at 1 range 0 .. 7; |
| 63 | Red at 2 range 0 .. 7; |
| 64 | Alpha at 3 range 0 .. 7; |
| 65 | end record; |
| 66 | |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 67 | White : constant Pixel_Type := (255, 255, 255, 255); |
| 68 | Black : constant Pixel_Type := ( 0, 0, 0, 255); |
| 69 | Red : constant Pixel_Type := (255, 0, 0, 255); |
| 70 | Green : constant Pixel_Type := ( 0, 255, 0, 255); |
| 71 | Blue : constant Pixel_Type := ( 0, 0, 255, 255); |
| 72 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 73 | function Pixel_To_Word (P : Pixel_Type) return Word32 |
| 74 | with |
| 75 | SPARK_Mode => Off |
| 76 | is |
| 77 | function To_Word is new Ada.Unchecked_Conversion (Pixel_Type, Word32); |
| 78 | begin |
| 79 | return To_Word (P); |
| 80 | end Pixel_To_Word; |
| 81 | |
| Nico Huber | 7bb10c6 | 2018-01-12 14:07:44 +0100 | [diff] [blame] | 82 | Max_W : constant := 4096; |
| 83 | Max_H : constant := 2160; |
| 84 | FB_Align : constant := 16#0004_0000#; |
| 85 | Cursor_Align : constant := 16#0001_0000#; |
| 86 | Max_Cursor_Wid : constant := 256; |
| 87 | subtype Screen_Index is Natural range 0 .. 3 * |
| 88 | (Max_W * Max_H + FB_Align / 4 + |
| 89 | 3 * Max_Cursor_Wid * Max_Cursor_Wid + Cursor_Align / 4) |
| 90 | - 1; |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 91 | type Screen_Type is array (Screen_Index) of Word32; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 92 | |
| Nico Huber | 34be654 | 2017-12-13 09:26:24 +0100 | [diff] [blame] | 93 | function Screen_Offset (FB : Framebuffer_Type) return Natural is |
| 94 | (Natural (Phys_Offset (FB) / 4)); |
| 95 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 96 | package Screen is new MMIO_Range (0, Word32, Screen_Index, Screen_Type); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 97 | |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 98 | Screen_Backup : Screen_Type; |
| 99 | |
| 100 | procedure Backup_Screen (FB : Framebuffer_Type) |
| 101 | is |
| Nico Huber | 34be654 | 2017-12-13 09:26:24 +0100 | [diff] [blame] | 102 | First : constant Screen_Index := Screen_Offset (FB); |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 103 | Last : constant Screen_Index := First + Natural (FB_Size (FB)) / 4 - 1; |
| 104 | begin |
| 105 | for Idx in Screen_Index range First .. Last loop |
| 106 | Screen.Read (Screen_Backup (Idx), Idx); |
| 107 | end loop; |
| 108 | end Backup_Screen; |
| 109 | |
| 110 | procedure Restore_Screen (FB : Framebuffer_Type) |
| 111 | is |
| Nico Huber | 34be654 | 2017-12-13 09:26:24 +0100 | [diff] [blame] | 112 | First : constant Screen_Index := Screen_Offset (FB); |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 113 | Last : constant Screen_Index := First + Natural (FB_Size (FB)) / 4 - 1; |
| 114 | begin |
| 115 | for Idx in Screen_Index range First .. Last loop |
| 116 | Screen.Write (Idx, Screen_Backup (Idx)); |
| 117 | end loop; |
| 118 | end Restore_Screen; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 119 | |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 120 | function Drawing_Width (FB : Framebuffer_Type) return Natural is |
| 121 | (Natural (FB.Width + 2 * Start_X)); |
| 122 | |
| 123 | function Drawing_Height (FB : Framebuffer_Type) return Natural is |
| 124 | (Natural (FB.Height + 2 * Start_Y)); |
| 125 | |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 126 | function Corner_Fill |
| 127 | (X, Y : Natural; |
| 128 | FB : Framebuffer_Type; |
| 129 | Pipe : Pipe_Index) |
| 130 | return Pixel_Type |
| 131 | is |
| 132 | Xrel : constant Integer := |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 133 | (if X < 32 then X else X - (Drawing_Width (FB) - 32)); |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 134 | Yrel : constant Integer := |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 135 | (if Y < 32 then Y else Y - (Drawing_Height (FB) - 32)); |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 136 | |
| 137 | function Color (Idx : Natural) return Pixel_Type is |
| 138 | (case (Idx + Pipe_Index'Pos (Pipe)) mod 4 is |
| 139 | when 0 => Blue, when 1 => Black, |
| 140 | when 3 => Green, when others => Red); |
| 141 | begin |
| 142 | return |
| 143 | (if Xrel mod 16 = 0 or Xrel = 31 or Yrel mod 16 = 0 or Yrel = 31 then |
| 144 | White |
| 145 | elsif Yrel < 16 then |
| 146 | (if Xrel < 16 then Color (0) else Color (1)) |
| 147 | else |
| 148 | (if Xrel < 16 then Color (3) else Color (2))); |
| 149 | end Corner_Fill; |
| 150 | |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 151 | function Fill |
| 152 | (X, Y : Natural; |
| 153 | Framebuffer : Framebuffer_Type; |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 154 | Pipe : Pipe_Index) |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 155 | return Pixel_Type |
| 156 | is |
| 157 | use type HW.Byte; |
| 158 | |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 159 | Xp : constant Natural := X * 256 / Drawing_Width (Framebuffer); |
| 160 | Yp : constant Natural := Y * 256 / Drawing_Height (Framebuffer); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 161 | Xn : constant Natural := 255 - Xp; |
| 162 | Yn : constant Natural := 255 - Yp; |
| 163 | |
| 164 | function Map (X, Y : Natural) return Byte is |
| 165 | begin |
| 166 | return Byte (X * Y / 255); |
| 167 | end Map; |
| 168 | begin |
| 169 | return |
| 170 | (case Pipe is |
| 171 | when GMA.Primary => (Map (Xn, Yn), Map (Xp, Yn), Map (Xp, Yp), 255), |
| 172 | when GMA.Secondary => (Map (Xn, Yp), Map (Xn, Yn), Map (Xp, Yn), 255), |
| 173 | when GMA.Tertiary => (Map (Xp, Yp), Map (Xn, Yp), Map (Xn, Yn), 255)); |
| 174 | end Fill; |
| 175 | |
| 176 | procedure Test_Screen |
| 177 | (Framebuffer : Framebuffer_Type; |
| 178 | Pipe : GMA.Pipe_Index) |
| 179 | is |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 180 | P : Pixel_Type; |
| 181 | -- We have pixel offset wheras the framebuffer has a byte offset |
| Nico Huber | 34be654 | 2017-12-13 09:26:24 +0100 | [diff] [blame] | 182 | Offset_Y : Natural := Screen_Offset (Framebuffer); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 183 | Offset : Natural; |
| Nico Huber | 9ca69f1 | 2017-08-28 14:31:46 +0200 | [diff] [blame] | 184 | |
| 185 | function Top_Test (X, Y : Natural) return Boolean |
| 186 | is |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 187 | C : constant Natural := Drawing_Width (Framebuffer) / 2; |
| 188 | S_Y : constant Natural := 3 * (Y - Start_Y) / 2; |
| Nico Huber | 9ca69f1 | 2017-08-28 14:31:46 +0200 | [diff] [blame] | 189 | Left : constant Integer := X - C + S_Y; |
| 190 | Right : constant Integer := X - C - S_Y; |
| 191 | begin |
| 192 | return |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 193 | (Y - Start_Y) < 12 and |
| Nico Huber | 9ca69f1 | 2017-08-28 14:31:46 +0200 | [diff] [blame] | 194 | ((-1 <= Left and Left <= 0) or |
| 195 | (0 <= Right and Right <= 1)); |
| 196 | end Top_Test; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 197 | begin |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 198 | for Y in 0 .. Drawing_Height (Framebuffer) - 1 loop |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 199 | Offset := Offset_Y; |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 200 | for X in 0 .. Drawing_Width (Framebuffer) - 1 loop |
| 201 | if (X < 32 or X >= Drawing_Width (Framebuffer) - 32) and |
| 202 | (Y < 32 or Y >= Drawing_Height (Framebuffer) - 32) |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 203 | then |
| 204 | P := Corner_Fill (X, Y, Framebuffer, Pipe); |
| Nico Huber | 9ca69f1 | 2017-08-28 14:31:46 +0200 | [diff] [blame] | 205 | elsif Framebuffer.Rotation /= No_Rotation and then |
| 206 | Top_Test (X, Y) |
| 207 | then |
| 208 | P := White; |
| Nico Huber | 244ea7e | 2017-08-28 11:38:23 +0200 | [diff] [blame] | 209 | elsif Y mod 16 = 0 or X mod 16 = 0 then |
| 210 | P := Black; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 211 | else |
| 212 | P := Fill (X, Y, Framebuffer, Pipe); |
| 213 | end if; |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 214 | Screen.Write (Offset, Pixel_To_Word (P)); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 215 | Offset := Offset + 1; |
| 216 | end loop; |
| 217 | Offset_Y := Offset_Y + Natural (Framebuffer.Stride); |
| 218 | end loop; |
| 219 | end Test_Screen; |
| 220 | |
| Nico Huber | 7bb10c6 | 2018-01-12 14:07:44 +0100 | [diff] [blame] | 221 | function Donut (X, Y, Max : Cursor_Pos) return Byte |
| 222 | is |
| 223 | ZZ : constant Int32 := Max * Max * 2; |
| 224 | Dist_Center : constant Int32 := ((X * X + Y * Y) * 255) / ZZ; |
| 225 | Dist_Circle : constant Int32 := Dist_Center - 20; |
| 226 | begin |
| 227 | return Byte (255 - Int32'Min (255, 6 * abs Dist_Circle + 64)); |
| 228 | end Donut; |
| 229 | |
| 230 | procedure Draw_Cursor (Pipe : Pipe_Index; Cursor : Cursor_Type) |
| 231 | is |
| 232 | use type HW.Byte; |
| 233 | Width : constant Width_Type := Cursor_Width (Cursor.Size); |
| 234 | Screen_Offset : Natural := |
| 235 | Natural (Shift_Left (Word32 (Cursor.GTT_Offset), 12) / 4); |
| 236 | begin |
| 237 | if Cursor.Mode /= ARGB_Cursor then |
| 238 | return; |
| 239 | end if; |
| 240 | for Y in Cursor_Pos range -Width / 2 .. Width / 2 - 1 loop |
| 241 | for X in Cursor_Pos range -Width / 2 .. Width / 2 - 1 loop |
| 242 | declare |
| 243 | D : constant Byte := Donut (X, Y, Width / 2); |
| 244 | begin |
| 245 | -- Hardware seems to expect pre-multiplied alpha (i.e. |
| 246 | -- color components already contain the alpha). |
| 247 | Screen.Write |
| 248 | (Index => Screen_Offset, |
| 249 | Value => Pixel_To_Word ( |
| 250 | (Red => (if Pipe = Secondary then D / 2 else 0), |
| 251 | Green => (if Pipe = Tertiary then D / 2 else 0), |
| 252 | Blue => (if Pipe = Primary then D / 2 else 0), |
| 253 | Alpha => D))); |
| 254 | Screen_Offset := Screen_Offset + 1; |
| 255 | end; |
| 256 | end loop; |
| 257 | end loop; |
| 258 | end Draw_Cursor; |
| 259 | |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 260 | procedure Calc_Framebuffer |
| 261 | (FB : out Framebuffer_Type; |
| 262 | Mode : in Mode_Type; |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 263 | Rotation : in Rotation_Type; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 264 | Offset : in out Word32) |
| 265 | is |
| Nico Huber | c5c767a | 2018-06-03 01:09:04 +0200 | [diff] [blame] | 266 | Width : constant Width_Type := Mode.H_Visible; |
| 267 | Height : constant Height_Type := Mode.V_Visible; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 268 | begin |
| 269 | Offset := (Offset + FB_Align - 1) and not (FB_Align - 1); |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 270 | if Rotation = Rotated_90 or Rotation = Rotated_270 then |
| 271 | FB := |
| Nico Huber | c5c767a | 2018-06-03 01:09:04 +0200 | [diff] [blame] | 272 | (Width => Height, |
| 273 | Height => Width, |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 274 | Start_X => Start_X, |
| 275 | Start_Y => Start_Y, |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 276 | BPC => 8, |
| Nico Huber | c5c767a | 2018-06-03 01:09:04 +0200 | [diff] [blame] | 277 | Stride => Div_Round_Up (Height + 2 * Start_X, 32) * 32, |
| 278 | V_Stride => Div_Round_Up (Width + 2 * Start_Y, 32) * 32, |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 279 | Tiling => Y_Tiled, |
| 280 | Rotation => Rotation, |
| Nico Huber | 34be654 | 2017-12-13 09:26:24 +0100 | [diff] [blame] | 281 | Offset => Offset + Word32 (GTT_Rotation_Offset) * GTT_Page_Size); |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 282 | else |
| 283 | FB := |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 284 | (Width => Width, |
| 285 | Height => Height, |
| 286 | Start_X => Start_X, |
| 287 | Start_Y => Start_Y, |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 288 | BPC => 8, |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame] | 289 | Stride => Div_Round_Up (Width + 2 * Start_X, 16) * 16, |
| 290 | V_Stride => Height + 2 * Start_Y, |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 291 | Tiling => Linear, |
| 292 | Rotation => Rotation, |
| 293 | Offset => Offset); |
| 294 | end if; |
| Nico Huber | b747049 | 2017-11-30 14:48:35 +0100 | [diff] [blame] | 295 | Offset := Offset + Word32 (FB_Size (FB)); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 296 | end Calc_Framebuffer; |
| 297 | |
| Nico Huber | 7bb10c6 | 2018-01-12 14:07:44 +0100 | [diff] [blame] | 298 | type Cursor_Array is array (Cursor_Size) of Cursor_Type; |
| 299 | Cursors : array (Pipe_Index) of Cursor_Array; |
| 300 | |
| 301 | procedure Prepare_Cursors |
| 302 | (Cursors : out Cursor_Array; |
| 303 | Offset : in out Word32) |
| 304 | is |
| 305 | GMA_Phys_Base : constant PCI.Index := 16#5c#; |
| 306 | GMA_Phys_Base_Mask : constant := 16#fff0_0000#; |
| 307 | |
| 308 | Phys_Base : Word32; |
| 309 | Success : Boolean; |
| 310 | begin |
| 311 | Dev.Read32 (Phys_Base, GMA_Phys_Base); |
| 312 | Phys_Base := Phys_Base and GMA_Phys_Base_Mask; |
| 313 | Success := Phys_Base /= GMA_Phys_Base_Mask and Phys_Base /= 0; |
| 314 | if not Success then |
| 315 | Debug.Put_Line ("Failed to read stolen memory base."); |
| 316 | return; |
| 317 | end if; |
| 318 | |
| 319 | for Size in Cursor_Size loop |
| 320 | Offset := (Offset + Cursor_Align - 1) and not (Cursor_Align - 1); |
| 321 | declare |
| 322 | Width : constant Width_Type := Cursor_Width (Size); |
| 323 | GTT_End : constant Word32 := Offset + Word32 (Width * Width) * 4; |
| 324 | begin |
| 325 | Cursors (Size) := |
| 326 | (Mode => ARGB_Cursor, |
| 327 | Size => Size, |
| 328 | Center_X => Width, |
| 329 | Center_Y => Width, |
| 330 | GTT_Offset => GTT_Range (Shift_Right (Offset, 12))); |
| 331 | while Offset < GTT_End loop |
| 332 | GMA.Write_GTT |
| 333 | (GTT_Page => GTT_Range (Offset / GTT_Page_Size), |
| 334 | Device_Address => GTT_Address_Type (Phys_Base + Offset), |
| 335 | Valid => True); |
| 336 | Offset := Offset + GTT_Page_Size; |
| 337 | end loop; |
| 338 | end; |
| 339 | end loop; |
| 340 | end Prepare_Cursors; |
| 341 | |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 342 | Pipes : GMA.Pipe_Configs; |
| 343 | |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 344 | procedure Prepare_Configs (Rotation : Rotation_Type) |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 345 | is |
| 346 | use type HW.GFX.GMA.Port_Type; |
| 347 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 348 | Offset : Word32 := 0; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 349 | Success : Boolean; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 350 | begin |
| 351 | GMA.Display_Probing.Scan_Ports (Pipes); |
| 352 | |
| 353 | for Pipe in GMA.Pipe_Index loop |
| 354 | if Pipes (Pipe).Port /= GMA.Disabled then |
| 355 | Calc_Framebuffer |
| 356 | (FB => Pipes (Pipe).Framebuffer, |
| 357 | Mode => Pipes (Pipe).Mode, |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 358 | Rotation => Rotation, |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 359 | Offset => Offset); |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 360 | GMA.Setup_Default_FB |
| 361 | (FB => Pipes (Pipe).Framebuffer, |
| 362 | Clear => False, |
| 363 | Success => Success); |
| 364 | if not Success then |
| 365 | Pipes (Pipe).Port := GMA.Disabled; |
| 366 | end if; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 367 | end if; |
| Nico Huber | 7bb10c6 | 2018-01-12 14:07:44 +0100 | [diff] [blame] | 368 | Prepare_Cursors (Cursors (Pipe), Offset); |
| 369 | Pipes (Pipe).Cursor := Cursors (Pipe) (Cursor_Size'Val (Rand mod 3)); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 370 | end loop; |
| 371 | |
| 372 | GMA.Dump_Configs (Pipes); |
| 373 | end Prepare_Configs; |
| 374 | |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 375 | procedure Script_Cursors |
| 376 | (Pipes : in out GMA.Pipe_Configs; |
| 377 | Time_MS : in Natural) |
| 378 | is |
| 379 | type Corner is (UL, UR, LR, LL); |
| 380 | type Cursor_Script_Entry is record |
| 381 | Rel : Corner; |
| 382 | X, Y : Int32; |
| 383 | end record; |
| 384 | Cursor_Script : constant array (Natural range 0 .. 19) of Cursor_Script_Entry := |
| 385 | ((UL, 16, 16), (UL, 16, 16), (UL, 16, 16), (UL, -32, 0), (UL, 16, 16), |
| 386 | (UR, -16, 16), (UR, -16, 16), (UR, -16, 16), (UR, 0, -32), (UR, -16, 16), |
| 387 | (LR, -16, -16), (LR, -16, -16), (LR, -16, -16), (LR, 32, 0), (LR, -16, -16), |
| 388 | (LL, 16, -16), (LL, 16, -16), (LL, 16, -16), (LL, 0, 32), (LL, 16, -16)); |
| 389 | |
| 390 | Deadline : constant Time.T := Time.MS_From_Now (Time_MS); |
| 391 | Timed_Out : Boolean := False; |
| 392 | Cnt : Word32 := 0; |
| 393 | begin |
| 394 | loop |
| 395 | for Pipe in Pipe_Index loop |
| 396 | exit when Pipes (Pipe).Port = GMA.Disabled; |
| 397 | declare |
| 398 | C : Cursor_Type renames Pipes (Pipe).Cursor; |
| 399 | FB : Framebuffer_Type renames Pipes (Pipe).Framebuffer; |
| Nico Huber | c5c767a | 2018-06-03 01:09:04 +0200 | [diff] [blame] | 400 | Width : constant Width_Type := Rotated_Width (FB); |
| 401 | Height : constant Height_Type := Rotated_Height (FB); |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 402 | CS : Cursor_Script_Entry renames Cursor_Script |
| 403 | (Natural (Cnt) mod (Cursor_Script'Last + 1)); |
| 404 | begin |
| 405 | C.Center_X := CS.X; |
| 406 | C.Center_Y := CS.Y; |
| 407 | case CS.Rel is |
| 408 | when UL => null; |
| 409 | when UR => C.Center_X := CS.X + Width; |
| 410 | when LR => C.Center_X := CS.X + Width; |
| 411 | C.Center_Y := CS.Y + Height; |
| 412 | when LL => C.Center_Y := CS.Y + Height; |
| 413 | end case; |
| 414 | GMA.Place_Cursor (Pipe, C.Center_X, C.Center_Y); |
| 415 | end; |
| 416 | end loop; |
| 417 | Timed_Out := Time.Timed_Out (Deadline); |
| 418 | exit when Timed_Out; |
| 419 | Time.M_Delay (160); |
| 420 | Cnt := Cnt + 1; |
| 421 | end loop; |
| 422 | end Script_Cursors; |
| 423 | |
| 424 | type Cursor_Info is record |
| 425 | X_Velo, Y_Velo : Int32; |
| 426 | X_Acc, Y_Acc : Int32; |
| 427 | Color : Pipe_Index; |
| 428 | Size : Cursor_Size; |
| 429 | end record; |
| 430 | function Cursor_Rand return Int32 is (Rand mod 51 - 25); |
| 431 | Cursor_Infos : array (Pipe_Index) of Cursor_Info := |
| 432 | (others => |
| 433 | (Color => Pipe_Index'Val (Rand mod 3), |
| 434 | Size => Cursor_Size'Val (Rand mod 3), |
| 435 | X_Velo => 3 * Cursor_Rand, |
| 436 | Y_Velo => 3 * Cursor_Rand, |
| 437 | others => Cursor_Rand)); |
| 438 | |
| 439 | procedure Move_Cursors |
| 440 | (Pipes : in out GMA.Pipe_Configs; |
| 441 | Time_MS : in Natural) |
| 442 | is |
| 443 | procedure Select_New_Cursor |
| 444 | (P : in Pipe_Index; |
| 445 | C : in out Cursor_Type; |
| 446 | CI : in out Cursor_Info) |
| 447 | is |
| 448 | Old_C : constant Cursor_Type := C; |
| 449 | begin |
| 450 | -- change either size or color |
| 451 | if Rand mod 2 = 0 then |
| 452 | CI.Color := Pipe_Index'Val |
| 453 | ((Pipe_Index'Pos (CI.Color) + 1 + Rand mod 2) mod 3); |
| 454 | else |
| 455 | CI.Size := Cursor_Size'Val |
| 456 | ((Cursor_Size'Pos (CI.Size) + 1 + Rand mod 2) mod 3); |
| 457 | end if; |
| 458 | C := Cursors (CI.Color) (CI.Size); |
| 459 | C.Center_X := Old_C.Center_X; |
| 460 | C.Center_Y := Old_C.Center_Y; |
| 461 | GMA.Update_Cursor (P, C); |
| 462 | end Select_New_Cursor; |
| 463 | |
| 464 | Deadline : constant Time.T := Time.MS_From_Now (Time_MS); |
| 465 | Timed_Out : Boolean := False; |
| 466 | Cnt : Word32 := 0; |
| 467 | begin |
| 468 | for Pipe in Pipe_Index loop |
| 469 | exit when Pipes (Pipe).Port = GMA.Disabled; |
| 470 | Select_New_Cursor (Pipe, Pipes (Pipe).Cursor, Cursor_Infos (Pipe)); |
| 471 | end loop; |
| 472 | loop |
| 473 | for Pipe in Pipe_Index loop |
| 474 | exit when Pipes (Pipe).Port = GMA.Disabled; |
| 475 | declare |
| 476 | C : Cursor_Type renames Pipes (Pipe).Cursor; |
| 477 | CI : Cursor_Info renames Cursor_Infos (Pipe); |
| 478 | FB : Framebuffer_Type renames Pipes (Pipe).Framebuffer; |
| Nico Huber | c5c767a | 2018-06-03 01:09:04 +0200 | [diff] [blame] | 479 | Width : constant Width_Type := Rotated_Width (FB); |
| 480 | Height : constant Height_Type := Rotated_Height (FB); |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 481 | |
| 482 | Update : Boolean := False; |
| 483 | begin |
| 484 | if Cnt mod 16 = 0 then |
| 485 | CI.X_Acc := Cursor_Rand; |
| 486 | CI.Y_Acc := Cursor_Rand; |
| 487 | end if; |
| 488 | CI.X_Velo := CI.X_Velo + CI.X_Acc; |
| 489 | CI.Y_Velo := CI.Y_Velo + CI.Y_Acc; |
| 490 | C.Center_X := C.Center_X + CI.X_Velo / 100; |
| 491 | C.Center_Y := C.Center_Y + CI.Y_Velo / 100; |
| 492 | if C.Center_X not in 0 .. Width - 1 then |
| 493 | C.Center_X := Int32'Max (0, Int32'Min (Width, C.Center_X)); |
| 494 | CI.X_Velo := -CI.X_Velo; |
| 495 | Update := True; |
| 496 | end if; |
| 497 | if C.Center_Y not in 0 .. Height - 1 then |
| 498 | C.Center_Y := Int32'Max (0, Int32'Min (Height, C.Center_Y)); |
| 499 | CI.Y_Velo := -CI.Y_Velo; |
| 500 | Update := True; |
| 501 | end if; |
| 502 | if Update then |
| 503 | Select_New_Cursor (Pipe, C, CI); |
| 504 | else |
| 505 | GMA.Place_Cursor (Pipe, C.Center_X, C.Center_Y); |
| 506 | end if; |
| 507 | end; |
| 508 | end loop; |
| 509 | Timed_Out := Time.Timed_Out (Deadline); |
| 510 | exit when Timed_Out; |
| 511 | Time.M_Delay (16); -- ~60 fps |
| 512 | Cnt := Cnt + 1; |
| 513 | end loop; |
| 514 | end Move_Cursors; |
| 515 | |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 516 | procedure Print_Usage |
| 517 | is |
| 518 | begin |
| 519 | Debug.Put_Line |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 520 | ("Usage: " & Ada.Command_Line.Command_Name & |
| 521 | " <delay seconds>" & |
| 522 | " [(0|90|180|270)]"); |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 523 | Debug.New_Line; |
| 524 | end Print_Usage; |
| 525 | |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 526 | procedure Main |
| 527 | is |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 528 | use type HW.GFX.GMA.Port_Type; |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 529 | use type HW.Word64; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 530 | use type Interfaces.C.int; |
| 531 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 532 | Res_Addr : Word64; |
| 533 | |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 534 | Delay_MS : Natural; |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 535 | Rotation : Rotation_Type := No_Rotation; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 536 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 537 | Dev_Init, |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 538 | Initialized : Boolean; |
| 539 | |
| 540 | function iopl (level : Interfaces.C.int) return Interfaces.C.int; |
| 541 | pragma Import (C, iopl, "iopl"); |
| 542 | begin |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 543 | if Ada.Command_Line.Argument_Count < 1 then |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 544 | Print_Usage; |
| 545 | return; |
| 546 | end if; |
| 547 | |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 548 | Delay_MS := Natural'Value (Ada.Command_Line.Argument (1)) * 1_000; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 549 | |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 550 | if Ada.Command_Line.Argument_Count >= 2 then |
| 551 | declare |
| 552 | Rotation_Degree : constant String := Ada.Command_Line.Argument (2); |
| 553 | begin |
| 554 | if Rotation_Degree = "0" then Rotation := No_Rotation; |
| 555 | elsif Rotation_Degree = "90" then Rotation := Rotated_90; |
| 556 | elsif Rotation_Degree = "180" then Rotation := Rotated_180; |
| 557 | elsif Rotation_Degree = "270" then Rotation := Rotated_270; |
| 558 | else Print_Usage; return; end if; |
| 559 | end; |
| 560 | end if; |
| 561 | |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 562 | if iopl (3) /= 0 then |
| 563 | Debug.Put_Line ("Failed to change i/o privilege level."); |
| 564 | return; |
| 565 | end if; |
| 566 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 567 | Dev.Initialize (Dev_Init); |
| 568 | if not Dev_Init then |
| 569 | Debug.Put_Line ("Failed to map PCI config."); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 570 | return; |
| 571 | end if; |
| 572 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 573 | Dev.Map (Res_Addr, PCI.Res2, WC => True); |
| 574 | if Res_Addr = 0 then |
| 575 | Debug.Put_Line ("Failed to map PCI resource2."); |
| 576 | return; |
| 577 | end if; |
| 578 | Screen.Set_Base_Address (Res_Addr); |
| 579 | |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 580 | GMA.Initialize |
| Nico Huber | 2b6f699 | 2017-07-09 18:11:34 +0200 | [diff] [blame] | 581 | (Clean_State => True, |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 582 | Success => Initialized); |
| 583 | |
| 584 | if Initialized then |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 585 | Backup_GTT; |
| 586 | |
| Nico Huber | 88f3c98 | 2017-08-28 13:31:38 +0200 | [diff] [blame] | 587 | Prepare_Configs (Rotation); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 588 | |
| 589 | GMA.Update_Outputs (Pipes); |
| 590 | |
| 591 | for Pipe in GMA.Pipe_Index loop |
| 592 | if Pipes (Pipe).Port /= GMA.Disabled then |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 593 | Backup_Screen (Pipes (Pipe).Framebuffer); |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 594 | Test_Screen |
| 595 | (Framebuffer => Pipes (Pipe).Framebuffer, |
| 596 | Pipe => Pipe); |
| 597 | end if; |
| Nico Huber | 7bb10c6 | 2018-01-12 14:07:44 +0100 | [diff] [blame] | 598 | for Size in Cursor_Size loop |
| 599 | Draw_Cursor (Pipe, Cursors (Pipe) (Size)); |
| 600 | end loop; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 601 | end loop; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 602 | |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 603 | if Delay_MS < Primary_Delay_MS + Secondary_Delay_MS then |
| 604 | Script_Cursors (Pipes, Delay_MS); |
| 605 | else -- getting bored? |
| 606 | Script_Cursors (Pipes, Primary_Delay_MS); |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 607 | Delay_MS := Delay_MS - Primary_Delay_MS; |
| 608 | declare |
| 609 | New_Pipes : GMA.Pipe_Configs := Pipes; |
| 610 | |
| Nico Huber | 7a74043 | 2018-05-30 13:58:27 +0200 | [diff] [blame] | 611 | function Rand_Div (Num : Position_Type) return Position_Type is |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 612 | (case Rand mod 4 is |
| 613 | when 3 => Rand mod Num / 3, |
| 614 | when 2 => Rand mod Num / 2, |
| 615 | when 1 => Rand mod Num, |
| 616 | when others => 0); |
| 617 | begin |
| 618 | Rand_P.Reset (Gen, Seed); |
| 619 | while Delay_MS >= Secondary_Delay_MS loop |
| 620 | New_Pipes := Pipes; |
| 621 | for Pipe in GMA.Pipe_Index loop |
| 622 | exit when Pipes (Pipe).Port = Disabled; |
| 623 | declare |
| 624 | New_FB : Framebuffer_Type renames |
| 625 | New_Pipes (Pipe).Framebuffer; |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 626 | Cursor : Cursor_Type renames New_Pipes (Pipe).Cursor; |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 627 | Width : constant Width_Type := |
| 628 | Pipes (Pipe).Framebuffer.Width; |
| 629 | Height : constant Height_Type := |
| 630 | Pipes (Pipe).Framebuffer.Height; |
| 631 | begin |
| Nico Huber | 7a74043 | 2018-05-30 13:58:27 +0200 | [diff] [blame] | 632 | New_FB.Start_X := Position_Type'Min |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 633 | (Width - 320, Rand_Div (Width)); |
| Nico Huber | 7a74043 | 2018-05-30 13:58:27 +0200 | [diff] [blame] | 634 | New_FB.Start_Y := Position_Type'Min |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 635 | (Height - 320, Rand_Div (Height)); |
| 636 | New_FB.Width := Width_Type'Max |
| 637 | (320, Width - New_FB.Start_X - Rand_Div (Width)); |
| 638 | New_FB.Height := Height_Type'Max |
| 639 | (320, Height - New_FB.Start_Y - Rand_Div (Height)); |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 640 | |
| Nico Huber | c5c767a | 2018-06-03 01:09:04 +0200 | [diff] [blame] | 641 | Cursor.Center_X := Rotated_Width (New_FB) / 2; |
| 642 | Cursor.Center_Y := Rotated_Height (New_FB) / 2; |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 643 | GMA.Update_Cursor (Pipe, Cursor); |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 644 | end; |
| 645 | end loop; |
| 646 | GMA.Dump_Configs (New_Pipes); |
| 647 | GMA.Update_Outputs (New_Pipes); |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 648 | Move_Cursors (New_Pipes, Secondary_Delay_MS); |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 649 | Delay_MS := Delay_MS - Secondary_Delay_MS; |
| 650 | end loop; |
| Nico Huber | a63e833 | 2018-02-01 16:41:30 +0100 | [diff] [blame] | 651 | Move_Cursors (New_Pipes, Delay_MS); |
| Nico Huber | a455f0e | 2018-01-07 11:40:40 +0100 | [diff] [blame] | 652 | end; |
| 653 | end if; |
| Nico Huber | 3b654a0 | 2017-07-15 22:27:14 +0200 | [diff] [blame] | 654 | |
| 655 | for Pipe in GMA.Pipe_Index loop |
| 656 | if Pipes (Pipe).Port /= GMA.Disabled then |
| 657 | Restore_Screen (Pipes (Pipe).Framebuffer); |
| 658 | end if; |
| 659 | end loop; |
| 660 | Restore_GTT; |
| Nico Huber | 1d0abe4 | 2017-03-05 14:14:09 +0100 | [diff] [blame] | 661 | end if; |
| 662 | end Main; |
| 663 | |
| Nico Huber | fda2d6e | 2017-07-09 16:47:52 +0200 | [diff] [blame] | 664 | end HW.GFX.GMA.GFX_Test; |