Example #1
0
PerformanceControlSet DomainPerformanceControl_002::createCombinedPerformanceControlSet(UIntN domainIndex)
{
    PerformanceControlSet performanceStateSet = getPerformanceStateSet(domainIndex);
    PerformanceControlSet throttlingStateSet;

    // Get T-States
    if (performanceStateSet.getCount() > 0)
    {
        throttlingStateSet = getThrottlingStateSet(domainIndex);
    }

    // Create all encompassing set (P and T states)
    //    P-States
    PerformanceControlSet combinedStateSet(performanceStateSet);

    //    T-States
    auto tStateStartIndex = isFirstTstateDeleted(domainIndex) ? 1 : 0;
    combinedStateSet.append(throttlingStateSet, tStateStartIndex);
        
    ParticipantMessage message = ParticipantMessage(FLF, "Performance controls created.");
    message.addMessage("Total Entries", combinedStateSet.getCount());
    message.addMessage("P-State Count", performanceStateSet.getCount());
    message.addMessage("T-State Count", throttlingStateSet.getCount());
    getParticipantServices()->writeMessageDebug(message);

    return PerformanceControlSet(combinedStateSet);
}
Example #2
0
PerformanceControlSet DomainPerformanceControl_003::createPerformanceControlSet(UIntN domainIndex)
{
    // Build GFX performance table
    DptfBuffer buffer = getParticipantServices()->primitiveExecuteGet(
        esif_primitive_type::GET_PERF_SUPPORT_STATES, ESIF_DATA_BINARY, domainIndex);
    auto controlSet = PerformanceControlSet(PerformanceControlSet::createFromProcessorGfxPstates(buffer));
    if (controlSet.getCount() == 0)
    {
        throw dptf_exception("GFX P-state set is empty. Impossible if we support performance controls.");
    }

    return controlSet;
}
Example #3
0
PerformanceControlSet DomainPerformanceControl_002::createThrottlingStateSet(UIntN domainIndex)
{
    PerformanceControlSet performanceStateSet = getPerformanceStateSet(domainIndex);
    PerformanceControlSet throttlingStateSet;
    try
    {
        DptfBuffer tstateBuffer = getParticipantServices()->primitiveExecuteGet(
            esif_primitive_type::GET_TSTATES, ESIF_DATA_BINARY, domainIndex);
        throttlingStateSet = PerformanceControlSet::createFromProcessorTss(
            performanceStateSet[performanceStateSet.getCount() - 1], tstateBuffer);
    }
    catch (...)
    {
        // T-States aren't supported.
        throttlingStateSet = PerformanceControlSet();
    }
    return throttlingStateSet;
}