blob: dae8d276e34107a1369ab8a431ea3263fed514a3 [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 =>
Nico Hubere015e822017-08-25 20:12:09 +0200304 (Config.Valid_Port_GPU, Dev.PCI_State,
Nico Huber83693c82016-10-08 22:17:55 +0200305 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
Nico Huber83693c82016-10-08 22:17:55 +0200343 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
344
345 pragma Debug (Debug.Set_Register_Write_Delay (Write_Delay));
346
347 Wait_For_HPD := HPD_Type'(others => False);
348 HPD_Delay := HPD_Delay_Type'(others => Now);
Nico Huber83693c82016-10-08 22:17:55 +0200349 Allocated_PLLs := (others => PLLs.Invalid);
Nico Huber99f10f32016-11-20 00:34:05 +0100350 Cur_Configs := Pipe_Configs'
351 (others => Pipe_Config'
Nico Huber83693c82016-10-08 22:17:55 +0200352 (Port => Disabled,
353 Framebuffer => HW.GFX.Default_FB,
354 Mode => HW.GFX.Invalid_Mode));
Nico Huber83693c82016-10-08 22:17:55 +0200355 PLLs.Initialize;
356
Nico Huber2b6f6992017-07-09 18:11:34 +0200357 Dev.Initialize (Success);
358
359 if Success then
360 Dev.Map (PCI_MMIO_Base, PCI.Res0, Length => Config.GTT_Offset);
361 Dev.Map (PCI_GTT_Base, PCI.Res0, Offset => Config.GTT_Offset);
362 if PCI_MMIO_Base /= 0 and PCI_GTT_Base /= 0 then
363 Registers.Set_Register_Base (PCI_MMIO_Base, PCI_GTT_Base);
364 else
365 pragma Debug (Debug.Put_Line
366 ("ERROR: Couldn't map resoure0."));
367 Registers.Set_Register_Base (Config.Default_MMIO_Base);
368 Success := Config.Default_MMIO_Base_Set;
369 end if;
370 else
371 pragma Debug (Debug.Put_Line
372 ("WARNING: Couldn't initialize PCI dev."));
373 Registers.Set_Register_Base (Config.Default_MMIO_Base);
374 Success := Config.Default_MMIO_Base_Set;
375 end if;
376
377 if Success then
378 Check_Platform (Success);
379 end if;
380
Nico Huber83693c82016-10-08 22:17:55 +0200381 if not Success then
382 pragma Debug (Debug.Put_Line ("ERROR: Incompatible CPU or PCH."));
383
384 Panel.Static_Init; -- for flow analysis
385
386 Initialized := False;
387 return;
388 end if;
389
390 Panel.Setup_PP_Sequencer;
391 Port_Detect.Initialize;
Nico Huber0923b792017-06-09 15:28:41 +0200392 Connectors.Initialize;
Nico Huber83693c82016-10-08 22:17:55 +0200393
Nico Huber793a8d42016-11-21 18:57:03 +0100394 if Clean_State then
395 Power_And_Clocks.Pre_All_Off;
396 Connectors.Pre_All_Off;
397 Display_Controller.All_Off;
398 Connectors.Post_All_Off;
399 PLLs.All_Off;
400 Power_And_Clocks.Post_All_Off;
Nico Huber17d64b62017-07-15 20:51:25 +0200401 Registers.Clear_Fences;
Nico Huber33912aa2016-12-06 20:36:23 +0100402 else
403 -- According to PRMs, VGA plane is the only thing
404 -- that's enabled by default after reset.
405 Display_Controller.Legacy_VGA_Off;
Nico Huber793a8d42016-11-21 18:57:03 +0100406 end if;
Nico Huber83693c82016-10-08 22:17:55 +0200407
408 -------------------- Now restart from a clean state ---------------------
409 Power_And_Clocks.Initialize;
410
Nico Huber1c3b9282017-02-09 13:57:04 +0100411 if Config.Has_PCH then
412 Registers.Unset_And_Set_Mask
413 (Register => Registers.PCH_RAWCLK_FREQ,
414 Mask_Unset => PCH_RAWCLK_FREQ_MASK,
415 Mask_Set => PCH_RAWCLK_FREQ (Config.Default_RawClk_Freq));
416 end if;
Nico Huberf54d0962016-10-20 14:17:18 +0200417
Nico Huber83693c82016-10-08 22:17:55 +0200418 Initialized := True;
419
420 end Initialize;
421
422 function Is_Initialized return Boolean
423 with
424 Refined_Post => Is_Initialized'Result = Initialized
425 is
426 begin
427 return Initialized;
428 end Is_Initialized;
429
430 ----------------------------------------------------------------------------
431
432 procedure Write_GTT
433 (GTT_Page : GTT_Range;
434 Device_Address : GTT_Address_Type;
435 Valid : Boolean) is
436 begin
437 Registers.Write_GTT (GTT_Page, Device_Address, Valid);
438 end Write_GTT;
439
Nico Huber194e57e2017-07-15 21:15:46 +0200440 procedure Setup_Default_GTT (FB : Framebuffer_Type; Phys_Base : Word32)
Nico Huber83693c82016-10-08 22:17:55 +0200441 is
Nico Huber194e57e2017-07-15 21:15:46 +0200442 Phys_Addr : GTT_Address_Type :=
443 GTT_Address_Type (Phys_Base) + GTT_Address_Type (FB.Offset);
Nico Huber83693c82016-10-08 22:17:55 +0200444 begin
Nico Huber194e57e2017-07-15 21:15:46 +0200445 for Idx in FB_First_Page (FB) .. FB_Last_Page (FB) loop
Nico Huber83693c82016-10-08 22:17:55 +0200446 Registers.Write_GTT
447 (GTT_Page => Idx,
448 Device_Address => Phys_Addr,
449 Valid => True);
Nico Huber194e57e2017-07-15 21:15:46 +0200450 Phys_Addr := Phys_Addr + GTT_Page_Size;
Nico Huber83693c82016-10-08 22:17:55 +0200451 end loop;
452 end Setup_Default_GTT;
453
454 ----------------------------------------------------------------------------
455
Nico Huber99f10f32016-11-20 00:34:05 +0100456 procedure Dump_Configs (Configs : Pipe_Configs)
Nico Huber83693c82016-10-08 22:17:55 +0200457 is
458 subtype Pipe_Name is String (1 .. 9);
Nico Huber99f10f32016-11-20 00:34:05 +0100459 type Pipe_Name_Array is array (Pipe_Index) of Pipe_Name;
Nico Huber83693c82016-10-08 22:17:55 +0200460 Pipe_Names : constant Pipe_Name_Array :=
461 (Primary => "Primary ",
462 Secondary => "Secondary",
463 Tertiary => "Tertiary ");
464 begin
465 Debug.New_Line;
Paul Menzelb83107c2017-05-04 09:02:33 +0200466 Debug.Put_Line ("CONFIG =>");
Nico Huber99f10f32016-11-20 00:34:05 +0100467 for Pipe in Pipe_Index loop
468 if Pipe = Pipe_Index'First then
Nico Huber83693c82016-10-08 22:17:55 +0200469 Debug.Put (" (");
470 else
471 Debug.Put (" ");
472 end if;
473 Debug.Put_Line (Pipe_Names (Pipe) & " =>");
474 Debug.Put_Line
475 (" (Port => " & Port_Names (Configs (Pipe).Port) & ",");
476 Debug.Put_Line (" Framebuffer =>");
477 Debug.Put (" (Width => ");
478 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Width);
479 Debug.Put_Line (",");
480 Debug.Put (" Height => ");
481 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Height);
482 Debug.Put_Line (",");
483 Debug.Put (" Stride => ");
484 Debug.Put_Int32 (Configs (Pipe).Framebuffer.Stride);
485 Debug.Put_Line (",");
486 Debug.Put (" Offset => ");
487 Debug.Put_Word32 (Configs (Pipe).Framebuffer.Offset);
488 Debug.Put_Line (",");
489 Debug.Put (" BPC => ");
490 Debug.Put_Int64 (Configs (Pipe).Framebuffer.BPC);
491 Debug.Put_Line ("),");
492 Debug.Put_Line (" Mode =>");
493 Debug.Put (" (Dotclock => ");
494 Debug.Put_Int64 (Configs (Pipe).Mode.Dotclock);
495 Debug.Put_Line (",");
496 Debug.Put (" H_Visible => ");
497 Debug.Put_Int16 (Configs (Pipe).Mode.H_Visible);
498 Debug.Put_Line (",");
499 Debug.Put (" H_Sync_Begin => ");
500 Debug.Put_Int16 (Configs (Pipe).Mode.H_Sync_Begin);
501 Debug.Put_Line (",");
502 Debug.Put (" H_Sync_End => ");
503 Debug.Put_Int16 (Configs (Pipe).Mode.H_Sync_End);
504 Debug.Put_Line (",");
505 Debug.Put (" H_Total => ");
506 Debug.Put_Int16 (Configs (Pipe).Mode.H_Total);
507 Debug.Put_Line (",");
508 Debug.Put (" V_Visible => ");
509 Debug.Put_Int16 (Configs (Pipe).Mode.V_Visible);
510 Debug.Put_Line (",");
511 Debug.Put (" V_Sync_Begin => ");
512 Debug.Put_Int16 (Configs (Pipe).Mode.V_Sync_Begin);
513 Debug.Put_Line (",");
514 Debug.Put (" V_Sync_End => ");
515 Debug.Put_Int16 (Configs (Pipe).Mode.V_Sync_End);
516 Debug.Put_Line (",");
517 Debug.Put (" V_Total => ");
518 Debug.Put_Int16 (Configs (Pipe).Mode.V_Total);
519 Debug.Put_Line (",");
520 Debug.Put_Line (" H_Sync_Active_High => " &
521 (if Configs (Pipe).Mode.H_Sync_Active_High
522 then "True,"
523 else "False,"));
524 Debug.Put_Line (" V_Sync_Active_High => " &
525 (if Configs (Pipe).Mode.V_Sync_Active_High
526 then "True,"
527 else "False,"));
528 Debug.Put (" BPC => ");
529 Debug.Put_Int64 (Configs (Pipe).Mode.BPC);
Nico Huber99f10f32016-11-20 00:34:05 +0100530 if Pipe /= Pipe_Index'Last then
Nico Huber83693c82016-10-08 22:17:55 +0200531 Debug.Put_Line (")),");
532 else
533 Debug.Put_Line (")));");
534 end if;
535 end loop;
536 end Dump_Configs;
537
538end HW.GFX.GMA;