blob: 387d6bdd15a4e4d931e9066986ef3be731178a04 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
Nico Huber3be61d42017-01-09 13:58:18 +01002-- Copyright (C) 2014-2017 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 Huber83693c82016-10-08 22:17:55 +020021with HW.GFX.GMA.Config;
Nico Huber8c45bcf2016-11-20 17:30:57 +010022with HW.GFX.GMA.Config_Helpers;
Nico Huber83693c82016-10-08 22:17:55 +020023with HW.GFX.GMA.Registers;
24with HW.GFX.GMA.Power_And_Clocks;
25with HW.GFX.GMA.Panel;
26with HW.GFX.GMA.PLLs;
27with HW.GFX.GMA.Port_Detect;
28with HW.GFX.GMA.Connectors;
29with HW.GFX.GMA.Connector_Info;
30with HW.GFX.GMA.Pipe_Setup;
31
Nico Huber83693c82016-10-08 22:17:55 +020032with HW.Debug;
33with GNAT.Source_Info;
34
Nico Huber83693c82016-10-08 22:17:55 +020035use type HW.Int32;
36
37package body HW.GFX.GMA
38 with Refined_State =>
39 (State =>
Nico Huber2b6f6992017-07-09 18:11:34 +020040 (Dev.Address_State,
41 Registers.Address_State,
Nico Huber83693c82016-10-08 22:17:55 +020042 PLLs.State, Panel.Panel_State,
Nico Huber1a712d32017-01-09 15:11:04 +010043 Cur_Configs, Allocated_PLLs,
Nico Huber83693c82016-10-08 22:17:55 +020044 HPD_Delay, Wait_For_HPD),
45 Init_State => Initialized,
46 Config_State => Config.Valid_Port_GPU,
47 Device_State =>
Nico Huber2b6f6992017-07-09 18:11:34 +020048 (Dev.PCI_State, Registers.Register_State, Registers.GTT_State))
Nico Huber83693c82016-10-08 22:17:55 +020049is
Nico Huber2b6f6992017-07-09 18:11:34 +020050 pragma Disable_Atomic_Synchronization;
Nico Huber83693c82016-10-08 22:17:55 +020051
52 subtype Port_Name is String (1 .. 8);
53 type Port_Name_Array is array (Port_Type) of Port_Name;
54 Port_Names : constant Port_Name_Array :=
55 (Disabled => "Disabled",
56 Internal => "Internal",
57 DP1 => "DP1 ",
58 DP2 => "DP2 ",
59 DP3 => "DP3 ",
Nico Huber0d454cd2016-11-21 13:33:43 +010060 HDMI1 => "HDMI1 ",
61 HDMI2 => "HDMI2 ",
62 HDMI3 => "HDMI3 ",
Nico Huber83693c82016-10-08 22:17:55 +020063 Analog => "Analog ");
64
Nico Huber2b6f6992017-07-09 18:11:34 +020065 package Dev is new HW.PCI.Dev (PCI.Address'(0, 2, 0));
66
Nico Huber83693c82016-10-08 22:17:55 +020067 package Display_Controller renames Pipe_Setup;
68
Nico Huber99f10f32016-11-20 00:34:05 +010069 type PLLs_Type is array (Pipe_Index) of PLLs.T;
Nico Huber83693c82016-10-08 22:17:55 +020070
Nico Huber83693c82016-10-08 22:17:55 +020071 type HPD_Type is array (Port_Type) of Boolean;
Nico Huber3be61d42017-01-09 13:58:18 +010072 type HPD_Delay_Type is array (Active_Port_Type) of Time.T;
Nico Huber83693c82016-10-08 22:17:55 +020073
Nico Huber83693c82016-10-08 22:17:55 +020074 Allocated_PLLs : PLLs_Type;
Nico Huber83693c82016-10-08 22:17:55 +020075 HPD_Delay : HPD_Delay_Type;
76 Wait_For_HPD : HPD_Type;
77 Initialized : Boolean := False;
78
Nico Huber83693c82016-10-08 22:17:55 +020079 ----------------------------------------------------------------------------
80
Nico Huberf54d0962016-10-20 14:17:18 +020081 PCH_RAWCLK_FREQ_MASK : constant := 16#3ff# * 2 ** 0;
82
83 function PCH_RAWCLK_FREQ (Freq : Frequency_Type) return Word32
84 is
85 begin
86 return Word32 (Freq / 1_000_000);
87 end PCH_RAWCLK_FREQ;
88
89 ----------------------------------------------------------------------------
90
Nico Huber43370ba2017-01-09 15:26:19 +010091 procedure Enable_Output
92 (Pipe : in Pipe_Index;
93 Pipe_Cfg : in Pipe_Config;
94 Success : out Boolean)
95 is
96 Port_Cfg : Port_Config;
97 begin
Nico Huber3be61d42017-01-09 13:58:18 +010098 pragma Debug (Debug.New_Line);
99 pragma Debug (Debug.Put_Line
100 ("Trying to enable port " & Port_Names (Pipe_Cfg.Port)));
101
Nico Huber43370ba2017-01-09 15:26:19 +0100102 Config_Helpers.Fill_Port_Config
103 (Port_Cfg, Pipe, Pipe_Cfg.Port, Pipe_Cfg.Mode, Success);
104
105 if Success then
106 Success := Config_Helpers.Validate_Config
107 (Pipe_Cfg.Framebuffer, Port_Cfg, Pipe);
108 end if;
109
Nico Huber43370ba2017-01-09 15:26:19 +0100110 if Success then
Nico Huber43370ba2017-01-09 15:26:19 +0100111 Connector_Info.Preferred_Link_Setting (Port_Cfg, Success);
112 end if;
113
114 -- loop over all possible DP-lane configurations
115 -- (non-DP ports use a single fake configuration)
116 while Success loop
117 pragma Loop_Invariant
118 (Pipe_Cfg.Port in Active_Port_Type and
119 Port_Cfg.Mode = Port_Cfg.Mode'Loop_Entry);
120
121 PLLs.Alloc
122 (Port_Cfg => Port_Cfg,
123 PLL => Allocated_PLLs (Pipe),
124 Success => Success);
125
126 if Success then
127 -- try each DP-lane configuration twice
128 for Try in 1 .. 2 loop
129 pragma Loop_Invariant
130 (Pipe_Cfg.Port in Active_Port_Type);
131
Nico Huber4798c662017-01-11 12:44:48 +0100132 -- Clear pending hot-plug events before every try
133 Port_Detect.Clear_Hotplug_Detect (Pipe_Cfg.Port);
134
Nico Huber43370ba2017-01-09 15:26:19 +0100135 Connectors.Pre_On
136 (Pipe => Pipe,
137 Port_Cfg => Port_Cfg,
138 PLL_Hint => PLLs.Register_Value (Allocated_PLLs (Pipe)),
139 Success => Success);
140
141 if Success then
142 Display_Controller.On
143 (Pipe => Pipe,
144 Port_Cfg => Port_Cfg,
145 Framebuffer => Pipe_Cfg.Framebuffer);
146
147 Connectors.Post_On
148 (Port_Cfg => Port_Cfg,
149 PLL_Hint => PLLs.Register_Value (Allocated_PLLs (Pipe)),
150 Success => Success);
151
152 if not Success then
153 Display_Controller.Off (Pipe);
154 Connectors.Post_Off (Port_Cfg);
155 end if;
156 end if;
157
158 exit when Success;
159 end loop;
160 exit when Success; -- connection established => stop loop
161
162 -- connection failed
163 PLLs.Free (Allocated_PLLs (Pipe));
164 end if;
165
166 Connector_Info.Next_Link_Setting (Port_Cfg, Success);
167 end loop;
168
169 if Success then
170 pragma Debug (Debug.Put_Line
171 ("Enabled port " & Port_Names (Pipe_Cfg.Port)));
172 else
173 Wait_For_HPD (Pipe_Cfg.Port) := True;
174 if Pipe_Cfg.Port = Internal then
175 Panel.Off;
176 end if;
177 end if;
178 end Enable_Output;
179
Nico Huber3be61d42017-01-09 13:58:18 +0100180 procedure Disable_Output (Pipe : Pipe_Index; Pipe_Cfg : Pipe_Config)
181 is
182 Port_Cfg : Port_Config;
183 Success : Boolean;
184 begin
185 Config_Helpers.Fill_Port_Config
186 (Port_Cfg, Pipe, Pipe_Cfg.Port, Pipe_Cfg.Mode, Success);
187 if Success then
188 pragma Debug (Debug.New_Line);
189 pragma Debug (Debug.Put_Line
190 ("Disabling port " & Port_Names (Pipe_Cfg.Port)));
191 pragma Debug (Debug.New_Line);
192
193 Connectors.Pre_Off (Port_Cfg);
194 Display_Controller.Off (Pipe);
195 Connectors.Post_Off (Port_Cfg);
196
197 PLLs.Free (Allocated_PLLs (Pipe));
198 end if;
199 end Disable_Output;
200
Nico Huber99f10f32016-11-20 00:34:05 +0100201 procedure Update_Outputs (Configs : Pipe_Configs)
Nico Huber83693c82016-10-08 22:17:55 +0200202 is
Nico Huber3be61d42017-01-09 13:58:18 +0100203 procedure Check_HPD (Port : in Active_Port_Type; Detected : out Boolean)
204 is
205 HPD_Delay_Over : constant Boolean := Time.Timed_Out (HPD_Delay (Port));
206 begin
207 if HPD_Delay_Over then
208 Port_Detect.Hotplug_Detect (Port, Detected);
209 HPD_Delay (Port) := Time.MS_From_Now (333);
210 else
211 Detected := False;
212 end if;
213 end Check_HPD;
Nico Huberb56b9c52017-01-11 15:12:23 +0100214
Nico Huber564103f2017-01-11 15:33:07 +0100215 Power_Changed : Boolean := False;
Nico Huberb56b9c52017-01-11 15:12:23 +0100216 Old_Configs : Pipe_Configs;
Nico Huber564103f2017-01-11 15:33:07 +0100217
218 -- Only called when we actually tried to change something
219 -- so we don't congest the log with unnecessary messages.
220 procedure Update_Power
221 is
222 begin
223 if not Power_Changed then
224 Power_And_Clocks.Power_Up (Old_Configs, Configs);
225 Power_Changed := True;
226 end if;
227 end Update_Power;
Nico Huber83693c82016-10-08 22:17:55 +0200228 begin
229 Old_Configs := Cur_Configs;
230
Nico Huberb56b9c52017-01-11 15:12:23 +0100231 -- disable all pipes that changed or had a hot-plug event
232 for Pipe in Pipe_Index loop
233 declare
234 Unplug_Detected : Boolean;
235 Cur_Config : Pipe_Config renames Cur_Configs (Pipe);
236 New_Config : Pipe_Config renames Configs (Pipe);
237 begin
238 if Cur_Config.Port /= Disabled then
239 Check_HPD (Cur_Config.Port, Unplug_Detected);
Nico Huber83693c82016-10-08 22:17:55 +0200240
Nico Huberb56b9c52017-01-11 15:12:23 +0100241 if Cur_Config.Port /= New_Config.Port or
242 Cur_Config.Mode /= New_Config.Mode or
243 Unplug_Detected
244 then
245 Disable_Output (Pipe, Cur_Config);
246 Cur_Config.Port := Disabled;
Nico Huber564103f2017-01-11 15:33:07 +0100247 Update_Power;
Nico Huberb56b9c52017-01-11 15:12:23 +0100248 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200249 end if;
Nico Huberb56b9c52017-01-11 15:12:23 +0100250 end;
251 end loop;
Nico Huber83693c82016-10-08 22:17:55 +0200252
Nico Huberb56b9c52017-01-11 15:12:23 +0100253 -- enable all pipes that changed and should be active
254 for Pipe in Pipe_Index loop
255 declare
256 Success : Boolean;
257 Cur_Config : Pipe_Config renames Cur_Configs (Pipe);
258 New_Config : Pipe_Config renames Configs (Pipe);
259 begin
260 if New_Config.Port /= Disabled and then
261 (Cur_Config.Port /= New_Config.Port or
262 Cur_Config.Mode /= New_Config.Mode)
263 then
Nico Huber3be61d42017-01-09 13:58:18 +0100264 if Wait_For_HPD (New_Config.Port) then
265 Check_HPD (New_Config.Port, Success);
266 Wait_For_HPD (New_Config.Port) := not Success;
267 else
268 Success := True;
Nico Huber8c45bcf2016-11-20 17:30:57 +0100269 end if;
Nico Huberc7a4fee2016-11-03 18:18:03 +0100270
Nico Huber3be61d42017-01-09 13:58:18 +0100271 if Success then
Nico Huber564103f2017-01-11 15:33:07 +0100272 Update_Power;
Nico Huberb56b9c52017-01-11 15:12:23 +0100273 Enable_Output (Pipe, New_Config, Success);
Nico Huber3be61d42017-01-09 13:58:18 +0100274 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200275
276 if Success then
Nico Huberb56b9c52017-01-11 15:12:23 +0100277 Cur_Config := New_Config;
Nico Huber83693c82016-10-08 22:17:55 +0200278 end if;
Nico Huber3be61d42017-01-09 13:58:18 +0100279
Nico Huberb56b9c52017-01-11 15:12:23 +0100280 -- update framebuffer offset only
281 elsif New_Config.Port /= Disabled and
282 Cur_Config.Framebuffer /= New_Config.Framebuffer
283 then
284 Display_Controller.Update_Offset (Pipe, New_Config.Framebuffer);
285 Cur_Config := New_Config;
286 end if;
287 end;
Nico Huber83693c82016-10-08 22:17:55 +0200288 end loop;
289
Nico Huber564103f2017-01-11 15:33:07 +0100290 if Power_Changed then
Nico Huber83693c82016-10-08 22:17:55 +0200291 Power_And_Clocks.Power_Down (Old_Configs, Configs, Cur_Configs);
292 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200293 end Update_Outputs;
294
295 ----------------------------------------------------------------------------
296
297 procedure Initialize
Nico Huber2b6f6992017-07-09 18:11:34 +0200298 (Write_Delay : in Word64 := 0;
Nico Huber793a8d42016-11-21 18:57:03 +0100299 Clean_State : in Boolean := False;
Nico Huber83693c82016-10-08 22:17:55 +0200300 Success : out Boolean)
301 with
302 Refined_Global =>
303 (In_Out =>
304 (Config.Valid_Port_GPU,
305 Registers.Register_State, Port_IO.State),
306 Input =>
307 (Time.State),
308 Output =>
Nico Huber2b6f6992017-07-09 18:11:34 +0200309 (Dev.Address_State,
310 Registers.Address_State,
Nico Huber83693c82016-10-08 22:17:55 +0200311 PLLs.State, Panel.Panel_State,
Nico Huber1a712d32017-01-09 15:11:04 +0100312 Cur_Configs, Allocated_PLLs,
Nico Huber83693c82016-10-08 22:17:55 +0200313 HPD_Delay, Wait_For_HPD, Initialized))
314 is
315 use type HW.Word64;
316
Nico Huber2b6f6992017-07-09 18:11:34 +0200317 PCI_MMIO_Base, PCI_GTT_Base : Word64;
318
Nico Huber83693c82016-10-08 22:17:55 +0200319 Now : constant Time.T := Time.Now;
320
321 procedure Check_Platform (Success : out Boolean)
322 is
323 Audio_VID_DID : Word32;
324 begin
325 case Config.CPU is
326 when Haswell .. Skylake =>
327 Registers.Read (Registers.AUD_VID_DID, Audio_VID_DID);
328 when Ironlake .. Ivybridge =>
329 Registers.Read (Registers.PCH_AUD_VID_DID, Audio_VID_DID);
330 end case;
331 Success :=
332 (case Config.CPU is
Nico Huber21da5742017-01-20 14:00:53 +0100333 when Broxton => Audio_VID_DID = 16#8086_280a#,
Nico Huber83693c82016-10-08 22:17:55 +0200334 when Skylake => Audio_VID_DID = 16#8086_2809#,
335 when Broadwell => Audio_VID_DID = 16#8086_2808#,
336 when Haswell => Audio_VID_DID = 16#8086_2807#,
337 when Ivybridge |
338 Sandybridge => Audio_VID_DID = 16#8086_2806# or
339 Audio_VID_DID = 16#8086_2805#,
Nico Hubereeb5a392016-10-09 19:28:30 +0200340 when Ironlake => Audio_VID_DID = 16#0000_0000#);
Nico Huber83693c82016-10-08 22:17:55 +0200341 end Check_Platform;
342 begin
343 pragma Warnings (GNATprove, Off, "unused variable ""Write_Delay""",
344 Reason => "Write_Delay is used for debugging only");
345
346 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
347
348 pragma Debug (Debug.Set_Register_Write_Delay (Write_Delay));
349
350 Wait_For_HPD := HPD_Type'(others => False);
351 HPD_Delay := HPD_Delay_Type'(others => Now);
Nico Huber83693c82016-10-08 22:17:55 +0200352 Allocated_PLLs := (others => PLLs.Invalid);
Nico Huber99f10f32016-11-20 00:34:05 +0100353 Cur_Configs := Pipe_Configs'
354 (others => Pipe_Config'
Nico Huber83693c82016-10-08 22:17:55 +0200355 (Port => Disabled,
356 Framebuffer => HW.GFX.Default_FB,
357 Mode => HW.GFX.Invalid_Mode));
Nico Huber83693c82016-10-08 22:17:55 +0200358 PLLs.Initialize;
359
Nico Huber2b6f6992017-07-09 18:11:34 +0200360 Dev.Initialize (Success);
361
362 if Success then
363 Dev.Map (PCI_MMIO_Base, PCI.Res0, Length => Config.GTT_Offset);
364 Dev.Map (PCI_GTT_Base, PCI.Res0, Offset => Config.GTT_Offset);
365 if PCI_MMIO_Base /= 0 and PCI_GTT_Base /= 0 then
366 Registers.Set_Register_Base (PCI_MMIO_Base, PCI_GTT_Base);
367 else
368 pragma Debug (Debug.Put_Line
369 ("ERROR: Couldn't map resoure0."));
370 Registers.Set_Register_Base (Config.Default_MMIO_Base);
371 Success := Config.Default_MMIO_Base_Set;
372 end if;
373 else
374 pragma Debug (Debug.Put_Line
375 ("WARNING: Couldn't initialize PCI dev."));
376 Registers.Set_Register_Base (Config.Default_MMIO_Base);
377 Success := Config.Default_MMIO_Base_Set;
378 end if;
379
380 if Success then
381 Check_Platform (Success);
382 end if;
383
Nico Huber83693c82016-10-08 22:17:55 +0200384 if not Success then
385 pragma Debug (Debug.Put_Line ("ERROR: Incompatible CPU or PCH."));
386
387 Panel.Static_Init; -- for flow analysis
388
389 Initialized := False;
390 return;
391 end if;
392
393 Panel.Setup_PP_Sequencer;
394 Port_Detect.Initialize;
Nico Huber0923b792017-06-09 15:28:41 +0200395 Connectors.Initialize;
Nico Huber83693c82016-10-08 22:17:55 +0200396
Nico Huber793a8d42016-11-21 18:57:03 +0100397 if Clean_State then
398 Power_And_Clocks.Pre_All_Off;
399 Connectors.Pre_All_Off;
400 Display_Controller.All_Off;
401 Connectors.Post_All_Off;
402 PLLs.All_Off;
403 Power_And_Clocks.Post_All_Off;
Nico Huber33912aa2016-12-06 20:36:23 +0100404 else
405 -- According to PRMs, VGA plane is the only thing
406 -- that's enabled by default after reset.
407 Display_Controller.Legacy_VGA_Off;
Nico Huber793a8d42016-11-21 18:57:03 +0100408 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200409
410 -------------------- Now restart from a clean state ---------------------
411 Power_And_Clocks.Initialize;
412
Nico Huber1c3b9282017-02-09 13:57:04 +0100413 if Config.Has_PCH then
414 Registers.Unset_And_Set_Mask
415 (Register => Registers.PCH_RAWCLK_FREQ,
416 Mask_Unset => PCH_RAWCLK_FREQ_MASK,
417 Mask_Set => PCH_RAWCLK_FREQ (Config.Default_RawClk_Freq));
418 end if;
Nico Huberf54d0962016-10-20 14:17:18 +0200419
Nico Huber83693c82016-10-08 22:17:55 +0200420 Initialized := True;
421
422 end Initialize;
423
424 function Is_Initialized return Boolean
425 with
426 Refined_Post => Is_Initialized'Result = Initialized
427 is
428 begin
429 return Initialized;
430 end Is_Initialized;
431
432 ----------------------------------------------------------------------------
433
434 procedure Write_GTT
435 (GTT_Page : GTT_Range;
436 Device_Address : GTT_Address_Type;
437 Valid : Boolean) is
438 begin
439 Registers.Write_GTT (GTT_Page, Device_Address, Valid);
440 end Write_GTT;
441
442 procedure Setup_Default_GTT (FB : Framebuffer_Type; Phys_FB : Word32)
443 is
444 FB_Size : constant Pos32 :=
445 FB.Stride * FB.Height * Pos32 (((FB.BPC * 4) / 8));
446 Phys_Addr : GTT_Address_Type := GTT_Address_Type (Phys_FB);
447 begin
448 for Idx in GTT_Range range 0 .. GTT_Range (((FB_Size + 4095) / 4096) - 1)
449 loop
450 Registers.Write_GTT
451 (GTT_Page => Idx,
452 Device_Address => Phys_Addr,
453 Valid => True);
454 Phys_Addr := Phys_Addr + 4096;
455 end loop;
456 end Setup_Default_GTT;
457
458 ----------------------------------------------------------------------------
459
Nico Huber99f10f32016-11-20 00:34:05 +0100460 procedure Dump_Configs (Configs : Pipe_Configs)
Nico Huber83693c82016-10-08 22:17:55 +0200461 is
462 subtype Pipe_Name is String (1 .. 9);
Nico Huber99f10f32016-11-20 00:34:05 +0100463 type Pipe_Name_Array is array (Pipe_Index) of Pipe_Name;
Nico Huber83693c82016-10-08 22:17:55 +0200464 Pipe_Names : constant Pipe_Name_Array :=
465 (Primary => "Primary ",
466 Secondary => "Secondary",
467 Tertiary => "Tertiary ");
468 begin
469 Debug.New_Line;
Paul Menzelb83107c2017-05-04 09:02:33 +0200470 Debug.Put_Line ("CONFIG =>");
Nico Huber99f10f32016-11-20 00:34:05 +0100471 for Pipe in Pipe_Index loop
472 if Pipe = Pipe_Index'First then
Nico Huber83693c82016-10-08 22:17:55 +0200473 Debug.Put (" (");
474 else
475 Debug.Put (" ");
476 end if;
477 Debug.Put_Line (Pipe_Names (Pipe) & " =>");
478 Debug.Put_Line
479 (" (Port => " & Port_Names (Configs (Pipe).Port) & ",");
480 Debug.Put_Line (" Framebuffer =>");
481 Debug.Put (" (Width => ");
482 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Width);
483 Debug.Put_Line (",");
484 Debug.Put (" Height => ");
485 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Height);
486 Debug.Put_Line (",");
487 Debug.Put (" Stride => ");
488 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Stride);
489 Debug.Put_Line (",");
490 Debug.Put (" Offset => ");
491 Debug.Put_Word32 (Configs (Pipe).Framebuffer.Offset);
492 Debug.Put_Line (",");
493 Debug.Put (" BPC => ");
494 Debug.Put_Int64 (Configs (Pipe).Framebuffer.BPC);
495 Debug.Put_Line ("),");
496 Debug.Put_Line (" Mode =>");
497 Debug.Put (" (Dotclock => ");
498 Debug.Put_Int64 (Configs (Pipe).Mode.Dotclock);
499 Debug.Put_Line (",");
500 Debug.Put (" H_Visible => ");
501 Debug.Put_Int16 (Configs (Pipe).Mode.H_Visible);
502 Debug.Put_Line (",");
503 Debug.Put (" H_Sync_Begin => ");
504 Debug.Put_Int16 (Configs (Pipe).Mode.H_Sync_Begin);
505 Debug.Put_Line (",");
506 Debug.Put (" H_Sync_End => ");
507 Debug.Put_Int16 (Configs (Pipe).Mode.H_Sync_End);
508 Debug.Put_Line (",");
509 Debug.Put (" H_Total => ");
510 Debug.Put_Int16 (Configs (Pipe).Mode.H_Total);
511 Debug.Put_Line (",");
512 Debug.Put (" V_Visible => ");
513 Debug.Put_Int16 (Configs (Pipe).Mode.V_Visible);
514 Debug.Put_Line (",");
515 Debug.Put (" V_Sync_Begin => ");
516 Debug.Put_Int16 (Configs (Pipe).Mode.V_Sync_Begin);
517 Debug.Put_Line (",");
518 Debug.Put (" V_Sync_End => ");
519 Debug.Put_Int16 (Configs (Pipe).Mode.V_Sync_End);
520 Debug.Put_Line (",");
521 Debug.Put (" V_Total => ");
522 Debug.Put_Int16 (Configs (Pipe).Mode.V_Total);
523 Debug.Put_Line (",");
524 Debug.Put_Line (" H_Sync_Active_High => " &
525 (if Configs (Pipe).Mode.H_Sync_Active_High
526 then "True,"
527 else "False,"));
528 Debug.Put_Line (" V_Sync_Active_High => " &
529 (if Configs (Pipe).Mode.V_Sync_Active_High
530 then "True,"
531 else "False,"));
532 Debug.Put (" BPC => ");
533 Debug.Put_Int64 (Configs (Pipe).Mode.BPC);
Nico Huber99f10f32016-11-20 00:34:05 +0100534 if Pipe /= Pipe_Index'Last then
Nico Huber83693c82016-10-08 22:17:55 +0200535 Debug.Put_Line (")),");
536 else
537 Debug.Put_Line (")));");
538 end if;
539 end loop;
540 end Dump_Configs;
541
542end HW.GFX.GMA;