MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetEDIDSettings

Function GetEDIDSettings

rEFIt_UEFI/Platform/Settings.cpp:2024–2077  ·  view source on GitHub ↗

EDID reworked by Sherlocks

Source from the content-addressed store, hash-verified

2022
2023// EDID reworked by Sherlocks
2024VOID
2025GetEDIDSettings(const TagDict* DictPointer)
2026{
2027 const TagStruct* Prop;
2028 const TagDict* Dict;
2029 UINTN j = 128;
2030
2031 Dict = DictPointer->dictPropertyForKey("EDID");
2032 if (Dict != NULL) {
2033 Prop = Dict->propertyForKey("Inject");
2034 gSettings.InjectEDID = IsPropertyNotNullAndTrue(Prop); // default = false!
2035
2036 if (gSettings.InjectEDID){
2037 //DBG("Inject EDID\n");
2038 Prop = Dict->propertyForKey("Custom");
2039 if (Prop != NULL) {
2040 gSettings.CustomEDID = GetDataSetting(Dict, "Custom", &j);
2041 if ((j % 128) != 0) {
2042 DBG(" Custom EDID has wrong length=%llu\n", j);
2043 } else {
2044 DBG(" Custom EDID is ok\n");
2045 gSettings.CustomEDIDsize = (UINT16)j;
2046 InitializeEdidOverride();
2047 }
2048 }
2049
2050 Prop = Dict->propertyForKey("VendorID");
2051 if (Prop) {
2052 gSettings.VendorEDID = (UINT16)GetPropertyAsInteger(Prop, gSettings.VendorEDID);
2053 //DBG(" VendorID = 0x%04lx\n", gSettings.VendorEDID);
2054 }
2055
2056 Prop = Dict->propertyForKey("ProductID");
2057 if (Prop) {
2058 gSettings.ProductEDID = (UINT16)GetPropertyAsInteger(Prop, gSettings.ProductEDID);
2059 //DBG(" ProductID = 0x%04lx\n", gSettings.ProductEDID);
2060 }
2061
2062 Prop = Dict->propertyForKey("HorizontalSyncPulseWidth");
2063 if (Prop) {
2064 gSettings.EdidFixHorizontalSyncPulseWidth = (UINT16)GetPropertyAsInteger(Prop, gSettings.EdidFixHorizontalSyncPulseWidth);
2065 //DBG(" EdidFixHorizontalSyncPulseWidth = 0x%02lx\n", gSettings.EdidFixHorizontalSyncPulseWidth);
2066 }
2067
2068 Prop = Dict->propertyForKey("VideoInputSignal");
2069 if (Prop) {
2070 gSettings.EdidFixVideoInputSignal = (UINT8)GetPropertyAsInteger(Prop, gSettings.EdidFixVideoInputSignal);
2071 //DBG(" EdidFixVideoInputSignal = 0x%02lx\n", gSettings.EdidFixVideoInputSignal);
2072 }
2073 } else {
2074 //DBG("Not Inject EDID\n");
2075 }
2076 }
2077}
2078
2079EFI_STATUS
2080GetEarlyUserSettings (

Callers 2

GetEarlyUserSettingsFunction · 0.85
GetUserSettingsFunction · 0.85

Calls 6

IsPropertyNotNullAndTrueFunction · 0.85
GetDataSettingFunction · 0.85
InitializeEdidOverrideFunction · 0.85
GetPropertyAsIntegerFunction · 0.85
dictPropertyForKeyMethod · 0.80
propertyForKeyMethod · 0.80

Tested by

no test coverage detected