<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26764">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gfx, gma: Move inline functions into private package parts<br><br>Change-Id: I3adb9776e87953997a0cd430f366956dfcb2b6f0<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M common/hw-gfx-gma.ads<br>M common/hw-gfx.ads<br>2 files changed, 24 insertions(+), 22 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/64/26764/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads</span><br><span>index bbcc282..7fccc0e 100644</span><br><span>--- a/common/hw-gfx-gma.ads</span><br><span>+++ b/common/hw-gfx-gma.ads</span><br><span>@@ -134,15 +134,6 @@</span><br><span>       Device_Address : GTT_Address_Type;</span><br><span>       Valid          : Boolean);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   -- For the default framebuffer setup (see below) with 90 degree rotations,</span><br><span style="color: hsl(0, 100%, 40%);">-   -- we expect the offset which is used for the final scanout to be above</span><br><span style="color: hsl(0, 100%, 40%);">-   -- `GTT_Rotation_Offset`. So we can use `Offset - GTT_Rotation_Offset` for</span><br><span style="color: hsl(0, 100%, 40%);">-   -- the physical memory location and aperture mapping.</span><br><span style="color: hsl(0, 100%, 40%);">-   function Phys_Offset (FB : Framebuffer_Type) return Word32 is</span><br><span style="color: hsl(0, 100%, 40%);">-     (if Rotation_90 (FB)</span><br><span style="color: hsl(0, 100%, 40%);">-      then FB.Offset - Word32 (GTT_Rotation_Offset) * GTT_Page_Size</span><br><span style="color: hsl(0, 100%, 40%);">-      else FB.Offset);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    procedure Setup_Default_FB</span><br><span>      (FB       : in     Framebuffer_Type;</span><br><span>       Clear    : in     Boolean := True;</span><br><span>@@ -156,6 +147,15 @@</span><br><span> </span><br><span> private</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   -- For the default framebuffer setup (see below) with 90 degree rotations,</span><br><span style="color: hsl(120, 100%, 40%);">+   -- we expect the offset which is used for the final scanout to be above</span><br><span style="color: hsl(120, 100%, 40%);">+   -- `GTT_Rotation_Offset`. So we can use `Offset - GTT_Rotation_Offset` for</span><br><span style="color: hsl(120, 100%, 40%);">+   -- the physical memory location and aperture mapping.</span><br><span style="color: hsl(120, 100%, 40%);">+   function Phys_Offset (FB : Framebuffer_Type) return Word32 is</span><br><span style="color: hsl(120, 100%, 40%);">+     (if Rotation_90 (FB)</span><br><span style="color: hsl(120, 100%, 40%);">+      then FB.Offset - Word32 (GTT_Rotation_Offset) * GTT_Page_Size</span><br><span style="color: hsl(120, 100%, 40%);">+      else FB.Offset);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    ----------------------------------------------------------------------------</span><br><span>    -- State tracking for the currently configured pipes</span><br><span> </span><br><span>diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads</span><br><span>index 7403a86..1464b97 100644</span><br><span>--- a/common/hw-gfx.ads</span><br><span>+++ b/common/hw-gfx.ads</span><br><span>@@ -51,19 +51,6 @@</span><br><span>       Offset   : Word32;</span><br><span>    end record;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   function Rotation_90 (FB : Framebuffer_Type) return Boolean is</span><br><span style="color: hsl(0, 100%, 40%);">-     (FB.Rotation = Rotated_90 or FB.Rotation = Rotated_270);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   function Rotated_Width (FB : Framebuffer_Type) return Pos16 is</span><br><span style="color: hsl(0, 100%, 40%);">-     (if Rotation_90 (FB) then Pos16 (FB.Height) else Pos16 (FB.Width));</span><br><span style="color: hsl(0, 100%, 40%);">-   function Rotated_Height (FB : Framebuffer_Type) return Pos16 is</span><br><span style="color: hsl(0, 100%, 40%);">-     (if Rotation_90 (FB) then Pos16 (FB.Width) else Pos16 (FB.Height));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)</span><br><span style="color: hsl(0, 100%, 40%);">-      return Int32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));</span><br><span style="color: hsl(0, 100%, 40%);">-   function FB_Size (FB : Framebuffer_Type) return Pos32 is</span><br><span style="color: hsl(0, 100%, 40%);">-     (Pixel_To_Bytes (FB.Stride * FB.V_Stride, FB));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    Default_FB : constant Framebuffer_Type := Framebuffer_Type'</span><br><span>      (Width    => 1,</span><br><span>       Height   => 1,</span><br><span>@@ -190,4 +177,19 @@</span><br><span>    Invalid_Mode : constant Mode_Type := Mode_Type'</span><br><span>       (Frequency_Type'First, 1, 1, 1, 1, 1, 1, 1, 1, False, False, Auto_BPC);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   function Rotation_90 (FB : Framebuffer_Type) return Boolean is</span><br><span style="color: hsl(120, 100%, 40%);">+     (FB.Rotation = Rotated_90 or FB.Rotation = Rotated_270);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   function Rotated_Width (FB : Framebuffer_Type) return Pos16 is</span><br><span style="color: hsl(120, 100%, 40%);">+     (if Rotation_90 (FB) then Pos16 (FB.Height) else Pos16 (FB.Width));</span><br><span style="color: hsl(120, 100%, 40%);">+   function Rotated_Height (FB : Framebuffer_Type) return Pos16 is</span><br><span style="color: hsl(120, 100%, 40%);">+     (if Rotation_90 (FB) then Pos16 (FB.Width) else Pos16 (FB.Height));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)</span><br><span style="color: hsl(120, 100%, 40%);">+      return Int32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));</span><br><span style="color: hsl(120, 100%, 40%);">+   function FB_Size (FB : Framebuffer_Type) return Pos32 is</span><br><span style="color: hsl(120, 100%, 40%);">+     (Pixel_To_Bytes (FB.Stride * FB.V_Stride, FB));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> end HW.GFX;</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26764">change 26764</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/26764"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libgfxinit </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3adb9776e87953997a0cd430f366956dfcb2b6f0 </div>
<div style="display:none"> Gerrit-Change-Number: 26764 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>