PerformanceControlDynamicCaps DomainPerformanceControl_002::createPerformanceControlDynamicCaps(UIntN domainIndex) { // 7.0 Reference : ProcCpuPerfControl.c -> ProcCalPerfControlCapability // Get dynamic caps for P-states UIntN pStateUpperLimitIndex; UIntN pStateLowerLimitIndex; calculatePerformanceStateLimits(pStateUpperLimitIndex, pStateLowerLimitIndex, domainIndex); // Get dynamic caps for T-states UIntN tStateUpperLimitIndex = Constants::Invalid; UIntN tStateLowerLimitIndex = Constants::Invalid; if (getThrottlingStateSet(domainIndex).getCount() > 0) { calculateThrottlingStateLimits(tStateUpperLimitIndex, tStateLowerLimitIndex, domainIndex); } // Arbitrate dynamic caps // Upper Limit UIntN performanceUpperLimitIndex = Constants::Invalid; UIntN performanceLowerLimitIndex = Constants::Invalid; arbitratePerformanceStateLimits(domainIndex, pStateUpperLimitIndex, pStateLowerLimitIndex, tStateUpperLimitIndex, tStateLowerLimitIndex, performanceUpperLimitIndex, performanceLowerLimitIndex); return PerformanceControlDynamicCaps(performanceLowerLimitIndex, performanceUpperLimitIndex); }
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)); }
PerformanceControlDynamicCaps DomainPerformanceControl_001::createPerformanceControlDynamicCaps(UIntN domainIndex) { //Get dynamic caps UInt32 lowerLimitIndex; UInt32 upperLimitIndex; auto controlSetSize = getPerformanceControlSet(getParticipantIndex(), domainIndex).getCount(); try { lowerLimitIndex = getParticipantServices()->primitiveExecuteGetAsUInt32( esif_primitive_type::GET_PERF_PSTATE_DEPTH_LIMIT, domainIndex); } catch (...) { // If PPDL is not supported, default to Pn. lowerLimitIndex = controlSetSize - 1; } try { // If PPPC is not supported, default to P0 upperLimitIndex = getParticipantServices()->primitiveExecuteGetAsUInt32( esif_primitive_type::GET_PARTICIPANT_PERF_PRESENT_CAPABILITY, domainIndex); } catch (...) { upperLimitIndex = 0; } if (upperLimitIndex >= controlSetSize || lowerLimitIndex >= controlSetSize) { throw dptf_exception("Retrieved control index out of control set bounds."); } if (upperLimitIndex > lowerLimitIndex) { lowerLimitIndex = controlSetSize - 1; getParticipantServices()->writeMessageWarning( ParticipantMessage(FLF, "Limit index mismatch, ignoring lower limit.")); } return PerformanceControlDynamicCaps(lowerLimitIndex, upperLimitIndex); }
PerformanceControlDynamicCaps DomainPerformanceControl_003::createPerformanceControlDynamicCaps(UIntN domainIndex) { auto controlSetSize = getPerformanceControlSet(getParticipantIndex(), domainIndex).getCount(); return PerformanceControlDynamicCaps(controlSetSize - 1, 0); }