From 9ca69f14ba6bfaf04767f7bd89a631f8382ac32a Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 28 Aug 2017 14:31:46 +0200 Subject: [PATCH] gfx_test: Add top marker for rotated framebuffers Mark the top with an arrow. Desperately needs anti aliasing. Change-Id: Ide0e06c29fefc8b5288714d53ee9fa15df2d5452 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/22714 Reviewed-by: Stefan Reinauer Tested-by: Stefan Reinauer --- gfxtest/hw-gfx-gma-gfx_test.adb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gfxtest/hw-gfx-gma-gfx_test.adb b/gfxtest/hw-gfx-gma-gfx_test.adb index e0ad71fe22..514e60fa87 100644 --- a/gfxtest/hw-gfx-gma-gfx_test.adb +++ b/gfxtest/hw-gfx-gma-gfx_test.adb @@ -160,6 +160,19 @@ is -- We have pixel offset wheras the framebuffer has a byte offset Offset_Y : Natural := Natural (Framebuffer.Offset / 4); Offset : Natural; + + function Top_Test (X, Y : Natural) return Boolean + is + C : constant Natural := Natural (Framebuffer.Width) / 2; + S_Y : constant Natural := 3 * Y / 2; + Left : constant Integer := X - C + S_Y; + Right : constant Integer := X - C - S_Y; + begin + return + Y < 12 and + ((-1 <= Left and Left <= 0) or + (0 <= Right and Right <= 1)); + end Top_Test; begin for Y in 0 .. Natural (Framebuffer.Height) - 1 loop Offset := Offset_Y; @@ -168,6 +181,10 @@ is (Y < 32 or Y >= Natural (Framebuffer.Height) - 32) then P := Corner_Fill (X, Y, Framebuffer, Pipe); + elsif Framebuffer.Rotation /= No_Rotation and then + Top_Test (X, Y) + then + P := White; elsif Y mod 16 = 0 or X mod 16 = 0 then P := Black; else