Exemplo n.º 1
0
void DomainPerformanceControl_001::setPerformanceControl(UIntN participantIndex, UIntN domainIndex,
    UIntN performanceControlIndex)
{
    if (performanceControlIndex == getCurrentPerformanceControlIndex(participantIndex, domainIndex))
    {
        getParticipantServices()->writeMessageDebug(
            ParticipantMessage(FLF, "Requested limit = current limit.  Ignoring."));
        return;
    }

    try
    {
        throwIfPerformanceControlIndexIsOutOfBounds(domainIndex, performanceControlIndex);
        getParticipantServices()->primitiveExecuteSetAsUInt32(
            esif_primitive_type::SET_PERF_PRESENT_CAPABILITY,
            performanceControlIndex,
            domainIndex);

        // Refresh the status
        m_performanceControlStatus.set(PerformanceControlStatus(performanceControlIndex));
    }
    catch (...)
    {
        // eat any errors
    }
}
Exemplo n.º 2
0
void DomainPerformanceControl_003::setPerformanceControl(UIntN participantIndex, UIntN domainIndex,
    UIntN performanceControlIndex)
{
    throwIfPerformanceControlIndexIsOutOfBounds(participantIndex, performanceControlIndex);
    getParticipantServices()->primitiveExecuteSetAsUInt32(
        esif_primitive_type::SET_PERF_PRESENT_CAPABILITY,
        performanceControlIndex,
        domainIndex);

    // Refresh the status
    m_performanceControlStatus.set(PerformanceControlStatus(performanceControlIndex));
}
Exemplo n.º 3
0
void DomainPerformanceControl_002::setPerformanceControl(UIntN participantIndex, UIntN domainIndex,
    UIntN performanceControlIndex)
{
    throwIfPerformanceControlIndexIsOutOfBounds(domainIndex, performanceControlIndex);

    auto performanceControlSet = getPerformanceControlSet(participantIndex, domainIndex);
    PerformanceControlType::Type targetType =
        (performanceControlSet)[performanceControlIndex].getPerformanceControlType();

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

    switch (targetType)
    {
        case PerformanceControlType::PerformanceState:
            // Set T0
            if (throttlingStateSet.getCount() > 0)
            {
                getParticipantServices()->primitiveExecuteSetAsUInt32(
                    esif_primitive_type::SET_TSTATE_CURRENT,
                    throttlingStateSet[0].getControlId(),
                    domainIndex);
            }
            getParticipantServices()->primitiveExecuteSetAsUInt32(
                esif_primitive_type::SET_PERF_PRESENT_CAPABILITY,
                performanceControlIndex,
                domainIndex);
            break;
        case PerformanceControlType::ThrottleState:
            // Set Pn
            getParticipantServices()->primitiveExecuteSetAsUInt32(
                esif_primitive_type::SET_PERF_PRESENT_CAPABILITY,
                static_cast<UIntN>(performanceStateSet.getCount()) - 1,
                domainIndex);
            getParticipantServices()->primitiveExecuteSetAsUInt32(
                esif_primitive_type::SET_TSTATE_CURRENT,
                (performanceControlSet)[performanceControlIndex].getControlId(),
                domainIndex);
            break;
        default:
            throw dptf_exception("Invalid performance state requested.");
            break;
    }

    // Refresh the status
    m_performanceControlStatus.set(PerformanceControlStatus(performanceControlIndex));
}