git: 02732f945ed2 - main - loader.efi: Do not use as frame buffer BLT-only GOPs.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Dec 2021 17:00:04 UTC
The branch main has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=02732f945ed2ec2b4fd03421923720608b28a615
commit 02732f945ed2ec2b4fd03421923720608b28a615
Author: Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-12-16 16:44:34 +0000
Commit: Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-12-16 16:44:34 +0000
loader.efi: Do not use as frame buffer BLT-only GOPs.
Kernel needs physical frame buffer address and size, which Block
Transfer-only Graphics Output Protocol instances do not have.
Some recent ASUS boards like PRIME Z690M-PLUS D4 and PRIME H570-Plus
report two GOPs, out of which the second one support ConOut protocol,
that made it preferable, but is BLT-only, that made console unusable.
Discussed with: tsoome (previous version)
MFC after: 1 week
---
stand/efi/loader/framebuffer.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c
index 03752b77a24e..0a00b3645b36 100644
--- a/stand/efi/loader/framebuffer.c
+++ b/stand/efi/loader/framebuffer.c
@@ -567,21 +567,33 @@ efi_find_framebuffer(teken_gfx_t *gfx_state)
/*
* Search for ConOut protocol, if not found, use first handle.
*/
- gop_handle = *hlist;
+ gop_handle = NULL;
for (i = 0; i < nhandles; i++) {
- void *dummy = NULL;
+ EFI_GRAPHICS_OUTPUT *tgop;
+ void *dummy;
+
+ status = OpenProtocolByHandle(hlist[i], &gop_guid, (void **)&tgop);
+ if (status != EFI_SUCCESS)
+ continue;
+
+ if (tgop->Mode->Info->PixelFormat == PixelBltOnly ||
+ tgop->Mode->Info->PixelFormat >= PixelFormatMax)
+ continue;
status = OpenProtocolByHandle(hlist[i], &conout_guid, &dummy);
if (status == EFI_SUCCESS) {
gop_handle = hlist[i];
+ gop = tgop;
break;
+ } else if (gop_handle == NULL) {
+ gop_handle = hlist[i];
+ gop = tgop;
}
}
- status = OpenProtocolByHandle(gop_handle, &gop_guid, (void **)&gop);
free(hlist);
- if (status == EFI_SUCCESS) {
+ if (gop_handle != NULL) {
gfx_state->tg_fb_type = FB_GOP;
gfx_state->tg_private = gop;
if (edid_info == NULL)