Jump to content

Disabling NVIDIA Optimus card on all laptops


Whit3Spirit
 Share

345 posts in this topic

Recommended Posts

Yes it is the disassembling problem.  My challenge is to get SSDTs compiled...  Even disassembling with -da *.aml leaves errors...  I am working on it, let you know if I ever succeed.

Rehabman,

 

Ok, I am really over my head now;  I reduced the problem of compiling my SSDT to two errors:

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(141) : error    6126: syntax error, unexpected PARSEOP_FIELD

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(551) : error    6126: syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File

Which I think related to:

        OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)

            {

                VGAR,   2048

            })

The culprit is EBAS(0x1000) I think, I really need your expert opinion.  I am enclosing all the aml files that I have extracted in the attached zip file and many thanks in advance for your help. 

Originals.zip

Link to comment
Share on other sites

Rehabman,

 

Ok, I am really over my head now;  I reduced the problem of compiling my SSDT to two errors:

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(141) : error    6126: syntax error, unexpected PARSEOP_FIELD

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(551) : error    6126: syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File

Which I think related to:

        OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)

            {

                VGAR,   2048

            })

The culprit is EBAS(0x1000) I think, I really need your expert opinion.  I am enclosing all the aml files that I have extracted in the attached zip file and many thanks in advance for your help.

Fighting Intel iasl bugs here... iasl -da doesn't work (bug in iasl)! Something about "ACPI Error: Null object, but type not ACPI_TYPE_ANY (20140214/nsobject-179)"

 

 

So you have to disassemble individually and fix the mess.

 

The disassembler thinks that EBAS is a method taking one parameter. But if you look in DSDT, you see that it isn't. It is a FieldUnitObj.

 

So...

// External (EBAS, MethodObj) 
External(EBAS, FieldObj)
..
        //OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
        //    {
        //        VGAR,   2048
       //     })
        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            }//) // balancing...
Link to comment
Share on other sites

Fighting Intel iasl bugs here... iasl -da doesn't work (bug in iasl)! Something about "ACPI Error: Null object, but type not ACPI_TYPE_ANY (20140214/nsobject-179)"

 

 

So you have to disassemble individually and fix the mess.

 

The disassembler thinks that EBAS is a method taking one parameter. But if you look in DSDT, you see that it isn't. It is a FieldUnitObj.

 

So...

// External (EBAS, MethodObj) 
External(EBAS, FieldObj)
..
        //OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
        //    {
        //        VGAR,   2048
       //     })
        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            }//) // balancing...

Ok, Now I have an option with your suggestion of commenting  above;  To use \RMDT.PUSH in SSDT is this definition correct "Extternal (\RMDT.PUSH, MethodObj)" ?

Link to comment
Share on other sites

Ok, Now I have an option with your suggestion of commenting  above;  To use \RMDT.PUSH in SSDT is this definition correct "Extternal (\RMDT.PUSH, MethodObj)" ?

There is a patch in the ACPIDebug DSDT patch repo for the externs...

Link to comment
Share on other sites

There is a patch in the ACPIDebug DSDT patch repo for the externs...

Good morning RehabMan,

 

Couple of points.  yes I did find the  patch for externs and applied to my SSDT.  However the compiler insists that it is guessing P1, P2 etc requires 6 arguments and messes up at least when disassemble.

The Other issue I have is I get compile error on External (EBAS, FieldObject)  it does not like FieldObject!  Incidently I build your version of isal and use that.

How fo you get FieldObject passed by the compiler?

Thanks in advance,

Artimess

Link to comment
Share on other sites

Good morning RehabMan,

 

Couple of points.  yes I did find the  patch for externs and applied to my SSDT.  However the compiler insists that it is guessing P1, P2 etc requires 6 arguments and messes up at least when disassemble.

Yes, of course... External declarations DO NOT carry into the AML, so the disassembler must guess. Thus the importance of disassembly in a group (with iasl -da). Just work with the .dsl as if they are source code... after initial disassembly, work only with the resulting .dsl files and never disassemble unless you update your BIOS. Disassembly is NOT something you should be doing every time...

 

The Other issue I have is I get compile error on External (EBAS, FieldObject)  it does not like FieldObject!  Incidently I build your version of isal and use that.

How fo you get FieldObject passed by the compiler?

Thanks in advance,

Artimess

It is FieldUnitObj, not FieldObject.

 

Read ACPI spec: http://acpi.info/spec.htm

Link to comment
Share on other sites

Hi Artimess,

try with that : https://www.dropbox.com/s/w84mvfaqyt7ampb/SSDT%28Artimess%29.aml

 

Apparently, external link cause the problem, this is not the OR. External link just cause an iASL bug... don't understand why but it's working now.

 

Modified :

OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            })
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

to :

        OperationRegion (GNVS, SystemMemory, 0xAAF25C18, 0x0172)
        Field (GNVS, AnyAcc, Lock, Preserve)
        {
            Offset (0x100),
            EBAS,   32
        }

        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            VGAR,   2048,
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }
Link to comment
Share on other sites

Hi Artimess,

try with that : https://www.dropbox.com/s/w84mvfaqyt7ampb/SSDT(Artimess).aml

 

Apparently, external link cause the problem, this is not the OR. External link just cause an iASL bug... don't understand why but it's working now.

 

Modified :

OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            })
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }
to :

        OperationRegion (GNVS, SystemMemory, 0xAAF25C18, 0x0172)
        Field (GNVS, AnyAcc, Lock, Preserve)
        {
            Offset (0x100),
            EBAS,   32
        }

        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            VGAR,   2048,
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

 

Did you read post #105? Not an iasl bug, but rather an iasl limitation. Externals are not encoded in the resulting AML. Therefore, the iasl disassembler must guess about any unresolved symbols when disassembling an AML standalone. Sometimes it cannot guess the correct configuration of the external symbol (because guessing is always imperfect). Thus why disassembly should always be done with the entire group of AML files (iasl -da) and only when necessary (eg. after initial extraction).

 

I should probably forget about trying to explain this to people, because unless you have a background in programming, it will probably never sink in.

 

Bottom line: Disassembly of AMLs is good (surprisingly good, actually), but imperfect. Don't disassemble unless absolutely necessary. Treat your edited DSL files as source code, and the resulting AML as binary results from compilation. Never open the AMLs directly for editing -- only open properly disassembled DSL files or DSL files you previously created via disassembly and patching.

Link to comment
Share on other sites

Okay. I'm obviously not a Programmer, I'm a mason.  ^_^  But I learned over time and experiences of others. This is my passion.

 

Maybe I made a mistake in my work then?

No. Just don't expect disassembly of an AML that has many external references to compile error free. It is an unreasonable expectation as the AML format was not designed for perfect disassembly.

Link to comment
Share on other sites

 

Hi Artimess,

try with that : https://www.dropbox.com/s/w84mvfaqyt7ampb/SSDT%28Artimess%29.aml

 

Apparently, external link cause the problem, this is not the OR. External link just cause an iASL bug... don't understand why but it's working now.

 

Modified :

OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            })
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

to :

        OperationRegion (GNVS, SystemMemory, 0xAAF25C18, 0x0172)
        Field (GNVS, AnyAcc, Lock, Preserve)
        {
            Offset (0x100),
            EBAS,   32
        }

        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            VGAR,   2048,
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

Bonjour, un grand merci pour ton aide. 

Thanks for your help.

  • Like 1
Link to comment
Share on other sites

Hi daxuexinsheng, copy these methods just in on line like that. Say to me if it's working pls.

 

Method (M_ON, 0, NotSerialized)
    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._ON)) { \_SB_.PCI0.PEG0.PEGP._ON() }  If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS0)) { \_SB_.PCI0.PEG0.PEGP._PS0() } }
Method (M_OF, 0, NotSerialized)
    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._OFF)) { \_SB_.PCI0.PEG0.PEGP._OFF() } If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS3)) { \_SB_.PCI0.PEG0.PEGP._PS3() } }

Link to comment
Share on other sites

Tried on MSI GE60 2OE, didn't work and it broke working sleep

I also attached original dsdt dsdt-hdmi1.rar


I also had same problem, I copied from here https://www.dropbox.com/s/p2epjg7mpg9cyxc/OptimusRemoved.patch instead, line that has + in front indicates that those are the line to be inserted to.

 

When I add the method M_ON and M_OF before the _WAK method,it comes the error:

 

"Input file does not appear to be an ASL or data table source file"

 

What should I do?

Link to comment
Share on other sites

can someone help me to patch my DSDT? i use a intel hd 3000 and a nvidia gt610m!

 

when i patch the dsdt with chameleon i got these errors:

/Users/PC/cw_dsdt/dsdt.dsl   3782:             \_SB.PCI0.PEG0.PEGP._ON (\_SB.PCI0.PEG0.PEGP._PS0 ())
Error    4084 -                                       Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._ON)

/Users/PC/cw_dsdt/dsdt.dsl   3782:             \_SB.PCI0.PEG0.PEGP._ON (\_SB.PCI0.PEG0.PEGP._PS0 ())
Error    4084 -                                                                 Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._PS0)

/Users/PC/cw_dsdt/dsdt.dsl   3790:             \_SB.PCI0.PEG0.PEGP._OFF (\_SB.PCI0.PEG0.PEGP._PS3 ())
Error    4084 -                                        Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._OFF)

/Users/PC/cw_dsdt/dsdt.dsl   3790:             \_SB.PCI0.PEG0.PEGP._OFF (\_SB.PCI0.PEG0.PEGP._PS3 ())
Error    4084 -                                                                  Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._PS3)

attached is my DSDT! thank you :)

can someone help me?

Link to comment
Share on other sites

For some reason, this isn't working on my Dell n5110. 

 

I have to copy the entire PEG0 device from the SSDT to the DSDT and call the _PS3 method from _INI to get the nvidia card disabled.

 

Trying to call _PS3 directly as per this guide doesn't work!!

Link to comment
Share on other sites

Hi daxuexinsheng, copy these methods just in on line like that. Say to me if it's working pls.

 

Method (M_ON, 0, NotSerialized)

    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._ON)) { \_SB_.PCI0.PEG0.PEGP._ON() }  If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS0)) { \_SB_.PCI0.PEG0.PEGP._PS0() } }

Method (M_OF, 0, NotSerialized)

    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._OFF)) { \_SB_.PCI0.PEG0.PEGP._OFF() } If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS3)) { \_SB_.PCI0.PEG0.PEGP._PS3() } }

 

It works,Thank you! :-)

Link to comment
Share on other sites

@Whit3Spirit:

 

Here are my untouched DSDT and SSDT dumps from AIDA64.

 

Also attached is my current patched DSDT that correctly disables the nvidia card. 

 

Your method is a non classic method for shutdown the discrete card. It is SGOF and SGON.

 

Try with that :

https://www.dropbox.com/s/as0jn4mrfe7s3kj/DSDT%28Dr.%20Hurt%29.aml

Link to comment
Share on other sites

Your method is a non classic method for shutdown the discrete card. It is SGOF and SGON.

 

Try with that :

https://www.dropbox.com/s/as0jn4mrfe7s3kj/DSDT%28Dr.%20Hurt%29.aml

 

That worked too :)

 

Now the question is, would I be able to the same without copying all those methods from the SSDT?

Link to comment
Share on other sites

Yes, with screwdrivers and pliers :P

 

gee thanks  <_<

 

What I meant is, why is it not possible to call method SGOF directly from the DSDT using "External (_SB_.PCI0.PEG0.PEGP.SGOF, MethodObj)" as per your guide? Why do I have to copy all those methods from SSDT to DSDT?

Link to comment
Share on other sites

gee thanks  <_<

 

What I meant is, why is it not possible to call method SGOF directly from the DSDT using "External (_SB_.PCI0.PEG0.PEGP.SGOF, MethodObj)" as per your guide? Why do I have to copy all those methods from SSDT to DSDT?

Probably because your SSDT is not loading or is being rejected due to other errors. See post #79 where I detail some of the causes.

Link to comment
Share on other sites

 Share

×
×
  • Create New...