Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Commit

Permalink
Adds TGDD for the first GPU to improve iStats compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aluveitie committed Feb 15, 2023
1 parent b385650 commit b565b47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SMCRadeonGPU/SMCRadeonGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ IOService *SMCRadeonGPU::probe(IOService *provider, SInt32 *score) {
suc &= VirtualSMCAPI::addKey(KeyTGxP(i), vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new GPUTempProvider(fProvider, i)));
suc &= VirtualSMCAPI::addKey(KeyTGxd(i), vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new GPUTempProvider(fProvider, i)));
suc &= VirtualSMCAPI::addKey(KeyTGxp(i), vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new GPUTempProvider(fProvider, i)));
if (i == 0) {
suc &= VirtualSMCAPI::addKey(KeyTGDD, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new GPUTempProvider(fProvider, i)));
}
}

qsort(const_cast<VirtualSMCKeyValue *>(vsmcPlugin.data.data()), vsmcPlugin.data.size(), sizeof(VirtualSMCKeyValue), VirtualSMCKeyValue::compare);

if (!suc) {
os_log(OS_LOG_DEFAULT, "SMCRadeonGPU setting up SMC keys failed");
Expand Down
1 change: 1 addition & 0 deletions SMCRadeonGPU/SMCRadeonGPU.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class EXPORT SMCRadeonGPU : public IOService {
static constexpr SMC_KEY KeyTGxD(size_t i) { return SMC_MAKE_IDENTIFIER('T','G',KeyIndexes[i],'D'); }
static constexpr SMC_KEY KeyTGxp(size_t i) { return SMC_MAKE_IDENTIFIER('T','G',KeyIndexes[i],'p'); }
static constexpr SMC_KEY KeyTGxd(size_t i) { return SMC_MAKE_IDENTIFIER('T','G',KeyIndexes[i],'d'); }
static constexpr SMC_KEY KeyTGDD = SMC_MAKE_IDENTIFIER('T','G','D','D');


VirtualSMCAPI::Plugin vsmcPlugin {
Expand Down

0 comments on commit b565b47

Please sign in to comment.