Skip to content

Commit

Permalink
Add hwSetMode skip hwRegsNeedUpdate patch for macOS Sonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
lshbluesky committed May 4, 2024
1 parent 54257ca commit 2f5d825
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions WhateverGreen/kern_igfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,20 @@ void IGFX::ForceCompleteModeset::processFramebufferKext(KernelPatcher &patcher,
static const uint8_t f2[] = {0xE8, 0x31, 0xE5, 0xFF, 0xFF, 0x84, 0xC0, 0x74, 0x3D};
static const uint8_t r2[] = {0xE8, 0x31, 0xE5, 0xFF, 0xFF, 0x84, 0xC0, 0xEB, 0x3D};

// AppleIntelFramebufferController::hwSetMode skip hwRegsNeedUpdate - macOS Sonoma 14.x
static const uint8_t f2b[] = {0xE8, 0x54, 0xEA, 0xFF, 0xFF, 0x84, 0xC0, 0x74, 0x5C};
static const uint8_t r2b[] = {0xE8, 0x54, 0xEA, 0xFF, 0xFF, 0x84, 0xC0, 0xeb, 0x5C};

// writeReg32(SOUTH_DSPCLK_GATE_D,PCH_GMBUSUNIT_CLOCK_GATE_DISABLE); Wa_14011294188:ehl,jsl,tgl,rkl,adl-s
static const uint8_t f1[] = {0x74, 0x28, 0x48, 0xFF, 0x05, 0x9E, 0x65, 0x0B, 0x00, 0xBE, 0x20, 0x20, 0x0C, 0x00, 0x4C, 0x89, 0xEF, 0xE8, 0x3F, 0xE2, 0xFF, 0xFF, 0x0D, 0x00, 0x10, 0x00, 0x00};
static const uint8_t r1[] = {0x90, 0x90, 0x48, 0xFF, 0x05, 0x9E, 0x65, 0x0B, 0x00, 0xBE, 0x20, 0x20, 0x0C, 0x00, 0x4C, 0x89, 0xEF, 0xE8, 0x3F, 0xE2, 0xFF, 0xFF, 0xb8, 0x00, 0x00, 0x00, 0x80};

KernelPatcher::LookupPatch patch { &kextIntelICLLPFb, f2, r2, sizeof(f2), 1 };
patcher.applyLookupPatch(&patch);

KernelPatcher::LookupPatch patchb { &kextIntelICLLPFb, f2b, r2b, sizeof(f2b), 1 };
patcher.applyLookupPatch(&patchb);

KernelPatcher::LookupPatch patch2 { &kextIntelICLLPFb, f1, r1, sizeof(f1), 1 };
patcher.applyLookupPatch(&patch2);
}
Expand Down

0 comments on commit 2f5d825

Please sign in to comment.