From 3f6778e13fbeef761eda57d6e0833e08f2210b07 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Mon, 28 Oct 2024 19:27:21 +0700 Subject: [PATCH] Add PNLF device directly to integrated GPU device --- Scripts/acpi_guru.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Scripts/acpi_guru.py b/Scripts/acpi_guru.py index ae742a4..d9d5c63 100644 --- a/Scripts/acpi_guru.py +++ b/Scripts/acpi_guru.py @@ -2104,10 +2104,11 @@ DefinitionBlock ("", "SSDT", 2, "ZPSS", "DNVMe", 0x00000000) ssdt_content = """ DefinitionBlock ("", "SSDT", 2, "ZPSS", "PNLF", 0x00000000) {""" - if uid_value == 14 and integrated_gpu.get("ACPI Path"): - ssdt_content += """\n External ([[igpu_path]], DeviceObj)\n""" + if integrated_gpu.get("ACPI Path"): + ssdt_content += """\n External ([[DevicePath]], DeviceObj)\n Device ([[DevicePath]].PNLF)""" + else: + ssdt_content += """\n Device (PNLF)""" ssdt_content += """ - Device (PNLF) { Name (_HID, EisaId ("APP0002")) // _HID: Hardware ID Name (_CID, "backlight") // _CID: Compatible ID @@ -2124,14 +2125,14 @@ DefinitionBlock ("", "SSDT", 2, "ZPSS", "PNLF", 0x00000000) Return (Zero) } }""" - if uid_value == 14 and integrated_gpu.get("ACPI Path"): + if integrated_gpu.get("ACPI Path") and uid_value == 14: ssdt_content += """ Method (_INI, 0, Serialized) { - If (LAnd (_OSI ("Darwin"), CondRefOf ([[igpu_path]]))) + If (_OSI ("Darwin")) { - OperationRegion ([[igpu_path]].RMP3, PCI_Config, Zero, 0x14) - Field ([[igpu_path]].RMP3, AnyAcc, NoLock, Preserve) + OperationRegion ([[DevicePath]].RMP3, PCI_Config, Zero, 0x14) + Field ([[DevicePath]].RMP3, AnyAcc, NoLock, Preserve) { Offset (0x02), GDID,16, Offset (0x10), BAR1,32, @@ -2226,8 +2227,8 @@ DefinitionBlock ("", "SSDT", 2, "ZPSS", "PNLF", 0x00000000) }""" ssdt_content = ssdt_content.replace("[[uid_value]]", str(uid_value)) - if "[[igpu_path]]" in ssdt_content: - ssdt_content = ssdt_content.replace("[[igpu_path]]", integrated_gpu.get("ACPI Path")) + if integrated_gpu.get("ACPI Path"): + ssdt_content = ssdt_content.replace("[[DevicePath]]", integrated_gpu.get("ACPI Path")) return { "Add": [