From nobody Tue Feb 3 01:52:00 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f4mgj0Lp6z6QtKG for ; Tue, 03 Feb 2026 01:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f4mgh6HPpz3Ysk for ; Tue, 03 Feb 2026 01:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770083520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kbiCqZPSYtUOCotFpflhOU/QvZRwJ5ULRw748JaTBE=; b=OnRadBp2Xn39xs2k0f/bTYpCzyQf27Hk7YSAKGRJqXLMY2JDlAKz4AvsC5Dy3aSQp45w8k M5/dwCpm+ps4zvdStmZ+FDLXU64LU47Hxl4bCnxx+3Rvio7FMTl1jADvWtdBsUgJ/6efHD szmgcs2Fq/Fh85x0QHVn3xvqaX+5G2Ft1nnLk0mF3to0AVOR4V4X62f4brHU2Wx+L4+Yqw Xgpj15hf2XGlvdrNsnbWpiVgRdoEWlO519bshcDm/9utIWuZIpmsPqi0KijjnzNqYSMOAn cQbVRZMuxfHTKHiRvh0/1RNt3H7w3UlXXeBkMxNiiwUpb1iF/0IYGk89ENSWeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770083520; a=rsa-sha256; cv=none; b=O7v+9B6liBLiDQiGm/OHulOKn0jpLjg2gqQuYFWnlGem2i5ptZlEzE0s+/wYKw7GYzRYSQ bs54oWfm4KoY7yjWZqCbmGJfIbUbH01W00IcBy8zk4TC0t3oOcvbStCu0TheWQ9d686dHM 3CfxE5OcFn5tlaEeRM6wMgq/pXW/pNcoErKmNx/GHjN3MwXvU+Bm3Flm/AdM6w8sKDkMc+ 6uwitp/xyUDkMSfhck9Luea+1XyYONh/SyGnJXEB5I0hXWLysf4cna/OESdl8npQS5pEQA pia1IJCEuZuSVNcU0BBhzamnYSm7IbMH+c8kzddIjzoBOEmcLtAx4ndOXTBWsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770083520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kbiCqZPSYtUOCotFpflhOU/QvZRwJ5ULRw748JaTBE=; b=wlhbMjWf/+HWTFPoEii7adLWmzaIPx29cZONEg5BugvjovFimJtITaeNZPhbjPQLFcPBWA raOn3UDMe68TE95ivwSGZ37yTcdk/gxFNwCzxS+TzmgJPkSCaTdcbc/mTrMhP2fpUqi/b6 ULWy7kyNLoSU3n4yWK3YDo12qeddkr1S3zjfnN3T7ClrT/SJOfSwN8d2p7j3CgLLeTKdae 823wtZBaobNXp3hpfnKpQQ1BiuRWZURVP3HzXrw/RhMQJykTgiT2oFx607dhVRfbhS6EMU /HIhf695MCCTH16pvPnAuQrLwKwKLlCxexnOwQXnRj0UqlV5G68Aw9xLqjVVMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f4mgh5tK0zs5N for ; Tue, 03 Feb 2026 01:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35e9d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 03 Feb 2026 01:52:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: 052a791b0055 - main - acpi: add Darwin OSI quirk for Apple Mac hardware List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 052a791b00555805f19ccc38a04d42d48b54104b Auto-Submitted: auto-generated Date: Tue, 03 Feb 2026 01:52:00 +0000 Message-Id: <698154c0.35e9d.2d7b8775@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=052a791b00555805f19ccc38a04d42d48b54104b commit 052a791b00555805f19ccc38a04d42d48b54104b Author: Abdelkader Boudih AuthorDate: 2026-02-03 01:43:00 +0000 Commit: Adrian Chadd CommitDate: 2026-02-03 01:51:37 +0000 acpi: add Darwin OSI quirk for Apple Mac hardware Mac firmware hides the Intel integrated GPU (iGPU) on dual GPU x86 systems, i.e., with AMD/NVIDIA dGPUs, when the Darwin OSI is not installed via ACPI. Prior to this change, FreeBSD always used the dGPU. This is fine in practice, but consumed more power than when the iGPU is used, resulting in reduced battery life. Linux handles this in `drivers/acpi/osi.c` by detecting Apple hardware via DMI, disabling all Windows OSI strings, and by explicitly installing the Darwin OSI ACPI handler. This change applies equivalent logic to the acpi(4) driver on FreeBSD. This feature can be enabled/disabled using the `hw.acpi.apple_darwin_osi` tunable. Setting this tunable to `0` restores the previous behavior by explicitly disabling the added support. Reviewed by: obiwac, ngie, adrian Differential Revision: https://reviews.freebsd.org/D54762 --- sys/dev/acpica/acpi.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 60a2dba91b05..8cdb73333462 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -293,6 +293,17 @@ static char acpi_remove_interface[256]; TUNABLE_STR("hw.acpi.remove_interface", acpi_remove_interface, sizeof(acpi_remove_interface)); +/* + * Automatically apply the Darwin OSI on Apple Mac hardware to obtain + * access to full ACPI hardware support on supported platforms. + * + * This flag automatically overrides any values set by + * `hw.acpi.acpi_install_interface` and unset by + * `hw.acpi.acpi_remove_interface`. + */ +static int acpi_apple_darwin_osi = 1; +TUNABLE_INT("hw.acpi.apple_darwin_osi", &acpi_apple_darwin_osi); + /* Allow users to dump Debug objects without ACPI debugger. */ static int acpi_debug_objects; TUNABLE_INT("debug.acpi.enable_debug_objects", &acpi_debug_objects); @@ -4903,6 +4914,67 @@ acpi_reset_interfaces(device_t dev) } acpi_free_interfaces(&list); } + + /* + * Apple Mac hardware quirk: install Darwin OSI. + * + * On Apple hardware, install the Darwin OSI and remove the Windows OSI + * to match Linux behavior. + * + * This is required for dual-GPU MacBook Pro systems + * (Intel iGPU + AMD/NVIDIA dGPU) where the iGPU is hidden when the + * firmware doesn't see Darwin OSI, but it also unlocks additional ACPI + * support on non-MacBook Pro Apple platforms. + * + * Apple's ACPI firmware checks _OSI("Darwin") and sets OSYS=10000 + * for macOS. Many device methods use OSDW() which checks OSYS==10000 + * for macOS-specific behavior including GPU visibility and power + * management. + * + * Linux enables Darwin OSI by default on Apple hardware and disables + * all Windows OSI strings (drivers/acpi/osi.c). Users can override + * this behavior with acpi_osi=!Darwin to get Windows-like behavior, + * in general, but this logic makes that process unnecessary. + * + * Detect Apple via SMBIOS and enable Darwin while disabling Windows + * vendor strings. This makes both GPUs visible on dual-GPU MacBook Pro + * systems (Intel iGPU + AMD dGPU) and unlocks full platform + * ACPI support. + */ + if (acpi_apple_darwin_osi) { + char *vendor = kern_getenv("smbios.system.maker"); + if (vendor != NULL) { + if (strcmp(vendor, "Apple Inc.") == 0 || + strcmp(vendor, "Apple Computer, Inc.") == 0) { + /* Disable all other OSI vendor strings. */ + status = AcpiUpdateInterfaces( + ACPI_DISABLE_ALL_VENDOR_STRINGS); + /* Install Darwin */ + if (ACPI_SUCCESS(status)) { + status = AcpiInstallInterface("Darwin"); + } + if (bootverbose) { + if (ACPI_SUCCESS(status)) { + device_printf(dev, + "Apple hardware: installed Darwin " + "OSI and removed other vendor OSI " + "(Windows, etc)\n"); + } else { + device_printf(dev, + "Apple hardware: failed to install " + "Darwin OSI: %s\n", + AcpiFormatException( + status)); + } + } + } else if (bootverbose) { + device_printf(dev, + "Not installing Darwin OSI on unsupported platform: %s\n", + vendor); + } + freeenv(vendor); + } + } } static int