gma: Add support for rotated framebuffers
As for the tiling, we enable support for rotated framebuffers on
platforms with Plane_Control. On every path where a rotated frame-
buffer may be expected, we have to exchange width and height in
case of 90 degree rotations. Beside the rotation setting itself,
the hardware needs to know the vertical stride instead of the hori-
zontal and a delicate page mapping in case of 90 degree rotations.
For that we divide the GTT space into two, the lower half contains
the linear mappings, the upper half mappings for a rotated scanout.
Change-Id: I1c901b7abc0fe7764bee87f6fda58ba9fa3f340d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22711
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/common/hw-gfx-gma-config_helpers.ads b/common/hw-gfx-gma-config_helpers.ads
index a9cde2b..e684f22 100644
--- a/common/hw-gfx-gma-config_helpers.ads
+++ b/common/hw-gfx-gma-config_helpers.ads
@@ -40,14 +40,16 @@
use type HW.Pos32;
pragma Warnings (GNAT, On, """Integer_32"" is already use-visible *");
function Validate_Config
- (Framebuffer : Framebuffer_Type;
- Port_Cfg : Port_Config;
- Pipe : Pipe_Index)
+ (FB : Framebuffer_Type;
+ Port_Cfg : Port_Config;
+ Pipe : Pipe_Index)
return Boolean
with
Post =>
(if Validate_Config'Result then
- Framebuffer.Width <= Pos32 (Port_Cfg.Mode.H_Visible) and
- Framebuffer.Height <= Pos32 (Port_Cfg.Mode.V_Visible));
+ Rotated_Width (FB) <= Port_Cfg.Mode.H_Visible and
+ Rotated_Height (FB) <= Port_Cfg.Mode.V_Visible and
+ (FB.Offset = VGA_PLANE_FRAMEBUFFER_OFFSET or
+ FB.Height <= FB.V_Stride));
end HW.GFX.GMA.Config_Helpers;