[coreboot-gerrit] Change in libgfxinit[master]: gfx, gma: Move inline functions into private package parts

Nico Huber (Code Review) gerrit at coreboot.org
Sat Jun 2 18:11:51 CEST 2018


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


Change subject: gfx, gma: Move inline functions into private package parts
......................................................................

gfx, gma: Move inline functions into private package parts

Change-Id: I3adb9776e87953997a0cd430f366956dfcb2b6f0
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M common/hw-gfx-gma.ads
M common/hw-gfx.ads
2 files changed, 24 insertions(+), 22 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/64/26764/1

diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index bbcc282..7fccc0e 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;

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

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3adb9776e87953997a0cd430f366956dfcb2b6f0
Gerrit-Change-Number: 26764
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/20180602/ecc46061/attachment.html>


More information about the coreboot-gerrit mailing list