[coreboot-gerrit] Change in libgfxinit[master]: Add Tiling setting to Framebuffer

Nico Huber (Code Review) gerrit at coreboot.org
Tue Dec 5 13:05:27 CET 2017


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 at 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;

-- 
To view, visit https://review.coreboot.org/22707
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e6f93caa8f2485a5792d72cfe2e8b3902add7a3
Gerrit-Change-Number: 22707
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171205/8b9f485f/attachment-0001.html>


More information about the coreboot-gerrit mailing list