Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DasharoModulePkg: Add Fans Off feature #193

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DasharoModulePkg/DasharoModulePkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions DasharoModulePkg/Include/DasharoOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typedef struct {
BOOLEAN ShowCpuCoreDisable;
BOOLEAN ShowCpuHyperThreading;
BOOLEAN ShowPowerFailureState;
BOOLEAN HideFanCurveOff;
// Feature data
BOOLEAN LockBios;
BOOLEAN SmmBwp;
Expand Down Expand Up @@ -106,6 +107,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@
gDasharoSystemFeaturesTokenSpaceGuid.PcdShowCpuCoreDisable
gDasharoSystemFeaturesTokenSpaceGuid.PcdShowCpuHyperThreading
gDasharoSystemFeaturesTokenSpaceGuid.PcdCpuMaxTemperature
gDasharoSystemFeaturesTokenSpaceGuid.PcdPowerMenuShowFanCurveOffOption
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +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;

Expand Down
Loading