diff options
-rw-r--r-- | src/drivers/intel/gma/gma-gfx_init.ads | 6 | ||||
-rw-r--r-- | src/drivers/intel/gma/hires_fb/gma-gfx_init.adb | 5 | ||||
-rw-r--r-- | src/include/framebuffer_info.h | 2 | ||||
-rw-r--r-- | src/lib/edid_fill_fb.c | 7 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/drivers/intel/gma/gma-gfx_init.ads b/src/drivers/intel/gma/gma-gfx_init.ads index 88f64d9ffe..ec1e0ce0ce 100644 --- a/src/drivers/intel/gma/gma-gfx_init.ads +++ b/src/drivers/intel/gma/gma-gfx_init.ads @@ -16,14 +16,14 @@ is ---------------------------------------------------------------------------- - function c_fb_add_framebuffer_info + function C_Fb_Add_Framebuffer_Info_Simple (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 Interfaces.C.int; - pragma import (C, c_fb_add_framebuffer_info, "fb_add_framebuffer_info"); + pragma import (C, C_Fb_Add_Framebuffer_Info_Simple, "fb_add_framebuffer_info_simple"); 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 ae0b0b7ba5..49d0ca495a 100644 --- a/src/drivers/intel/gma/hires_fb/gma-gfx_init.adb +++ b/src/drivers/intel/gma/hires_fb/gma-gfx_init.adb @@ -27,6 +27,7 @@ is use type word64; use type word32; use type Interfaces.C.size_t; + use type Interfaces.C.int; ports : Port_List; @@ -39,7 +40,7 @@ is min_h : pos32 := Config.LINEAR_FRAMEBUFFER_MAX_WIDTH; min_v : pos32 := Config.LINEAR_FRAMEBUFFER_MAX_HEIGHT; - fbinfo : Interfaces.C.size_t; + fbinfo : Interfaces.C.int; begin lightup_ok := 0; @@ -82,7 +83,7 @@ is HW.GFX.GMA.Map_Linear_FB (linear_fb_addr, fb); if linear_fb_addr /= 0 then - fbinfo := c_fb_add_framebuffer_info + fbinfo := C_Fb_Add_Framebuffer_Info_Simple (fb_addr => Interfaces.C.size_t (linear_fb_addr), x_resolution => word32 (fb.Width), y_resolution => word32 (fb.Height), diff --git a/src/include/framebuffer_info.h b/src/include/framebuffer_info.h index 83445ecea0..451d893e99 100644 --- a/src/include/framebuffer_info.h +++ b/src/include/framebuffer_info.h @@ -14,6 +14,8 @@ fb_add_framebuffer_info_ex(const struct lb_framebuffer *fb); struct fb_info *fb_add_framebuffer_info(uintptr_t fb_addr, uint32_t x_resolution, uint32_t y_resolution, uint32_t bytes_per_line, uint8_t bits_per_pixel); +int fb_add_framebuffer_info_simple(uintptr_t fb_addr, uint32_t x_res, uint32_t y_res, + uint32_t bytes_per_line, uint8_t bits_per_pixel); void fb_set_orientation(struct fb_info *info, enum lb_fb_orientation orientation); diff --git a/src/lib/edid_fill_fb.c b/src/lib/edid_fill_fb.c index e4fb08c3fd..c72b70172c 100644 --- a/src/lib/edid_fill_fb.c +++ b/src/lib/edid_fill_fb.c @@ -148,6 +148,13 @@ fb_add_framebuffer_info(uintptr_t fb_addr, uint32_t x_resolution, return info; } +/* Wrapper for Ada to have a simpler function signature */ +int fb_add_framebuffer_info_simple(uintptr_t fb_addr, uint32_t x_res, uint32_t y_res, + uint32_t bytes_per_line, uint8_t bits_per_pixel) +{ + return fb_add_framebuffer_info(fb_addr, x_res, y_res, bytes_per_line, bits_per_pixel) != NULL; +} + void fb_set_orientation(struct fb_info *info, enum lb_fb_orientation orientation) { if (!info) |