x86/efistub: Call Apple set_os protocol on dual GPU Intel Macs
authorAditya Garg <gargaditya08@live.com>
Sun, 30 Jun 2024 19:24:54 +0000 (19:24 +0000)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 8 Jul 2024 08:17:45 +0000 (10:17 +0200)
commit71e49eccdca6328eecc335ed8f5557bd0ed70fc6
treedfd12906effacef2b1b75d88b167a63d54f01eca
parentcd6193877c603f4b0c3c7e5607ffa3d52815403f
x86/efistub: Call Apple set_os protocol on dual GPU Intel Macs

0c18184de990 ("platform/x86: apple-gmux: support MMIO gmux on T2 Macs")
brought support for T2 Macs in apple-gmux. But in order to use dual GPU,
the integrated GPU has to be enabled. On such dual GPU EFI Macs, the EFI
stub needs to report that it is booting macOS in order to prevent the
firmware from disabling the iGPU.

This patch is also applicable for some non T2 Intel Macs.

Based on this patch for GRUB by Andreas Heider <andreas@heider.io>:
https://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html

Credits also goto Kerem Karabay <kekrby@gmail.com> for helping porting
the patch to the Linux kernel.

Cc: Orlando Chamberlain <orlandoch.dev@gmail.com>
Signed-off-by: Aditya Garg <gargaditya08@live.com>
[ardb: limit scope using list of DMI matches provided by Lukas and Orlando]
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Tested-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/x86-stub.c
include/linux/efi.h