Example #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);
        }
    }
}
Example #2
0
void DomainDisplayControl_001::setDisplayControlDynamicCaps(UIntN participantIndex, UIntN domainIndex, 
    DisplayControlDynamicCaps newCapabilities)
{
    auto displaySet = getDisplayControlSet(participantIndex, domainIndex);
    auto upperLimitIndex = newCapabilities.getCurrentUpperLimit();
    auto lowerLimitIndex = newCapabilities.getCurrentLowerLimit();

    if (upperLimitIndex != Constants::Invalid && lowerLimitIndex != Constants::Invalid)
    {
        auto size = displaySet.getCount();
        if (upperLimitIndex >= size)
        {
            throw dptf_exception("Upper Limit index is out of control set bounds.");
        }
        else if (upperLimitIndex > lowerLimitIndex || lowerLimitIndex >= size)
        {
            lowerLimitIndex = size - 1;
            getParticipantServices()->writeMessageWarning(
                ParticipantMessage(FLF, "Limit index mismatch, setting lower limit to lowest possible index."));
        }

        m_displayControlDynamicCaps.invalidate();

        Percentage upperLimitBrightness = displaySet[upperLimitIndex].getBrightness();
        UInt32 uint32UpperLimit = upperLimitBrightness.toWholeNumber();
        getParticipantServices()->primitiveExecuteSetAsUInt32(
            esif_primitive_type::SET_DISPLAY_CAPABILITY,
            uint32UpperLimit,
            domainIndex,
            Constants::Esif::NoPersistInstance);

        Percentage lowerLimitBrightness = displaySet[lowerLimitIndex].getBrightness();
        UInt32 uint32LowerLimit = lowerLimitBrightness.toWholeNumber();
        getParticipantServices()->primitiveExecuteSetAsUInt32(
            esif_primitive_type::SET_DISPLAY_DEPTH_LIMIT,
            uint32LowerLimit,
            domainIndex,
            Constants::Esif::NoPersistInstance);
    }
    else
    {
        m_displayControlDynamicCaps.invalidate();

        getParticipantServices()->primitiveExecuteSetAsUInt32(
            esif_primitive_type::SET_DISPLAY_CAPABILITY,
            upperLimitIndex,
            domainIndex,
            Constants::Esif::NoPersistInstance);

        getParticipantServices()->primitiveExecuteSetAsUInt32(
            esif_primitive_type::SET_DISPLAY_DEPTH_LIMIT,
            lowerLimitIndex,
            domainIndex,
            Constants::Esif::NoPersistInstance);
    }
}
Example #3
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";
    }
}
Example #4
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";
    }
}