Example #1
0
void DomainPerformanceControl_002::setPerformanceControlDynamicCaps(UIntN participantIndex, UIntN domainIndex, 
    PerformanceControlDynamicCaps newCapabilities)
{
    auto upperLimitIndex = newCapabilities.getCurrentUpperLimitIndex();
    auto lowerLimitIndex = newCapabilities.getCurrentLowerLimitIndex();

    auto throttlingStateSet = getThrottlingStateSet(domainIndex);
    auto performanceStateSet = getPerformanceStateSet(domainIndex);

    auto pstateLowerLimit = 0;
    auto tstateLowerLimit = 0;

    if (upperLimitIndex != Constants::Invalid && lowerLimitIndex != Constants::Invalid)
    {
        auto pstateSetSize = performanceStateSet.getCount();
        auto tstateSetSize = throttlingStateSet.getCount();
        auto combinedSet = getPerformanceControlSet(participantIndex, domainIndex);
        auto combinedSetSize = combinedSet.getCount();
        if (upperLimitIndex >= combinedSetSize)
        {
            throw dptf_exception("Upper Limit index is out of control set bounds.");
        }
        else if (upperLimitIndex > lowerLimitIndex || lowerLimitIndex >= combinedSetSize)
        {
            pstateLowerLimit = pstateSetSize - 1;
            tstateLowerLimit = tstateSetSize - 1;
            getParticipantServices()->writeMessageWarning(
                ParticipantMessage(FLF, "Limit index mismatch, setting lower limit to lowest possible index."));
        }
        else if (lowerLimitIndex > pstateSetSize - 1)
        {
            pstateLowerLimit = pstateSetSize - 1;
            if (isFirstTstateDeleted(domainIndex))
            {
                tstateLowerLimit = combinedSetSize - tstateSetSize;
            }
            else
            {
                tstateLowerLimit = combinedSetSize - tstateSetSize - 1;
            }
        }
    }

    m_performanceControlDynamicCaps.invalidate();

    getParticipantServices()->primitiveExecuteSetAsUInt32(
        esif_primitive_type::SET_PROC_PERF_PSTATE_DEPTH_LIMIT,
        pstateLowerLimit,
        domainIndex,
        Constants::Esif::NoPersistInstance);
    getParticipantServices()->primitiveExecuteSetAsUInt32(
        esif_primitive_type::SET_PROC_PERF_TSTATE_DEPTH_LIMIT,
        tstateLowerLimit,
        domainIndex,
        Constants::Esif::NoPersistInstance);

    // TODO: allow DPTF to change the MAX limit
    getParticipantServices()->writeMessageInfo(
        ParticipantMessage(FLF, "Currently DPTF cannot change the MAX limit."));
}
Example #2
0
void DomainPerformanceControl_003::setPerformanceControlDynamicCaps(UIntN participantIndex, UIntN domainIndex, 
    PerformanceControlDynamicCaps newCapabilities)
{
    auto upperLimitIndex = newCapabilities.getCurrentUpperLimitIndex();
    auto lowerLimitIndex = newCapabilities.getCurrentLowerLimitIndex();

    if (upperLimitIndex == Constants::Invalid && lowerLimitIndex == Constants::Invalid)
    {
        if (m_capabilitiesLocked == false)
        {
            m_performanceControlDynamicCaps.invalidate();
        }

        return;
    }

    auto size = getPerformanceControlSet(participantIndex, domainIndex).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_performanceControlDynamicCaps.invalidate();
    m_performanceControlDynamicCaps.set(PerformanceControlDynamicCaps(lowerLimitIndex, upperLimitIndex));
}
Example #3
0
void DomainPerformanceControl_001::setPerformanceControlDynamicCaps(UIntN participantIndex, UIntN domainIndex, 
    PerformanceControlDynamicCaps newCapabilities)
{
    auto upperLimitIndex = newCapabilities.getCurrentUpperLimitIndex();
    auto lowerLimitIndex = newCapabilities.getCurrentLowerLimitIndex();

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

    m_performanceControlDynamicCaps.invalidate();

    getParticipantServices()->primitiveExecuteSetAsUInt32(
        esif_primitive_type::SET_PERF_PSTATE_DEPTH_LIMIT,
        lowerLimitIndex,
        domainIndex,
        Constants::Esif::NoPersistInstance);

    // TODO: allow DPTF to change the MAX limit
    getParticipantServices()->writeMessageInfo(
        ParticipantMessage(FLF, "Currently DPTF cannot change the MAX limit."));
}
PerformanceControlSet PassiveDomainControlStatus::filterControlSet(
	const PerformanceControlSet& controlSet,
	PerformanceControlDynamicCaps dynamicCapabilities,
	PerformanceControlType::Type type) const
{
	std::vector<PerformanceControl> filteredControls;
	UIntN startIndex = dynamicCapabilities.getCurrentUpperLimitIndex();
	UIntN endIndex = dynamicCapabilities.getCurrentLowerLimitIndex();
	for (UIntN controlIndex = startIndex; controlIndex < std::min(endIndex + 1, controlSet.getCount()); controlIndex++)
	{
		if (controlSet[controlIndex].getPerformanceControlType() == type)
		{
			filteredControls.push_back(controlSet[controlIndex]);
		}
	}
	return PerformanceControlSet(filteredControls);
}