From nobody Sun Feb 22 04:19:32 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 4fJW3G1tpsz6SvD5 for ; Sun, 22 Feb 2026 04:19:38 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fJW3F5cJYz3ZrP for ; Sun, 22 Feb 2026 04:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771733977; 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=GXKdPYWJVVJowK8FFNdy37ay0wepPDqu6aszXc5i8q0=; b=lXykHNCNbHTE+7445CJtITNRoCG7hgq0nntynxuPQroYSdIvAcDfiLhsQ5MK1dCt1WJpVb q8us6e07mJSNsJNsbvWfqgYw6UxqrhT1rkQ8AQG3TViXhxSMhME/CQhC67VNUc+opqKNxB g95JVq2UTwrOswlYF6IWhGSDJLRi/mDdPLxzUGikMPxrrRYc5efthmsnUwkO0FcCN/SF1h lTKyngFl+s0mYHUUyylq7nHflnhirPmS4m2DxE/pcHLI4n5awO3F5PlmtpBet8oPEcN+kz +m7dtr9eGueOCoyck112G8iDrFTpjCOxEcqQqU66AA0EGYqMPoDLlfKlDD8mjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771733977; a=rsa-sha256; cv=none; b=lUkwNt5W5zCn5r+W3rwJpJeGzVCuIAqu19FfIrqHFpK12pw/4QAA4WvLGdkO/niM1vL8V1 9TDfrVMbjrKmfdfkX7uBx4xG9yyqndCBKc3J4cjBksxVbpGDpSRO5/KedX6s4FIuRgqSmj mp58rhoFZKc6TwhU35ikBWJzYdSX9Xx8VT71WQ5qtdiH1DiPKSTLACvSc3/6veTf+AAsXA k0iFHLcVflb6F9iL134/2GZ2R2p3oT0e3DnHho4bEH8SlT/NMsq7VLPdsoflOt6ffDFROA clk/GvY34yt7b+m8+7qQBEjLgp+CAyMEmd/E8ArZ56ozG43vNWp0Kl7Eoy9IPA== 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=1771733977; 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=GXKdPYWJVVJowK8FFNdy37ay0wepPDqu6aszXc5i8q0=; b=RAmP+tGYjiGzMBpnsJurkz4LJj5/MxORP9gm0vVe4FqvBJ3QU5ZcuZHPNaLjVgGWpLrfG8 68xWVavvitaA2voI2t62BFbolZPYNMUjtVlRI3h92ztjqKLEduhagXer5FBdMOwEzdUT/L 5NPQ+NA4AMy9oTW9XQLe6G82i+6zMFTLkmwTqr+SBIyr0YuBZGtj7xXtC4IPKv4jevR7ov i8bfpAs6VKvWVwHiAa32by63OFD1u+mpn/rveouetxhNDzSrodm8M0Q8aaLYzpS6g6q2RN WdhoGRdkFcTSqq1PiQUTWXtgD4+BZij80yTCaNfiRN8E5eO2A8uves2f4PyU7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fJW3F5BsyzCLP for ; Sun, 22 Feb 2026 04:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25b31 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Feb 2026 04:19:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Abdelkader Boudih From: Enji Cooper Subject: git: cd937141ac00 - stable/15 - 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: ngie X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cd937141ac0041d018e56bfc39843b7a96a5fd41 Auto-Submitted: auto-generated Date: Sun, 22 Feb 2026 04:19:32 +0000 Message-Id: <699a83d4.25b31.29b25edf@gitrepo.freebsd.org> The branch stable/15 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=cd937141ac0041d018e56bfc39843b7a96a5fd41 commit cd937141ac0041d018e56bfc39843b7a96a5fd41 Author: Abdelkader Boudih AuthorDate: 2026-02-03 01:43:00 +0000 Commit: Enji Cooper CommitDate: 2026-02-22 04:17:44 +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 (cherry picked from commit 052a791b00555805f19ccc38a04d42d48b54104b) --- 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 04fc8d708a7d..9a141248524c 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -273,6 +273,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); @@ -4616,6 +4627,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