blob: f962e1cb301871f2fd30a0c22e5ccbc4ad3f0038 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
Nico Huber3d06de82018-05-29 01:35:04 +02002-- Copyright (C) 2014-2018 secunet Security Networks AG
Nico Huber2b6f6992017-07-09 18:11:34 +02003-- Copyright (C) 2017 Nico Huber <nico.h@gmx.de>
Nico Huber83693c82016-10-08 22:17:55 +02004--
5-- This program is free software; you can redistribute it and/or modify
6-- it under the terms of the GNU General Public License as published by
Nico Huber125a29e2016-10-18 00:23:54 +02007-- the Free Software Foundation; either version 2 of the License, or
8-- (at your option) any later version.
Nico Huber83693c82016-10-08 22:17:55 +02009--
10-- This program is distributed in the hope that it will be useful,
11-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-- GNU General Public License for more details.
14--
15
Nico Huber2b6f6992017-07-09 18:11:34 +020016with HW.MMIO_Range;
17pragma Elaborate_All (HW.MMIO_Range);
18with HW.PCI.Dev;
19pragma Elaborate_All (HW.PCI.Dev);
20
Nico Huber5374c3a2017-07-15 21:48:06 +020021with HW.GFX.Framebuffer_Filler;
22
Nico Huber83693c82016-10-08 22:17:55 +020023with HW.GFX.GMA.Config;
Nico Huber8c45bcf2016-11-20 17:30:57 +010024with HW.GFX.GMA.Config_Helpers;
Nico Huber83693c82016-10-08 22:17:55 +020025with HW.GFX.GMA.Registers;
26with HW.GFX.GMA.Power_And_Clocks;
27with HW.GFX.GMA.Panel;
28with HW.GFX.GMA.PLLs;
29with HW.GFX.GMA.Port_Detect;
30with HW.GFX.GMA.Connectors;
31with HW.GFX.GMA.Connector_Info;
32with HW.GFX.GMA.Pipe_Setup;
33
Nico Huber83693c82016-10-08 22:17:55 +020034with HW.Debug;
35with GNAT.Source_Info;
36
Nico Huber83693c82016-10-08 22:17:55 +020037use type HW.Int32;
38
39package body HW.GFX.GMA
40 with Refined_State =>
41 (State =>
Nico Huber2b6f6992017-07-09 18:11:34 +020042 (Dev.Address_State,
43 Registers.Address_State,
Nico Huber83693c82016-10-08 22:17:55 +020044 PLLs.State, Panel.Panel_State,
Nico Huber1a712d32017-01-09 15:11:04 +010045 Cur_Configs, Allocated_PLLs,
Nico Huberc3f66f62017-07-16 21:39:54 +020046 HPD_Delay, Wait_For_HPD,
47 Linear_FB_Base),
Nico Huber83693c82016-10-08 22:17:55 +020048 Init_State => Initialized,
Arthur Heymansd1988d12018-03-28 16:27:57 +020049 Config_State => (Config.Valid_Port_GPU, Config.Raw_Clock),
Nico Huber83693c82016-10-08 22:17:55 +020050 Device_State =>
Nico Huber2b6f6992017-07-09 18:11:34 +020051 (Dev.PCI_State, Registers.Register_State, Registers.GTT_State))
Nico Huber83693c82016-10-08 22:17:55 +020052is
Nico Huber2b6f6992017-07-09 18:11:34 +020053 pragma Disable_Atomic_Synchronization;
Nico Huber83693c82016-10-08 22:17:55 +020054
55 subtype Port_Name is String (1 .. 8);
56 type Port_Name_Array is array (Port_Type) of Port_Name;
57 Port_Names : constant Port_Name_Array :=
58 (Disabled => "Disabled",
59 Internal => "Internal",
60 DP1 => "DP1 ",
61 DP2 => "DP2 ",
62 DP3 => "DP3 ",
Nico Huber0d454cd2016-11-21 13:33:43 +010063 HDMI1 => "HDMI1 ",
64 HDMI2 => "HDMI2 ",
65 HDMI3 => "HDMI3 ",
Nico Huber83693c82016-10-08 22:17:55 +020066 Analog => "Analog ");
67
Nico Huber2b6f6992017-07-09 18:11:34 +020068 package Dev is new HW.PCI.Dev (PCI.Address'(0, 2, 0));
69
Nico Huber83693c82016-10-08 22:17:55 +020070 package Display_Controller renames Pipe_Setup;
71
Nico Huber99f10f32016-11-20 00:34:05 +010072 type PLLs_Type is array (Pipe_Index) of PLLs.T;
Nico Huber83693c82016-10-08 22:17:55 +020073
Nico Huber83693c82016-10-08 22:17:55 +020074 type HPD_Type is array (Port_Type) of Boolean;
Nico Huber3be61d42017-01-09 13:58:18 +010075 type HPD_Delay_Type is array (Active_Port_Type) of Time.T;
Nico Huber83693c82016-10-08 22:17:55 +020076
Nico Huber83693c82016-10-08 22:17:55 +020077 Allocated_PLLs : PLLs_Type;
Nico Huber83693c82016-10-08 22:17:55 +020078 HPD_Delay : HPD_Delay_Type;
79 Wait_For_HPD : HPD_Type;
80 Initialized : Boolean := False;
81
Nico Huberc3f66f62017-07-16 21:39:54 +020082 Linear_FB_Base : Word64;
83
Nico Huber83693c82016-10-08 22:17:55 +020084 ----------------------------------------------------------------------------
85
Nico Huberf54d0962016-10-20 14:17:18 +020086 PCH_RAWCLK_FREQ_MASK : constant := 16#3ff# * 2 ** 0;
87
88 function PCH_RAWCLK_FREQ (Freq : Frequency_Type) return Word32
89 is
90 begin
91 return Word32 (Freq / 1_000_000);
92 end PCH_RAWCLK_FREQ;
93
94 ----------------------------------------------------------------------------
95
Nico Huber43370ba2017-01-09 15:26:19 +010096 procedure Enable_Output
97 (Pipe : in Pipe_Index;
98 Pipe_Cfg : in Pipe_Config;
99 Success : out Boolean)
100 is
101 Port_Cfg : Port_Config;
102 begin
Nico Huber3be61d42017-01-09 13:58:18 +0100103 pragma Debug (Debug.New_Line);
104 pragma Debug (Debug.Put_Line
105 ("Trying to enable port " & Port_Names (Pipe_Cfg.Port)));
106
Nico Huber43370ba2017-01-09 15:26:19 +0100107 Config_Helpers.Fill_Port_Config
108 (Port_Cfg, Pipe, Pipe_Cfg.Port, Pipe_Cfg.Mode, Success);
109
110 if Success then
111 Success := Config_Helpers.Validate_Config
Nico Hubercbbaade2018-01-02 13:59:36 +0100112 (Pipe_Cfg.Framebuffer, Port_Cfg.Mode, Pipe);
Nico Huber43370ba2017-01-09 15:26:19 +0100113 end if;
114
Nico Huber43370ba2017-01-09 15:26:19 +0100115 if Success then
Nico Huber43370ba2017-01-09 15:26:19 +0100116 Connector_Info.Preferred_Link_Setting (Port_Cfg, Success);
117 end if;
118
119 -- loop over all possible DP-lane configurations
120 -- (non-DP ports use a single fake configuration)
121 while Success loop
122 pragma Loop_Invariant
123 (Pipe_Cfg.Port in Active_Port_Type and
124 Port_Cfg.Mode = Port_Cfg.Mode'Loop_Entry);
125
126 PLLs.Alloc
127 (Port_Cfg => Port_Cfg,
128 PLL => Allocated_PLLs (Pipe),
129 Success => Success);
130
131 if Success then
132 -- try each DP-lane configuration twice
133 for Try in 1 .. 2 loop
134 pragma Loop_Invariant
135 (Pipe_Cfg.Port in Active_Port_Type);
136
Nico Huber4798c662017-01-11 12:44:48 +0100137 -- Clear pending hot-plug events before every try
138 Port_Detect.Clear_Hotplug_Detect (Pipe_Cfg.Port);
139
Nico Huber43370ba2017-01-09 15:26:19 +0100140 Connectors.Pre_On
141 (Pipe => Pipe,
142 Port_Cfg => Port_Cfg,
143 PLL_Hint => PLLs.Register_Value (Allocated_PLLs (Pipe)),
144 Success => Success);
145
146 if Success then
147 Display_Controller.On
148 (Pipe => Pipe,
149 Port_Cfg => Port_Cfg,
Nico Huber4dc4c612018-01-10 15:55:09 +0100150 Framebuffer => Pipe_Cfg.Framebuffer,
151 Cursor => Pipe_Cfg.Cursor);
Nico Huber43370ba2017-01-09 15:26:19 +0100152
153 Connectors.Post_On
Arthur Heymans60d0e5f2018-03-28 17:08:27 +0200154 (Pipe => Pipe,
155 Port_Cfg => Port_Cfg,
Nico Huber43370ba2017-01-09 15:26:19 +0100156 PLL_Hint => PLLs.Register_Value (Allocated_PLLs (Pipe)),
157 Success => Success);
158
159 if not Success then
160 Display_Controller.Off (Pipe);
161 Connectors.Post_Off (Port_Cfg);
162 end if;
163 end if;
164
165 exit when Success;
166 end loop;
167 exit when Success; -- connection established => stop loop
168
169 -- connection failed
170 PLLs.Free (Allocated_PLLs (Pipe));
171 end if;
172
173 Connector_Info.Next_Link_Setting (Port_Cfg, Success);
174 end loop;
175
176 if Success then
177 pragma Debug (Debug.Put_Line
178 ("Enabled port " & Port_Names (Pipe_Cfg.Port)));
179 else
180 Wait_For_HPD (Pipe_Cfg.Port) := True;
181 if Pipe_Cfg.Port = Internal then
182 Panel.Off;
183 end if;
184 end if;
185 end Enable_Output;
186
Nico Huber3be61d42017-01-09 13:58:18 +0100187 procedure Disable_Output (Pipe : Pipe_Index; Pipe_Cfg : Pipe_Config)
188 is
189 Port_Cfg : Port_Config;
190 Success : Boolean;
191 begin
192 Config_Helpers.Fill_Port_Config
193 (Port_Cfg, Pipe, Pipe_Cfg.Port, Pipe_Cfg.Mode, Success);
194 if Success then
195 pragma Debug (Debug.New_Line);
196 pragma Debug (Debug.Put_Line
197 ("Disabling port " & Port_Names (Pipe_Cfg.Port)));
198 pragma Debug (Debug.New_Line);
199
200 Connectors.Pre_Off (Port_Cfg);
201 Display_Controller.Off (Pipe);
202 Connectors.Post_Off (Port_Cfg);
203
204 PLLs.Free (Allocated_PLLs (Pipe));
205 end if;
206 end Disable_Output;
207
Nico Huber99f10f32016-11-20 00:34:05 +0100208 procedure Update_Outputs (Configs : Pipe_Configs)
Nico Huber83693c82016-10-08 22:17:55 +0200209 is
Nico Huber3be61d42017-01-09 13:58:18 +0100210 procedure Check_HPD (Port : in Active_Port_Type; Detected : out Boolean)
211 is
212 HPD_Delay_Over : constant Boolean := Time.Timed_Out (HPD_Delay (Port));
213 begin
214 if HPD_Delay_Over then
215 Port_Detect.Hotplug_Detect (Port, Detected);
216 HPD_Delay (Port) := Time.MS_From_Now (333);
217 else
218 Detected := False;
219 end if;
220 end Check_HPD;
Nico Huberb56b9c52017-01-11 15:12:23 +0100221
Nico Huber564103f2017-01-11 15:33:07 +0100222 Power_Changed : Boolean := False;
Nico Huberb56b9c52017-01-11 15:12:23 +0100223 Old_Configs : Pipe_Configs;
Nico Huber564103f2017-01-11 15:33:07 +0100224
225 -- Only called when we actually tried to change something
226 -- so we don't congest the log with unnecessary messages.
227 procedure Update_Power
228 is
229 begin
230 if not Power_Changed then
231 Power_And_Clocks.Power_Up (Old_Configs, Configs);
232 Power_Changed := True;
233 end if;
234 end Update_Power;
Nico Huber3d06de82018-05-29 01:35:04 +0200235
236 function Full_Update (Cur_Config, New_Config : Pipe_Config) return Boolean
237 is
238 begin
239 return
240 Cur_Config.Port /= New_Config.Port or else
241 Cur_Config.Mode /= New_Config.Mode or else
242 (Config.Use_PDW_For_EDP_Scaling and then
243 (Cur_Config.Port = Internal and
244 Requires_Scaling (Cur_Config) /= Requires_Scaling (New_Config)));
245 end Full_Update;
Nico Huber83693c82016-10-08 22:17:55 +0200246 begin
247 Old_Configs := Cur_Configs;
248
Nico Huberb56b9c52017-01-11 15:12:23 +0100249 -- disable all pipes that changed or had a hot-plug event
250 for Pipe in Pipe_Index loop
251 declare
252 Unplug_Detected : Boolean;
253 Cur_Config : Pipe_Config renames Cur_Configs (Pipe);
254 New_Config : Pipe_Config renames Configs (Pipe);
255 begin
256 if Cur_Config.Port /= Disabled then
257 Check_HPD (Cur_Config.Port, Unplug_Detected);
Nico Huber83693c82016-10-08 22:17:55 +0200258
Nico Huber3d06de82018-05-29 01:35:04 +0200259 if Full_Update (Cur_Config, New_Config) or Unplug_Detected then
Nico Huberb56b9c52017-01-11 15:12:23 +0100260 Disable_Output (Pipe, Cur_Config);
261 Cur_Config.Port := Disabled;
Nico Huber564103f2017-01-11 15:33:07 +0100262 Update_Power;
Nico Huberb56b9c52017-01-11 15:12:23 +0100263 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200264 end if;
Nico Huberb56b9c52017-01-11 15:12:23 +0100265 end;
266 end loop;
Nico Huber83693c82016-10-08 22:17:55 +0200267
Nico Huberb56b9c52017-01-11 15:12:23 +0100268 -- enable all pipes that changed and should be active
269 for Pipe in Pipe_Index loop
270 declare
271 Success : Boolean;
272 Cur_Config : Pipe_Config renames Cur_Configs (Pipe);
273 New_Config : Pipe_Config renames Configs (Pipe);
274 begin
Nico Huber3d06de82018-05-29 01:35:04 +0200275 if New_Config.Port /= Disabled and
276 Full_Update (Cur_Config, New_Config)
Nico Huberb56b9c52017-01-11 15:12:23 +0100277 then
Nico Huber3be61d42017-01-09 13:58:18 +0100278 if Wait_For_HPD (New_Config.Port) then
279 Check_HPD (New_Config.Port, Success);
280 Wait_For_HPD (New_Config.Port) := not Success;
281 else
282 Success := True;
Nico Huber8c45bcf2016-11-20 17:30:57 +0100283 end if;
Nico Huberc7a4fee2016-11-03 18:18:03 +0100284
Nico Huber3be61d42017-01-09 13:58:18 +0100285 if Success then
Nico Huber564103f2017-01-11 15:33:07 +0100286 Update_Power;
Nico Huberb56b9c52017-01-11 15:12:23 +0100287 Enable_Output (Pipe, New_Config, Success);
Nico Huber3be61d42017-01-09 13:58:18 +0100288 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200289
290 if Success then
Nico Huberb56b9c52017-01-11 15:12:23 +0100291 Cur_Config := New_Config;
Nico Huber83693c82016-10-08 22:17:55 +0200292 end if;
Nico Huber3be61d42017-01-09 13:58:18 +0100293
Nico Huberb56b9c52017-01-11 15:12:23 +0100294 -- update framebuffer offset only
295 elsif New_Config.Port /= Disabled and
Nico Huberf7f537e2018-01-02 14:15:43 +0100296 Cur_Config.Framebuffer /= New_Config.Framebuffer and
297 Config_Helpers.Validate_Config
298 (New_Config.Framebuffer, New_Config.Mode, Pipe)
Nico Huberb56b9c52017-01-11 15:12:23 +0100299 then
Nico Huberf7f537e2018-01-02 14:15:43 +0100300 Display_Controller.Setup_FB
301 (Pipe, New_Config.Mode, New_Config.Framebuffer);
Nico Huber15ffc4f2018-01-11 14:44:43 +0100302 Display_Controller.Update_Cursor
303 (Pipe, New_Config.Framebuffer, New_Config.Cursor);
Nico Huberb56b9c52017-01-11 15:12:23 +0100304 Cur_Config := New_Config;
305 end if;
306 end;
Nico Huber83693c82016-10-08 22:17:55 +0200307 end loop;
308
Nico Huber564103f2017-01-11 15:33:07 +0100309 if Power_Changed then
Nico Huber83693c82016-10-08 22:17:55 +0200310 Power_And_Clocks.Power_Down (Old_Configs, Configs, Cur_Configs);
311 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200312 end Update_Outputs;
313
314 ----------------------------------------------------------------------------
315
Nico Huber15ffc4f2018-01-11 14:44:43 +0100316 procedure Update_Cursor (Pipe : Pipe_Index; Cursor : Cursor_Type)
317 is
318 begin
319 Cur_Configs (Pipe).Cursor := Cursor;
320 Display_Controller.Update_Cursor
321 (Pipe, Cur_Configs (Pipe).Framebuffer, Cur_Configs (Pipe).Cursor);
322 end Update_Cursor;
323
324 procedure Place_Cursor
325 (Pipe : Pipe_Index;
326 X : Cursor_Pos;
327 Y : Cursor_Pos)
328 is
329 begin
330 Cur_Configs (Pipe).Cursor.Center_X := X;
331 Cur_Configs (Pipe).Cursor.Center_Y := Y;
332 Display_Controller.Place_Cursor
333 (Pipe, Cur_Configs (Pipe).Framebuffer, Cur_Configs (Pipe).Cursor);
334 end Place_Cursor;
335
336 procedure Move_Cursor
337 (Pipe : Pipe_Index;
338 X : Cursor_Pos;
339 Y : Cursor_Pos)
340 is
341 function Cap_Add (A, B : Cursor_Pos) return Cursor_Pos is
342 (if A + B < 0
343 then Int32'Max (Cursor_Pos'First, A + B)
344 else Int32'Min (Cursor_Pos'Last, A + B));
345 begin
346 Place_Cursor
347 (Pipe => Pipe,
348 X => Cap_Add (Cur_Configs (Pipe).Cursor.Center_X, X),
349 Y => Cap_Add (Cur_Configs (Pipe).Cursor.Center_Y, Y));
350 end Move_Cursor;
351
352 ----------------------------------------------------------------------------
353
Nico Huber83693c82016-10-08 22:17:55 +0200354 procedure Initialize
Nico Huber2b6f6992017-07-09 18:11:34 +0200355 (Write_Delay : in Word64 := 0;
Nico Huber793a8d42016-11-21 18:57:03 +0100356 Clean_State : in Boolean := False;
Nico Huber83693c82016-10-08 22:17:55 +0200357 Success : out Boolean)
358 with
359 Refined_Global =>
360 (In_Out =>
Nico Hubere015e822017-08-25 20:12:09 +0200361 (Config.Valid_Port_GPU, Dev.PCI_State,
Arthur Heymansd1988d12018-03-28 16:27:57 +0200362 Registers.Register_State, Port_IO.State,
363 Config.Raw_Clock),
Nico Huber83693c82016-10-08 22:17:55 +0200364 Input =>
365 (Time.State),
366 Output =>
Nico Huber2b6f6992017-07-09 18:11:34 +0200367 (Dev.Address_State,
368 Registers.Address_State,
Nico Huber83693c82016-10-08 22:17:55 +0200369 PLLs.State, Panel.Panel_State,
Nico Huber1a712d32017-01-09 15:11:04 +0100370 Cur_Configs, Allocated_PLLs,
Nico Huberc3f66f62017-07-16 21:39:54 +0200371 HPD_Delay, Wait_For_HPD,
372 Linear_FB_Base, Initialized))
Nico Huber83693c82016-10-08 22:17:55 +0200373 is
374 use type HW.Word64;
375
Nico Huber2b6f6992017-07-09 18:11:34 +0200376 PCI_MMIO_Base, PCI_GTT_Base : Word64;
377
Nico Huber83693c82016-10-08 22:17:55 +0200378 Now : constant Time.T := Time.Now;
379
380 procedure Check_Platform (Success : out Boolean)
381 is
382 Audio_VID_DID : Word32;
383 begin
384 case Config.CPU is
Arthur Heymans73ea0322018-03-28 17:17:07 +0200385 when G45 =>
386 Registers.Read (Registers.G4X_AUD_VID_DID, Audio_VID_DID);
Nico Huber83693c82016-10-08 22:17:55 +0200387 when Haswell .. Skylake =>
388 Registers.Read (Registers.AUD_VID_DID, Audio_VID_DID);
389 when Ironlake .. Ivybridge =>
390 Registers.Read (Registers.PCH_AUD_VID_DID, Audio_VID_DID);
391 end case;
392 Success :=
393 (case Config.CPU is
Nico Huber21da5742017-01-20 14:00:53 +0100394 when Broxton => Audio_VID_DID = 16#8086_280a#,
Nico Huber83693c82016-10-08 22:17:55 +0200395 when Skylake => Audio_VID_DID = 16#8086_2809#,
396 when Broadwell => Audio_VID_DID = 16#8086_2808#,
397 when Haswell => Audio_VID_DID = 16#8086_2807#,
398 when Ivybridge |
399 Sandybridge => Audio_VID_DID = 16#8086_2806# or
400 Audio_VID_DID = 16#8086_2805#,
Arthur Heymans73ea0322018-03-28 17:17:07 +0200401 when Ironlake => Audio_VID_DID = 16#0000_0000#,
402 when G45 => Audio_VID_DID = 16#8086_2801# or
403 Audio_VID_DID = 16#8086_2802# or
404 Audio_VID_DID = 16#8086_2803#);
Nico Huber83693c82016-10-08 22:17:55 +0200405 end Check_Platform;
Nico Hubere7ac6eb2017-09-04 23:54:13 +0200406
407 procedure Check_Platform_PCI (Success : out Boolean)
408 is
409 use type HW.Word16;
410 Vendor, Device : Word16;
411 begin
412 Dev.Read16 (Vendor, PCI.Vendor_Id);
413 Dev.Read16 (Device, PCI.Device_Id);
414
415 Success := Vendor = 16#8086# and Config.Compatible_GPU (Device);
416 end Check_Platform_PCI;
Nico Huber83693c82016-10-08 22:17:55 +0200417 begin
Nico Huber83693c82016-10-08 22:17:55 +0200418 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
419
420 pragma Debug (Debug.Set_Register_Write_Delay (Write_Delay));
421
Nico Huberc3f66f62017-07-16 21:39:54 +0200422 Linear_FB_Base := 0;
Nico Huber83693c82016-10-08 22:17:55 +0200423 Wait_For_HPD := HPD_Type'(others => False);
424 HPD_Delay := HPD_Delay_Type'(others => Now);
Nico Huber83693c82016-10-08 22:17:55 +0200425 Allocated_PLLs := (others => PLLs.Invalid);
Nico Huber99f10f32016-11-20 00:34:05 +0100426 Cur_Configs := Pipe_Configs'
427 (others => Pipe_Config'
Nico Huber83693c82016-10-08 22:17:55 +0200428 (Port => Disabled,
429 Framebuffer => HW.GFX.Default_FB,
Nico Hubera02b2c62018-01-09 15:58:34 +0100430 Cursor => Default_Cursor,
Nico Huber83693c82016-10-08 22:17:55 +0200431 Mode => HW.GFX.Invalid_Mode));
Nico Huber83693c82016-10-08 22:17:55 +0200432 PLLs.Initialize;
433
Nico Huber2b6f6992017-07-09 18:11:34 +0200434 Dev.Initialize (Success);
435
436 if Success then
437 Dev.Map (PCI_MMIO_Base, PCI.Res0, Length => Config.GTT_Offset);
438 Dev.Map (PCI_GTT_Base, PCI.Res0, Offset => Config.GTT_Offset);
439 if PCI_MMIO_Base /= 0 and PCI_GTT_Base /= 0 then
440 Registers.Set_Register_Base (PCI_MMIO_Base, PCI_GTT_Base);
441 else
442 pragma Debug (Debug.Put_Line
443 ("ERROR: Couldn't map resoure0."));
444 Registers.Set_Register_Base (Config.Default_MMIO_Base);
445 Success := Config.Default_MMIO_Base_Set;
446 end if;
Nico Hubere7ac6eb2017-09-04 23:54:13 +0200447
448 if Success then
449 Check_Platform_PCI (Success);
450 end if;
Nico Huber2b6f6992017-07-09 18:11:34 +0200451 else
452 pragma Debug (Debug.Put_Line
453 ("WARNING: Couldn't initialize PCI dev."));
454 Registers.Set_Register_Base (Config.Default_MMIO_Base);
455 Success := Config.Default_MMIO_Base_Set;
Nico Huber2b6f6992017-07-09 18:11:34 +0200456
Nico Hubere7ac6eb2017-09-04 23:54:13 +0200457 if Success then
458 Check_Platform (Success);
459 end if;
Nico Huber2b6f6992017-07-09 18:11:34 +0200460 end if;
461
Nico Huber83693c82016-10-08 22:17:55 +0200462 if not Success then
463 pragma Debug (Debug.Put_Line ("ERROR: Incompatible CPU or PCH."));
464
465 Panel.Static_Init; -- for flow analysis
466
467 Initialized := False;
468 return;
469 end if;
470
471 Panel.Setup_PP_Sequencer;
472 Port_Detect.Initialize;
Nico Huber0923b792017-06-09 15:28:41 +0200473 Connectors.Initialize;
Nico Huber83693c82016-10-08 22:17:55 +0200474
Nico Huber793a8d42016-11-21 18:57:03 +0100475 if Clean_State then
476 Power_And_Clocks.Pre_All_Off;
477 Connectors.Pre_All_Off;
478 Display_Controller.All_Off;
479 Connectors.Post_All_Off;
480 PLLs.All_Off;
481 Power_And_Clocks.Post_All_Off;
Nico Huber17d64b62017-07-15 20:51:25 +0200482 Registers.Clear_Fences;
Nico Huber33912aa2016-12-06 20:36:23 +0100483 else
484 -- According to PRMs, VGA plane is the only thing
Nico Huber3a0e2a02017-07-19 14:41:46 +0200485 -- that's enabled by default after reset...
Nico Huber33912aa2016-12-06 20:36:23 +0100486 Display_Controller.Legacy_VGA_Off;
Nico Huber3a0e2a02017-07-19 14:41:46 +0200487 -- ... along with some DDI port bits since Skylake.
488 Connectors.Post_Reset_Off;
Nico Huber793a8d42016-11-21 18:57:03 +0100489 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200490
491 -------------------- Now restart from a clean state ---------------------
492 Power_And_Clocks.Initialize;
493
Nico Huber1c3b9282017-02-09 13:57:04 +0100494 if Config.Has_PCH then
495 Registers.Unset_And_Set_Mask
496 (Register => Registers.PCH_RAWCLK_FREQ,
497 Mask_Unset => PCH_RAWCLK_FREQ_MASK,
498 Mask_Set => PCH_RAWCLK_FREQ (Config.Default_RawClk_Freq));
499 end if;
Nico Huberf54d0962016-10-20 14:17:18 +0200500
Nico Huber83693c82016-10-08 22:17:55 +0200501 Initialized := True;
502
503 end Initialize;
504
505 function Is_Initialized return Boolean
506 with
507 Refined_Post => Is_Initialized'Result = Initialized
508 is
509 begin
510 return Initialized;
511 end Is_Initialized;
512
513 ----------------------------------------------------------------------------
514
Nico Huber42fb2d02017-09-01 17:01:51 +0200515 procedure Power_Up_VGA
516 is
517 Fake_Config : constant Pipe_Configs :=
518 (Primary =>
519 (Port => Analog,
520 Framebuffer => HW.GFX.Default_FB,
Nico Hubera02b2c62018-01-09 15:58:34 +0100521 Cursor => Default_Cursor,
Nico Huber42fb2d02017-09-01 17:01:51 +0200522 Mode => HW.GFX.Invalid_Mode),
523 others =>
524 (Port => Disabled,
525 Framebuffer => HW.GFX.Default_FB,
Nico Hubera02b2c62018-01-09 15:58:34 +0100526 Cursor => Default_Cursor,
Nico Huber42fb2d02017-09-01 17:01:51 +0200527 Mode => HW.GFX.Invalid_Mode));
528 begin
529 Power_And_Clocks.Power_Up (Cur_Configs, Fake_Config);
530 end Power_Up_VGA;
531
532 ----------------------------------------------------------------------------
533
Nico Huber5374c3a2017-07-15 21:48:06 +0200534 function FB_First_Page (FB : Framebuffer_Type) return Natural is
Nico Huber34be6542017-12-13 09:26:24 +0100535 (Natural (Phys_Offset (FB) / GTT_Page_Size));
Nico Huber5374c3a2017-07-15 21:48:06 +0200536 function FB_Pages (FB : Framebuffer_Type) return Natural is
537 (Natural (Div_Round_Up (FB_Size (FB), GTT_Page_Size)));
538 function FB_Last_Page (FB : Framebuffer_Type) return Natural is
539 (FB_First_Page (FB) + FB_Pages (FB) - 1);
540
Nico Huber34be6542017-12-13 09:26:24 +0100541 -- Check basics and that it fits in GTT. For 90 degree rotations,
542 -- the Offset should be above GTT_Rotation_Offset. The latter will
543 -- be subtracted for the aperture mapping.
Nico Huber5374c3a2017-07-15 21:48:06 +0200544 function Valid_FB (FB : Framebuffer_Type) return Boolean is
Nico Huber34be6542017-12-13 09:26:24 +0100545 (Valid_Stride (FB) and
546 FB_First_Page (FB) in GTT_Range and
547 FB_Last_Page (FB) in GTT_Range and
548 (not Rotation_90 (FB) or
549 (FB_Last_Page (FB) + GTT_Rotation_Offset in GTT_Range and
550 FB.Offset >= Word32 (GTT_Rotation_Offset) * GTT_Page_Size)));
Nico Huber5374c3a2017-07-15 21:48:06 +0200551
552 -- Also check that we don't overflow the GTT's 39-bit space
553 -- (always true with a 32-bit base)
554 function Valid_Phys_FB (FB : Framebuffer_Type; Phys_Base : Word32)
555 return Boolean is
556 (Valid_FB (FB) and
Nico Huber34be6542017-12-13 09:26:24 +0100557 Int64 (Phys_Base) + Int64 (Phys_Offset (FB)) + Int64 (FB_Size (FB)) <=
Nico Huber5374c3a2017-07-15 21:48:06 +0200558 Int64 (GTT_Address_Type'Last))
559 with
560 Ghost;
561
Nico Huber83693c82016-10-08 22:17:55 +0200562 procedure Write_GTT
563 (GTT_Page : GTT_Range;
564 Device_Address : GTT_Address_Type;
Nico Huber5374c3a2017-07-15 21:48:06 +0200565 Valid : Boolean)
566 is
Nico Huber83693c82016-10-08 22:17:55 +0200567 begin
568 Registers.Write_GTT (GTT_Page, Device_Address, Valid);
569 end Write_GTT;
570
Nico Huber194e57e2017-07-15 21:15:46 +0200571 procedure Setup_Default_GTT (FB : Framebuffer_Type; Phys_Base : Word32)
Nico Huber5374c3a2017-07-15 21:48:06 +0200572 with
573 Pre => Is_Initialized and Valid_Phys_FB (FB, Phys_Base)
Nico Huber83693c82016-10-08 22:17:55 +0200574 is
Nico Huber194e57e2017-07-15 21:15:46 +0200575 Phys_Addr : GTT_Address_Type :=
Nico Huber34be6542017-12-13 09:26:24 +0100576 GTT_Address_Type (Phys_Base) + GTT_Address_Type (Phys_Offset (FB));
Nico Huber83693c82016-10-08 22:17:55 +0200577 begin
Nico Huber194e57e2017-07-15 21:15:46 +0200578 for Idx in FB_First_Page (FB) .. FB_Last_Page (FB) loop
Nico Huber83693c82016-10-08 22:17:55 +0200579 Registers.Write_GTT
580 (GTT_Page => Idx,
581 Device_Address => Phys_Addr,
582 Valid => True);
Nico Huber194e57e2017-07-15 21:15:46 +0200583 Phys_Addr := Phys_Addr + GTT_Page_Size;
Nico Huber83693c82016-10-08 22:17:55 +0200584 end loop;
Nico Huber9b479412017-08-27 11:55:56 +0200585
586 if Rotation_90 (FB) and FB.Tiling = Y_Tiled and FB.V_Stride >= 32 then
587 declare
588 V_Pages : constant Natural := Natural (FB.V_Stride) / 32;
589 Bytes_Per_Row : constant GTT_Address_Type :=
590 GTT_Address_Type (Pixel_To_Bytes (32 * FB.Stride, FB));
591 begin
592 Phys_Addr := GTT_Address_Type (Phys_Base) +
Nico Huber34be6542017-12-13 09:26:24 +0100593 GTT_Address_Type (Phys_Offset (FB)) +
Nico Huber9b479412017-08-27 11:55:56 +0200594 GTT_Address_Type (FB_Size (FB));
595 for Page in FB_First_Page (FB) .. FB_Last_Page (FB) loop
596 Phys_Addr := Phys_Addr - Bytes_Per_Row;
597 Registers.Write_GTT
598 (GTT_Page => GTT_Rotation_Offset + Page,
599 Device_Address => Phys_Addr,
600 Valid => True);
601
602 if (Page - FB_First_Page (FB) + 1) mod V_Pages = 0 then
603 Phys_Addr := Phys_Addr + GTT_Page_Size +
604 GTT_Address_Type (V_Pages) * Bytes_Per_Row;
605 end if;
606 end loop;
607 end;
608 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200609 end Setup_Default_GTT;
610
611 ----------------------------------------------------------------------------
612
Nico Hubereedde882017-07-16 02:54:39 +0200613 use type HW.Word16;
614 subtype Stolen_Size_Range is Int64 range 0 .. 2 ** 33;
615
616 function GGMS_Gen4 (GGC : Word16) return Natural is
617 (Natural (Shift_Right (GGC, 8) and 16#07#));
618 function GTT_Size_Gen4 (GGC : Word16) return Natural is
619 (if GGMS_Gen4 (GGC) in 1 .. 3 then
620 (GGMS_Gen4 (GGC) + 1) * 2 ** 19 else 0);
621
622 function GMS_Gen4 (GGC : Word16) return Natural is
623 (Natural (Shift_Right (GGC, 4) and 16#0f#));
624 Valid_Stolen_Size_Gen4 : constant
625 array (Natural range 1 .. 13) of Stolen_Size_Range :=
626 (1, 4, 8, 16, 32, 48, 64, 128, 256, 96, 160, 224, 352);
627 function Stolen_Size_Gen4 (GGC : Word16) return Stolen_Size_Range is
628 (if GMS_Gen4 (GGC) in Valid_Stolen_Size_Gen4'Range then
Arthur Heymans5fd9a312017-09-12 12:45:18 +0200629 Valid_Stolen_Size_Gen4 (GMS_Gen4 (GGC)) * 2 ** 20 else 0);
Nico Hubereedde882017-07-16 02:54:39 +0200630
631 function GTT_Size_Gen6 (GGC : Word16) return Natural is
632 (Natural (Shift_Right (GGC, 8) and 16#03#) * 2 ** 20);
633
634 function Stolen_Size_Gen6 (GGC : Word16) return Stolen_Size_Range is
635 (Stolen_Size_Range (Shift_Right (GGC, 3) and 16#1f#) * 32 * 2 ** 20);
636
637 function GTT_Size_Gen8 (GGC : Word16) return Natural is
638 (Natural (Shift_Right (GGC, 6) and 16#03#) * 2 ** 20);
639
640 function GMS_Gen8 (GGC : Word16) return Stolen_Size_Range is
641 (Stolen_Size_Range (Shift_Right (GGC, 8) and 16#ff#));
642 function Stolen_Size_Gen8 (GGC : Word16) return Stolen_Size_Range is
643 (GMS_Gen8 (GGC) * 32 * 2 ** 20);
644
645 function Stolen_Size_Gen9 (GGC : Word16) return Stolen_Size_Range is
646 (if GMS_Gen8 (GGC) < 16#f0# then
647 Stolen_Size_Gen8 (GGC)
648 else
649 (GMS_Gen8 (GGC) - 16#f0# + 1) * 4 * 2 ** 20);
650
651 procedure Decode_Stolen
652 (GTT_Size : out Natural;
653 Stolen_Size : out Stolen_Size_Range)
654 with
655 Pre => Is_Initialized
656 is
657 GGC_Reg : constant :=
658 (case Config.CPU is
Arthur Heymans73ea0322018-03-28 17:17:07 +0200659 when G45 | Ironlake => 16#52#,
Nico Hubereedde882017-07-16 02:54:39 +0200660 when Sandybridge .. Skylake => 16#50#);
661 GGC : Word16;
662 begin
663 Dev.Read16 (GGC, GGC_Reg);
664 case Config.CPU is
Arthur Heymans73ea0322018-03-28 17:17:07 +0200665 when G45 | Ironlake =>
Nico Hubereedde882017-07-16 02:54:39 +0200666 GTT_Size := GTT_Size_Gen4 (GGC);
667 Stolen_Size := Stolen_Size_Gen4 (GGC);
668 when Sandybridge .. Haswell =>
669 GTT_Size := GTT_Size_Gen6 (GGC);
670 Stolen_Size := Stolen_Size_Gen6 (GGC);
671 when Broadwell =>
672 GTT_Size := GTT_Size_Gen8 (GGC);
673 Stolen_Size := Stolen_Size_Gen8 (GGC);
674 when Broxton .. Skylake =>
675 GTT_Size := GTT_Size_Gen8 (GGC);
676 Stolen_Size := Stolen_Size_Gen9 (GGC);
677 end case;
678 end Decode_Stolen;
679
680 -- Additional runtime validation that FB fits stolen memory and aperture.
681 procedure Validate_FB (FB : Framebuffer_Type; Valid : out Boolean)
682 with
683 Pre => Is_Initialized,
684 Post => (if Valid then Valid_FB (FB))
685 is
686 GTT_Size, Aperture_Size : Natural;
687 Stolen_Size : Stolen_Size_Range;
688 begin
689 Valid := Valid_FB (FB);
690
691 if Valid then
692 Decode_Stolen (GTT_Size, Stolen_Size);
693 Dev.Resource_Size (Aperture_Size, PCI.Res2);
694 Valid :=
695 FB_Last_Page (FB) < GTT_Size / Config.GTT_PTE_Size and
696 FB_Last_Page (FB) < Natural (Stolen_Size / GTT_Page_Size) and
697 FB_Last_Page (FB) < Aperture_Size / GTT_Page_Size;
Nico Huber34be6542017-12-13 09:26:24 +0100698 pragma Debug (not Valid, Debug.Put_Line
Nico Hubereedde882017-07-16 02:54:39 +0200699 ("Stolen memory too small to hold framebuffer."));
700 end if;
701 end Validate_FB;
702
Nico Huber5374c3a2017-07-15 21:48:06 +0200703 procedure Setup_Default_FB
704 (FB : in Framebuffer_Type;
705 Clear : in Boolean := True;
706 Success : out Boolean)
707 is
708 GMA_Phys_Base : constant PCI.Index := 16#5c#;
709 GMA_Phys_Base_Mask : constant := 16#fff0_0000#;
710
711 Phys_Base : Word32;
712 begin
Nico Hubereedde882017-07-16 02:54:39 +0200713 Validate_FB (FB, Success);
Nico Huber5374c3a2017-07-15 21:48:06 +0200714
715 if Success then
716 Dev.Read32 (Phys_Base, GMA_Phys_Base);
717 Phys_Base := Phys_Base and GMA_Phys_Base_Mask;
718 Success := Phys_Base /= GMA_Phys_Base_Mask and Phys_Base /= 0;
719 pragma Debug (not Success, Debug.Put_Line
720 ("Failed to read stolen memory base."));
Nico Huber0164b022017-08-24 15:12:51 +0200721
722 if Success then
723 if FB.Tiling in XY_Tiling then
724 Registers.Add_Fence
725 (First_Page => FB_First_Page (FB),
726 Last_Page => FB_Last_Page (FB),
727 Tiling => FB.Tiling,
728 Pitch => FB_Pitch (FB.Stride, FB),
729 Success => Success);
730 end if;
731 pragma Debug (not Success, Debug.Put_Line
732 ("Tiled framebuffer but no fence regs available."));
733 end if;
734
Nico Huber5374c3a2017-07-15 21:48:06 +0200735 if Success then
736 Setup_Default_GTT (FB, Phys_Base);
737 end if;
738 end if;
739
740 if Success and then Clear then
741 declare
742 use type HW.Word64;
743 Linear_FB : Word64;
744 begin
Nico Huberc3f66f62017-07-16 21:39:54 +0200745 Map_Linear_FB (Linear_FB, FB);
Nico Huber5374c3a2017-07-15 21:48:06 +0200746 if Linear_FB /= 0 then
Nico Huberc3f66f62017-07-16 21:39:54 +0200747 Framebuffer_Filler.Fill (Linear_FB, FB);
Nico Huber5374c3a2017-07-15 21:48:06 +0200748 end if;
Nico Huber5374c3a2017-07-15 21:48:06 +0200749 end;
750 end if;
751 end Setup_Default_FB;
752
Nico Huberc3f66f62017-07-16 21:39:54 +0200753 procedure Map_Linear_FB (Linear_FB : out Word64; FB : in Framebuffer_Type)
754 is
755 use type HW.Word64;
756
757 Valid : Boolean;
758 begin
759 Linear_FB := 0;
760
761 if Linear_FB_Base = 0 then
762 Dev.Map (Linear_FB_Base, PCI.Res2);
763 pragma Debug
764 (Linear_FB_Base = 0, Debug.Put_Line ("Failed to map resource2."));
765 end if;
766
767 if Linear_FB_Base /= 0 then
768 Validate_FB (FB, Valid);
769 if Valid then
Nico Huber34be6542017-12-13 09:26:24 +0100770 Linear_FB := Linear_FB_Base + Word64 (Phys_Offset (FB));
Nico Huberc3f66f62017-07-16 21:39:54 +0200771 end if;
772 end if;
773 end Map_Linear_FB;
774
Nico Huber5374c3a2017-07-15 21:48:06 +0200775 ----------------------------------------------------------------------------
776
Nico Huber99f10f32016-11-20 00:34:05 +0100777 procedure Dump_Configs (Configs : Pipe_Configs)
Nico Huber83693c82016-10-08 22:17:55 +0200778 is
779 subtype Pipe_Name is String (1 .. 9);
Nico Huber99f10f32016-11-20 00:34:05 +0100780 type Pipe_Name_Array is array (Pipe_Index) of Pipe_Name;
Nico Huber83693c82016-10-08 22:17:55 +0200781 Pipe_Names : constant Pipe_Name_Array :=
782 (Primary => "Primary ",
783 Secondary => "Secondary",
784 Tertiary => "Tertiary ");
Nico Huber5ef4d602017-12-13 13:56:47 +0100785
786 subtype Tiling_Name is String (1 .. 7);
787 type Tiling_Name_Array is array (Tiling_Type) of Tiling_Name;
788 Tilings : constant Tiling_Name_Array :=
789 (Linear => "Linear ",
790 X_Tiled => "X_Tiled",
791 Y_Tiled => "Y_Tiled");
792
793 subtype Rotation_Name is String (1 .. 11);
794 type Rotation_Name_Array is array (Rotation_Type) of Rotation_Name;
795 Rotations : constant Rotation_Name_Array :=
796 (No_Rotation => "No_Rotation",
797 Rotated_90 => "Rotated_90 ",
798 Rotated_180 => "Rotated_180",
799 Rotated_270 => "Rotated_270");
Nico Huber83693c82016-10-08 22:17:55 +0200800 begin
801 Debug.New_Line;
Paul Menzelb83107c2017-05-04 09:02:33 +0200802 Debug.Put_Line ("CONFIG =>");
Nico Huber99f10f32016-11-20 00:34:05 +0100803 for Pipe in Pipe_Index loop
804 if Pipe = Pipe_Index'First then
Nico Huber83693c82016-10-08 22:17:55 +0200805 Debug.Put (" (");
806 else
807 Debug.Put (" ");
808 end if;
809 Debug.Put_Line (Pipe_Names (Pipe) & " =>");
810 Debug.Put_Line
811 (" (Port => " & Port_Names (Configs (Pipe).Port) & ",");
812 Debug.Put_Line (" Framebuffer =>");
Nico Huber5ef4d602017-12-13 13:56:47 +0100813 Debug.Put (" (Width => ");
Nico Huber83693c82016-10-08 22:17:55 +0200814 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Width);
815 Debug.Put_Line (",");
Nico Huber5ef4d602017-12-13 13:56:47 +0100816 Debug.Put (" Height => ");
Nico Huber83693c82016-10-08 22:17:55 +0200817 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Height);
818 Debug.Put_Line (",");
Nico Huber5ef4d602017-12-13 13:56:47 +0100819 Debug.Put (" Start_X => ");
820 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Start_X);
821 Debug.Put_Line (",");
822 Debug.Put (" Start_Y => ");
823 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Start_Y);
824 Debug.Put_Line (",");
825 Debug.Put (" Stride => ");
Nico Huber83693c82016-10-08 22:17:55 +0200826 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Stride);
827 Debug.Put_Line (",");
Nico Huber5ef4d602017-12-13 13:56:47 +0100828 Debug.Put (" V_Stride => ");
829 Debug.Put_Int32 (Configs (Pipe).Framebuffer.V_Stride);
830 Debug.Put_Line (",");
831 Debug.Put (" Tiling => ");
832 Debug.Put_Line (Tilings (Configs (Pipe).Framebuffer.Tiling) & ",");
833 Debug.Put (" Rotation => ");
834 Debug.Put_Line (Rotations (Configs (Pipe).Framebuffer.Rotation) & ",");
Nico Huber83693c82016-10-08 22:17:55 +0200835 Debug.Put (" Offset => ");
836 Debug.Put_Word32 (Configs (Pipe).Framebuffer.Offset);
837 Debug.Put_Line (",");
838 Debug.Put (" BPC => ");
839 Debug.Put_Int64 (Configs (Pipe).Framebuffer.BPC);
840 Debug.Put_Line ("),");
841 Debug.Put_Line (" Mode =>");
842 Debug.Put (" (Dotclock => ");
843 Debug.Put_Int64 (Configs (Pipe).Mode.Dotclock);
844 Debug.Put_Line (",");
845 Debug.Put (" H_Visible => ");
846 Debug.Put_Int16 (Configs (Pipe).Mode.H_Visible);
847 Debug.Put_Line (",");
848 Debug.Put (" H_Sync_Begin => ");
849 Debug.Put_Int16 (Configs (Pipe).Mode.H_Sync_Begin);
850 Debug.Put_Line (",");
851 Debug.Put (" H_Sync_End => ");
852 Debug.Put_Int16 (Configs (Pipe).Mode.H_Sync_End);
853 Debug.Put_Line (",");
854 Debug.Put (" H_Total => ");
855 Debug.Put_Int16 (Configs (Pipe).Mode.H_Total);
856 Debug.Put_Line (",");
857 Debug.Put (" V_Visible => ");
858 Debug.Put_Int16 (Configs (Pipe).Mode.V_Visible);
859 Debug.Put_Line (",");
860 Debug.Put (" V_Sync_Begin => ");
861 Debug.Put_Int16 (Configs (Pipe).Mode.V_Sync_Begin);
862 Debug.Put_Line (",");
863 Debug.Put (" V_Sync_End => ");
864 Debug.Put_Int16 (Configs (Pipe).Mode.V_Sync_End);
865 Debug.Put_Line (",");
866 Debug.Put (" V_Total => ");
867 Debug.Put_Int16 (Configs (Pipe).Mode.V_Total);
868 Debug.Put_Line (",");
869 Debug.Put_Line (" H_Sync_Active_High => " &
870 (if Configs (Pipe).Mode.H_Sync_Active_High
871 then "True,"
872 else "False,"));
873 Debug.Put_Line (" V_Sync_Active_High => " &
874 (if Configs (Pipe).Mode.V_Sync_Active_High
875 then "True,"
876 else "False,"));
877 Debug.Put (" BPC => ");
878 Debug.Put_Int64 (Configs (Pipe).Mode.BPC);
Nico Huber99f10f32016-11-20 00:34:05 +0100879 if Pipe /= Pipe_Index'Last then
Nico Huber83693c82016-10-08 22:17:55 +0200880 Debug.Put_Line (")),");
881 else
882 Debug.Put_Line (")));");
883 end if;
884 end loop;
885 end Dump_Configs;
886
887end HW.GFX.GMA;