From d18fe1c54c9100e4e854fa1cec3f296e61d5f24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 21 Feb 2019 05:11:00 +0100 Subject: [PATCH] loader: disable scaling on nvidia VESA BIOS cf. https://patchwork.kernel.org/patch/7113461/ Change-Id: I3f564bd1037aeb4b539f495d57397446ae14e5ed --- src/system/boot/platform/bios_ia32/video.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/system/boot/platform/bios_ia32/video.cpp b/src/system/boot/platform/bios_ia32/video.cpp index fa9b1fba8c..4a719478f7 100644 --- a/src/system/boot/platform/bios_ia32/video.cpp +++ b/src/system/boot/platform/bios_ia32/video.cpp @@ -439,12 +439,30 @@ vesa_get_vbe_info_block(vbe_info_block *info) } +static void +vesa_fixups(vbe_info_block *info) +{ + const char *oem_string = (const char *)info->oem_string; + + if (!strcmp(oem_string, "NVIDIA")) { + dprintf("Disabling nvidia scaling.\n"); + struct bios_regs regs; + regs.eax = 0x4f14; + regs.ebx = 0x0102; + regs.ecx = 1; // centered unscaled + call_bios(0x10, ®s); + } +} + + static status_t vesa_init(vbe_info_block *info, video_mode **_standardMode) { if (vesa_get_vbe_info_block(info) != B_OK) return B_ERROR; + vesa_fixups(info); + // fill mode list and find standard video mode video_mode *standardMode = NULL;