aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/gma/text_fb/gma-gfx_init.adb
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-02-18 01:21:11 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-03-27 08:31:07 +0000
commit7458629de369a220ea24afdfbf5f1dc9fdc36a5e (patch)
treecc1ced64184e7f69914d52a438d01e4c4f777b36 /src/drivers/intel/gma/text_fb/gma-gfx_init.adb
parentfde7c317c2a6db0c35005b598042dd5509743207 (diff)
drivers/intel/gma: Move gfxinit into sub package
Move the actual graphics init provided by libgfxinit into a sub package `GMA.GFX_Init`. This way it can be compiled in individually. Change-Id: Ib413a0d70c8dc305f4476c1d5aee6b81ff880bec Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31456 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/intel/gma/text_fb/gma-gfx_init.adb')
-rw-r--r--src/drivers/intel/gma/text_fb/gma-gfx_init.adb68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/drivers/intel/gma/text_fb/gma-gfx_init.adb b/src/drivers/intel/gma/text_fb/gma-gfx_init.adb
new file mode 100644
index 0000000000..038b76b26a
--- /dev/null
+++ b/src/drivers/intel/gma/text_fb/gma-gfx_init.adb
@@ -0,0 +1,68 @@
+with HW.GFX;
+with HW.GFX.GMA;
+with HW.GFX.GMA.Display_Probing;
+
+use HW.GFX;
+use HW.GFX.GMA;
+use HW.GFX.GMA.Display_Probing;
+
+with GMA.Mainboard;
+
+package body GMA.GFX_Init
+is
+
+ function fill_lb_framebuffer
+ (framebuffer : in out lb_framebuffer)
+ return Interfaces.C.int
+ is
+ use type Interfaces.C.int;
+ begin
+ return -1;
+ end fill_lb_framebuffer;
+
+ ----------------------------------------------------------------------------
+
+ procedure gfxinit (lightup_ok : out Interfaces.C.int)
+ is
+ ports : Port_List;
+ configs : Pipe_Configs;
+
+ success : boolean;
+
+ -- from pc80/vga driver
+ procedure vga_io_init;
+ pragma Import (C, vga_io_init, "vga_io_init");
+ procedure vga_textmode_init;
+ pragma Import (C, vga_textmode_init, "vga_textmode_init");
+ begin
+ lightup_ok := 0;
+
+ HW.GFX.GMA.Initialize (Success => success);
+
+ if success then
+ ports := Mainboard.ports;
+ HW.GFX.GMA.Display_Probing.Scan_Ports
+ (Configs => configs,
+ Ports => ports,
+ Max_Pipe => Primary);
+
+ if configs (Primary).Port /= Disabled then
+ HW.GFX.GMA.Power_Up_VGA;
+ vga_io_init;
+ vga_textmode_init;
+
+ -- override probed framebuffer config
+ configs (Primary).Framebuffer.Width := 640;
+ configs (Primary).Framebuffer.Height := 400;
+ configs (Primary).Framebuffer.Offset :=
+ VGA_PLANE_FRAMEBUFFER_OFFSET;
+
+ HW.GFX.GMA.Dump_Configs (configs);
+ HW.GFX.GMA.Update_Outputs (configs);
+
+ lightup_ok := 1;
+ end if;
+ end if;
+ end gfxinit;
+
+end GMA.GFX_Init;