Skip to content

Commit

Permalink
Add disable-telemetry-load iGPU property to disable telemetry loading
Browse files Browse the repository at this point in the history
Disables iGPU telemetry loading that may cause a freeze during startup on certain laptops such as Chromebooks
  • Loading branch information
Goldfish64 committed Dec 27, 2022
1 parent b47e559 commit 3c4ceca
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ WhateverGreen Changelog
=======================
#### v1.6.3
- Added various GPU identifiers from different Macs
- Added `disable-telemetry-load` to disable iGPU telemetry loading that may cause a freeze during startup on certain laptops such as Chromebooks.

#### v1.6.2
- Added W7170M/S7100X ID
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Read [FAQs](https://github.com/acidanthera/WhateverGreen/blob/master/Manual/) an
| `-igfxmlr` | `enable-dpcd-max-link-rate-fix` property on IGPU | Apply the maximum link rate fix |
| `-igfxmpc` | `enable-max-pixel-clock-override` and `max-pixel-clock-frequency` properties on IGPU | Increase max pixel clock (as an alternative to patching `CoreDisplay.framework` |
| `-igfxnohdmi` | `disable-hdmi-patches` | Disable DP to HDMI conversion patches for digital sound |
| `-igfxnotelemetryload` | `disable-telemetry-load` property on IGPU | Disables iGPU telemetry loading that may cause a freeze during startup on certain laptops such as Chromebooks
| `-igfxsklaskbl` | N/A | Enforce Kaby Lake (KBL) graphics kext being loaded and used on Skylake models (KBL `device-id` and `ig-platform-id` are required. Not required on macOS 13 and above) |
| `-igfxtypec` | N/A | Force DP connectivity for Type-C platforms |
| `-igfxvesa` | N/A | Disable Intel Graphics acceleration |
Expand Down
21 changes: 21 additions & 0 deletions WhateverGreen/kern_igfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ void IGFX::processKernel(KernelPatcher &patcher, DeviceInfo *info) {

disableAccel = checkKernelArgument("-igfxvesa");

disableIGTelemetry = info->videoBuiltin->getProperty("disable-telemetry-load") != nullptr || checkKernelArgument("-igfxnotelemetryload");

bool connectorLessFrame = info->reportedFramebufferIsConnectorLess;

int gl = info->videoBuiltin->getProperty("disable-metal") != nullptr;
Expand Down Expand Up @@ -249,6 +251,8 @@ void IGFX::processKernel(KernelPatcher &patcher, DeviceInfo *info) {
return true;
if (disableAccel)
return true;
if (disableIGTelemetry)
return true;
return false;
};

Expand Down Expand Up @@ -279,6 +283,23 @@ bool IGFX::processKext(KernelPatcher &patcher, size_t index, mach_vm_address_t a
auto cpuGeneration = BaseDeviceInfo::get().cpuGeneration;

if (currentGraphics && currentGraphics->loadIndex == index) {
if (disableIGTelemetry) {
auto symTelemetry = patcher.solveSymbol(index, "__ZN18IGTelemetryManager16prepareTelemetryEj");
if (symTelemetry) {
uint8_t ret[] {0xC3};
patcher.routeBlock(symTelemetry, ret, sizeof(ret));
if (patcher.getError() == KernelPatcher::Error::NoError) {
DBGLOG("igfx", "disabled __ZN18IGTelemetryManager16prepareTelemetryEj");
} else {
SYSLOG("igfx", "failed to disable __ZN18IGTelemetryManager16prepareTelemetryEj with code %d", patcher.getError());
patcher.clearError();
}
} else {
SYSLOG("igfx", "failed to resolve __ZN18IGTelemetryManager16prepareTelemetryE code %d", patcher.getError());
patcher.clearError();
}
}

if (forceOpenGL || forceMetal || forceSKLAsKBL || moderniseAccelerator || fwLoadMode != FW_APPLE || disableAccel) {
KernelPatcher::RouteRequest request("__ZN16IntelAccelerator5startEP9IOService", wrapAcceleratorStart, orgAcceleratorStart);
patcher.routeMultiple(index, &request, 1, address, size);
Expand Down
5 changes: 5 additions & 0 deletions WhateverGreen/kern_igfx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ class IGFX {
*/
bool forceMetal {false};

/**
* Set to true to disable telemetry loading for IGTelemetryManager.
*/
bool disableIGTelemetry {false};

/**
* Set to true if Sandy Bridge Gen6Accelerator should be renamed
*/
Expand Down

0 comments on commit 3c4ceca

Please sign in to comment.