Jump to content

Tracing back the AMD GPU wakeup issue to its origin

AMD GPU Sierra El Capitan sleep wakeup Radeon

  • Please log in to reply
249 replies to this topic

#41
Carpentryplus25

Carpentryplus25

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
  • Gender:Male

One more confirmed working VisionTek AMD HD 7970 devID 6798 with CSM disabled and iGPU as secondary and using Namako framebuffer with connector patch, Hamachi and Futomaki result in black screen even with connector patch. Sleep working great also. Thanks great work!



#42
zxv

zxv

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 147 posts
  • Gender:Male
Seems to work perfectly for my R9 380X in UEFI boot. No more WhateverGreen needed, no Clover injection used.
 
Using a tweaked ACPI 6.0 compatible SSDT. Could probably be slimmed down further by removing superfluous device properties:
/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20170929 (64-bit version)
 * Copyright (c) 2000 - 2017 Intel Corporation
 *
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of iASLVulVNL.aml, Tue Oct 31 19:55:21 2017
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x000002BD (701)
 *     Revision         0x02
 *     Checksum         0xF3
 *     OEM ID           "APPLE "
 *     OEM Table ID     "SSDTAMDG"
 *     OEM Revision     0x00001000 (4096)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20170929 (538380585)
 */
DefinitionBlock ("", "SSDT", 2, "APPLE ", "SSDTAMDG", 0x00001000)
{
    External (_SB_.PCI0, DeviceObj)
    External (_SB_.PCI0.PEG0, DeviceObj)
    External (_SB_.PCI0.PEG0.GFX0, DeviceObj)

    Scope (\_SB.PCI0.PEG0)
    {
        Scope (GFX0)
        {
            OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
            Field (PCIB, AnyAcc, NoLock, Preserve)
            {
                Offset (0x10),
                BAR0,   32,
                BAR1,   32,
                BAR2,   64,
                BAR4,   32,
                BAR5,   32
            }

            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If ((BAR5 == Zero))
                {
                    Local0 = BAR2 /* \_SB_.PCI0.PEG0.GFX0.BAR2 */
                }
                Else
                {
                    Local0 = BAR5 /* \_SB_.PCI0.PEG0.GFX0.BAR5 */
                }

                OperationRegion (GREG, SystemMemory, (Local0 & 0xFFFFFFFFFFFFFFF0), 0x8000)
                Field (GREG, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x6800),
                    GENA,   32,
                    GCTL,   32,
                    LTBC,   32,
                    Offset (0x6810),
                    PSBL,   32,
                    SSBL,   32,
                    PTCH,   32,
                    PSBH,   32,
                    SSBH,   32,
                    Offset (0x6848),
                    FCTL,   32,
                    Offset (0x6EF8),
                    MUMD,   32
                }

                FCTL = Zero
                PSBH = Zero
                SSBH = Zero
                LTBC = Zero
                GENA = One
                MUMD = Zero
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg2 == Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                             // .
                    })
                }

                Return (Package ()
                {
                    "AAPL,slot-name",
                    Buffer ()
                    {
                        "Slot-1"
                    },

                    "@0,AAPL,boot-display",
                    Buffer (One)
                    {
                         0x00                                             // .
                    },

                    "@0,name",
                    Buffer ()
                    {
                        "ATY,Lagotto"
                    },

                    "@1,name",
                    Buffer ()
                    {
                        "ATY,Lagotto"
                    },

                    "@2,name",
                    Buffer ()
                    {
                        "ATY,Lagotto"
                    },

                    "@3,name",
                    Buffer ()
                    {
                        "ATY,Lagotto"
                    },

                    "ATY,VendorID",
                    Buffer ()
                    {
                         0x02, 0x10                                       // ..
                    },

                    "ATY,DeviceID",
                    Buffer ()
                    {
                         0x38, 0x69                                       // 8i
                    },

                    "model",
                    Buffer ()
                    {
                        "AMD Radeon R9 380X"
                    },

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

        Device (HDAU)
        {
            Name (_ADR, One)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg2 == Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                             // .
                    })
                }

                Return (Package ()
                {
                    "layout-id",
                    Buffer ()
                    {
                         0x01, 0x00, 0x00, 0x00                           // ....
                    },

                    "hda-gfx",
                    Buffer ()
                    {
                        "onboard-1"
                    }
                })
            }
        }
    }
}
Attached File  Screen Shot 2017-10-31 at 12.26.08.png   490.96KB   11 downloads
Oh, and thanks Mieze.

Edit: Added HDAU device.

Edited by zxv, 05 November 2017 - 04:13 PM.


#43
ic005k

ic005k

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts

I hope we can find a solution for older pc rigs. I didn’t have the time to play around with new ideas.


Sent from my iPhone using Tapatalk

I used to go back to OSX10.12.6, this patch code can work very well, wake up there is no black screen problem, everything is normal. And the motherboard seems to have nothing to do with the old and new, is 10.13.1 system problems, my HD6450 graphics card in 10.13.1 below is not really driven, it needs 10.12.6 related driver file to supplement the driver, it may be The root of the problem.

 

I will continue to study 10.13.1 HD6450 sleep wake up the black screen problem, I hope to be able to break through.

@Mieze

 

This is a great discovery!
After my initial verification, this patch code can almost solve all the ATI graphics card to wake up the black screen, the prerequisite is: ATI graphics card must be able to be the normal system driver.
Of course, you can also use BAR2 as a judge to identify the card, the code is as follows:
 
If (LEqual (BAR2, Zero))
         {
             Store (BAR5, Local0)
         }
         Else
         {
             Store (BAR2, Local0)
         }
 
Thank you again for the ATI graphics card to wake up the black screen of the efforts and contributions!
 

 

I think WhateverGreen.kext can retire ~ ~ ha ha ~ ~


#44
jalavoui

jalavoui

    InsanelyMac Legend

  • Developers
  • 1,206 posts
  • Gender:Male

"The Radeon driver's source code tells us that the first display controller engine's registers can be found starting at offset 0x6800"

 

Can u point to source code of this? can't seem to find it.



#45
jsl

jsl

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 903 posts
  • Gender:Male

Thanks for your advice & help.

In 10.12.6 or lower my Z87/Z97 Intel hackintoshs can boot to desktop with both Intel HD 4600 & AMD Radeon HD 5770 at the same time.

In 10.13.1 I must disable Intel HD 4600 at BIOS, otherwise it can not boot to desktop with AMD Radeon HD 5770.

In Z97 Intel hackintosh no matter what display card enabled, always got blank screen on wake-up from sleep.

There is no such an issue in Z87 Intel hackintosh if Lilu + WhateverGreen are applied.

I'll test more with AMD Radeon 6870 & report later to confirm whether this SSDT.aml working or not at 10.12.6 & 10.13.1.

In FX-6300 hackintosh with AMD GPU Radeon HD 6870:

this trick worked at 10.13.1(17B48), but it got instant reboot at 10.13.2(17C60c) & 10.12GM on wake up from S3 sleep.

If booted by Enoch 2905 and Lilu/WhateverGreen.kext in /S/L/E at 10.12.6 it can wake up from S3 sleep without blank screen issue. But not working by Clover 4243 yet (still got blank screen on wake up from sleep).



#46
Mieze

Mieze

    Giant Cat

  • Developers
  • 1,230 posts
  • Gender:Female
  • Location:Germany
  • Interests:Cats

"The Radeon driver's source code tells us that the first display controller engine's registers can be found starting at offset 0x6800"

 

Can u point to source code of this? can't seem to find it.

Here you are:

 

https://git.kernel.o...h=next-20171103

 

Mieze



#47
Tusskan

Tusskan

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 157 posts
  • Gender:Male
  • Interests:Javascript.

anyone would love to share his compiled aml of R9 290X? I'd like to try this new method.



#48
Mieze

Mieze

    Giant Cat

  • Developers
  • 1,230 posts
  • Gender:Female
  • Location:Germany
  • Interests:Cats

In FX-6300 hackintosh with AMD GPU Radeon HD 6870:

this trick worked at 10.13.1(17B48), but it got instant reboot at 10.13.2(17C60c) & 10.12GM on wake up from S3 sleep.

If booted by Enoch 2905 and Lilu/WhateverGreen.kext in /S/L/E at 10.12.6 it can wake up from S3 sleep without blank screen issue. But not working by Clover 4243 yet (still got blank screen on wake up from sleep).

There is a 99% probability that the reason for this behavior lies somewhere else, maybe a broken DSDT, a BIOS issue, incorrect connector patch, etc.

 

Mieze


  • jsl likes this

#49
Si Vis Pacem

Si Vis Pacem

    InsanelyMac Protégé

  • Members
  • PipPip
  • 65 posts
did u try booting into single user mode and

rm /S/L/PrelinkedKernels/prelinkedkernel
touch /S/L/E
kextcache -u /

and rebooting?

#50
jsl

jsl

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 903 posts
  • Gender:Male

There is a 99% probability that the reason for this behavior lies somewhere else, maybe a broken DSDT, a BIOS issue, incorrect connector patch, etc.

 

Mieze

Thanks for your advice and help.

Booted by Clover 4289 in FX-6300 hackintosh the instant reboot issue on wake up from sleep can be fixed by put FakeSMC.kext (3.5.0), Lilu (1.2.1), & WhateverGreen (1.1.2) in /S/L/E instead of EFI/CLOVER/kexts/Other at 10.10.5(14F1807), 10.11.6(15G1004), 10.12GM & 10.12.6 (16G1036), but not worked yet at 10.13.2 (17C60c).

Only booted by Enoch 2905 can fix this issue at 10.13.2 up to now.

 

[Edit]

Booted by Clover 4288/4289 in Intel Z87 hackintosh the instant reboot issue on wake up from sleep can be fixed by put FakeSMC.kext (3.5.0), Lilu (1.2.1), & WhateverGreen (1.1.2) in /S/L/E instead of EFI/CLOVER/kexts/Other at 10.13.2(17C60c) at last !

However it is Not always working. Sometimes OK, most times failed.

Need better solution !


Edited by jsl, 05 November 2017 - 11:00 AM.


#51
xtddd

xtddd

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 310 posts
  • Gender:Male

Just want to confirm, that Miezes patch from first post is working on my config as well. IGPU and CSM completely disabled in BIOS.

just have to make some "preperations" to make a tripple-monitor-setup working and some cosmetic changes as well,

as already Matthew82 has documented.

 

So now, i no longer nee LILU and WhatEverGreen kexts.

Thanx for another incredible work. Love it. Makes my Hackintosh so much easier.

hi,how to let clover to apply this patch?



#52
cyberdevs

cyberdevs

    InsanelyMacaholic

  • Donators
  • 2,524 posts
  • Gender:Male

Another confirmation, after couple of days spending the time to figuring out what's what, I finally managed to activate my Sapphire Radeon HD 7790 with the DSDT patch that @Mieze found and a big thanks to her :)

I didn't inject anything (No InjectATI, no framebuffer or Ati Connectors Controller) via my config.plist.

 

Spoiler
 

 

Thanks to @Matthew82's R9 290X settings because my 7790 is working well with Baladi farmebuffer I just edited the essential information for my GPU.

The only thing is that this patch only worked on my Asus P8H77-L ME which has UEFI support but still no luck on my GA-EP45-DS3R.

 

There is no PEGP or GFX in the DSDT and I don't know what was used on older pc BIOS's ACPI tables to address the GPU.

 

CSM is enabled and Boot from PCIe/PCI Expansion Devices is set to legacy.

 

Thanks again for this solution :)



#53
WarDoc

WarDoc

    The oncoming Storm

  • Members
  • PipPipPipPipPipPipPip
  • 819 posts
  • Gender:Male
  • Location:usa
  • Interests:Causing Chaos just to watch the world burn

Another confirmation, after couple of days spending the time to figuring out what's what, I finally managed to activate my Sapphire Radeon HD 7790 with the DSDT patch that @Mieze found and a big thanks to her :)

I didn't inject anything (No InjectATI, no framebuffer or Ati Connectors Controller) via my config.plist.

 

Spoiler
 

 

Thanks to @Matthew82's R9 290X settings because my 7790 is working well with Baladi farmebuffer I just edited the essential information for my GPU.

The only thing is that this patch only worked on my Asus P8H77-L ME which has UEFI support but still no luck on my GA-EP45-DS3R.

 

There is no PEGP or GFX in the DSDT and I don't know what was used on older pc BIOS's ACPI tables to address the GPU.

 

CSM is enabled and Boot from PCIe/PCI Expansion Devices is set to legacy.

 

Thanks again for this solution :)

mind making a SSDT for my 290x im not good with this stuff zxv did good above



#54
cyberdevs

cyberdevs

    InsanelyMacaholic

  • Donators
  • 2,524 posts
  • Gender:Male

mind making a SSDT for my 290x im not good with this stuff zxv did good above

I'm not good with these stuff either but I can definitely try :)

 

Is this your GPU?



#55
WarDoc

WarDoc

    The oncoming Storm

  • Members
  • PipPipPipPipPipPipPip
  • 819 posts
  • Gender:Male
  • Location:usa
  • Interests:Causing Chaos just to watch the world burn

I'm not good with these stuff either but I can definitely try :)

 

Is this your GPU?

no i will dump the rom https://drive.google...iew?usp=sharingi have a 290x NOT A 290



#56
cyberdevs

cyberdevs

    InsanelyMacaholic

  • Donators
  • 2,524 posts
  • Gender:Male

no i will dump the rom https://drive.google...iew?usp=sharingi have a 290x NOT A 290

 

Test this one and let me know. As I mentioned before I'm not good with DSDT and SSDTs.

 

Let me know

Attached Files


  • zxv likes this

#57
xtddd

xtddd

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 310 posts
  • Gender:Male

i enable rx580 with ssdt.amd but it show AMD 9XXX 8G...how to resolve it ..thx. 



#58
Mieze

Mieze

    Giant Cat

  • Developers
  • 1,230 posts
  • Gender:Female
  • Location:Germany
  • Interests:Cats

i enable rx580 with ssdt.amd but it show AMD 9XXX 8G...how to resolve it ..thx. 

Inject the missing device properties. For an example, please see http://www.insanelym...igin/?p=2525983

 

Mieze



#59
xtddd

xtddd

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 310 posts
  • Gender:Male

Inject the missing device properties. For an example, please see http://www.insanelym...igin/?p=2525983

 

Mieze

ok,sorry. but i cant do that..i still use ssdt.amd.aml provided by slice now



#60
zxv

zxv

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 147 posts
  • Gender:Male

mind making a SSDT for my 290x im not good with this stuff zxv did good above


The one cyberdevs did should work. Just verify that ATY,DeviceID matches your GPU and that the correct number of framebuffer ports (@0…@n) are allotted.

Oh, and make sure PEGP is renamed to GFX0 (easy enough to do within Clover).





Also tagged with one or more of these keywords: AMD, GPU, Sierra, El Capitan, sleep, wakeup, Radeon


4 user(s) are reading this topic

4 members, 0 guests, 0 anonymous users


© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy