From eac9610833b747aa3d1685dbc665cf13d863eaa6 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sat, 5 Jun 2021 19:59:09 +0000 Subject: [PATCH] graphic_utils.c: handle 10-bpc framebuffer layouts Signed-off-by: Pip Cet --- lib/gui/graphic_utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 0bed93221..3cb791050 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -24,10 +24,10 @@ u32 gu_rgb_to_pixel(struct fb_info *info, u8 r, u8 g, u8 b, u8 t) { u32 px; - px = (t >> (8 - info->transp.length)) << info->transp.offset | - (r >> (8 - info->red.length)) << info->red.offset | - (g >> (8 - info->green.length)) << info->green.offset | - (b >> (8 - info->blue.length)) << info->blue.offset; + px = ((t << 2) >> (10 - info->transp.length)) << info->transp.offset | + ((r << 2) >> (10 - info->red.length)) << info->red.offset | + ((g << 2) >> (10 - info->green.length)) << info->green.offset | + ((b << 2) >> (10 - info->blue.length)) << info->blue.offset; return px; } -- 2.30.2