[coreboot-gerrit] Change in coreboot[master]: drivers/intel/gma: Depend less on default fb values

Nico Huber (Code Review) gerrit at coreboot.org
Thu Mar 29 16:44:23 CEST 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/25452


Change subject: drivers/intel/gma: Depend less on default fb values
......................................................................

drivers/intel/gma: Depend less on default fb values

Instead of hard-coding a lot of default values of the framebuffer config,
we use the values provided by Display_Probing.Scan_Ports() and only
overwrite what is necessary. This way we are more independent from
changes inside libgfxinit.

Change-Id: I121bbd926532c27321446282aa334cc45cdbeef1
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M src/drivers/intel/gma/hires_fb/gma.adb
M src/drivers/intel/gma/text_fb/gma.adb
2 files changed, 10 insertions(+), 12 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/25452/1

diff --git a/src/drivers/intel/gma/hires_fb/gma.adb b/src/drivers/intel/gma/hires_fb/gma.adb
index 086da9b..839d2d3 100644
--- a/src/drivers/intel/gma/hires_fb/gma.adb
+++ b/src/drivers/intel/gma/hires_fb/gma.adb
@@ -79,12 +79,11 @@
                min_v := pos16'min (min_v, configs (i).Mode.V_Visible);
             end loop;
 
-            fb :=
-               (Width   => Width_Type (min_h),
-                Height  => Height_Type (min_v),
-                BPC     => 8,
-                Stride  => Div_Round_Up (Width_Type (min_h), 16) * 16,
-                Offset  => 0);
+            fb := configs (Primary).Framebuffer;
+            fb.Width    := Width_Type (min_h);
+            fb.Height   := Height_Type (min_v);
+            fb.Stride   := Div_Round_Up (fb.Width, 16) * 16;
+
             for i in Pipe_Index loop
                exit when configs (i).Port = Disabled;
 
diff --git a/src/drivers/intel/gma/text_fb/gma.adb b/src/drivers/intel/gma/text_fb/gma.adb
index 8f61d1d..145b9a0 100644
--- a/src/drivers/intel/gma/text_fb/gma.adb
+++ b/src/drivers/intel/gma/text_fb/gma.adb
@@ -51,12 +51,11 @@
             vga_io_init;
             vga_textmode_init;
 
-            configs (Primary).Framebuffer :=
-              (Width    => 640,
-               Height   => 400,
-               BPC      => Auto_BPC,   -- ignored for VGA plane
-               Stride   => 320,        -- ignored
-               Offset   => VGA_PLANE_FRAMEBUFFER_OFFSET);
+            -- 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);

-- 
To view, visit https://review.coreboot.org/25452
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I121bbd926532c27321446282aa334cc45cdbeef1
Gerrit-Change-Number: 25452
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180329/9d91d051/attachment-0001.html>


More information about the coreboot-gerrit mailing list