Contribute
Register

AMD WX4170 dGPU on ZBook G5 17 Laptop

Joined
Mar 29, 2019
Messages
104
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
I found my wx4150 pci id (0x67E8) and WX4170 (0x67E0) in ATY,Yelcho framebuffer IOPCIMatch inside info.plist. I think that this one is OEM based OS loading framebuffer

TAKE A LOOK FOR WX4170: this frame buffer need short patch of reorder ports as osx txmit 21 (HDMI) located as DP, and HDMI as DP.

wx4150-yelcho.png

ORIGINAL BUFFER
Yelcho (6) @ 0x66a80
DP, DP, HDMI, DP, DP, DP

000400000001000000010111000000001204060100000000
000400000001000000010321000000002205040300000000
000800000402000000010500000000002103050400000000
000400000001000000014251000000001000000000000000
000400000001000000014461000000002001000000000000
000400000001000000014601000000001102000000000000

redsock_bios_decoder and radeon_bios_decode info
HP Vaughn G1-50 GDDR5

PCI ID: 1002:67e8
Connector at index 0
Type [@offset 37664]: eDP (14)
Encoder [@offset 37668]: INTERNAL_UNIPHY1 (0x20)
i2cid [@offset 37756]: 0x93, OSX senseid: 0x4
HotPlugID: 4
Connector at index 1
Type [@offset 37674]: DisplayPort (10)
Encoder [@offset 37678]: INTERNAL_UNIPHY1 (0x20)
i2cid [@offset 37783]: 0x92, OSX senseid: 0x3
HotPlugID: 3
Connector at index 2
Type [@offset 37684]: DisplayPort (10)
Encoder [@offset 37688]: INTERNAL_UNIPHY (0x1e)
i2cid [@offset 37810]: 0x90, OSX senseid: 0x1
HotPlugID: 1
Connector at index 3
Type [@offset 37694]: DisplayPort (10)
Encoder [@offset 37698]: INTERNAL_UNIPHY (0x1e)
i2cid [@offset 37837]: 0x91, OSX senseid: 0x2
HotPlugID: 2



Connector Object Id [20] which is [EDP]
encoder obj id [0x20] which is [INTERNAL_UNIPHY1 (osx txmit 0x11 [duallink 0x1] enc 0x2)] linkb: false
Connector Object Id [19] which is [DISPLAY_PORT]
encoder obj id [0x20] which is [INTERNAL_UNIPHY1 (osx txmit 0x21 [duallink 0x1] enc 0x3)] linkb: true
Connector Object Id [19] which is [DISPLAY_PORT]
encoder obj id [0x1e] which is [INTERNAL_UNIPHY (osx txmit 0x20 [duallink 0x0] enc 0x1)] linkb: true
Connector Object Id [19] which is [DISPLAY_PORT]
encoder obj id [0x1e] which is [INTERNAL_UNIPHY (osx txmit 0x10 [duallink 0x0] enc 0x0)] linkb: false

My connectors VBIOS PRIORITY:​

[EDP]
HP Boot screen priority = 01
osx txmit
0x11; enc 0x2; HotPlugID: 4; senseid: 0x4

[DP] to [VGA]
HP Boot screen priority = 04
osx txmit
0x21; enc 0x3; HotPlugID: 3; senseid: 0x3

[DP] to [USB-C DP]
HP Boot screen priority = 03
osx txmit
0x20; enc 0x1; HotPlugID: 1; senseid: 0x1

[DP] to [HDMI]
HP Boot screen priority = 02
osx txmit
0x10; enc 0x0; HotPlugID: 2; senseid: 0x2



MY txmit and enc in ORIGINAL BUFFER
Yelcho (6) @ 0x66a80
DP, DP, HDMI, DP, DP, DP

00040000 00010000 00010111 00000000 12 04 06 01 00000000
00040000 00010000 00010321 00000000 22 05 04 03 00000000
00080000 04020000 00010500 00000000 21 03 05 04 00000000 [DP] to [VGA]
00040000 00010000 00014251 00000000 10 00 00 00 00000000 [DP] to [HDMI]
00040000 00010000 00014461 00000000 20 01 00 00 00000000 [DP] to [USB-C DP]
00040000 00010000 00014601 00000000 11 02 00 00 00000000 [EDP]


FIRST STEP IS DISABLE HDMI IN BUFFER, DISABLE AMD INJECT, DISABLE Whatevergreen, Lilu and test it
Yelcho (6) @ 0x66a80
DP, DP, HDMI, DP, DP, DP

00040000 00010000 00010111 00000000 12 04 06 01 00000000
00040000 00010000 00010321 00000000 22 05 04 03 00000000
00000000 00000000 00000000 00000000 00 00 00 00 00000000 [DP] to [VGA]
00040000 00010000 00014251 00000000 10 00 00 00 00000000 [DP] to [HDMI]
00040000 00010000 00014461 00000000 20 01 00 00 00000000 [DP] to [USB-C DP]
00040000 00010000 00014601 00000000 11 02 00 00 00000000 [EDP]


KEXT PATCH
AMD9500Controller

FIND
000400000001000000010111000000001204060100000000000400000001000000010321000000002205040300000000000800000402000000010500000000002103050400000000000400000001000000014251000000001000000000000000000400000001000000014461000000002001000000000000000400000001000000014601000000001102000000000000

REPLACE

000400000001000000010111000000001204060100000000000400000001000000010321000000002205040300000000000000000000000000000000000000000000000000000000000400000001000000014251000000001000000000000000000400000001000000014461000000002001000000000000000400000001000000014601000000001102000000000000
 
Joined
Jul 21, 2011
Messages
216
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
I found my wx4150 pci id (0x67E8) and WX4170 (0x67E0) in ATY,Yelcho framebuffer IOPCIMatch inside info.plist. I think that this one is OEM based OS loading framebuffer
No, That is just the match for AMD9500Controller.kext that gets loaded if you have any of those cards.
TAKE A LOOK FOR WX4170: this frame buffer need short patch of reorder ports as osx txmit 21 (HDMI) located as DP, and HDMI as DP.

View attachment 516372
If you open the Yelcho tab, it will show you how that particular FB is diferent from the default FB (aside from connectors)
 
Joined
Mar 29, 2019
Messages
104
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
No, That is just the match for AMD9500Controller.kext that gets loaded if you have any of those cards.

If you open the Yelcho tab, it will show you how that particular FB is diferent from the default FB (aside from connectors)
Where to find default fb info?

Info.plist have framebuffer match by the pciid
 
Joined
Mar 29, 2019
Messages
104
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
Yelcho connector path for WX4170



Original:
000400000001000000010111000000001204060100000000
000400000001000000010321000000002205040300000000
000800000402000000010500000000002103050400000000
000400000001000000014251000000001000000000000000
000400000001000000014461000000002001000000000000
000400000001000000014601000000001102000000000000


Patch:
000400000406000000010111000000002103000300000000
000400000403000000010321000000002001000100000000
000800000402000000710500000000001102000400000000
000400000403000000014251000000001000000200000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000

0406 solves color problems on edp display, otherwise it will be inverted or wrong colors, like RGB on Ycbcr


maybe parametr 14
is for edp

maybe parametr 10
is for dp or external out
 
Joined
Jul 21, 2011
Messages
216
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
I looked at your report file, and your problem is not the framebuffer, you don't have CPU power management, you may have other ACPI problems. Those are causing the LAG. not Whatevergreen.

If you want to find out what is the default FB, enable screen sharing and boot, and with a second machine log in and see on ioreg what is the name of the FB.
 
Joined
Mar 29, 2019
Messages
104
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
you don't have CPU power management
What do you mean? CPU SSDT is generated by app included in Hotpatch instalation. Or i should to change something in clover config?
 
Joined
Mar 29, 2019
Messages
104
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
If you want to find out what is the default FB, enable screen sharing and boot, and with a second machine log in and see on ioreg what is the name of the FB.
BOOT ARGS:
-wegoff
-liluoff
amd, inject=no
amd vbios=no


MINE GPU APPEAR AS 6 ports

Some info from IOREG

IOREG = 5 DP, 1 LVDS


ATY,AMD,RadeonFramebuffer@0
Active flags = 0x100
Control flags = 0x100
Av-signal-type = 10 00 00 00
Display connect flags = 00 00 00 00
Connector type = 0x2
DisplayType = display


ATY,AMD,RadeonFramebuffer@1
Active flags = 0x100
Control flags = 0x304
Av-signal-type = 10 00 00 00
Display connect flags = 00 00 00 00
Connector type = 0x400
DisplayType = display


ATY,AMD,RadeonFramebuffer@2
Active flags = 0x100
Control flags = 0x304
Av-signal-type = 10 00 00 00
Display connect flags = 00 00 00 00
Connector type = 0x400
DisplayType = display



ATY,AMD,RadeonFramebuffer@3
Active flags =0x4
Control flags = 0x304
Av-signal-type = 02 00 00 00
Display connect flags = 00 00 00 00
Connector type = 0x400
DisplayType = LCD


ATY,AMD,RadeonFramebuffer@4
Active flags = 0x1
Control flags = 0x100
Av-signal-type = 00 00 00 00
Display connect flags = 00 00 00
Connector type = 0x400
DisplayType = NONE


ATY,AMD,RadeonFramebuffer@5
Active flags = 0x1
Control flags = 0x100
Av-signal-type = 00 00 00 00
Display connect flags = 00 00 00
Connector type = 0x400
DisplayType = NONE
 
Joined
Jul 21, 2011
Messages
216
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
BOOT ARGS:
-wegoff
-liluoff
amd, inject=no
amd vbios=no


MINE GPU APPEAR AS 6 ports

Some info from IOREG

IOREG = 5 DP, 1 LVDS


ATY,AMD,RadeonFramebuffer@0
Active flags = 0x100
Control flags = 0x100
Av-signal-type = 10 00 00 00
Display connect flags = 00 00 00 00
Connector type = 0x2
DisplayType = display

Ok that means the default is ATY,AMD,RadeonFramebuffer, the same one that Whatevergreen injects.
Like I said before you can try and inject an already named FB, but you will most likely also inject undesired properties.
For example the Yelcho FB is probably a Desktop GPU FB, so your clock/thermal/etc... will be all wrong for a laptop GPU.

I believe in my case a MacBookPro 15,1 which is the SMBios that most closely matches my machine, the "closest-correct" FB would be Palena, but I guess the Properties for Palena are not for a Polaris Baffin Card, and I would get the odd Window Server Freeze.
So I tried just injecting the Palena Properties using a info.plist only kext to the default Whatevergreen/RadeonFramebuffer and everything behaved exactly like the Palena FB (problems and all), so that's why I don't think you need to inject a named FB at all.
Now I removed all the injected Palena stuff and added the Acre stuff that is for Polaris Mobile and so far it seems to be working great, zero crashes and even better performance.
The only thing I kept from Palena was the Connector information that enabled DHCP on the internal screen.

These are the only properties I'm injecting using the attached kext and so far the GPU's clock and Memory seem to be scaling back correctly on idle and up under load, and no window server freezes.

Screen Shot 2021-04-26 at 9.27.05 AM.png

(The CFG_PTPL2_TBL Data only shows "2" but it's actually the same data as shown below)

You can find these properties by looking at the AMD9500Controller.kext in IOREG.

Screen Shot 2021-04-26 at 10.06.51 AM.png

I'm not injecting CFG_NVV=0x02 and CFG_USE_AGDC=True because they're already set that way by the default RadeonFramebuffer

For my WX4170 I only have 4 ports. and I patch the automatically detected Whatevergreen's version using these device properties: (I also patch the applbkl - brightness range)

Screen Shot 2021-04-26 at 9.28.59 AM.png


By analyzing https://github.com/acidanthera/WhateverGreen/blob/master/Manual/Sample.dsl
You see how Whatevergreen patches connectors, like so:

Screen Shot 2021-04-26 at 9.31.35 AM.png

Screen Shot 2021-04-26 at 9.42.06 AM.png


So in the end using this combo: Whatevergreen+Fixed Connectors+Injected FB Properties, I'm getting a stable, patched GPU.


For PM you should see something along the lines of:

Screen Shot 2021-04-26 at 9.17.31 AM.png
 

Attachments

  • PolarisZbook_WX4170.kext.zip
    3.6 KB · Views: 7
Last edited:
Joined
Mar 29, 2019
Messages
104
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
Done some battery only tests so list of FB, which can work without power cord on low frequency (Core 214 mhz, 15W):
Salado (non listed in info.plist, but in 9500 controller)
Exmore not stable, long switch to power save mode, gpu eats all power, than freeze, than low power mode enabled (non listed in info.plist, but in 9500 controller)

Anyway, non one of them return high profile powerstate after power connector was connected

Therefore, the highest watts level was on Berbice (80w) and up to 12% faster short period test.
 
Top