gfx, gma: Move inline functions into private package parts
Change-Id: I3adb9776e87953997a0cd430f366956dfcb2b6f0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/26764
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 2cc28a6..dffb81a 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -134,15 +134,6 @@
Device_Address : GTT_Address_Type;
Valid : Boolean);
- -- For the default framebuffer setup (see below) with 90 degree rotations,
- -- we expect the offset which is used for the final scanout to be above
- -- `GTT_Rotation_Offset`. So we can use `Offset - GTT_Rotation_Offset` for
- -- the physical memory location and aperture mapping.
- function Phys_Offset (FB : Framebuffer_Type) return Word32 is
- (if Rotation_90 (FB)
- then FB.Offset - Word32 (GTT_Rotation_Offset) * GTT_Page_Size
- else FB.Offset);
-
procedure Setup_Default_FB
(FB : in Framebuffer_Type;
Clear : in Boolean := True;
@@ -156,6 +147,15 @@
private
+ -- For the default framebuffer setup (see below) with 90 degree rotations,
+ -- we expect the offset which is used for the final scanout to be above
+ -- `GTT_Rotation_Offset`. So we can use `Offset - GTT_Rotation_Offset` for
+ -- the physical memory location and aperture mapping.
+ function Phys_Offset (FB : Framebuffer_Type) return Word32 is
+ (if Rotation_90 (FB)
+ then FB.Offset - Word32 (GTT_Rotation_Offset) * GTT_Page_Size
+ else FB.Offset);
+
----------------------------------------------------------------------------
-- State tracking for the currently configured pipes
diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads
index 7403a86..1464b97 100644
--- a/common/hw-gfx.ads
+++ b/common/hw-gfx.ads
@@ -51,19 +51,6 @@
Offset : Word32;
end record;
- function Rotation_90 (FB : Framebuffer_Type) return Boolean is
- (FB.Rotation = Rotated_90 or FB.Rotation = Rotated_270);
-
- function Rotated_Width (FB : Framebuffer_Type) return Pos16 is
- (if Rotation_90 (FB) then Pos16 (FB.Height) else Pos16 (FB.Width));
- function Rotated_Height (FB : Framebuffer_Type) return Pos16 is
- (if Rotation_90 (FB) then Pos16 (FB.Width) else Pos16 (FB.Height));
-
- function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)
- return Int32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));
- function FB_Size (FB : Framebuffer_Type) return Pos32 is
- (Pixel_To_Bytes (FB.Stride * FB.V_Stride, FB));
-
Default_FB : constant Framebuffer_Type := Framebuffer_Type'
(Width => 1,
Height => 1,
@@ -190,4 +177,19 @@
Invalid_Mode : constant Mode_Type := Mode_Type'
(Frequency_Type'First, 1, 1, 1, 1, 1, 1, 1, 1, False, False, Auto_BPC);
+private
+
+ function Rotation_90 (FB : Framebuffer_Type) return Boolean is
+ (FB.Rotation = Rotated_90 or FB.Rotation = Rotated_270);
+
+ function Rotated_Width (FB : Framebuffer_Type) return Pos16 is
+ (if Rotation_90 (FB) then Pos16 (FB.Height) else Pos16 (FB.Width));
+ function Rotated_Height (FB : Framebuffer_Type) return Pos16 is
+ (if Rotation_90 (FB) then Pos16 (FB.Width) else Pos16 (FB.Height));
+
+ function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)
+ return Int32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));
+ function FB_Size (FB : Framebuffer_Type) return Pos32 is
+ (Pixel_To_Bytes (FB.Stride * FB.V_Stride, FB));
+
end HW.GFX;