-
-
Save xxxzc/032bf9eef2f217bc7d60f087e25555e1 to your computer and use it in GitHub Desktop.
# Modify laptop 4k panel edid for big sur | |
# This will make panel running at 48Hz | |
# Created by xxxzc | |
# Reference: http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=1866466&highlight=edid | |
from subprocess import check_output | |
from base64 import b64encode | |
from textwrap import wrap | |
edid = '' | |
try: | |
edid = check_output('ioreg -lw0 | grep -i "IODisplayEDID"', | |
shell=True, encoding='utf-8') | |
edid = edid.split('<')[1].split('>')[0] | |
except Exception: | |
edid = input('No edid found, please input it manually: ') | |
edid = wrap(''.join(filter(str.isalnum, edid)), 2) # convert to 128 bytes | |
print('Default EDID:', ''.join(edid)) | |
# set refresh rate to 48Hz | |
if len(edid) == 128: | |
edid[54] = edid[55] = 'a6' # Descriptor 1 | |
elif len(edid) == 256: | |
edid[54] = edid[55] = 'a6' # Descriptor 1 | |
edid[72] = edid[73] = 'a6' # Descriptor 2 | |
data = list(int(x, 16) for x in edid) | |
csb = 127 # checksum byte | |
checksum = 256 - sum(data[:csb]) % 256 | |
edid[csb] = hex(checksum)[2:] | |
print('Patched EDID:', ''.join(edid)) | |
data[csb] = checksum | |
data = b64encode(bytes(data)).decode('utf-8') | |
print() | |
print('You should add following to PciRoot(0x0)/Pci(0x2,0x0):') | |
print('<key>AAPL00,override-no-connect</key>') | |
print(f'<data>{data}</data>') |
@iamsanoj1 add
AP///////wAGr3ycAAAAAAAZAQSlJhVgAm+xp1VMniUMUFQAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBwPoAwIDUAftYQAAAYAAAADwAAAAAAAAAAAAAAAAAgAAAA/gBBVU8KICAgICAgICAgAAAA/gBCMTczWkFOMDEuMCAKAPo=
to AAPL00,override-no-connect under PciRoot(0x0)/Pci(0x2,0x0).
This will make 4k panel running at 48Hz, you should know, it's awful. I‘ve switched back to 10.15.
Hi! I'm having the same issue. No matter how many times I run the script in my terminal, it produces nothing. Is there anyway you could please edit this edid? Thank you.
00ffffffffffff004d10911400000000271b0104a52313780edf58a35435b5260f4b54000000010101010101010101010101010101014dd000a0f0703e80302035005ac210000018000000000000000000000000000000000000000000fe00344e35394a804c513135364431000000000002410323001200000b010a20200085
AP///////wBNEJEUAAAAACcbAQSlIxN4Dt9Yo1Q1tSYPS1QAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBwPoAwIDUAWsIQAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gA0TjU5SoBMUTE1NkQxAAAAAAACQQMjABIAAAsBCiAgAFY=
Add this @sebasinparis
AP///////wBNEJEUAAAAACcbAQSlIxN4Dt9Yo1Q1tSYPS1QAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBwPoAwIDUAWsIQAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gA0TjU5SoBMUTE1NkQxAAAAAAACQQMjABIAAAsBCiAgAFY=
Add this @sebasinparis
Thank you, it worked! People like you make this community worthwhile.
@sebasinparis no problem, but unlikely it's not working for my Dell XPS 2020 with 4k internal panel, but I'll get it working ;)
@sebasinparis no problem, but unlikely it's not working for my Dell XPS 2020 with 4k internal panel, but I'll get it working ;)
Any luck? Have same panel.
Patch is working for Dell XPS 2020 4k
Patch is working for Dell XPS 2020 4k
Good to hear
Patch is working for Dell XPS 2020 4k
Can you share your lines? I was generated for myself but boot process stuck.
Look into my repo and description.
Look into my repo and description.
Doesn't work for XPS 17 for some reason. My EDID is 00ffffffffffff004d10d61400000000051e0104b52517780ad4c6aa5333ba240c50550000000101010101010101010101010101010172e700a0f0604590302036006ee51000001828b900a0f0604590302036006ee510000018000000fe00374a584b38804c513137305231000000000002410332011200000b010a2020018102030f00e3058000e606050160602800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aa
, after patch data looks like this AP///////wBNENYUAAAAAAUeAQS1JRd4CtTGqlMzuiQMUFUAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBgRZAwIDYAbuUQAAAYKLkAoPBgRZAwIDYAbuUQAAAYAAAA/gA3SlhLOIBMUTE3MFIxAAAAAAACQQMyARIAAAsBCiAgAYECAw8A4wWAAOYGBQFgYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtw==
and if I apply this system won't boot - freezes before desktop should appear.
@khmyznikov I updated my script to support 256 bytes EDID , please try this:
patch descriptor 1 and descriptor 2 to 48Hz:
AP///////wBNENYUAAAAAAUeAQS1JRd4CtTGqlMzuiQMUFUAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBgRZAwIDYAbuUQAAAYpqYAoPBgRZAwIDYAbuUQAAAYAAAA/gA3SlhLOIBMUTE3MFIxAAAAAAACQQMyARIAAAsBCiAgASMCAw8A4wWAAOYGBQFgYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqg==
or patch descriptor 2 only
AP///////wBNENYUAAAAAAUeAQS1JRd4CtTGqlMzuiQMUFUAAAABAQEBAQEBAQEBAQEBAQEBcucAoPBgRZAwIDYAbuUQAAAYpqYAoPBgRZAwIDYAbuUQAAAYAAAA/gA3SlhLOIBMUTE3MFIxAAAAAAACQQMyARIAAAsBCiAgARYCAw8A4wWAAOYGBQFgYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqg==
or patch descriptor 1 only:
AP///////wBNENYUAAAAAAUeAQS1JRd4CtTGqlMzuiQMUFUAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBgRZAwIDYAbuUQAAAYKLkAoPBgRZAwIDYAbuUQAAAYAAAA/gA3SlhLOIBMUTE3MFIxAAAAAAACQQMyARIAAAsBCiAgAY4CAw8A4wWAAOYGBQFgYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqg==
can you confirm this is your internal panel's EDID? 256 bytes EDID is normally found on external display.
@xxxzc @thefiredragon yes I confirm - it's 256. So with WEG 1.4.5 and with any of three strings from @xxxzc i got same result - screen recognized as 4k and show image, but very very glitchy like every third row of pixels was stolen and image constantly shake and jump. @thefiredragon I used your config and there is already no enable-dpcd-max-link-rate option, only enable-dpcd-max-link-rate-fix.
please provide on my repo your efi, I could take a look
please provide on my repo your efi, I could take a look
It's all your repo copy pasted, just changed override to first one from @xxxzc post
New WEG version fixed this problem
Hi, I am a noobie in Hackintosh, I'm facing the black screen issue in my 4k panel, MSI laptop. After a long search, I have reached here. I have no idea how to run the above script. I have tried but could not understand. could you make a simplified tutorial or edit my edid?
00FFFFFF FFFFFF00 06AF7C9C 00000000 00190104 A5261560 026FB1A7 554C9E25 0C505400 00000101 01010101 01010101 01010101 010166D0 00A0F070 3E803020 35007ED6 10000018 0000000F 00000000 00000000 00000000 00200000 00FE0041 554F0A20 20202020 20202020 000000FE 00423137 335A414E 30312E30 200A0010