| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 1 | -- |
| Nico Huber | 3be61d4 | 2017-01-09 13:58:18 +0100 | [diff] [blame] | 2 | -- Copyright (C) 2015-2017 secunet Security Networks AG |
| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 3 | -- |
| 4 | -- This program is free software; you can redistribute it and/or modify |
| 5 | -- it under the terms of the GNU General Public License as published by |
| 6 | -- the Free Software Foundation; either version 2 of the License, or |
| 7 | -- (at your option) any later version. |
| 8 | -- |
| 9 | -- This program is distributed in the hope that it will be useful, |
| 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | -- GNU General Public License for more details. |
| 13 | -- |
| 14 | |
| 15 | with HW; |
| 16 | |
| 17 | private package HW.GFX.GMA.Config_Helpers |
| 18 | is |
| 19 | |
| Nico Huber | 3be61d4 | 2017-01-09 13:58:18 +0100 | [diff] [blame] | 20 | function To_GPU_Port |
| 21 | (Pipe : Pipe_Index; |
| 22 | Port : Active_Port_Type) |
| 23 | return GPU_Port; |
| 24 | |
| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 25 | function To_PCH_Port (Port : Active_Port_Type) return PCH_Port; |
| 26 | |
| 27 | function To_Display_Type (Port : Active_Port_Type) return Display_Type; |
| 28 | |
| 29 | procedure Fill_Port_Config |
| 30 | (Port_Cfg : out Port_Config; |
| 31 | Pipe : in Pipe_Index; |
| 32 | Port : in Port_Type; |
| 33 | Mode : in Mode_Type; |
| 34 | Success : out Boolean); |
| 35 | |
| 36 | ---------------------------------------------------------------------------- |
| 37 | |
| Nico Huber | 31a5217 | 2017-03-05 14:17:34 +0100 | [diff] [blame] | 38 | pragma Warnings (GNAT, Off, """Integer_32"" is already use-visible *", |
| 39 | Reason => "Needed for older compiler versions"); |
| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 40 | use type HW.Pos32; |
| Nico Huber | 31a5217 | 2017-03-05 14:17:34 +0100 | [diff] [blame] | 41 | pragma Warnings (GNAT, On, """Integer_32"" is already use-visible *"); |
| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 42 | function Validate_Config |
| Nico Huber | 9b47941 | 2017-08-27 11:55:56 +0200 | [diff] [blame] | 43 | (FB : Framebuffer_Type; |
| 44 | Port_Cfg : Port_Config; |
| 45 | Pipe : Pipe_Index) |
| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 46 | return Boolean |
| 47 | with |
| 48 | Post => |
| 49 | (if Validate_Config'Result then |
| Nico Huber | 9b47941 | 2017-08-27 11:55:56 +0200 | [diff] [blame] | 50 | Rotated_Width (FB) <= Port_Cfg.Mode.H_Visible and |
| 51 | Rotated_Height (FB) <= Port_Cfg.Mode.V_Visible and |
| 52 | (FB.Offset = VGA_PLANE_FRAMEBUFFER_OFFSET or |
| Nico Huber | 5ef4d60 | 2017-12-13 13:56:47 +0100 | [diff] [blame^] | 53 | FB.Height + FB.Start_Y <= FB.V_Stride)); |
| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame] | 54 | |
| 55 | end HW.GFX.GMA.Config_Helpers; |