GPU (macOS): apply the same logic as CPU just in case

This commit is contained in:
李通洲
2024-11-12 22:47:24 +08:00
parent 644458bc74
commit c70c37c50c
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ static const char* detectFrequency(FFCPUResult* cpu)
if (pMax > 0)
{
if (pMax > 100000000) // Assume that pMax is in MHz, M1~M3
if (pMax > 100000000) // Assume that pMax is in Hz, M1~M3
cpu->frequencyMax = pMax / 1000 / 1000;
else // Assume that pMax is in kHz, M4 and later (#1394)
cpu->frequencyMax = pMax / 1000;
+7 -1
View File
@@ -68,7 +68,13 @@ static const char* detectFrequency(FFGPUResult* gpu)
pMax = pMax > pStart[i] ? pMax : pStart[i];
if (pMax > 0)
gpu->frequency = pMax / 1000 / 1000;
{
// While this is not necessary for now (seems), we add this logic just in case. See cpu_apple.c
if (pMax > 100000000) // Assume that pMax is in Hz
gpu->frequency = pMax / 1000 / 1000;
else // Assume that pMax is in kHz
gpu->frequency = pMax / 1000;
}
return NULL;
}