<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22710">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Add Rotation setting to Framebuffer<br><br>Add a Rotation setting to the Framebuffer type that tells us if the<br>framebuffer is rotated by 90, 180 or 270 degrees. The hardware should<br>rotate the picture in the opposite direction before display.<br><br>To support more complex memory layouts, we also add a V_Stride (ver-<br>tical stride) setting.<br><br>Change-Id: I6430fb44b5c9cfcf9fa58684a425e8c2e4647ac3<br>Signed-off-by: Nico Huber <nico.huber@secunet.com><br>---<br>M common/hw-gfx.ads<br>M gfxtest/hw-gfx-gma-gfx_test.adb<br>2 files changed, 13 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/10/22710/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads<br>index 67662ed..5594b18 100644<br>--- a/common/hw-gfx.ads<br>+++ b/common/hw-gfx.ads<br>@@ -23,9 +23,9 @@<br> -- such that the count of pixels in any framebuffer may fit<br> subtype Pixel_Type is Pos32 range 1 .. 8192 * 8192;<br> <br>- -- implementation only supports 4800p for now ;-)<br>- subtype Width_Type is Pos32 range 1 .. 4800;<br>- subtype Height_Type is Pos32 range 1 .. 7680;<br>+ -- Allow same range for width and height (for rotated framebuffers)<br>+ subtype Width_Type is Pos32 range 1 .. 8192;<br>+ subtype Height_Type is Pos32 range 1 .. 8192;<br> <br> Auto_BPC : constant := 5;<br> subtype BPC_Type is Int64 range Auto_BPC .. 16;<br>@@ -33,27 +33,33 @@<br> type Tiling_Type is (Linear, X_Tiled, Y_Tiled);<br> subtype XY_Tiling is Tiling_Type range X_Tiled .. Y_Tiled;<br> <br>+ type Rotation_Type is (No_Rotation, Rotated_90, Rotated_180, Rotated_270);<br>+<br> type Framebuffer_Type is<br> record<br> Width : Width_Type;<br> Height : Height_Type;<br> BPC : BPC_Type;<br> Stride : Width_Type;<br>+ V_Stride : Height_Type;<br> Tiling : Tiling_Type;<br>+ Rotation : Rotation_Type;<br> Offset : Word32;<br> end record;<br> <br> function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)<br> return Pos32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));<br> function FB_Size (FB : Framebuffer_Type) return Pos32 is<br>- (Pixel_To_Bytes (FB.Stride * FB.Height, FB));<br>+ (Pixel_To_Bytes (FB.Stride * FB.V_Stride, FB));<br> <br> Default_FB : constant Framebuffer_Type := Framebuffer_Type'<br> (Width => 1,<br> Height => 1,<br> BPC => 8,<br> Stride => 1,<br>+ V_Stride => 1,<br> Tiling => Linear,<br>+ Rotation => No_Rotation,<br> Offset => 0);<br> <br> subtype Frequency_Type is Pos64 range 24_000_000 .. 600_000_000;<br>diff --git a/gfxtest/hw-gfx-gma-gfx_test.adb b/gfxtest/hw-gfx-gma-gfx_test.adb<br>index ef6c91d..9a5ce0a 100644<br>--- a/gfxtest/hw-gfx-gma-gfx_test.adb<br>+++ b/gfxtest/hw-gfx-gma-gfx_test.adb<br>@@ -157,9 +157,11 @@<br> Height => Height_Type (Mode.V_Visible),<br> BPC => 8,<br> Stride => Width_Type ((Word32 (Mode.H_Visible) + 15) and not 15),<br>+ V_Stride => Height_Type (Mode.V_Visible),<br> Tiling => Linear,<br>+ Rotation => No_Rotation,<br> Offset => Offset);<br>- Offset := Offset + Word32 (FB.Stride * FB.Height * 4);<br>+ Offset := Offset + Word32 (FB_Size (FB));<br> end Calc_Framebuffer;<br> <br> Pipes : GMA.Pipe_Configs;<br></pre><p>To view, visit <a href="https://review.coreboot.org/22710">change 22710</a>. To unsubscribe, 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/22710"/><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: I6430fb44b5c9cfcf9fa58684a425e8c2e4647ac3 </div>
<div style="display:none"> Gerrit-Change-Number: 22710 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>