diff --git a/IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h b/IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h index def52cc03..92273ba77 100644 --- a/IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h +++ b/IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h @@ -240,7 +240,7 @@ void CharConvert::Convert(const std::string data, T& convertedData, Header co else if (data == "Composed: Copy with CPU GDI") { convertedData = PM_PRESENT_MODE_COMPOSED_COPY_WITH_CPU_GDI; } - else if (data == "Hardware: Composed Independent Flip") { + else if (data == "Hardware Composed: Independent Flip") { convertedData = PM_PRESENT_MODE_HARDWARE_COMPOSED_INDEPENDENT_FLIP; } else { diff --git a/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.cpp b/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.cpp index 0935669ef..f833d3ce5 100644 --- a/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.cpp +++ b/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.cpp @@ -263,7 +263,7 @@ namespace CpuFrameQpcGatherCommand_(size_t nextAvailableByteOffset) : outputOffset_{ (uint32_t)nextAvailableByteOffset } {} void Gather(const Context& ctx, uint8_t* pDestBlob) const override { - reinterpret_cast(pDestBlob[outputOffset_]) = ctx.cpuFrameQpc; + reinterpret_cast(pDestBlob[outputOffset_]) = ctx.cpuStart; } uint32_t GetBeginOffset() const override { @@ -298,7 +298,7 @@ namespace return; } } - const auto val = TimestampDeltaToUnsignedMilliSeconds(ctx.cpuFrameQpc, + const auto val = TimestampDeltaToUnsignedMilliSeconds(ctx.cpuStart, ctx.pSourceFrameData->present_event.*pEnd, ctx.performanceCounterPeriodMs); reinterpret_cast(pDestBlob[outputOffset_]) = val; } @@ -394,7 +394,7 @@ namespace } } const auto val = TimestampDeltaToMilliSeconds(ctx.pSourceFrameData->present_event.*pStart - ctx.previousDisplayedQpc, - ctx.cpuFrameQpc - ctx.previousDisplayedCpuStartQpc, ctx.performanceCounterPeriodMs); + ctx.cpuStart - ctx.previousDisplayedCpuStartQpc, ctx.performanceCounterPeriodMs); reinterpret_cast(pDestBlob[outputOffset_]) = val; } uint32_t GetBeginOffset() const override @@ -419,10 +419,12 @@ namespace CpuFrameQpcFrameTimeCommand_(size_t nextAvailableByteOffset) : outputOffset_{ (uint32_t)nextAvailableByteOffset } {} void Gather(const Context& ctx, uint8_t* pDestBlob) const override { - const auto qpcDuration = (ctx.pSourceFrameData->present_event.PresentStartTime - ctx.cpuFrameQpc) + - ctx.pSourceFrameData->present_event.TimeInPresent; - const auto val = ctx.performanceCounterPeriodMs * double(qpcDuration); - reinterpret_cast(pDestBlob[outputOffset_]) = val; + const auto cpuBusy = TimestampDeltaToUnsignedMilliSeconds(ctx.cpuStart, ctx.pSourceFrameData->present_event.PresentStartTime, + ctx.performanceCounterPeriodMs); + const auto cpuWait = TimestampDeltaToMilliSeconds(ctx.pSourceFrameData->present_event.TimeInPresent, + ctx.performanceCounterPeriodMs); + + reinterpret_cast(pDestBlob[outputOffset_]) = cpuBusy + cpuWait; } uint32_t GetBeginOffset() const override { @@ -662,12 +664,12 @@ void PM_FRAME_QUERY::Context::UpdateSourceData(const PmNsmFrameData* pSourceFram pSourceFrameData = pSourceFrameData_in; dropped = pSourceFrameData->present_event.FinalState != PresentResult::Presented; if (pFrameDataOfLastPresented) { - cpuFrameQpc = pFrameDataOfLastPresented->present_event.PresentStartTime + pFrameDataOfLastPresented->present_event.TimeInPresent; + cpuStart = pFrameDataOfLastPresented->present_event.PresentStartTime + pFrameDataOfLastPresented->present_event.TimeInPresent; } else { // TODO: log issue or invalidate related columns or drop frame (or some combination) pmlog_info(L"null pFrameDataOfLastPresented"); - cpuFrameQpc = 0; + cpuStart = 0; } if (pFrameDataOfNextDisplayed) { nextDisplayedQpc = pFrameDataOfNextDisplayed->present_event.ScreenTime; diff --git a/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.h b/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.h index e830d059f..9f7916b19 100644 --- a/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.h +++ b/IntelPresentMon/PresentMonMiddleware/FrameEventQuery.h @@ -34,7 +34,7 @@ struct PM_FRAME_QUERY const uint64_t qpcStart{}; bool dropped{}; // Start qpc of the previous frame, displayed or not - uint64_t cpuFrameQpc = 0; + uint64_t cpuStart = 0; // Start qpc of the previously DISPLAYED frame. uint64_t previousDisplayedCpuStartQpc = 0; // Screen time qpc of the previously displayed frame.