History:
I make two patches:
1. NVDA::validateDetailedTiming, only return success when resolution is 3840x2160. It make LG ultrafine 5K can be light up with one cable. (Without this patch LG ultrafine 5K just stay black always, no matter how I try). But it works flawly, In most of time screen show up for few seconds, then turn black again...
2. setStartupDisplayMode just sleep for 10 seconds, It get more stable, will not turn black so much, I got 80% to light up the screen without problem with one cable(3840x2160). I make it sleep for 10 seconds, because I noticed that the screen turn black after 4-5 seconds. But it seems unreasonable, and very ugly patch, very very ugly, it cause the system boot up very slowly , takes a few minutes, and any display settings changing operation is very very slow. Anyone can give me tips on how to patch it more nicely?
With above two patches, I still get black screen when I plug two cables( I let the 5120x2880 past in validateDetailedTiming).
So, any tips ? Help Please.
Patch codes attached
Patch 1:
Code:
IOReturn NGFX::nvda_validateDetailedTiming_patch(IONDRVFramebuffer *that, void* _desc, IOByteCount descripSize)
{
if(callbackNGFX && callbackNGFX->org_nda_validateDetailedTiming)
{
//kIOReturnSuccess
if (descripSize == sizeof(IOFBDisplayModeDescription))
{
IOFBDisplayModeDescription * fbdesc = (IOFBDisplayModeDescription *) _desc;
DBGLOG("ngfx", "validateDetailedTiming %llx info %u x %u @ %u.%u hz, maxDepthIndex: %u",(void*)that,
fbdesc->info.nominalWidth,
fbdesc->info.nominalHeight,
(fbdesc->info.refreshRate>>16)&0xffff,
fbdesc->info.refreshRate&0xffff,
fbdesc->info.maxDepthIndex
);
if(
isValidTime(fbdesc->timingInfo)
)
{
logTimingInfoV2(that, "validateDetailedTiming isValidTiming", fbdesc->timingInfo.detailedInfo.v2);
}
else
{
logTimingInfoV2(that, "validateDetailedTiming notvalidTiming", fbdesc->timingInfo.detailedInfo.v2);
return kIOReturnUnsupported;
}
}
else if(sizeof(IODetailedTimingInformationV2)==descripSize)
{
IODetailedTimingInformationV2 *pifov2 =(IODetailedTimingInformationV2 *) _desc;
if(
isValidTimev2(*pifov2)
)
{
logTimingInfoV2(that, "validateDetailedTiming V2 isValidTiming", *pifov2);
}
else
{
logTimingInfoV2(that, "validateDetailedTiming V2 notvalidTiming", *pifov2);
return kIOReturnUnsupported;
}
}
else
{
DBGLOG("ngfx", "validateDetailedTiming %llx called size %llu unknown ", (void*)that, descripSize);
}
IOReturn ret= callbackNGFX->org_nda_validateDetailedTiming(that,_desc, descripSize);
DBGLOG("ngfx", "validateDetailedTiming %llx org_nda_validateDetailedTiming return %x", (void*)that, ret);
return ret;
}
DBGLOG("ngfx", "validateDetailedTimin not install ");
return kIOReturnUnsupported;
}
bool isValidTimev2(IODetailedTimingInformationV2 &v2)
{
if (
(v2.horizontalActive == 1920 && v2.verticalActive == 1080)
||
(v2.horizontalActive == 3840 && v2.verticalActive == 2160)
||
(v2.horizontalActive == 1080 && v2.verticalActive == 1920)
)
{
return true;
}
return false;
}
bool isValidTime(IOTimingInformation &timingInfo)
{
if (
isValidTimev2(timingInfo.detailedInfo.v2)
)
{
return true;
}
return false;
}
Patch 2:
Code:
IOReturn NGFX::setStartupDisplayMode (IONDRVFramebuffer *that, IODisplayModeID displayMode, IOIndex depth )
{
if (callbackNGFX && callbackNGFX->org_setStartupDisplayMode)
{
DBGLOG("ngfx", "setStartupDisplayMode %llx displayMode %u depth %u called",that, displayMode, depth);
IOSleep(10000); // 80% lightup
//do not call the orinal setStartupDisplayMode, just return kIOReturnSuccess
//
return kIOReturnSuccess;
}
return kIOReturnSuccess;
}
I have found a perfect solution. there is a few kConnectionHandleDisplayPortEvent attribute settings for this display, such as , kIODPEventStart, kIODPEventIdle and kIODPEventContentProtection. Althought I still not know it trigger by who, But I can get screen not black any more by skipping the kIODPEventIdle. It works fine and fastly. Patch 2 is no longer needed.
Patch3:
Code:
IOReturn NGFX::NVDA_setAttributeForConnection(IONDRVFramebuffer *that , IOIndex connectIndex,
IOSelect attribute, uintptr_t value )
{
switch(attribute)
{
case kConnectionHandleDisplayPortEvent:
{
if(kIODPEventIdle==evt)
{
return kIOReturnSuccess;
}
}
break;
}
}
IOReturn ret = callbackNGFX->org_NVDA_setAttributeForConnection(that, connectIndex,attribute,value);
DBGLOG("ngfx", "NVDA_setAttributeForConnection %s:%s ret %x ",that->getName(), that->getProvider()!=NULL?that->getProvider()->getName():"nopriver",ret);
return ret;
}
A lot of people buy a LG 5K Display with GTX1080(TI)/1070. But the web driver for MacOs can not driver the Display up. People had to give up the GTX Card, and turn to the AMD's Vega and RX580. It is really bad for the faithful Nvidia user. We were proud of the Nvidia driver that is stable and mighty. Do something please, or give us some advise what we can do the make the webdriver work with LG 5K. the LG ultrafine EDID attached:
EDID report generated by SwitchResX Version 4.6.6 (x64) for display LG UltraFine
-----------------------------------------------------
------------------- RAW DATA ------------------------
-----------------------------------------------------
0 1 2 3 4 5 6 7 8 9 A B C D E F
-----------------------------------------------------
0 | 00 FF FF FF FF FF FF 00 1E 6D 11 5B 53 45 00 00
1 | 09 1B 01 04 B5 3C 22 78 80 0F 91 AE 52 43 B0 26
2 | 0F 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01
3 | 01 01 01 01 01 01 25 CC 00 50 F0 70 3E 80 08 20
4 | 18 00 58 54 21 00 00 1A A3 5B 00 50 A0 A0 29 50
5 | 08 20 18 00 58 54 21 00 00 1A 00 00 00 FF 00 37
6 | 30 39 4E 54 4D 58 30 48 37 34 37 0A 00 00 00 FC
7 | 00 4C 47 20 55 6C 74 72 61 46 69 6E 65 0A 02 A4
-----------------------------------------------------
0 1 2 3 4 5 6 7 8 9 A B C D E F
-----------------------------------------------------
0 | 70 12 79 03 00 01 00 0C 3E 17 16 0D 00 14 40 0B
1 | 50 78 4E 99 29 00 10 B0 4B CE D5 4A E0 49 D7 AC
2 | 4C E4 51 03 80 BD 60 03 00 28 F5 E7 00 04 FF 0F
3 | 4F 00 07 80 1F 00 FF 08 41 00 00 00 07 00 5E 8E
4 | 00 04 7F 0C 4F 00 07 80 1F 00 07 07 33 00 00 00
5 | 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DC 90
-----------------------------------------------------
0 1 2 3 4 5 6 7 8 9 A B C D E F
-----------------------------------------------------
0 | 70 12 79 03 00 12 00 16 82 10 00 00 FF 09 3F 0B
1 | 00 00 00 00 00 47 53 4D 11 5B 01 01 01 01 03 00
2 | 14 45 B7 00 08 FF 09 4F 00 07 80 1F 00 3F 0B 51
3 | 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00
4 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 90
-----------------------------------------------------
< 00FFFFFF FFFFFF00 1E6D115B 53450000 091B0104 B53C2278 800F91AE 5243B026 0F505420 00000101 01010101 01010101 01010101 010125CC 0050F070 3E800820 18005854 2100001A A35B0050 A0A02950 08201800 58542100 001A0000 00FF0037 30394E54 4D583048 3734370A 000000FC 004C4720 556C7472 6146696E 650A02A4 70127903 0001000C 3E17160D 0014400B 50784E99 290010B0 4BCED54A E049D7AC 4CE45103 80BD6003 0028F5E7 0004FF0F 4F000780 1F00FF08 41000000 07005E8E 00047F0C 4F000780 1F000707 33000000 07000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000DC90 70127903 00120016 82100000 FF093F0B 00000000 0047534D 115B0101 01010300 1445B700 08FF094F 0007801F 003F0B51 00000007 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00005590 >
-----------------------------------------------------
{ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x1E, 0x6D, 0x11, 0x5B, 0x53, 0x45, 0x00, 0x00, 0x09, 0x1B, 0x01, 0x04, 0xB5, 0x3C, 0x22, 0x78, 0x80, 0x0F, 0x91, 0xAE, 0x52, 0x43, 0xB0, 0x26, 0x0F, 0x50, 0x54, 0x20, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x25, 0xCC, 0x00, 0x50, 0xF0, 0x70, 0x3E, 0x80, 0x08, 0x20, 0x18, 0x00, 0x58, 0x54, 0x21, 0x00, 0x00, 0x1A, 0xA3, 0x5B, 0x00, 0x50, 0xA0, 0xA0, 0x29, 0x50, 0x08, 0x20, 0x18, 0x00, 0x58, 0x54, 0x21, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x37, 0x30, 0x39, 0x4E, 0x54, 0x4D, 0x58, 0x30, 0x48, 0x37, 0x34, 0x37, 0x0A, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x4C, 0x47, 0x20, 0x55, 0x6C, 0x74, 0x72, 0x61, 0x46, 0x69, 0x6E, 0x65, 0x0A, 0x02, 0xA4, 0x70, 0x12, 0x79, 0x03, 0x00, 0x01, 0x00, 0x0C, 0x3E, 0x17, 0x16, 0x0D, 0x00, 0x14, 0x40, 0x0B, 0x50, 0x78, 0x4E, 0x99, 0x29, 0x00, 0x10, 0xB0, 0x4B, 0xCE, 0xD5, 0x4A, 0xE0, 0x49, 0xD7, 0xAC, 0x4C, 0xE4, 0x51, 0x03, 0x80, 0xBD, 0x60, 0x03, 0x00, 0x28, 0xF5, 0xE7, 0x00, 0x04, 0xFF, 0x0F, 0x4F, 0x00, 0x07, 0x80, 0x1F, 0x00, 0xFF, 0x08, 0x41, 0x00, 0x00, 0x00, 0x07, 0x00, 0x5E, 0x8E, 0x00, 0x04, 0x7F, 0x0C, 0x4F, 0x00, 0x07, 0x80, 0x1F, 0x00, 0x07, 0x07, 0x33, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x90, 0x70, 0x12, 0x79, 0x03, 0x00, 0x12, 0x00, 0x16, 0x82, 0x10, 0x00, 0x00, 0xFF, 0x09, 0x3F, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x53, 0x4D, 0x11, 0x5B, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x14, 0x45, 0xB7, 0x00, 0x08, 0xFF, 0x09, 0x4F, 0x00, 0x07, 0x80, 0x1F, 0x00, 0x3F, 0x0B, 0x51, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x90 }
-----------------------------------------------------
Valid EDID block #0: checksum ok
Valid EDID block #1: checksum ok
Valid EDID block #2: checksum ok
-----------------------------------------------------
------------------- MAIN EDID BLOCK -----------------
-----------------------------------------------------
EDID Version........1.4
Manufacturer........GSM (1E6D)
Product ID..........23313 (5B11)
Serial Number.......00004553
Manufactured........Week 9 of year 2017
Max H Size..........60 cm
Max V Size..........34 cm
Gamma...............2.20
Display Supported Features:
---------------------------
Power Management: Standby
Display type:
-------------
RGB 4:4:4 Color Encoding Format
Display is non continuous frequency
Default color space is not sRGB standard
Input signal & sync:
--------------------
Digital Input
10 Bits per Primary Color
DisplayPort interface
Color info:
-----------
Red x = 0.680 Green x = 0.265 Blue x = 0.150 White x = 0.312
Red y = 0.320 Green y = 0.690 Blue y = 0.060 White y = 0.329
Established Timings:
--------------------
640 x 480 @ 60Hz
Manufacturer Reserved Timings:
------------------------------
Standard Timing Identification:
-------------------------------
Monitor Description blocks:
---------------------------
Descriptor #0 - Timing definition:
Mode = 3840 x 2160 @ 59.999Hz
Pixel Clock............. 522.61 MHz Non-Interlaced
Horizontal Vertical
Active.................. 3840 pixels 2160 lines
Front Porch............. 8 pixels 1 lines
Sync Width.............. 32 pixels 8 lines
Back Porch.............. 40 pixels 53 lines
Blanking................ 80 pixels 62 lines
Total................... 3920 pixels 2222 lines
Scan Rate............... 133.319 kHz 59.999 Hz
Image Size.............. 600 mm 340 mm
Border.................. 0 pixels 0 lines
Sync: Digital separate with
* Negative vertical polarity
* Positive horizontal polarity
Descriptor #1 - Timing definition:
Mode = 2560 x 1440 @ 60.000Hz
Pixel Clock............. 234.59 MHz Non-Interlaced
Horizontal Vertical
Active.................. 2560 pixels 1440 lines
Front Porch............. 8 pixels 1 lines
Sync Width.............. 32 pixels 8 lines
Back Porch.............. 40 pixels 32 lines
Blanking................ 80 pixels 41 lines
Total................... 2640 pixels 1481 lines
Scan Rate............... 88.860 kHz 60.000 Hz
Image Size.............. 600 mm 340 mm
Border.................. 0 pixels 0 lines
Sync: Digital separate with
* Negative vertical polarity
* Positive horizontal polarity
Descriptor #2 - Serial number:
709NTMX0H747
Descriptor #3 - Monitor name:
LG UltraFine
-----------------------------------------------------
------------ EXTENSION EDID BLOCK 1 ---------------
-----------------------------------------------------
DID-EXT: Display ID Extension:
------------------------------
(only partly interpreted)
DisplayID version........1.2
DisplayID Block Type = Detailed Timing Block type 1:
Detailed Timing #1 in Block
Mode = 4096 x 2304 @ 59.999Hz
Pixel Clock............. 593.82 MHz Non-Interlaced
Horizontal Vertical
Active.................. 4096 pixels 2304 lines
Front Porch............. 8 pixels 1 lines
Sync Width.............. 32 pixels 8 lines
Back Porch.............. 40 pixels 57 lines
Blanking................ 80 pixels 66 lines
Total................... 4176 pixels 2370 lines
Scan Rate............... 142.198 kHz 59.999 Hz
Is non-default Mode
Sync: Digital separate with
* Negative vertical polarity
* Positive horizontal polarity
Detailed Timing #2 in Block
Mode = 3200 x 1800 @ 59.999Hz
Pixel Clock............. 364.47 MHz Non-Interlaced
Horizontal Vertical
Active.................. 3200 pixels 1800 lines
Front Porch............. 8 pixels 1 lines
Sync Width.............. 32 pixels 8 lines
Back Porch.............. 40 pixels 43 lines
Blanking................ 80 pixels 52 lines
Total................... 3280 pixels 1852 lines
Scan Rate............... 111.119 kHz 59.999 Hz
Is non-default Mode
Sync: Digital separate with
* Negative vertical polarity
* Positive horizontal polarity
-----------------------------------------------------
------------ EXTENSION EDID BLOCK 2 ---------------
-----------------------------------------------------
DID-EXT: Display ID Extension:
------------------------------
(only partly interpreted)
DisplayID version........1.2
DisplayID Block Type = Detailed Timing Block type 1:
Detailed Timing #1 in Block
Mode = 2560 x 2880 @ 60.000Hz
Pixel Clock............. 469.18 MHz Non-Interlaced
Horizontal Vertical
Active.................. 2560 pixels 2880 lines
Front Porch............. 8 pixels 1 lines
Sync Width.............. 32 pixels 8 lines
Back Porch.............. 40 pixels 73 lines
Blanking................ 80 pixels 82 lines
Total................... 2640 pixels 2962 lines
Scan Rate............... 177.720 kHz 60.000 Hz
Is non-default Mode
Sync: Digital separate with
* Negative vertical polarity
* Positive horizontal polarity