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 } }
PerformanceControlStatus DomainPerformanceControl_002::getPerformanceControlStatus(UIntN participantIndex, UIntN domainIndex) { if (m_performanceControlStatus.isInvalid()) { m_performanceControlStatus.set(PerformanceControlStatus(Constants::Invalid)); } return m_performanceControlStatus.get(); }
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)); }
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)); }