[Reprint] Shielded dual graphics card notebook's unique display

Source: Internet
Author: User
Tags ssdt

Overview

The purpose of this tutorial is to show you how to block discrete graphics cards for dual graphics notebooks by modifying DSDT and SSDT. (Example: Intel integrated graphics + nvidia discrete graphics [Optimus Technology], and Intel integrated graphics +radeon discrete graphics).

Because under the black Apple, the dual graphics notebook can only drive Intel's integrated graphics, and if it does not do any processing, although it will not work, but, in general, alone will still be active, and consume electricity, generate heat, causing fan noise, and battery power consumption quickly. Although we can turn it off in the BIOS, however, masking by modifying the ACPI file is a better choice because such masking is not affected by Windows alone. (If you use the BIOS screen, then you want to go to Windows to play the game, you need to advanced BIOS and then open the display).

While it seems that masking a single patch is simple (Rehabman provides a patch) (sometimes it only takes one line of code), because we need to modify 1 or more SSDT, the problem is actually more complex and there are many pitfalls. Also, for some computers and ACPI files, there are different ways of dealing with this problem, which makes this issue even more complicated. The DSDT/SSDT provided by this paste is a more complicated situation. So, this post on the processing of these documents will also cover most of the situation you will encounter in the future.

You should download the example file, follow the introduction yourself and do it again to fully understand the post. Then change your own file.

As an example of the file, is Asus G53SW (Intel hd4600+nvidia), which extracts the files (in the Acpi/origin directory) by pressing the F4 key in the Clover startup interface.

Basic concepts

Our goal is very simple. Often, in SSDT, notebooks provide us with a _off method that we can use to cut the power supply by calling this method. The simplest way to do this is to call the _off method in the corresponding _ini method. It is important to note that this _off method may also be in DSDT, or may have different names (e.g. Gpof, OPOF, _PS3, etc.).

Some implementations of the _off method, because it contains a dependency on the EC (Embedded Controller), make it impossible to invoke in the _ini method. In this case, the entire _off method or part of its code needs to be moved to the _reg method for deferred execution (when the _reg method receives the parameters arg0==3 and arg1==1, it is executed after the _ini method) (see ACPI specification). In some cases, it is too late to call _off in the _reg method, which results in either a blocking-alone failure or a system of five states. For such a situation, it would become necessary to modify the _off method to remove its reliance on the EC. After that, we can call it in _ini (remove the dependency on the EC _off). At the same time, the code removed in the _off needs to be added to the _reg. Thus, although the EC-associated code is executed after (_ini) (since the code is added to the _reg, it is executed later), it achieves better results. This is the case with the example provided by the post.

Basic patching operations

It is important to understand how to extract ACPI files and decompile them, and then patch them up and place them where they are modified. For these, please go to this post to learn: [authorized translation] using patch modification DSDT/SSDT [DSDT/SSDT Comprehensive tutorial] you need to be familiar with this before you actually do it.

You can also look at the landlord's video tutorial (because the video tutorial recorded earlier, so the operation and this paste slightly different. The video as a demonstration of how to modify the ACPI file as shown in this post): [Video tutorial]acpi file processing and MACIASL patch usage

Because basic knowledge is very important, we need to understand this before the actual operation is masked.

First of all, for extracting good files (you can download the examples provided by the post to practice). Decompile all files at the same time with IASL.
iasl -da -dl *.aml
After the anti-compilation, we will get all the DSL files, next, to start patching the DSL file, for our example file, need to hit the patch of the situation:

DSDT.DSL:

    • "Fix Parseop_zero Error" (First delete "more agressive" comment (that is, delete the last two lines before the patch)
    • "Fix adbg Error"
    • "Remove _DSM Methods"
    • "IRQ Fix"
    • "SMBUS Fix"
    • "OS Check Fix (Windows 8)"
    • "Add IMEI"
    • "RTC Fix"
    • "Fix _wak Arg0 v2"
    • "Fix _wak Iaoe" (Rehabman new patch)
    • "Rename GFX0 to IGPU"
    • "Rename b0d3 to Hdau" (New patch)
    • "ASUS N55sl/vivobook"
    • "USB3 _PRW (0x6d) and Rename XHC to XHC1" (New patch)
    • "Audio Layout 12"

SSDT-0.DSL:

    • "Remove _PSS placeholders" (New patch)

No need to modify ssdt-2x, ssdt-3x, ssdt-4x, because these are dynamically loaded (that is, each fetch will be different)
and need to SSDT-1, SSDT-5, SSDT-6, SSDT-8 patched

SSDT-7.DSL:

    • "Rename GFX0 to IGPU"

SSDT-9.DSL:

    • "Rename GFX0 to IGPU"
    • "Brightness Fix (Haswell)"
    • "Rename b0d3 to Hdau" (New patch)

SSDT-10.DSL:

    • "Rename GFX0 to IGPU"

SSDT-11.DSL:

    • "Remove _DSM Methods"
    • "Rename GFX0 to IGPU"
    • "Cleanup/fix Errors (SSDT)"

SSDT-12.DSL:

    • "Rename GFX0 to IGPU"

If it goes well, all the files can be compiled smoothly after being modified.

You can use IASL to build a test.
iasl *.dsl
Note: You should back up all the original AML files first, because the compilation will produce new AML files and overwrite the original files.

Considerations for selecting patches above:
–B0D3 (name may not be the same) you can use this command to find the file containing it ' grep-b3 _adr.*0x00030000 *.dsl '
–gfx0 (name may not be the same) you can use this command to find the file containing it ' grep-b3 _adr.*0x00020000 *.dsl '
– "Rename GFX0 to IGPU" needs to be hit by the file referenced to GFX0. Need "balancing renames" (that is, there are GFX0 files to play), you can use this command to find the file containing it ' grep-l GFX0 *.dsl '
– as in the previous instructions, "Rename b0d3 to Hdau". Use this command to find the file containing it ' grep-l b0d3 *.dsl '
– "Remove _DSM methods" needs to be played at the beginning (for files containing _DSM methods) (You can use this command to find the file containing it ' grep-l method.*_dsm *.dsl ')
– Previous posts, we advocated deleting all CPU-related SSDT, but now we need to keep them (if there is an error, hit the corresponding patch). Using the original CPU-related SSDT, you can no longer hit the "Fix Pnot/ppnt" patch for DSDT.
– The battery level display patch is associated with a specific model, here is an example of Asus G53SW.

Hit Patch mask alone display

Do you remember our goal? The _off method is called in the _ini method. For this purpose, we need to patch a series of previously obtained DSDT and SSDT to fix compilation errors, rename some names completely, and remove all _DSM methods.

So, how do you find SSDT that contains the _off method? We can do this with the grep command:
grep -l Method.*_OFF *.dsl
For the files we give, the following results are displayed:

    • Ssdt-10.dsl
    • Ssdt-11.dsl

Of course, you can use this command to find the _ini method:
grep -l Method.*_INI *.dsl
Results:

    • Dsdt.dsl
    • Ssdt-10.dsl
    • Ssdt-11.dsl
    • Ssdt-9.dsl

Note: SSDT-10 and SSDT-11 appear two times. The _off method we are looking for and the _ini method associated with it are likely to be in these two files.

Of course we can use MACIASL to find _off and _ini with an open file search, but it's easier and quicker to use grep commands.

Open SSDT-10.DSL, search for "Method (_ini") to find:

Method (_ini, 0, notserialized)//_ini:initialize
{
Store (Zero, \_SB. PCI0. RP05. PEGP._ADR)
}

This is a typical _ini method (INI is the abbreviation for initial, which is the initialization method), and is the method we want to invoke _off inside.

If we put the cursor in the method body (the programming term, which is the curly brace of the method). You can simply point the cursor to the name of the method, and we can see the ACPI path where the method is located. MACIASL will show this path in the lower left corner, our example is: SSDT-and \_SB. PCI0. RP05. PEGP, _ini. In this way, it is possible to infer the path of the _off method, which should be \_SB. PCI0. RP05. Pegp._off.

By now, we can infer that the _off method is in SSDT-10.DSL or SSDT-11.DSL. If you open SSDT-10.DSL search _off, you can find a method that is defined in the Powerresource macro. This is not the _off method we are looking for. Then open SSDT-11.DSL Search, you can find a regular (more standard) _off method, it is the method we want to find. Now, we find out where _off is. We need to check the _off code to see if there is access to the EC.

The _off definition in SSDT-11.DSL:

Method (_off, 0, serialized)//_off:power OFF
{
If (LEqual (CTXT, Zero))
{
\_SB. PCI0. LPCB. EC0. SPIN (0x96, Zero)
If (Lnotequal (GPRF, one))
{
Store (Vgar, Vgab)
}

Store (one, CTXT)
}

Sgof ()
}

By checking, we can see inside access to the EC (\_SB. PCI0. LPCB. EC0. SPIN (0x96, Zero). The access to the EC code here will cause some problems, and it will block the full execution of the code when _ini calls _off. Take a good look at this and sometimes the code might not look good. In some cases, the code does not directly access the EC, but instead calls the method defined in the EC (indirect access). So, for some computer situations, you need to drill down into the code. And our example is to give the word EC0 directly.

The best way to deal with EC access is to remove the nasty code from _off (Haha, English is really straightforward).

We can delete them manually, or we can remove them automatically with patches:

into method label _off Parent_label \_SB. PCI0. RP05. PEGP Code_regex. *ec.* removeall_matched;
The modified _off method is this:
Code:
Method (_off, 0, serialized)//_off:power OFF
{
If (LEqual (CTXT, Zero))
{
If (Lnotequal (GPRF, one))
{
Store (Vgar, Vgab)
}

Store (one, CTXT)
}

Sgof ()
}

(Landlord reminder: This patch and model has a strong correlation, it can be said that for this model.) Other computers need to be patched, or deleted manually. )

We need to save the deleted code somewhere else, because we have to use the deleted code in _reg. (our example is: \_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero) ).

Now, we have fixed the _off method. So let's go to the _ini in SSDT-10.DSL and call _off.

We can use ready-made patches: "Disable from _ini (SSDT)". However, the access path in the patch is the general case. And our example is special, so we need to change the patch. In addition, the _off that we want to invoke is defined in SSDT-11.DSL (that is, outside of SSDT-10.DSL), so we need to use the external declaration to tell the compiler that this method is outside.

Modified patches: (Note your own path, need to change the path according to the actual, Parent_label and external)

into method label _ini Parent_label \_SB. PCI0. RP05. PEGP Insert
Begin
Added to turn Nvidia/radeon off\n
External (\_SB. PCI0. RP05. Pegp._off, methodobj) \ n
_off () \ n
End

After patching, now the _ini method becomes this:

Method (_ini, 0, notserialized)//_ini:initialize
{
Store (Zero, \_SB. PCI0. RP05. PEGP._ADR)
Added to turn Nvidia/radeon off
External (\_SB. PCI0. RP05. Pegp._off, Methodobj)
_off ()
}

Now, we need to turn our attention to the _reg in DSDT. The _reg method needs to replace the EC work done by the previous _off.

The following is the original _reg method:

Method (_reg, 2, notserialized)//_reg:region availability
{
If (LEqual (Arg0, 0x03))
{
Store (ARG1, ECFL)
}
}

Rehabman Patch Source, there is a patch used to call _off in _reg. We can make changes based on this patch:

into method label _reg Parent_hid pnp0c09 Insert
Begin
Added to turn Nvidia/radeon off\n
If (Land (lequal (arg0,3), lequal (arg1,1))) \ n
{\ n
External (\_SB. PCI0. PEG0. Pegp._off, methodobj) \ n
\_SB. PCI0. PEG0. Pegp._off () \ n
}\n
End

We need to change the _off in the patch into spin. (according to the actual situation, replace the previously found EC access code)

Modified patches:

into method label _reg Parent_hid pnp0c09 Insert
Begin
Added to turn Nvidia/radeon off\n
If (Land (lequal (arg0,3), lequal (arg1,1))) \ n
{\ n
\_SB. PCI0. LPCB. EC0. SPIN (0x96, Zero) \ n
}\n
End

The _reg method after patching has changed to this:

Method (_reg, 2, notserialized)//_reg:region availability
{
If (LEqual (Arg0, 0x03))
{
Store (ARG1, ECFL)
}
Added to turn Nvidia/radeon off
If (Land (lequal (arg0,3), lequal (arg1,1)))
{
\_SB. PCI0. LPCB. EC0. SPIN (0x96, Zero)
}
}

(We have to change the code according to the situation, the IF (Land (lequal (arg0,3), lequal (arg1,1)))

After doing all the steps, if it goes well, we can compile all the modified files together, then put them in the boot Read folder, let the boot load these files, to see the effect.

Note: our example files are quite complex and not all notebooks are the same. In most cases, the _ini method and the _off method, which are related to the single-manifestation, are in the same SSDT. In that case, we don't need to use the external declaration (to tell the compiler that an object is outside the file). You can hit this patch directly: "Call _off from _ini (SSDT)". In addition, there is the case that the _ini and _off in the DSDT (the patch can also be played directly). Also, not all computer _off will access the EC, in which case there is no need to move the code that accesses the EC to _reg.

Please note: All files need to be placed in the correct place according to the use of the boot (chameleon or clover) and boot to read and load them. In another post, there is a detailed description of this issue: [Authorized translation] using patch modification DSDT/SSDT [DSDT/SSDT Comprehensive tutorial]

In this post simply mention that you have to block all of the OEM SSDT to load your own modified SSDT. (Chameleon: Dropssdt=yes,,clover:dropoem=true).

Sleep/Wake problems

After the method is masked by this paste, some notebooks may have sleep/wake problems, even shutdown/restart issues. For example, HP's ProBook (Radeon models). The solution is: Open before sleep, and in the wake of the time when the mask alone.

Patches for such operations are available in the Rehabman patch source. The patch name is "disable/enable on _wak/_pts (DSDT)".

However, since our example of the _off/_on path is rather special (the patch is the general case), we need to change the patch.

Original patches for patch source:

into method label _pts Code_regex ([\s\s]*) replace_matched
Begin
External (\\_SB. PCI0. PEG0. pegp._on, methodobj) \ n
If (Condrefof (\\_SB. PCI0. PEG0. pegp._on)) {\\_SB. PCI0. PEG0. PEGP._ON ()}\n
%
End

into method label _wak Code_regex (return\s+\ (. *) replace_matched
Begin
External (\\_SB. PCI0. PEG0. Pegp._off, methodobj) \ n
If (Condrefof (\\_SB. PCI0. PEG0. Pegp._off)) {\\_SB. PCI0. PEG0. Pegp._off ()}\n
%
End

Modified Patch: (change PEG0 to Rp05,peg0 is the general situation)

into method label _pts Code_regex ([\s\s]*) replace_matched
Begin
External (\\_SB. PCI0. RP05. pegp._on, methodobj) \ n
If (Condrefof (\\_SB. PCI0. RP05. pegp._on)) {\\_SB. PCI0. RP05. PEGP._ON ()}\n
%
End

into method label _wak Code_regex (return\s+\ (. *) replace_matched
Begin
External (\\_SB. PCI0. RP05. Pegp._off, methodobj) \ n
If (Condrefof (\\_SB. PCI0. RP05. Pegp._off)) {\\_SB. PCI0. RP05. Pegp._off ()}\n
%
End

If your notebook screen is unique, there is no sleep/wake/restart/shutdown issues, then you do not need the above patch. You need to test for any of these problems before deciding to do the above changes.

Question Feedback

If you have a problem with DSDT/SSDT patching, or a bug fix, please provide all of your computer's original files.
If you are shielded by this method and are not successful, please provide the following data for the error:

Download Patchmatic:https://bitbucket.org/rehabman/os-x-maciasl-patchmatic/downloads/rehabman-patchmatic-2015-0107.zip
Unzip the patchmatic command-line tool and copy it to the/usr/bin directory.

Open the terminal and enter:
rm -R ~/Downloads/RehabMan
mkdir ~/Downloads/RehabMan
cd ~/Downloads/RehabMan
patchmatic -extract
Compress the resulting files (Zip) and upload them.

Also, you need to upload ioreg:[guide] How to make a Copy of Ioreg. Please use the Ioregistryexplorer v2.1 version provided in the post. Never use a different version of Ioregistryexplorer.

In the terminal, enter in sequence:
kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu

If you are using Clover boot, please upload the Efi/clover folder again. If you are using a chameleon or chimera boot, please upload the/extra folder again. (You can delete the theme files inside to reduce the volume of files that need to be uploaded).

All data needs to be compressed. (Zip format)

Original Sticker Address: Http://www.firewolf.science/2015/05/%E5%B1%8F%E8%94%BD%E5%8F%8C%E6%98%BE%E5%8D%A1%E7%AC%94%E8%AE%B0%E6%9C %ac%e7%9a%84%e7%8b%ac%e6%98%be/

[Reprint] Shielded dual graphics card notebook's unique display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.