Jump to content

GTX 765M in iMac 11,1 (Late 2009) display brightness fix


CoolBits
 Share

26 posts in this topic

Recommended Posts

Hello to all hackers here.

 

I have an iMac from late 2009 with i5, 8Gb and dead ATI HD 4850M, worked great until recently.

 

I replaced dead MXM 4850 with an GTX 765M 2Gb which works oob but without bootscreen and brightness adjustment.

About bootscreen i know it needs apple efi but this is coming later.

 

What i would really need now is some help in getting the brightness adjustment to work.

I installed clover in tried some DSDT stuff but i only got black screeen with mouse pointer and backlight on, tried also almost all clover options for NVIDIA cards with no efect on brightness.

I think main problem is in display detection as external and not built in because all needed kexts are loaded.

516073044_ScreenShot2018-04-29at20_10_39.png.543d77a7e083aeac9655f945c21dc998.png

 

I would be really happy if we could make this work.

 

https://cloudstation.klopcic.eu/ACPI-original.zip

https://cloudstation.klopcic.eu/iMac.ioreg.zip

https://cloudstation.klopcic.eu/ACPI_with_765.zip

Edited by CoolBits
insert files
Link to comment
Share on other sites

I started adding options to my patched DSDT that are present in imac with original card and missing in mine, and discovered why i got black screen with mouse visible and backlight.

I must have all 4 connectors inside @0..3, if i put only @3 (where my display is connected) i get black screen.

This is currently in my DSDT under GFX0:

Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method

                    {

                        If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))

                        {

                            If (LNotEqual (And (VID0, 0xFFFF), 0xFFFF))

                            {

                                Store (Package (0x28)

                                    {

                                        "AAPL,backlight-control",

                                        Buffer (0x04)

                                        {

                                             0x00, 0x00, 0x00, 0x00                     

                                        },


                                        "AAPL01,blackscreen-preferences",

                                        Buffer (0x04)

                                        {

                                             0x00, 0x00, 0x00, 0x08                     

                                        },


                                        "AAPL00,inverterFrequency",

                                        Buffer (0x04)

                                        {

                                             0x08, 0x52, 0x00, 0x00                     

                                        },


                                        "AAPL,aux-power-connected",

                                        Buffer (0x04)

                                        {

                                             0x01, 0x00, 0x00, 0x00                     

                                        },


                                        "bksv",

                                        Buffer (0x04)

                                        {

                                             0x9F, 0x00, 0x00, 0x00                     

                                        },


                                        "subsystem-id",

                                        Buffer (0x04)

                                        {

                                             0xB5, 0x00, 0x00, 0x00                     

                                        },


                                        "subsystem-vendor-id",

                                        Buffer (0x04)

                                        {

                                             0x6B, 0x10, 0x00, 0x00                     

                                        },


                                        "@0,display-connect-flags",

                                        Buffer (0x04)

                                        {

                                             0x00, 0x00, 0x00, 0x00                     

                                        },


                                        "@1,display-connect-flags",

                                        Buffer (0x04)

                                        {

                                             0x00, 0x00, 0x00, 0x00                     

                                        },


                                        "@2,display-connect-flags",

                                        Buffer (0x04)

                                        {

                                             0x00, 0x00, 0x00, 0x00                     

                                        },


                                        "@3,display-connect-flags",

                                        Buffer (0x04)

                                        {

                                             0x04, 0x00, 0x00, 0x00                     

                                        },


                                        "@3,display-inverter",

                                        Buffer (0x04)

                                        {

                                             0x02, 0x00, 0x00, 0x00                     

                                        },


                                        "@3,AAPL,boot-display",

                                        Buffer (0x04)

                                        {

                                             0x01, 0x00, 0x00, 0x00                     

                                        },


                                        "@3,display-dither-support",

                                        Buffer (0x04)

                                        {

                                             0x01, 0x00, 0x00, 0x00                     

                                        },


                                        "@3,backlight-PWM-freq",

                                        Buffer (0x04)

                                        {

                                             0x08, 0x52, 0x00, 0x00                     

                                        },


                                        "@3,display-inverter-default-cycle",

                                        Buffer (One)

                                        {

                                             0xB7                                       

                                        },


                                        "@3,NVDA,ActiveFlags",

                                        0x0100,

                                        "@3,NVDA,ControlFlags",

                                        0x0100,

                                        "@3,inverter-current",

                                        Buffer (0x04)

                                        {

                                             0x00, 0x00, 0x00, 0x00                     

                                        },


                                        "hda-gfx",

                                        Buffer (0x0A)

                                        {

                                            "onboard-1"

                                        }

                                    }, Local0)

                                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))

                                Return (Local0)

                            }

                        }

No more black screen and dither is enabled which is nice, all options are visible in ioreg and so valid.

 

If i add

"@3,built-in",

Buffer (Zero) {}

 i still get black screen (no mouse and no backlight) and with remote display i see that display is not connected.

 

What is AGPM gpu-control? This is usualy under @0 but if i add "built-in" option to @3, AGPM connects to @3 and no display...

I would really appreciate little help.

  • Like 1
Link to comment
Share on other sites

AGPM is short for Apple Graphics Power Management. you would have to look at the ioreg of a mac model with your similar graphics card lke maybe imac 2013 or mac book pro 2013/14 wich have GTX-750-775 family cards. you can search everymac.com for more info on the machines

Link to comment
Share on other sites

Great thanks!

Already looking into it, i see nvidia cards have many different options, main difference here is that imac 14,2 with gtx755 is not MXM module but soldered.

Going to test some :)

Link to comment
Share on other sites

Did you tried:

 

Quote

"AAPL,slot-name", 
"Built In",

 

 

Instead?

 

Insert it before:

"AAPL,backlight-control",
Link to comment
Share on other sites

7 hours ago, ammoune78 said:

Did you tried:

 

 

Instead?

 

Insert it before:


"AAPL,backlight-control",

Thanks for suggestion, i tried it now but nodifference and also no black screen. Also this option doesn exist in my imac or 14,2 imac.

195922860_ScreenShot2018-05-04at15_42_03.thumb.png.fb9823efdedffba0bb997fb2304f748d.png

 

1 hour ago, joe75 said:

OMG! I had to do a double take when I seen a CoolBits post. :P

 

Nice to see you're still alive and hacking. I hope life has been treating you well.

 

Yes still here, its always about GPU :D

Link to comment
Share on other sites

Here's one from our hackintosh nvidia patches, i always do the same as Apple:

 

Quote

#

# NVIDIA

# Insert device parameters (Nvidia Graphics) into GFX0

into device label GFX0 insert begin

Name (_ADR, Zero)  // _ADR: Address\n

Name (_SUN, One)  // _SUN: Slot User Number\n

OperationRegion (PEGH, PCI_Config, 0x00, 0x40)\n

Field (PEGH, ByteAcc, NoLock, Preserve)\n

{\n

VID0,   16,\n

DID0,   16\n

}\n

\n

Method (_DSM, 4, NotSerialized)\n

{\n

If (LEqual (Arg0, Buffer (0x10)\n

    {\n

        /* 0000 */    0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,\n

        /* 0008 */    0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B\n

    }))\n

    {\n

    If (LNotEqual (And (VID0, 0xFFFF), 0xFFFF))\n

    {\n

Store (Package () {\n

"AAPL,slot-name", Buffer () {"Built In"},\n

"@0,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"@1,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"@2,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"@3,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"model", Buffer () {"Nvidia GeForce GTX 765M"},\n

"hda-gfx", Buffer () {"onboard-1"}\n

}, Local0)\n

DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n

Return (Local0)\n

}\n

} Return (0x80000002)\n

}\n

end;

 

 

But IMHO, i will recommend you to do a F4 from clover boot menu, and then take a look at EFI\CLOVER\ACPI\origin, and search for SaSsdt, open it with MaciASL with revision 4.0, and look at the _DSM already there, and add the following:

 

Quote

AAPL,slot-name", Buffer () {"Built In"},\n

"@0,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"@1,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"@2,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

"@3,connector-type", Buffer() { 0x00, 0x08, 0x00, 0x00 },\n

 

 

And you can also add:

 

Quote

into device label GFX0 insert begin

Name (_ADR, Zero)  // _ADR: Address\n

Name (_SUN, One)  // _SUN: Slot User Number\n

end;

 

 

But you have to move them on the top of the GFX0 code, right after:

Device (GFX0)

{

    Name (_ADR, Zero)  // _ADR: Address

    Name (_SUN, One)  // _SUN: Slot User Number

 

Or you can do in clover config the following:

 

In Boot:

nvda_drv=0

 

In Graphics:

Inject Nvidia=True

 

 

Link to comment
Share on other sites

Thanks for suggestions.

This is my current device config:

                Device (GFX0)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                    {
                        0x09, 
                        0x04
                    })
                    OperationRegion (PEGH, PCI_Config, Zero, 0x40)
                    Field (PEGH, ByteAcc, NoLock, Preserve)
                    {
                        VID0,   16, 
                        DID0,   16
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
                        {
                            If (LNotEqual (And (VID0, 0xFFFF), 0xFFFF))
                            {
                                Store (Package (0x20)
                                    {
                                        "NVDA,features", 
                                        Buffer (0x04)
                                        {
                                             0xFF, 0x16, 0x20, 0x01                         
                                        }, 

                                        "AAPL,backlight-control", 
                                        Buffer (0x04)
                                        {
                                             0x00, 0x00, 0x00, 0x00                         
                                        }, 

                                        "graphic-options", 
                                        Buffer (0x04)
                                        {
                                             0x0C, 0x00, 0x00, 0x08                         
                                        }, 

                                        "NVDA,invalid-config", 
                                        Buffer (0x04)
                                        {
                                             0x00, 0x00, 0x00, 0x00                         
                                        }, 

                                        "NVKernelLoaded", 
                                        Buffer (0x04)
                                        {
                                             0x01, 0x00, 0x00, 0x00                         
                                        }, 

                                        "subsystem-id", 
                                        Buffer (0x04)
                                        {
                                             0xB5, 0x00, 0x00, 0x00                         
                                        }, 

                                        "subsystem-vendor-id", 
                                        Buffer (0x04)
                                        {
                                             0x6B, 0x10, 0x00, 0x00                         
                                        }, 

                                        "@0,display-connect-flags", 
                                        Buffer (0x04)
                                        {
                                             0x00, 0x00, 0x00, 0x00                         
                                        }, 

                                        "@1,display-connect-flags", 
                                        Buffer (0x04)
                                        {
                                             0x00, 0x00, 0x00, 0x00                         
                                        }, 

                                        "@2,display-connect-flags", 
                                        Buffer (0x04)
                                        {
                                             0x00, 0x00, 0x00, 0x00                         
                                        }, 

                                        "@3,display-connect-flags", 
                                        Buffer (0x04)
                                        {
                                             0x04, 0x00, 0x00, 0x00                         
                                        }, 

                                        "@3,AAPL,boot-display", 
                                        Buffer (Zero) {}, 
                                        "@3,display-dither-support", 
                                        Buffer (0x04)
                                        {
                                             0x01, 0x00, 0x00, 0x00                         
                                        }, 

                                        "@3,use-backlight-blanking", 
                                        Buffer (Zero) {}, 
                                        "@3,display-cfg", 
                                        Buffer (0x04)
                                        {
                                             0x03, 0x04, 0x08, 0x00                         
                                        }, 

                                        "hda-gfx", 
                                        Buffer (0x0A)
                                        {
                                            "onboard-1"
                                        }
                                    }, Local0)
                                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                                Return (Local0)
                            }
                        }

                        Return (0x80000002)
                    }
                }

This is default with added some options that are missing.

 

connector-type 0x00, 0x08, 0x00, 0x00 is HDMI?, i need DP which is 0x00 0x04 0x00 0x00 i think.

Should i try with DP connector? The screen works fine otherwise... i would first need to get it recognised as internal to get brightness working.

 

 

No bootscreen for me and so no F4 for clover that is the other problem...

 

Will try

In Boot:

nvda_drv=0

 

In Graphics:

Inject Nvidia=True

 

Interesting... with Inject Nvidia i got black loading screen after the driver started and just before login screen. Never seen that on a mac.

 

Edited by CoolBits
Link to comment
Share on other sites

Use the real connector types that you have, DP, and here's iMac 11,1 dump , just take the SaSsdt.dsl from ACPI\DSL\ folder, and start there, but once done, just add dict to drop SaSsdt in config from the OEM tables, otherwise you'll result with KP while booting ^_^ !

Link to comment
Share on other sites

Yes my patched DSDT is built from exactly that file + options from my original + imac 14,2 with NVIDIA gtx 755.

Also my extracted DSDT is exactly the same as that from dump on link. Same mac, same dsdt.

 

The difference is only in video card, my current card is not apple and  so without apple efi driver in vbios.

 

Will try adding connectors.

Edited by CoolBits
Link to comment
Share on other sites

Ohh, well do it in DSDT, i wasn't aware about that imac using graphics code in DSDT! So no dropping, but you should find where the code apply to brightness, and about that internal, you should keep some code from your real dsdt, do not use all code from iMac with GTX 755

Edited by ammoune78
Link to comment
Share on other sites

Yes this is what im trying to do but cant find any code about brightness in imac 11,1 DSDT and cant use code from imac 14,2 because that has built in GPU (not mxm) + IGPU and probably even different display type.

Is it possible to be just a nvram variable for brightness?

 

I tried connectors and removed inject nvidia as it makes no difference.

here is my current ioreg + imac 14,2 ioreg

https://cloudstation.klopcic.eu/current-iMac.ioreg

https://cloudstation.klopcic.eu/iMac-gtx755.ioreg

Edited by CoolBits
Link to comment
Share on other sites

I can suggest you MaLdOn and RehabMan and for sure THe KiNG as he know to much about ACPI code, from what i know.

Link to comment
Share on other sites

Thanks, will try to contact them.

I tried almost every option i could find for attaching display and device but nothing works.

Everytime i put @#,built-in to DSDT under GFX0 i get black screen with no display attached in ioreg.

Display only works on @3 and FBIndex 0x3, every other combination results in no picture only backlight and mouse.

As i already said, my knowledge ends here. (at the moment :))

Link to comment
Share on other sites

Well looks like i did it half way.

I put in board id from imac 14.2 and now with "@3,built-in" recognizes display properly as built in and also all commands and graphics for brightness work.

It just doesnt change brightness yet.

As a bonus for my trouble i got "night shift" option from imac 14.2 in display preference :)

1445543511_ScreenShot2018-05-13at00_04_16.thumb.png.b54b3b6c9c7f553821936163a149bd85.png

 

  • Like 2
Link to comment
Share on other sites

54 minutes ago, CoolBits said:

Well looks like i did it half way.

I put in board id from imac 14.2 and now with "@3,built-in" recognizes display properly as built in and also all commands and graphics for brightness work.

It just doesnt change brightness yet.

As a bonus for my trouble i got "night shift" option from imac 14.2 in display preference :)

 

Glade to see that progress worked for you, for brightness, you need to add PNLF_SSDT from rehabman GitHub repos ^_^ .

Link to comment
Share on other sites

I know that, but it was read by clover, it's not enough, you can try this:

 

Quote

#
# PNLF
# Add the missing PNLF device for Backlight 
into scope label _SB insert begin
Device (PNLF)\n
{\n
    Name (_ADR, Zero)\n
    Name (_HID, EisaId ("APP0002"))\n
    Name (_CID, "backlight")\n
    Name (_UID, 0x0A)\n
    Name (_STA, 0x0B)\n
    Method (_DSM, 4, NotSerialized)\n
    {\n
            Store (Package () {\n
                "refnum", "Zero",\n
                "type", "BLCT",\n
            }, Local0)\n
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
            Return (Local0)\n
        } Return (Zero)\n
}\n
end;

 

Link to comment
Share on other sites

  • 8 months later...
  • 2 months later...
  • 4 weeks later...

Same conf here, managed to fix a iMac (27-inch, Mid 2011) by installing a NVidia GTX 765M 2Gb - no bootscreen, no dimming - using «screen shade» at the moment. 

I would love to learn of a better solution - the machine is heating up quickly, too. 

 

 

Link to comment
Share on other sites

  • 4 weeks later...
On 4/29/2019 at 5:11 AM, Pit66 said:

Same conf here, managed to fix a iMac (27-inch, Mid 2011) by installing a NVidia GTX 765M 2Gb - no bootscreen, no dimming - using «screen shade» at the moment. 

I would love to learn of a better solution - the machine is heating up quickly, too. 

 

 

 

Install Mac Fans Control app to control your fans.  I use QuickShade app to control my brightness (same machine, same video card).  My temps are fine.  There is a good thread on the subject over at MacRumors.com, btw.  But it's a l o n g one.

Link to comment
Share on other sites

 Share

×
×
  • Create New...