<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22712">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gfx_test: Add corner markers to test screen<br><br>Show a white-framed square with rotating colors in each corner.<br><br>Change-Id: Ifcd20a3f531c9cebcaf0e7502a76ffb7ff6ca4f8<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M gfxtest/hw-gfx-gma-gfx_test.adb<br>1 file changed, 38 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/12/22712/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/gfxtest/hw-gfx-gma-gfx_test.adb b/gfxtest/hw-gfx-gma-gfx_test.adb<br>index 9a5ce0a..4016664 100644<br>--- a/gfxtest/hw-gfx-gma-gfx_test.adb<br>+++ b/gfxtest/hw-gfx-gma-gfx_test.adb<br>@@ -56,6 +56,12 @@<br>       Alpha at 3 range 0 .. 7;<br>    end record;<br> <br>+   White : constant Pixel_Type := (255, 255, 255, 255);<br>+   Black : constant Pixel_Type := (  0,   0,   0, 255);<br>+   Red   : constant Pixel_Type := (255,   0,   0, 255);<br>+   Green : constant Pixel_Type := (  0, 255,   0, 255);<br>+   Blue  : constant Pixel_Type := (  0,   0, 255, 255);<br>+<br>    function Pixel_To_Word (P : Pixel_Type) return Word32<br>    with<br>       SPARK_Mode => Off<br>@@ -96,10 +102,35 @@<br>       end loop;<br>    end Restore_Screen;<br> <br>+   function Corner_Fill<br>+     (X, Y  : Natural;<br>+      FB    : Framebuffer_Type;<br>+      Pipe  : Pipe_Index)<br>+      return Pixel_Type<br>+   is<br>+      Xrel : constant Integer :=<br>+        (if X < 32 then X else X - (Natural (FB.Width) - 32));<br>+      Yrel : constant Integer :=<br>+        (if Y < 32 then Y else Y - (Natural (FB.Height) - 32));<br>+<br>+      function Color (Idx : Natural) return Pixel_Type is<br>+        (case (Idx + Pipe_Index'Pos (Pipe)) mod 4 is<br>+            when 0 => Blue,   when      1 => Black,<br>+            when 3 => Green,  when others => Red);<br>+   begin<br>+      return<br>+        (if Xrel mod 16 = 0 or Xrel = 31 or Yrel mod 16 = 0 or Yrel = 31 then<br>+            White<br>+         elsif Yrel < 16 then<br>+           (if Xrel < 16 then Color (0) else Color (1))<br>+         else<br>+           (if Xrel < 16 then Color (3) else Color (2)));<br>+   end Corner_Fill;<br>+<br>    function Fill<br>      (X, Y        : Natural;<br>       Framebuffer : Framebuffer_Type;<br>-      Pipe        : GMA.Pipe_Index)<br>+      Pipe        : Pipe_Index)<br>       return Pixel_Type<br>    is<br>       use type HW.Byte;<br>@@ -133,8 +164,12 @@<br>       for Y in 0 .. Natural (Framebuffer.Height) - 1 loop<br>          Offset := Offset_Y;<br>          for X in 0 .. Natural (Framebuffer.Width) - 1 loop<br>-            if Y mod 16 = 0 or X mod 16 = 0 then<br>-               P := (0, 0, 0, 0);<br>+            if (X < 32 or X >= Natural (Framebuffer.Width) - 32) and<br>+               (Y < 32 or Y >= Natural (Framebuffer.Height) - 32)<br>+            then<br>+               P := Corner_Fill (X, Y, Framebuffer, Pipe);<br>+            elsif Y mod 16 = 0 or X mod 16 = 0 then<br>+               P := Black;<br>             else<br>                P := Fill (X, Y, Framebuffer, Pipe);<br>             end if;<br></pre><p>To view, visit <a href="https://review.coreboot.org/22712">change 22712</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/22712"/><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: Ifcd20a3f531c9cebcaf0e7502a76ffb7ff6ca4f8 </div>
<div style="display:none"> Gerrit-Change-Number: 22712 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>