[coreboot-gerrit] Change in libgfxinit[master]: gfx: Introduce Size_Type for framebuffer size in bytes
Nico Huber (Code Review)
gerrit at coreboot.org
Tue Jun 5 15:38:20 CEST 2018
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/26865
Change subject: gfx: Introduce Size_Type for framebuffer size in bytes
......................................................................
gfx: Introduce Size_Type for framebuffer size in bytes
Change-Id: I8809a887b12124e5331f188dfa1674cbcca7152e
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M common/hw-gfx.ads
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/65/26865/1
diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads
index cff3e18..93a3684 100644
--- a/common/hw-gfx.ads
+++ b/common/hw-gfx.ads
@@ -24,6 +24,9 @@
subtype Pixel_Type is Int32 range 0 .. 8192 * 8192;
subtype Pos_Pixel_Type is Pixel_Type range 1 .. Pixel_Type'Last;
+ -- assume at most 8 bytes per pixel
+ subtype Size_Type is Int32 range 0 .. Pixel_Type'Last * 8;
+
-- Allow same range for width and height (for rotated framebuffers)
subtype Width_Type is Pos32 range 1 .. 8192;
subtype Height_Type is Pos32 range 1 .. 8192;
@@ -188,7 +191,7 @@
(if Rotation_90 (FB) then FB.Width else FB.Height);
function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)
- return Int32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));
+ return Size_Type is (Pixel * Pos32 (FB.BPC) / (8 / 4));
function FB_Size (FB : Framebuffer_Type)
return Pos32 is (Pixel_To_Bytes (FB.Stride * FB.V_Stride, FB));
--
To view, visit https://review.coreboot.org/26865
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8809a887b12124e5331f188dfa1674cbcca7152e
Gerrit-Change-Number: 26865
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/20180605/ec3d0fe0/attachment.html>
More information about the coreboot-gerrit
mailing list