| 1 |
-- SPDX-License-Identifier: GPL-2.0-only |
| 2 |
|
| 3 |
with HW.GFX.GMA; |
| 4 |
with HW.GFX.GMA.Display_Probing; |
| 5 |
|
| 6 |
use HW.GFX.GMA; |
| 7 |
|
| 8 |
package body GMA is |
| 9 |
|
| 10 |
function read_edid |
| 11 |
(raw_edid : out HW.GFX.EDID.Raw_EDID_Data; |
| 12 |
port : in Interfaces.C.int) |
| 13 |
return Interfaces.C.int |
| 14 |
is |
| 15 |
use type Interfaces.C.int; |
| 16 |
success : Boolean := true; |
| 17 |
begin |
| 18 |
if port not in Active_Port_Type'Pos (Active_Port_Type'First) |
| 19 |
.. Active_Port_Type'Pos (Active_Port_Type'Last) |
| 20 |
then |
| 21 |
raw_edid := (others => 0); |
| 22 |
return -2; |
| 23 |
else |
| 24 |
if not HW.GFX.GMA.Is_Initialized then |
| 25 |
HW.GFX.GMA.Initialize (Success => success); |
| 26 |
end if; |
| 27 |
if success then |
| 28 |
HW.GFX.GMA.Display_Probing.Read_EDID |
| 29 |
(raw_edid, Active_Port_Type'Val (port), success); |
| 30 |
end if; |
| 31 |
if success then |
| 32 |
return 0; |
| 33 |
else |
| 34 |
return -1; |
| 35 |
end if; |
| 36 |
end if; |
| 37 |
end read_edid; |
| 38 |
|
| 39 |
end GMA; |