RuleBreaker01
Banned
- Joined
- May 31, 2018
- Messages
- 1,274
Playing with DSDT injection.
Could anyone confirm if I'm doing the right thing?
With this injection, the Vega is properly described in About You Mac, though my 2nd screen is no longer working.
with this, in the PCI section of the "AMD Radeon Vega 64" appears as:
ATY,Kamarang
While without it it would show as:
ATY,AMD,RadeonFramebuffer
No idea if one is preferred over the other.
In IORegistryExplorer the GFXO card will now show in:
PCI02.BR2A.GFX0.GFXA.GFX0
sounds rather complicated to me, would make sense in dual GPU setup, but not single one...
Could anyone confirm if I'm doing the right thing?
With this injection, the Vega is properly described in About You Mac, though my 2nd screen is no longer working.
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "Wake", 0x00000000)
{
External (_SB_.PC02.BR2A, DeviceObj) // (from opcode)
External (_SB_.PC02.BR2A.GFX0, DeviceObj) // (from opcode)
External (GPRW, MethodObj) // 2 Arguments (from opcode)
Scope (_SB.PC02.BR2A.GFX0)
{
OperationRegion (PCIS, PCI_Config, Zero, 0x0100)
Field (PCIS, AnyAcc, NoLock, Preserve)
{
PVID, 16,
PDID, 16
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (GPRW (0x69, 0x04))
}
Device (GFXA)
{
Name (_ADR, Zero) // _ADR: Address
Device (GFX0)
{
Name (_ADR, Zero) // _ADR: Address
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 (LEqual (BAR5, Zero))
{
Store (BAR2, Local0)
}
Else
{
Store (BAR5, Local0)
}
OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFF0), 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
}
Store (Zero, FCTL)
Store (Zero, PSBH)
Store (Zero, SSBH)
Store (Zero, LTBC)
Store (One, GENA)
Store (Zero, MUMD)
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Store (Package (0x16)
{
"AAPL,slot-name",
Buffer (0x07)
{
"Slot-1"
},
"CFG,CFG_USE_AGDC",
Buffer (One)
{
0x00
},
"PP,PP_DisableAutoWattman",
Buffer (One)
{
0x00
},
"ATY,Part#",
Buffer (0x0C)
{
"113-3E366DU"
},
"@0,AAPL,boot-display",
Buffer (One)
{
0x00
},
"@0,name",
Buffer (0x0D)
{
"ATY,Kamarang"
},
"@1,name",
Buffer (0x0D)
{
"ATY,Kamarang"
},
"@2,name",
Buffer (0x0D)
{
"ATY,Kamarang"
},
"@3,name",
Buffer (0x0D)
{
"ATY,Kamarang"
},
"model",
Buffer (0x13)
{
"AMD Radeon Vega 64"
},
"hda-gfx",
Buffer (0x0A)
{
"onboard-2"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
Device (HDAU)
{
Name (_ADR, One) // _ADR: Address
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Store (Package (0x0C)
{
"built-in",
Buffer (One)
{
0x00
},
"AAPL,slot-name",
Buffer (0x07)
{
"Slot-1"
},
"layout-id",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},
"name",
Buffer (0x0D)
{
"AMD HD-Audio"
},
"model",
Buffer (0x0D)
{
"AMD HD-Audio"
},
"hda-gfx",
Buffer (0x0A)
{
"onboard-2"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
}
}
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}
If (LEqual (Arg2, One))
{
Return (One)
}
}
}
Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}
}
with this, in the PCI section of the "AMD Radeon Vega 64" appears as:
ATY,Kamarang
While without it it would show as:
ATY,AMD,RadeonFramebuffer
No idea if one is preferred over the other.
In IORegistryExplorer the GFXO card will now show in:
PCI02.BR2A.GFX0.GFXA.GFX0
sounds rather complicated to me, would make sense in dual GPU setup, but not single one...