| Nico Huber | 8c45bcf | 2016-11-20 17:30:57 +0100 | [diff] [blame^] | 1 | -- |
| 2 | -- Copyright (C) 2015-2016 secunet Security Networks AG |
| 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 | |
| 20 | function To_PCH_Port (Port : Active_Port_Type) return PCH_Port; |
| 21 | |
| 22 | function To_Display_Type (Port : Active_Port_Type) return Display_Type; |
| 23 | |
| 24 | procedure Fill_Port_Config |
| 25 | (Port_Cfg : out Port_Config; |
| 26 | Pipe : in Pipe_Index; |
| 27 | Port : in Port_Type; |
| 28 | Mode : in Mode_Type; |
| 29 | Success : out Boolean); |
| 30 | |
| 31 | ---------------------------------------------------------------------------- |
| 32 | |
| 33 | use type HW.Pos32; |
| 34 | function Validate_Config |
| 35 | (Framebuffer : Framebuffer_Type; |
| 36 | Port_Cfg : Port_Config; |
| 37 | Pipe : Pipe_Index) |
| 38 | return Boolean |
| 39 | with |
| 40 | Post => |
| 41 | (if Validate_Config'Result then |
| 42 | Framebuffer.Width <= Pos32 (Port_Cfg.Mode.H_Visible) and |
| 43 | Framebuffer.Height <= Pos32 (Port_Cfg.Mode.V_Visible)); |
| 44 | |
| 45 | end HW.GFX.GMA.Config_Helpers; |