Last active
January 24, 2021 15:09
-
-
Save xxxzc/032bf9eef2f217bc7d60f087e25555e1 to your computer and use it in GitHub Desktop.
Modify laptop 4k display EDID for Big Sur (run at 48Hz)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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>') |
My Device had also 256 bit Edid
Try to enable only enable-dpcd-max-link-rate-fix
And remove enable-dpcd-max-link-rate 14000000
Also test it with beta build of whatevergreen 1.4.5 from my repo
Von meinem iPhone gesendet
… Am 27.11.2020 um 11:07 schrieb zicong xie ***@***.***>:
***@***.*** commented on this gist.
@khmyznikov I updated my script to support 256 bytes EDID , please you try this:
AP///////wBNENYUAAAAAAUeAQS1JRd4CtTGqlMzuiQMUFUAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBgRZAwIDYAbuUQAAAYpqYAoPBgRZAwIDYAbuUQAAAYAAAA/gA3SlhLOIBMUTE3MFIxAAAAAAACQQMyARIAAAsBCiAgASMCAw8A4wWAAOYGBQFgYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqg==
or
AP///////wBNENYUAAAAAAUeAQS1JRd4CtTGqlMzuiQMUFUAAAABAQEBAQEBAQEBAQEBAQEBpqYAoPBgRZAwIDYAbuUQAAAYKLkAoPBgRZAwIDYAbuUQAAAYAAAA/gA3SlhLOIBMUTE3MFIxAAAAAAACQQMyARIAAAsBCiAgAY4CAw8A4wWAAOYGBQFgYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqg==
can you confirm this is your internal panel's EDID? 256 bytes EDID is normally found on external display.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
@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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@khmyznikov I updated my script to support 256 bytes EDID , please try this:
patch descriptor 1 and descriptor 2 to 48Hz:
or patch descriptor 2 only
or patch descriptor 1 only:
can you confirm this is your internal panel's EDID? 256 bytes EDID is normally found on external display.