Jump to content
CoolBits

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

21 posts in this topic

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites
Advertisement

I found some differences in ioreg under PNLF

282307656_ScreenShot2018-04-30at16_26_34.thumb.png.4fd44c884969fa23af2d7412df8059b0.png

How do i insert options from right ioreg window to my DSDT?

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

Did you tried:

 

Quote

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

 

 

Instead?

 

Insert it before:

"AAPL,backlight-control",

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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 ^_^ !

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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 :))

Share this post


Link to post
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

 

Share this post


Link to post
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 ^_^ .

Share this post


Link to post
Share on other sites

Thanks, i really wish it would be that simple.

PNLF is already present in original DSDT.

711790627_ScreenShot2018-05-13at08_27_16.png.ad11662c32d440a9813556ab0e9c8d05.png

 

59130556_ScreenShot2018-05-13at08_22_58.png.ae3331c81d5817beaa8758651b8efc3c.png

Share this post


Link to post
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;

 

Share this post


Link to post
Share on other sites

Yes i tried PNLF with this _DSM method, its same as in iMac 13,2.

I also added LCD device with brightness methods _BCL, _BCM, _BQC under GFX0 but it didnt work.

Thanks for trying to help :)1669347734_ScreenShot2018-05-13at18_24_25.png.918bab66d3af940986c543ec1633af8d.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Onestyle
      THIS IS STILL WORK IN PROGRESS
      Laptop : Sony Vaio- SVE1712W1EB



       
       
      OSX version : 10.13 - High Sierra - SMBIOS - MacBookPro9,1
       
      Motherboard : Intel HM76 Express
      DSDT FIX :



      Show Fan RPM's : Updated,now working with Latest Istat Menus and HWMonitor 



      CPU : i7 - 3632QM (2.2Ghz- 3.2Ghz) :



      Dedicated Graphics : AMD Radeon HD 7650M 2048MB 
      Full QE/CI and Resolution: 


      Fix gradient issue with AMD Graphics the fast way :


      Fix Brightness issue + brightness fn keys:


       
      Fix sleep issue  and naming issue with AMD Graphics :


       
      Integrated Graphics : Intel HD Graphics 4000 (can't be enabled in bios,no option)

      Touchpad and Keyboard :



      Wifi : AR9485 : 



      Ethernet : Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller : Works out of the box

      Sound : Realtek ALC269 -VC1 : 



      Battery: Works after patching : 





      Built-in Camera :




       
       

      OSX version : 10.12 - Sierra - SMBIOS - MacBookPro9,1
      Motherboard : Intel HM76 Express
      DSDT FIX :



      Show Fan RPM's : Updated,now working with Latest Istat Menus and HWMonitor 



      CPU : i7 - 3632QM (2.2Ghz- 3.2Ghz) :



      Dedicated Graphics : AMD Radeon HD 7650M 2048MB
      Full QE/CI and Resolution:


      Fix gradient issue with AMD Graphics the fast way :


      Fix Brightness issue + brightness fn keys:



      Integrated Graphics : Intel HD Graphics 4000 (can't be enabled in bios,no option)

      Touchpad and Keyboard :



      Wifi : AR9485 :



      Ethernet : Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller : Works out of the box

      Sound : Realtek ALC269 -VC1 :



      Battery: Works after patching :





      Built-in Camera :






      OSX version : 10.11.6 - El Capitan - SMBIOS - MacBookPro9,1

      Motherboard : Intel HM76 Express
      DSDT FIX :



      Show Fan RPM's : Updated,now working with Latest Istat Menus and HWMonitor 



      CPU : i7 - 3632QM (2.2Ghz- 3.2Ghz) :



      Dedicated Graphics : AMD Radeon HD 7650M 2048MB
      Full QE/CI and Resolution:


      Fix gradient issue with AMD Graphics the fast way :


      Fix Brightness issue + brightness fn keys:



      Integrated Graphics : Intel HD Graphics 4000 (can't be enabled in bios,no option)

      Touchpad and Keyboard :



      Wifi : AR9485 :



      Ethernet : Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller : Works out of the box

      Sound : Realtek ALC269 -VC1 :



      Battery: Works after patching :





      Built-in Camera :





      UPDATED : October 9. 2016.
    • By Marta Reis
      Hi, After a successful installation of 10.10.5 on my x99 system there are still things to fix on post.
       
      I would appreciate every one's help and contribution to solve these problems. 
       
      Needing to be fixed:
      Backlight/Brightness control Sleep/Wake (It doesn't sleep properly and doesn't wake up through mouse touch or keyboard) ThunderboltEX II isn't recognized being the great mystery of this build (devices are always plugged before booting, Bios Security ID is set to Legacy, the card is installed on Pcie x4_1 and recognized in Windows) AppleThunderboltNHI.kext was removed for faster booting Speedstep not accomplished        Nvidia Driver - I can't select it at system preferences. OSX default driver assumes control. One of my software's displays the message "NO CUDA ACCELERATION HARDWARE DETECTED".
      config.plist.zip
      IoReg mac.zip
      SSDT-1.aml.zip
      001_2016-04-15_22-27-13_MacPro6,1.zip
    • By tempered
      My hackintosh is currently running 10.6.8 on an HP 4530s, and I experience an issue where I can't fine tune the screen brightness after I first turn it on. In order to control screen brightness properly I need to sleep the display first, then wake it back on, and finally I can fine tune the brightness. I grew tired of needing to do that everytime I booted so I decided to find a work-around. Once I figured out a reliable method I went ahead and packaged it up for anyone who might also benefit from it!
       
      In no way do I guarantee this will work for everyone, but give it a shot if you have the brightness bug. The patch makes no permanent changes and does not require elevated access to install. It's all local to the user and does not make any system changes. It has a provided uninstaller just in case things go awry!
       
      The README in the .zip contains all information about the files that will be installed and what they do. The patch is a collective of two open source applications to control the screen and brightness via command line, and some bash scripting by me. It requires the Terminal to install for now... I don't know a thing about making a GUI Installer but if anyone can provide any tips, I would be greatful!
       
      Download the zip, use Terminal to install by navigating to the file and typing "./install.sh", then log out or reboot to enable the patch.
       
      - Adam
      brightness_fix.zip
×