gma config: Fix framebuffer alignment check

The framebuffer stride has to be aligned to one cacheline (i.e.
64 bytes) and not to 64 pixels.

Change-Id: I8016b6c03b7908aff3ae72601d8d68cba065c7a0
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17957
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Nico Huber
2016-12-23 13:00:49 +01:00
committed by Nico Huber
parent 793a8d49af
commit d6d6f6b366

View File

@@ -188,12 +188,16 @@ is
Pipe : Pipe_Index)
return Boolean
is
function To_Bytes (Pixels : Width_Type) return Pos32 is
begin
return Pos32 (Pixels) * 4 * Pos32 (Framebuffer.BPC) / 8;
end To_Bytes;
begin
-- No downscaling
-- Respect maximum scalable width
-- VGA plane is only allowed on the primary pipe
-- Only 32bpp RGB (ignored for VGA plane)
-- Stride must be a multiple of 64 (ignored for VGA plane)
-- Stride must be a multiple of 64 bytes (ignored for VGA plane)
return
((Framebuffer.Width = Pos32 (Port_Cfg.Mode.H_Visible) and
Framebuffer.Height = Pos32 (Port_Cfg.Mode.V_Visible)) or
@@ -204,7 +208,7 @@ is
and
(Framebuffer.Offset = VGA_PLANE_FRAMEBUFFER_OFFSET or
(Framebuffer.BPC = 8 and
Framebuffer.Stride mod 64 = 0));
To_Bytes (Framebuffer.Stride) mod 64 = 0));
end Validate_Config;
end HW.GFX.GMA.Config_Helpers;