Nico Huber has uploaded this change for review. ( https://review.coreboot.org/22707
Change subject: Add Tiling setting to Framebuffer ......................................................................
Add Tiling setting to Framebuffer
Beside linear framebuffers, we can, on Intel hardware, easily support X and Y tiled framebuffers too. If we access the framebuffer through the aperture window, we can let the hardware handle the tiling.
Tiling generally divides the framebuffer into rectangular pieces of fixed size where each piece, or tile, is represented by one page of memory. Even inside one tile, the pixels are not always ordered linearly but either in a row-major (aka. X tiled) or column-major (aka. Y tiled) manner.
Change-Id: I3e6f93caa8f2485a5792d72cfe2e8b3902add7a3 Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx.ads M gfxtest/hw-gfx-gma-gfx_test.adb 2 files changed, 15 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/07/22707/1
diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads index daf648d..ae19235 100644 --- a/common/hw-gfx.ads +++ b/common/hw-gfx.ads @@ -27,24 +27,28 @@ Auto_BPC : constant := 5; subtype BPC_Type is Int64 range Auto_BPC .. 16;
+ type Tiling_Type is (Linear, X_Tiled, Y_Tiled); + type Framebuffer_Type is record - Width : Width_Type; - Height : Height_Type; - BPC : BPC_Type; - Stride : Width_Type; - Offset : Word32; + Width : Width_Type; + Height : Height_Type; + BPC : BPC_Type; + Stride : Width_Type; + Tiling : Tiling_Type; + Offset : Word32; end record;
function FB_Size (FB : Framebuffer_Type) return Pos32 is (FB.Stride * FB.Height * Pos32 (FB.BPC) / (8 / 4));
Default_FB : constant Framebuffer_Type := Framebuffer_Type' - (Width => 1, - Height => 1, - BPC => 8, - Stride => 1, - Offset => 0); + (Width => 1, + Height => 1, + BPC => 8, + Stride => 1, + Tiling => Linear, + Offset => 0);
subtype Frequency_Type is Pos64 range 24_000_000 .. 600_000_000;
diff --git a/gfxtest/hw-gfx-gma-gfx_test.adb b/gfxtest/hw-gfx-gma-gfx_test.adb index d870401..ef6c91d 100644 --- a/gfxtest/hw-gfx-gma-gfx_test.adb +++ b/gfxtest/hw-gfx-gma-gfx_test.adb @@ -157,6 +157,7 @@ Height => Height_Type (Mode.V_Visible), BPC => 8, Stride => Width_Type ((Word32 (Mode.H_Visible) + 15) and not 15), + Tiling => Linear, Offset => Offset); Offset := Offset + Word32 (FB.Stride * FB.Height * 4); end Calc_Framebuffer;