summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2016-11-08 12:29:50 +0100
committerNico Huber <nico.h@gmx.de>2016-12-19 16:11:35 +0100
commita4facf80f2df7ebd51d512c4091ab8df24bb71c9 (patch)
tree93a5d1499c1d2a466cf02d32d0d217ee6e693826 /src
parent66203df660ad2230389597a942f5252074a33aac (diff)
downloadcoreboot-a4facf80f2df7ebd51d512c4091ab8df24bb71c9.tar.xz
drivers/intel/gma: Use scaling to simplify fb config
Utilize libgfxinit's support for scaling to simplify the framebuffer configuration. In case of multiple displays of different resolutions, we had configured one framebuffer big enough for their union, each display only showing its respective upper left window. Instead, we use the smallest resolution now and show the whole image on all displays. Change-Id: I70a9d92f88ef891703829945264f94ac7eff09b0 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/17492 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src')
-rw-r--r--src/drivers/intel/gma/hires_fb/gma.adb29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/drivers/intel/gma/hires_fb/gma.adb b/src/drivers/intel/gma/hires_fb/gma.adb
index 7ebc4f88bc..87e0900981 100644
--- a/src/drivers/intel/gma/hires_fb/gma.adb
+++ b/src/drivers/intel/gma/hires_fb/gma.adb
@@ -59,9 +59,8 @@ is
success : boolean;
- stride : Width_Type;
- max_h : pos16 := 1;
- max_v : pos16 := 1;
+ min_h : pos16 := pos16'last;
+ min_v : pos16 := pos16'last;
begin
lightup_ok := 0;
@@ -77,30 +76,24 @@ is
for i in Config_Index loop
exit when configs (i).Port = Disabled;
- max_h := pos16'max (max_h, configs (i).Mode.H_Visible);
- max_v := pos16'max (max_v, configs (i).Mode.V_Visible);
+ min_h := pos16'min (min_h, configs (i).Mode.H_Visible);
+ min_v := pos16'min (min_v, configs (i).Mode.V_Visible);
end loop;
- stride := ((Width_Type (max_h) + 63) / 64) * 64;
+ fb :=
+ (Width => Width_Type (min_h),
+ Height => Height_Type (min_v),
+ BPC => 8,
+ Stride => ((Width_Type (min_h) + 63) / 64) * 64,
+ Offset => 0);
for i in Config_Index loop
exit when configs (i).Port = Disabled;
- configs (i).Framebuffer :=
- (Width => Width_Type (configs (i).Mode.H_Visible),
- Height => Height_Type (configs (i).Mode.V_Visible),
- BPC => 8,
- Stride => stride,
- Offset => 0);
+ configs (i).Framebuffer := fb;
end loop;
HW.GFX.GMA.Dump_Configs (configs);
- fb :=
- (Width => Width_Type (max_h),
- Height => Height_Type (max_v),
- BPC => 8,
- Stride => stride,
- Offset => 0);
HW.GFX.GMA.Setup_Default_GTT (fb, phys_fb);
HW.GFX.Framebuffer_Filler.Fill (linear_fb, fb);