Add Start_X and Start_Y offsets for framebuffer panning

For tiled modes, the offsets add to the stride. To keep things simple,
we always assume that they are accounted for (even in linear mode).

To make the panning visible, the offsets are added in `gfx_test` and
the test image is drawn larger by two times the offsets. Also add the
new parameters to Dump_Configs() along with the forgotten tiling and
rotation parameters.

Change-Id: I5d1e1f2ed8b1872a2b82be23a6a622d948f7831f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22866
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 77def8e..c35c687 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -177,14 +177,14 @@
    Tile_Rows : constant array (Tiling_Type) of Pos32 :=
      (Linear => 1, X_Tiled => 8, Y_Tiled => 32);
 
-   function FB_Pitch (Px : Pixel_Type; FB : Framebuffer_Type) return Natural is
-     (Natural (Div_Round_Up
-        (Pixel_To_Bytes (Px, FB), Tile_Width (FB.Tiling) * 4)));
+   function FB_Pitch (Px : Pos_Pixel_Type; FB : Framebuffer_Type) return Natural
+      is (Natural (Div_Round_Up
+           (Pixel_To_Bytes (Px, FB), Tile_Width (FB.Tiling) * 4)));
 
    function Valid_Stride (FB : Framebuffer_Type) return Boolean is
-     (FB.Width <= FB.Stride and
+     (FB.Width + FB.Start_X <= FB.Stride and
       Pixel_To_Bytes (FB.Stride, FB) mod (Tile_Width (FB.Tiling) * 4) = 0 and
-      FB.Height <= FB.V_Stride and
+      FB.Height + FB.Start_Y <= FB.V_Stride and
       FB.V_Stride mod Tile_Rows (FB.Tiling) = 0);
 
 end HW.GFX.GMA;