Skip to content

Commit

Permalink
Fix kern_nred fallback IGPU naming
Browse files Browse the repository at this point in the history
Signed-off-by: Visual Ehrmanntraut <[email protected]>
  • Loading branch information
VisualEhrmanntraut committed Aug 13, 2023
1 parent 86bd323 commit ede4b28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions NootedRed/kern_amd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ struct CAILAsicCapsInitEntry {
const void *goldenCaps;
} PACKED;

static const uint32_t ddiCapsRaven[16] = {0x800005U, 0x500011FEU, 0x80000U, 0x11001000U, 0x200U, 0x68000001U,
0x20000000, 0x4002U, 0x22420001U, 0x9E20E10U, 0x2000120U, 0x0U, 0x0U, 0x0U, 0x0U, 0x0U};
static const uint32_t ddiCapsRenoir[16] = {0x800005U, 0x500011FEU, 0x80000U, 0x11001000U, 0x200U, 0x68000001U,
0x20000000, 0x4002U, 0x22420001U, 0x9E20E18U, 0x2000120U, 0x0U, 0x0U, 0x0U, 0x0U, 0x0U};
static const uint32_t ddiCapsRaven[16] = {0x800005, 0x500011FE, 0x80000, 0x11001000, 0x200, 0x68000001, 0x20000000,
0x4002, 0x22420001, 0x9E20E10, 0x2000120, 0x0, 0x0, 0x0, 0x0, 0x0};
static const uint32_t ddiCapsRenoir[16] = {0x800005, 0x500011FE, 0x80000, 0x11001000, 0x200, 0x68000001, 0x20000000,
0x4002, 0x22420001, 0x9E20E18, 0x2000120, 0x0, 0x0, 0x0, 0x0, 0x0};

enum CAILResult : uint32_t {
kCAILResultSuccess = 0,
Expand Down
20 changes: 10 additions & 10 deletions NootedRed/kern_nred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ void NRed::processPatcher(KernelPatcher &patcher) {
WIOKit::renameDevice(this->iGPU, "IGPU");
WIOKit::awaitPublishing(this->iGPU);

char name[128] = {0};
for (size_t i = 0, ii = 0; i < devInfo->videoExternal.size(); i++) {
auto *device = OSDynamicCast(IOPCIDevice, devInfo->videoExternal[i].video);
if (device) {
snprintf(name, arrsize(name), "GFX%zu", ii++);
WIOKit::renameDevice(device, name);
WIOKit::awaitPublishing(device);
}
}

static uint8_t builtin[] = {0x00};
this->iGPU->setProperty("built-in", builtin, arrsize(builtin));
this->deviceId = WIOKit::readPCIConfigValue(this->iGPU, WIOKit::kIOPCIConfigDeviceID);
Expand All @@ -108,6 +98,16 @@ void NRed::processPatcher(KernelPatcher &patcher) {

this->iGPU->setMemoryEnable(true);

char name[128] = {0};
for (size_t i = 0, ii = 0; i < devInfo->videoExternal.size(); i++) {
auto *device = OSDynamicCast(IOPCIDevice, devInfo->videoExternal[i].video);
if (device && WIOKit::readPCIConfigValue(device, WIOKit::kIOPCIConfigDeviceID) != this->deviceId) {
snprintf(name, arrsize(name), "GFX%zu", ii++);
WIOKit::renameDevice(device, name);
WIOKit::awaitPublishing(device);
}
}

auto *prop = OSDynamicCast(OSData, this->iGPU->getProperty("ATY,bin_image"));
if (prop) {
DBGLOG("nred", "VBIOS manually overridden");
Expand Down

0 comments on commit ede4b28

Please sign in to comment.