Contribute
Register

[Guide] Disabling discrete graphics in dual-GPU laptops

I intend to compare the files in ACPI/patched with the files in ACPI/origin. For that to happen, must have the same names. And I'm not going to spend the time sorting them out. That is your task if you wish...
Sorry for the inconvenience, I have re-uploaded the files with the same names.Thank you so much.
 

Attachments

  • Yoga 3 14.zip
    2.1 MB · Views: 90
Sorry for the inconvenience, I have re-uploaded the files with the same names.Thank you so much.

FYI: Your SortedOrder array is causing SSDT.aml to be injected twice.
FYI2: Your native DSDT does not use 0x0d in its _PRW methods, so the patch you used there is wrong...
FYI3: No need to rename all _T_x to T_x... it just makes it more difficult to compare origin to patched...

Your SSDT-3.aml and SSDT-4.aml (from origin) has duplicates.
If you look at the code there you can see the entire contents of each is conditional.
Presumably these two conditions are mutually exclusive, such that only one (or none) of these SSDTs is being used on your computer...

From SSDT-3:
Code:
    If (LAnd (LEqual (BID, 0x31), LEqual (RTD3, One)))
    {

From SSDT-4:
Code:
    If (LAnd (LOr (LOr (LEqual (BID, 0x80), LEqual (BID, 0x82)), LEqual (BID, 0x83)), LEqual (RTD3, One)))
    {

To know which one is actually being used, you will need to find out the value of BID, and RTD3.
If RTD3 is zero, neither is being used.
And then SSDT-3 vs. SSDT-4 depends on BID==0x31, or BID==0x80/0x82/0x83

You can use ACPIDebug to find the values of BID and RTD3.
Or you could even use RW-Everything as these fields are in SystemMemory (you would need to calculate the address of them).

For example, calculating the SystemMemory address of BID:
Code:
    OperationRegion (GNVS, SystemMemory, 0xACF7CC18, 0x036F)
    Field (GNVS, AnyAcc, Lock, Preserve)
    {
        Offset (0x42),
        MEFE,   8, //42
        DSTS,   8, //43
        TL2F,   32, //44
        MORD,   8, //48
        TCGP,   8, //49
        PPRP,   32, //4a
        PPRQ,   8, //4e
        LPPR,   8, //4f
        GTF0,   56, //50
        GTF2,   56, //57
        IDEM,   8, //5e
        GTF1,   56, //60
        BID,    16, //67

Would be 0xACF7CC18+0x67=0xACF7CC7F

You should check my math there...

BTW, to get a clean disassembly from these files you have to disassemble twice. Once with SSDT-3, without SSDT-4. And another with SSDT-4, without SSDT-3.

For example:
Code:
# assuming cwd is at ACPI/origin
mkdir d1
mkdir d2
cp DSDT.aml SSDT*.aml d1
cp DSDT.aml SSDT*.aml d2
rm d1/SSDT-4.aml
rm d2/SSDT-3.aml
cd d1
iasl -da -dl *.aml
cd ../d2
iasl -da -dl *.aml
cd ..
cp d1/*.dsl .
cp d2/SSDT-4.dsl .

And then you have a complete set of disassembled files in ACPI/origin (*.dsl).

And to answer your question about _INI. If you don't find an _INI at the path of the discrete GPU, you simply create one.
 
Last edited:
If RTD3 is zero, neither is being used.
Thank you for your help.

I just checked the value with ACPIDebug, and unfortunately the value of BID is 0x2 and the value of RTD3 is 0x0. I tried them both when the discrete graphics is disabled and enabled in BIOS and got the same value.
So does this mean both two tables are meaningless and thus can be simply omitted?

Then in order to disable the discrete graphics device, should I do the following with DSDT?
1. Copy whole "Scope (\_SB.PCI0.RP05)" section in the SSDT into DSDT and add the coordinate External resources into DefinitionBlock.
Sorry I don't know if there are difference with "Scope (_SB.PCI0.RP05)" and Scope (\_SB.PCI0.RP05) and "Device (RP05)" under "Scope (_SB.PCI0)", and can I merge them?

2. Under "Device (RP05)" under "Scope (_SB.PCI0)", I just found a _INI method. Sorry for the misleading.
I tried to add "\_SB.PCI0.RP05._OFF()" to the last line of this method and an error prompts that "Object does not exist (\_SB.PCI0.RP05._OFF)"
The _OFF method is in the pasted section and how can I call it?
 
GTF0, 56, //56
8 instead of 56 should be added here...
And I'm going to check the value under windows with RW-Everything

The value are both zero, slightly different from result in ACPIDebug. And I found the value of \RMDT.PUSH (BID) is "ACPIDebug: 0x2" while this is a 16-bit value.
 
Last edited:
8 instead of 56 should be added here...

Wrong, but there is a mistake. I make corrections in the original.

Thank you for your help.

I just checked the value with ACPIDebug, and unfortunately the value of BID is 0x2 and the value of RTD3 is 0x0.

Submit your offset calculations for RTD3.
But yes, if it really is zero, then both of these SSDTs contribute nothing to ACPI namespace.
 
1. Copy whole "Scope (\_SB.PCI0.RP05)" section in the SSDT into DSDT and add the coordinate External resources into DefinitionBlock.

It is never necessary to copy any code, except for as noted with regards to EC related code.
And I don't know what you mean by "the SSDT".

2. Under "Device (RP05)" under "Scope (_SB.PCI0)", I just found a _INI method. Sorry for the misleading.
I tried to add "\_SB.PCI0.RP05._OFF()" to the last line of this method and an error prompts that "Object does not exist (\_SB.PCI0.RP05._OFF)"
The _OFF method is in the pasted section and how can I call it?

_SB.PCI0.RP05 is not the correct scope.
You already stated it is at _SB.PCI0.RP05.PEGP.
 
Submit your offset calculations for RTD3.
0xACF7CC18+0xCE=0xACF7CCE6
Code:
Offset (0x7A),
        DSEN,   8, //7b
        ECON,   8, //7c
        GPIC,   8, //7d
        CTYP,   8, //7e
        L01C,   8, //7f
        VFN0,   8, //80
        VFN1,   8, //81
        VFN2,   8, //82
        VFN3,   8, //83
        VFN4,   8, //84
        VFN5,   8, //85
        VFN6,   8, //86
        VFN7,   8, //87
        VFN8,   8, //88
        VFN9,   8, //89
        ISCT,   8, //8a
        SLDR,   32, //8b-1=8a
        WAKR,   8, //8f
        ATMC,   8, //90
        PTMC,   8, //91
        ATRA,   8, //92
        PTRA,   8, //93
        PNHM,   32, //94
        TBAB,   32, //98
        TBAH,   32, //9c
        RTIP,   8, //a0-1=9f
        TSOD,   8, //a1
        ATPC,   8, //a2
        PTPC,   8, //a3
        PFLV,   8, //a4
        BREV,   8, //a5
        PDTS,   8, //a6
        PKGA,   8, //a7
        PAMT,   8, //a8
        AC0F,   8, //a9
        AC1F,   8, //aa
        DTS3,   8, //ab
        DTS4,   8, //ac
        SHFQ,   32, //ad
        LTR1,   8, //b1-1=b0
        LTR2,   8, //b2
        LTR3,   8, //b3
        LTR4,   8, //b4
        LTR5,   8, //b5
        LTR6,   8, //b6
        LTR7,   8, //b7
        LTR8,   8, //b8
        OBF1,   8, //b9
        OBF2,   8, //ba
        OBF3,   8, //bb
        OBF4,   8, //bc
        OBF5,   8, //bd
        OBF6,   8, //be
        OBF7,   8, //bf
        OBF8,   8, //c0
        XHCI,   8, //c1
        XTUB,   32, //c2-1=c1
        XTUS,   32, //c6
        XMPB,   32, //ca
        DDRF,   8, //ce
        RTD3,   8, //cf-1=ce

I misunderstood the first address at the beginning, and then minus 1 for each address.

rw_everything_snipaste_20170403_005346.png


And I don't know what you mean by "the SSDT".

For this I mean section related to RP05 in those duplicated SSDT, 3 and 4.

So I can only add an external method of _SB.PCI0.RP05.PEGP._OFF and a Device of _SB.PCI0.RP05.PEGP._INI in DSDT which call _OFF to fix discrete graphics?
 
0xACF7CC18+0xCE=0xACF7CCE6
Code:
Offset (0x7A),
        DSEN,   8, //7b

^^^
Wrong already.
DSEN is at 0x7A as per Offset declaration right before it.
No idea why you added one to it...

I stopped reading at that point...
 
Dear RehabMan,
I've installed Sierra 10.12.4 successfully on my brandnew ASUS UX510U notebook. It works very smoothly and the only things that do not seem to work are sound (alc256), touchpad (elan1200), brightness controls (intel hd620). your current brightness control guide doesnt seem to work for me (maybe because in dsdt its still gfx0 instead of igpu).
I got battery display working by using your asus n55sl patch on my dsdt and got power management working (i believe) with gfx0 -> igpu in ssdt-1 and ssdt-15. when I try to do gfx0 -> igpu in dsdt, the laptop doesnt boot and glitches at the end when waiting for root. then I thought it might be due to the second nvidia card, so I followed your guide for disabling discrete graphics and patched all dsdt/ssdt successfully, eventually without compiling errors (using all the patches of the guide's list). Now when I try to boot with the new DSDT/SSDT and dropoem=true in config, the laptop shutsdown very early during the boot process, so something I changed for disabling nvidia seems to cause a kernel panic at the beginning.
is it maybe because the discrete graphics guide is not compatible with 10.12.4? or did I make any errors?
I have 10 years of experience with hackintoshing, but it is the first time I'm trying to use DSDT/SSDT patching, so excuse me for my limited knowledge.
thanks for helping in advance!
 

Attachments

  • Asus UX510UW troubleshoot.zip
    2.1 MB · Views: 80
Dear RehabMan,
I've installed Sierra 10.12.4 successfully on my brandnew ASUS UX510U notebook. It works very smoothly and the only things that do not seem to work are sound (alc256), touchpad (elan1200), brightness controls (intel hd620). your current brightness control guide doesnt seem to work for me (maybe because in dsdt its still gfx0 instead of igpu).
I got battery display working by using your asus n55sl patch on my dsdt and got power management working (i believe) with gfx0 -> igpu in ssdt-1 and ssdt-15. when I try to do gfx0 -> igpu in dsdt, the laptop doesnt boot and glitches at the end when waiting for root. then I thought it might be due to the second nvidia card, so I followed your guide for disabling discrete graphics and patched all dsdt/ssdt successfully, eventually without compiling errors (using all the patches of the guide's list). Now when I try to boot with the new DSDT/SSDT and dropoem=true in config, the laptop shutsdown very early during the boot process, so something I changed for disabling nvidia seems to cause a kernel panic at the beginning.
is it maybe because the discrete graphics guide is not compatible with 10.12.4? or did I make any errors?
I have 10 years of experience with hackintoshing, but it is the first time I'm trying to use DSDT/SSDT patching, so excuse me for my limited knowledge.
thanks for helping in advance!

Start with native ACPI files in ACPI/patched.
Then apply patches one at a time until you find your mistake.

One obvious mistake: _OFF calls HGOF. HGOF appears to contain EC related code that you did not move to _REG.
 
Back
Top