-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Substitute complicated PNLF _UID implementation #91
Draft
zhen-zen
wants to merge
6
commits into
master
Choose a base branch
from
suid
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6eb7385
Move PNLF _UID processing to WhateverGreen
zhen-zen 3ffbb99
Fix Clang analyze
zhen-zen d652dd3
Follow fakeDevice
zhen-zen 602b673
Move SUID to GFX0 for customized PNLF name
zhen-zen 41040c2
Return new _UID result; revert to old _STA style OS check
zhen-zen 2097bff
Return PNLF device name to allow different name on laptops with exist…
zhen-zen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Adding PNLF device for WhateverGreen.kext and others. | ||
// This is a simplified PNLF version originally taken from RehabMan/OS-X-Clover-Laptop-Config repository: | ||
// https://raw.githubusercontent.com/RehabMan/OS-X-Clover-Laptop-Config/master/hotpatch/SSDT-PNLF.dsl | ||
// Rename GFX0 to anything else if your IGPU name is different. | ||
// | ||
// Licensed under GNU General Public License v2.0 | ||
// https://github.com/RehabMan/OS-X-Clover-Laptop-Config/blob/master/License.md | ||
|
||
DefinitionBlock ("", "SSDT", 2, "ACDT", "PNLF", 0x00000000) | ||
{ | ||
External (_SB_.PCI0.GFX0, DeviceObj) // (from opcode) | ||
|
||
Scope (\_SB.PCI0.GFX0) | ||
{ | ||
// For backlight control | ||
Device (PNLF) | ||
{ | ||
// Name(_ADR, Zero) | ||
Name (_HID, EisaId ("APP0002")) // _HID: Hardware ID | ||
Name (_CID, "backlight") // _CID: Compatible ID | ||
// _UID is set depending on PWMMax to match profiles in WhateverGreen.kext https://github.com/acidanthera/WhateverGreen/blob/1.4.7/WhateverGreen/kern_weg.cpp#L32 | ||
// 14: Sandy/Ivy 0x710 | ||
// 15: Haswell/Broadwell 0xad9 | ||
// 16: Skylake/KabyLake 0x56c (and some Haswell, example 0xa2e0008) | ||
// 17: custom LMAX=0x7a1 | ||
// 18: custom LMAX=0x1499 | ||
// 19: CoffeeLake 0xffff | ||
// 99: Other (requires custom profile using WhateverGreen.kext via DeviceProperties applbkl-name and applbkl-data) | ||
Name (_UID, Zero) // _UID: Unique ID | ||
Method (_STA, 0, NotSerialized) // _STA: Status | ||
{ | ||
If (_OSI ("Darwin")) | ||
{ | ||
Return (0x0B) | ||
} | ||
Else | ||
{ | ||
Return (Zero) | ||
} | ||
} | ||
} | ||
|
||
Method (SUID, 1, NotSerialized) | ||
{ | ||
^PNLF._UID = ToInteger (Arg0) | ||
// Return PNLF device name in case of conflict | ||
Return ("PNLF") | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it good to just replace it with
CPUInfo::CpuGeneration
?