Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void CharConvert<T>::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 {
Expand Down
20 changes: 11 additions & 9 deletions IntelPresentMon/PresentMonMiddleware/FrameEventQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t&>(pDestBlob[outputOffset_]) = ctx.cpuFrameQpc;
reinterpret_cast<uint64_t&>(pDestBlob[outputOffset_]) = ctx.cpuStart;
}
uint32_t GetBeginOffset() const override
{
Expand Down Expand Up @@ -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<double&>(pDestBlob[outputOffset_]) = val;
}
Expand Down Expand Up @@ -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<double&>(pDestBlob[outputOffset_]) = val;
}
uint32_t GetBeginOffset() const override
Expand All @@ -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<double&>(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<double&>(pDestBlob[outputOffset_]) = cpuBusy + cpuWait;
}
uint32_t GetBeginOffset() const override
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion IntelPresentMon/PresentMonMiddleware/FrameEventQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down