Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84056?usp=email )
Change subject: drivers/intel/gma: Fix mismatching types for fb_add_framebuffer_info ......................................................................
drivers/intel/gma: Fix mismatching types for fb_add_framebuffer_info
GCC LTO found this.
Change-Id: I2d5a9a86dbb91a5505891a30c6e9072b1b4dfc92 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/drivers/intel/gma/gma-gfx_init.ads M src/drivers/intel/gma/hires_fb/gma-gfx_init.adb 2 files changed, 65 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/84056/1
diff --git a/src/drivers/intel/gma/gma-gfx_init.ads b/src/drivers/intel/gma/gma-gfx_init.ads index 88f64d9..dff0042 100644 --- a/src/drivers/intel/gma/gma-gfx_init.ads +++ b/src/drivers/intel/gma/gma-gfx_init.ads @@ -16,14 +16,75 @@
----------------------------------------------------------------------------
+ type List_Node; + type List_Node_Access is access all List_Node; + + type List_Node is record + Next : List_Node_Access; + Prev : List_Node_Access; + end record; + pragma Convention (C, List_Node); -- Ensure C compatibility + + type LB_FB_Orientation is (LB_FB_ORIENTATION_NORMAL, + LB_FB_ORIENTATION_BOTTOM_UP, + LB_FB_ORIENTATION_LEFT_UP, + LB_FB_ORIENTATION_RIGHT_UP); + for LB_FB_Orientation use + (LB_FB_ORIENTATION_NORMAL => 0, + LB_FB_ORIENTATION_BOTTOM_UP => 1, + LB_FB_ORIENTATION_LEFT_UP => 2, + LB_FB_ORIENTATION_RIGHT_UP => 3); + pragma Convention (C, LB_FB_Orientation); -- Ensure C compatibility + + type LB_Framebuffer_Flags is record + Has_External_Display : Interfaces.Unsigned_8 range 0..1; + Reserved : Interfaces.Unsigned_8 range 0..127; + end record; + pragma Convention (C, LB_Framebuffer_Flags); -- Ensure C compatibility + for LB_Framebuffer_Flags'Alignment use 1; + for LB_Framebuffer_Flags use + record + Has_External_Display at 0 range 0 .. 0; + Reserved at 0 range 1 .. 7; + end record; + + type LB_Framebuffer is record + Tag : Interfaces.Unsigned_32; + Size : Interfaces.Unsigned_32; + Physical_Address : Interfaces.Unsigned_64; + X_Resolution : Interfaces.Unsigned_32; + Y_Resolution : Interfaces.Unsigned_32; + Bytes_Per_Line : Interfaces.Unsigned_32; + Bits_Per_Pixel : Interfaces.Unsigned_8; + Red_Mask_Pos : Interfaces.Unsigned_8; + Red_Mask_Size : Interfaces.Unsigned_8; + Green_Mask_Pos : Interfaces.Unsigned_8; + Green_Mask_Size : Interfaces.Unsigned_8; + Blue_Mask_Pos : Interfaces.Unsigned_8; + Blue_Mask_Size : Interfaces.Unsigned_8; + Reserved_Mask_Pos: Interfaces.Unsigned_8; + Reserved_Mask_Size: Interfaces.Unsigned_8; + Orientation : LB_FB_Orientation; + Flags : LB_Framebuffer_Flags; + Pad : Interfaces.Unsigned_8; + end record; + pragma Convention (C, LB_Framebuffer); -- Ensure C compatibility + + type Fb_Info is record + Node : List_Node; + FB : LB_Framebuffer; + end record; + pragma Convention (C, Fb_Info); -- Ensure C compatibility + + type Fb_Info_Ptr is access all Fb_Info; + function c_fb_add_framebuffer_info (fb_addr: Interfaces.C.size_t; x_resolution : word32; y_resolution : word32; bytes_per_line : word32; bits_per_pixel : word8) - return Interfaces.C.size_t; + return Fb_Info_Ptr;
pragma import (C, c_fb_add_framebuffer_info, "fb_add_framebuffer_info"); - end GMA.GFX_Init; diff --git a/src/drivers/intel/gma/hires_fb/gma-gfx_init.adb b/src/drivers/intel/gma/hires_fb/gma-gfx_init.adb index ae0b0b7..0afba8a 100644 --- a/src/drivers/intel/gma/hires_fb/gma-gfx_init.adb +++ b/src/drivers/intel/gma/hires_fb/gma-gfx_init.adb @@ -39,7 +39,7 @@ min_h : pos32 := Config.LINEAR_FRAMEBUFFER_MAX_WIDTH; min_v : pos32 := Config.LINEAR_FRAMEBUFFER_MAX_HEIGHT;
- fbinfo : Interfaces.C.size_t; + fbinfo : Fb_Info_Ptr;
begin lightup_ok := 0; @@ -88,7 +88,7 @@ y_resolution => word32 (fb.Height), bytes_per_line => word32 (fb.Stride) * 4, bits_per_pixel => 32); - if fbinfo /= 0 then + if fbinfo /= null then lightup_ok := 1; end if; end if;