From d2b59e7db62988e91e51184f589e6672cd7d39a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Wed, 27 Nov 2024 14:59:45 +0100 Subject: [PATCH 1/2] DasharoModulePkg: Add Fans Off feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- DasharoModulePkg/Include/DasharoOptions.h | 1 + .../DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h | 1 + .../DasharoSystemFeaturesStrings.uni | 4 +++- .../DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DasharoModulePkg/Include/DasharoOptions.h b/DasharoModulePkg/Include/DasharoOptions.h index 23273381a3..9cd0733a7d 100644 --- a/DasharoModulePkg/Include/DasharoOptions.h +++ b/DasharoModulePkg/Include/DasharoOptions.h @@ -54,6 +54,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define DASHARO_FAN_CURVE_OPTION_SILENT 0 #define DASHARO_FAN_CURVE_OPTION_PERFORMANCE 1 +#define DASHARO_FAN_CURVE_OPTION_OFF 2 #define DASHARO_ME_MODE_ENABLE 0 #define DASHARO_ME_MODE_DISABLE_HECI 1 diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h index 83fe4a028a..a0654de4f5 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h @@ -106,6 +106,7 @@ typedef struct { #define FAN_CURVE_OPTION_SILENT DASHARO_FAN_CURVE_OPTION_SILENT #define FAN_CURVE_OPTION_PERFORMANCE DASHARO_FAN_CURVE_OPTION_PERFORMANCE +#define FAN_CURVE_OPTION_OFF DASHARO_FAN_CURVE_OPTION_OFF #define ME_MODE_ENABLE DASHARO_ME_MODE_ENABLE #define ME_MODE_DISABLE_HECI DASHARO_ME_MODE_DISABLE_HECI diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesStrings.uni b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesStrings.uni index 8739ecd8e2..156152530b 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesStrings.uni +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesStrings.uni @@ -91,10 +91,12 @@ #string STR_FAN_CURVE_PROMPT #language en-US "Fan profile" #string STR_FAN_CURVE_HELP #language en-US "Sets the preferred fan operation mode.\n\n" "Silent: The fan will operate at lower speeds to reduce noise.\n\n" - "Performance: The fans will work at higher speeds to reduce temperature and increase performance." + "Performance: The fans will work at higher speeds to reduce temperature and increase performance.\n\n" + "Fans Off: The fans will be turned off." #string STR_FAN_CURVE_SILENT #language en-US "Silent" #string STR_FAN_CURVE_PERFORMANCE #language en-US "Performance" +#string STR_FAN_CURVE_OFF #language en-US "Fans Off" #string STR_DMA_PROTECTION_PROMPT #language en-US "Early boot DMA Protection" #string STR_DMA_PROTECTION_HELP #language en-US "Enables IOMMU DMA protection early during POST." diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr index b843979bba..2d24dbcca4 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr @@ -290,6 +290,7 @@ formset option text = STRING_TOKEN(STR_FAN_CURVE_SILENT), value = FAN_CURVE_OPTION_SILENT, flags = DEFAULT; option text = STRING_TOKEN(STR_FAN_CURVE_PERFORMANCE), value = FAN_CURVE_OPTION_PERFORMANCE, flags = 0; + option text = STRING_TOKEN(STR_FAN_CURVE_OFF), value = FAN_CURVE_OPTION_OFF, flags = 0; endoneof; endif; From 0d915b890f8756980e6c967e82cb4e18b8ad5663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Fri, 29 Nov 2024 12:34:04 +0100 Subject: [PATCH 2/2] DasharoModulePkg: Add option to hide the Fan Off feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- DasharoModulePkg/DasharoModulePkg.dec | 1 + .../Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c | 1 + .../DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h | 1 + .../DasharoSystemFeaturesUiLib/DasharoSystemFeaturesUiLib.inf | 1 + .../DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr | 2 ++ 5 files changed, 6 insertions(+) diff --git a/DasharoModulePkg/DasharoModulePkg.dec b/DasharoModulePkg/DasharoModulePkg.dec index 4790ad01d7..6d4f6d0dc2 100644 --- a/DasharoModulePkg/DasharoModulePkg.dec +++ b/DasharoModulePkg/DasharoModulePkg.dec @@ -80,6 +80,7 @@ gDasharoSystemFeaturesTokenSpaceGuid.PcdShowCpuHyperThreading|FALSE|BOOLEAN|0x000000027 gDasharoSystemFeaturesTokenSpaceGuid.PcdCpuHyperThreadingDefault|TRUE|BOOLEAN|0x000000028 gDasharoSystemFeaturesTokenSpaceGuid.PcdCpuThrottlingOffsetDefault|20|UINT8|0x00000029 + gDasharoSystemFeaturesTokenSpaceGuid.PcdPowerMenuShowFanCurveOffOption|FALSE|BOOLEAN|0x00000002A [PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx] ## Indicate whether the password is cleared. diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c index 36e0fb8da7..7dfd2550f3 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c @@ -197,6 +197,7 @@ DasharoSystemFeaturesUiLibConstructor ( PRIVATE_DATA(ShowCpuHyperThreading) = FixedPcdGetBool(PcdShowCpuHyperThreading); PRIVATE_DATA(WatchdogAvailable) = FixedPcdGetBool (PcdShowOcWdtOptions); PRIVATE_DATA(ShowPowerFailureState) = FixedPcdGet8 (PcdDefaultPowerFailureState) != POWER_FAILURE_STATE_HIDDEN; + PRIVATE_DATA(HideFanCurveOff) = !FixedPcdGetBool (PcdPowerMenuShowFanCurveOffOption); // Ensure at least one option is visible in given menu (if enabled), otherwise hide it if (PRIVATE_DATA(ShowSecurityMenu)) diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h index a0654de4f5..4c4905bd52 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h @@ -59,6 +59,7 @@ typedef struct { BOOLEAN ShowCpuCoreDisable; BOOLEAN ShowCpuHyperThreading; BOOLEAN ShowPowerFailureState; + BOOLEAN HideFanCurveOff; // Feature data BOOLEAN LockBios; BOOLEAN SmmBwp; diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesUiLib.inf b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesUiLib.inf index 2ae4d94e73..d30a7b863e 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesUiLib.inf +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesUiLib.inf @@ -95,3 +95,4 @@ gDasharoSystemFeaturesTokenSpaceGuid.PcdShowCpuCoreDisable gDasharoSystemFeaturesTokenSpaceGuid.PcdShowCpuHyperThreading gDasharoSystemFeaturesTokenSpaceGuid.PcdCpuMaxTemperature + gDasharoSystemFeaturesTokenSpaceGuid.PcdPowerMenuShowFanCurveOffOption diff --git a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr index 2d24dbcca4..58adcbf8e4 100644 --- a/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr +++ b/DasharoModulePkg/Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesVfr.vfr @@ -290,7 +290,9 @@ formset option text = STRING_TOKEN(STR_FAN_CURVE_SILENT), value = FAN_CURVE_OPTION_SILENT, flags = DEFAULT; option text = STRING_TOKEN(STR_FAN_CURVE_PERFORMANCE), value = FAN_CURVE_OPTION_PERFORMANCE, flags = 0; + suppressif ideqval FeaturesData.HideFanCurveOff == 1; option text = STRING_TOKEN(STR_FAN_CURVE_OFF), value = FAN_CURVE_OPTION_OFF, flags = 0; + endif; endoneof; endif;