From f7cf08a659eeeb54954f787bad43d436209aebc8 Mon Sep 17 00:00:00 2001 From: sp00n Date: Fri, 11 Apr 2025 00:59:45 +0200 Subject: [PATCH 1/2] This should fix #11 (--get-offsets-terse not displaying the correct values for some cores) --- ryzen-smu-cli/Program.cs | 12 +++++++++--- ryzen-smu-cli/ryzen-smu-cli.csproj | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ryzen-smu-cli/Program.cs b/ryzen-smu-cli/Program.cs index 5108a0f..ed0095c 100644 --- a/ryzen-smu-cli/Program.cs +++ b/ryzen-smu-cli/Program.cs @@ -79,12 +79,18 @@ namespace ryzen_smu_cli Console.WriteLine("Current PBO offsets:"); string offsetLine = ""; bool flagNotifyDisabledCCD = false; - for (int i = 0; i < mappedCores.Count; i++) + + for (int logicalCore = 0; logicalCore < mappedCores.Count; logicalCore++) { - int mapIndex = i < 8 ? 0 : 1; + int physicalCore = mappedCores[logicalCore]; + int ccdIndex = (int)Math.Floor((double)(physicalCore / 8)); + int ccdBitmask = ccdIndex << 8; + int coreNumOnCcd = physicalCore % 8; + uint coreBitMask = (uint)((ccdBitmask | (coreNumOnCcd & 0xF)) << 20); + try { - offsetLine += Convert.ToDecimal((int)ryzen.GetPsmMarginSingleCore((uint)(((mapIndex << 8) | ((mappedCores[i] % 8) & 0xF)) << 20))!); + offsetLine += Convert.ToDecimal((int)ryzen.GetPsmMarginSingleCore(coreBitMask)!); offsetLine += ","; } diff --git a/ryzen-smu-cli/ryzen-smu-cli.csproj b/ryzen-smu-cli/ryzen-smu-cli.csproj index b7c7957..17971b6 100644 --- a/ryzen-smu-cli/ryzen-smu-cli.csproj +++ b/ryzen-smu-cli/ryzen-smu-cli.csproj @@ -6,7 +6,7 @@ ryzen_smu_cli enable enable - 0.1.2 + 0.1.3 From 056a3add8f21698fd55980bbc16ed81b0e12f1a8 Mon Sep 17 00:00:00 2001 From: sp00n Date: Fri, 11 Apr 2025 01:04:33 +0200 Subject: [PATCH 2/2] "Bitmask" vs. "BitMask" --- ryzen-smu-cli/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ryzen-smu-cli/Program.cs b/ryzen-smu-cli/Program.cs index ed0095c..c5d5e86 100644 --- a/ryzen-smu-cli/Program.cs +++ b/ryzen-smu-cli/Program.cs @@ -84,9 +84,9 @@ namespace ryzen_smu_cli { int physicalCore = mappedCores[logicalCore]; int ccdIndex = (int)Math.Floor((double)(physicalCore / 8)); - int ccdBitmask = ccdIndex << 8; + int ccdBitMask = ccdIndex << 8; int coreNumOnCcd = physicalCore % 8; - uint coreBitMask = (uint)((ccdBitmask | (coreNumOnCcd & 0xF)) << 20); + uint coreBitMask = (uint)((ccdBitMask | (coreNumOnCcd & 0xF)) << 20); try {