示例#1
0
void ActivePolicy::requestFanSpeedChange(
    const ActiveRelationshipTableEntry& entry,
    const Temperature& currentTemperature)
{
    auto tripPoints = getParticipantTracker()[entry.targetDeviceIndex()].getActiveTripPointProperty().getTripPoints();
    auto domainIndexes = getParticipantTracker()[entry.sourceDeviceIndex()].getDomainIndexes();
    for (auto domainIndex = domainIndexes.begin(); domainIndex != domainIndexes.end(); domainIndex++)
    {
        ActiveCoolingControl& coolingControl =
            getParticipantTracker()[entry.sourceDeviceIndex()][*domainIndex].getActiveCoolingControl();
        if (coolingControl.supportsFineGrainControl())
        {
            Percentage fanSpeed = selectFanSpeed(entry, tripPoints, currentTemperature);
            postDebugMessage(PolicyMessage(FLF, "Requesting fan speed of " + fanSpeed.toString() + "."));
            coolingControl.requestFanSpeedPercentage(entry.targetDeviceIndex(), fanSpeed);
        }
        else
        {
            UIntN activeControlIndex = selectActiveControlIndex(entry, tripPoints, currentTemperature);
            postDebugMessage(PolicyMessage(
                FLF, "Requesting fan speed index of " + to_string(activeControlIndex) + "."));
            coolingControl.requestActiveControlIndex(entry.targetDeviceIndex(), activeControlIndex);
        }
    }
}
示例#2
0
std::string DomainPlatformPowerControl_001::createStatusStringForDutyCycle(PlatformPowerLimitType::Type limitType)
{
    try
    {
        if (isEnabled(limitType) &&
            (limitType == PlatformPowerLimitType::PSysPL3))
        {
            Percentage dutyCycle = getPlatformPowerLimitDutyCycle(getParticipantIndex(), getDomainIndex(),
                limitType);
            return dutyCycle.toString();
        }
        else
        {
            return "DISABLED";
        }
    }
    catch (...)
    {
        return "ERROR";
    }
}
示例#3
0
std::string DomainPowerControl_001::createStatusStringForDutyCycle(PowerControlType::Type controlType)
{
    try
    {
        if (isEnabled(controlType) &&
            (controlType == PowerControlType::PL3))
        {
            Percentage dutyCycle = getPowerLimitDutyCycle(getParticipantIndex(), getDomainIndex(), controlType);
            return dutyCycle.toString();
        }
        else
        {
            return "DISABLED";
        }
    }
    catch (primitive_not_found_in_dsp)
    {
        return "NOT SUPPORTED";
    }
    catch (...)
    {
        return "ERROR";
    }
}