loader.efi: only use firmware provided Blt on GOP

gfx_state.tg_private points to a EFI_GRAPHICS_OUTPUT_PROTOCOL only when
using GOP.

The firmware provided Blt functions on UGA platforms have been observed
to not work on old MacBooks, and are likley hit or miss anyways as UGA
has been deprecated since 2006.

Reviewed by:	tsoome
PR:		291935
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54432
This commit is contained in:
Ahmad Khalifa 2026-01-04 15:15:37 +02:00
parent 5d85dde27b
commit 9595055ae7

View file

@ -83,6 +83,7 @@
*/
#include <sys/param.h>
#include <assert.h>
#include <stand.h>
#include <teken.h>
#include <gfx_fb.h>
@ -856,7 +857,7 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation,
int rv;
#if defined(EFI)
EFI_STATUS status;
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = gfx_state.tg_private;
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
EFI_TPL tpl;
/*
@ -866,7 +867,10 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation,
* done as they are provided by protocols that disappear when exit
* boot services.
*/
if (!ignore_gop_blt && gop != NULL && boot_services_active) {
if (gfx_state.tg_fb_type == FB_GOP && !ignore_gop_blt &&
boot_services_active) {
assert(gfx_state.tg_private != NULL);
gop = gfx_state.tg_private;
tpl = BS->RaiseTPL(TPL_NOTIFY);
switch (BltOperation) {
case GfxFbBltVideoFill: