haiku_loader.efi: add support for rgb16

Change-Id: I7634b8734d057f99d69c494ea941e1f38f94b757
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8564
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
Jérôme Duval 2024-11-14 17:06:24 +01:00 committed by waddlesplash
parent dcbba21430
commit ba8970a3e0

View File

@ -197,6 +197,12 @@ platform_init_video(void)
&& info->PixelInformation.BlueMask == 0x0000FF && info->PixelInformation.BlueMask == 0x0000FF
&& info->PixelInformation.ReservedMask == 0) { && info->PixelInformation.ReservedMask == 0) {
depth = 24; depth = 24;
} else if (info->PixelFormat == PixelBitMask
&& info->PixelInformation.RedMask == 0xF800
&& info->PixelInformation.GreenMask == 0x07E0
&& info->PixelInformation.BlueMask == 0x001F
&& info->PixelInformation.ReservedMask == 0) {
depth = 16;
} else { } else {
TRACE((" pixel format: %x unsupported\n", TRACE((" pixel format: %x unsupported\n",
info->PixelFormat)); info->PixelFormat));
@ -209,7 +215,7 @@ platform_init_video(void)
videoMode->mode = mode; videoMode->mode = mode;
videoMode->width = info->HorizontalResolution; videoMode->width = info->HorizontalResolution;
videoMode->height = info->VerticalResolution; videoMode->height = info->VerticalResolution;
videoMode->bits_per_pixel = info->PixelFormat == PixelBitMask ? 24 : 32; videoMode->bits_per_pixel = depth;
videoMode->bytes_per_row = info->PixelsPerScanLine * depth / 8; videoMode->bytes_per_row = info->PixelsPerScanLine * depth / 8;
add_video_mode(videoMode); add_video_mode(videoMode);
} }