loader: disable scaling on nvidia VESA BIOS

cf. https://patchwork.kernel.org/patch/7113461/

Change-Id: I3f564bd1037aeb4b539f495d57397446ae14e5ed
This commit is contained in:
François Revol 2019-02-21 05:11:00 +01:00
parent 38c4c8bfa9
commit d18fe1c54c

View File

@ -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, &regs);
}
}
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;