On Thu, 4 Feb 2016 00:37:42 +0100 (CET)
Mark Kettenis <[email protected]> wrote:
> I suspect that what's happening is that the QueryMode() calls
> overwrite the current mode information in the GOP structure. The
> SetMode() call will update the information again. In my book that
> means the UEFI BIOS of this machine is borked. Unfortunately other
> machines, like those with the Asus M5A97 LE R2.0 board, are borked in
> another way:
>
> http://comments.gmane.org/gmane.os.openbsd.misc/226553
>
> Yasuoka, what do you think of the diff below? It will do the
> SetMode() call even if the "best" mode is the same as the current
> mode, but doesn't print a warning if the SetMode() call fails in that
> case.
Yes, the diff seems to be better than my fix.
ok yasuoka
> Index: efiboot.c
> ===================================================================
> RCS file: /home/cvs/src/sys/arch/amd64/stand/efiboot/efiboot.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 efiboot.c
> --- efiboot.c 26 Nov 2015 20:26:20 -0000 1.10
> +++ efiboot.c 3 Feb 2016 23:28:08 -0000
> @@ -526,9 +526,9 @@ efi_makebootargs(void)
> bestsiz = gopsiz;
> }
> }
> - if (bestmode >= 0 && conout->Mode->Mode != bestmode) {
> + if (bestmode >= 0) {
> status = EFI_CALL(gop->SetMode, gop, bestmode);
> - if (EFI_ERROR(status))
> + if (EFI_ERROR(status) && gop->Mode->Mode != bestmode)
> printf("GOP setmode failed(%d)\n", status);
> }
>
>