mb/google/brya: Create rull variant
[coreboot2.git] / src / drivers / intel / gma / gma.adb
blob43fc7b28a797711a6dcaf62705eb7b22d5fbd6df
1 -- SPDX-License-Identifier: GPL-2.0-only
3 with HW.GFX.GMA;
4 with HW.GFX.GMA.Display_Probing;
6 use HW.GFX.GMA;
8 package body GMA is
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
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;
39 end GMA;